Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to cut image to smaller pieces?

I need to cut image in half and each of them save as different one. For example I have image in grayscale and I try to do it like this:

halfImg[0] = Mat(greyimg, Rect(0, 0, 163, 93)).clone();
halfImg[1] = Mat(greyimg, Rect(164, 0, 327, 93)).clone();

but the second one generates this error:

image description

Is there another way to do it in Open CV?