Ask Your Question
0

ROI Assertion Error

asked 2013-02-05 15:25:29 -0600

Possede gravatar image

updated 2013-02-05 22:52:22 -0600

Three webcams are used to capture three images which overlap as shown here: http://i1276.photobucket.com/albums/y475/sesj13/ROI_zpsffce8c7d.png

I am trying to reduce the ROIs to just the overlapped regions (1/4 of the width of each image), but having problems. My code and the associated error is shown here: http://i1276.photobucket.com/albums/y475/sesj13/ROIError_zpsede8e7d3.jpg

I am trying this (which I believe is correct), but to no avail:

img_roi0 = img_grey0(Rect((WIDTH-(WIDTH/4)), 0, WIDTH, HEIGHT));

img_roi1 = img_grey1(Rect(0, 0, (WIDTH/4), HEIGHT));

img_roi2 = img_grey1(Rect((WIDTH-(WIDTH/4)), 0, WIDTH, HEIGHT));

img_roi3 = img_grey2(Rect(0, 0, (WIDTH/4), HEIGHT));

Any input would be appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-02-05 22:34:49 -0600

Daniil Osokin gravatar image

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));
edit flag offensive delete link more

Comments

Thank you very much, I was being a plonker!

Possede gravatar imagePossede ( 2013-02-06 10:23:46 -0600 )edit

You are welcome.

Daniil Osokin gravatar imageDaniil Osokin ( 2013-02-07 00:30:23 -0600 )edit

Question Tools

Stats

Asked: 2013-02-05 15:25:29 -0600

Seen: 340 times

Last updated: Feb 05 '13