Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2015-09-16 02:44:20 -0500

Nbb gravatar image

ROI out of bounds issue

Hello forum,

I would like to crop out a part of my image using

Mat crop = frame(_rectangle);

The problem is, I get an error when _rectangle is out of bounds of my 1920 x 1080 frame. Is there a simple function that I could use to just crop out the section where the Rect and the Mat intersects ? I could write my own function for it but it would be simpler if opencv has a built-in function to resolve the out of bounds issue.

Regards, Haziq

ROI out of bounds issue

Hello forum,

I would like to crop out a part of my image using

Mat crop = frame(_rectangle);

The problem is, I get an error when _rectangle is out of bounds of my 1920 x 1080 frame. Is there a simple function that I could use to just crop out the section where the Rect and the Mat intersects ? I could write my own function for it but it would be simpler if opencv has a built-in function to resolve the out of bounds issue.

Regards, Haziq

ROI out of bounds issue

Hello forum,

I would like to crop out a part of my image using

Mat crop = frame(_rectangle);

The problem is, I get an error when _rectangle is out of bounds of my 1920 x 1080 frame. Is there a simple function that I could use to just crop out the section where the Rect and the Mat intersects ? I could write my own function for it but it would be simpler if opencv has a built-in function to resolve the out of bounds issue.

Regards, Haziq