If you're just moving from matlab to C++ and want to be able to do a bunch of image processing, it's going to be a challenge to learn the differences and set things up. C++ doesn't come with anything specifically built-in to handle image processing. You'll either need to make your own (not suggested), or learn existing libraries.
Matlab already has pretty nice built-ins for cropping, rotating, and matrix objects for applying transformations for adjusting perspective. Making a prototype in Matlab sounds like it would be much easier. I have not done this myself, but matlab functions apparently can be compiled for deployment:
https://www.mathworks.com/help/mps/ml_code/mcc.html
But if you still want to do this in C++ instead:
The hardest part of your problem isn't the cropping, rotating, or perspective transformations themselves -- rather, it's the image recognition to find where the barcode is on an image, and then determine its perspective. I assume you want the program to be able to do this automatically given a raw image.
For general advanced object recognition, people usually go to OpenCV. But a google search I did found me this library:
https://github.com/zxing/zxing
https://en.wikipedia.org/wiki/Barcode_Scanner_(application)
It's in Java, but the algorithms and basic logic can be translated into C++, or Matlab if you take the time. It supports recognition of multiple types of barcodes. You could try exploring the code and seeing what you could learn from it.
https://en.wikipedia.org/wiki/Transformation_matrix#Perspective_projection
To get started in C++, some basic image-reading libraries that come to mind are libjpeg and libpng. And libraries like GLM (OpenGL Mathematics) provide matrix structures. There might be C++ translations of Matlab built-ins you could find, I don't know. Cropping can be done without a library once you have the pixel data itself, but I'm sure one already exists if you don't want to re-invent the wheel.