Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If it is really only about cropping - try this

//crops an image starting on top left with 100pixels width and height
Mat img = imread("myimage.jpg")
Rect roi = new Rect(0, 0 , 100, 100)
Mat cropped = new Mat(img, roi)
imwrite("cropped.jpg", cropped)