Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi! According to the Rect documentation, 3rd and 4th parameters are width and height of the resulting rectangle, not the image, so your code should be like this:

img_roi0 = img_grey0(Rect((WIDTH-(WIDTH/4)), 0, WIDTH/4, HEIGHT));
img_roi1 = img_grey1(Rect(0, 0, (WIDTH/4), HEIGHT));
img_roi2 = img_grey1(Rect((WIDTH-(WIDTH/4)), 0, WIDTH/4, HEIGHT));
img_roi3 = img_grey2(Rect(0, 0, (WIDTH/4), HEIGHT));