I have a question about how to define a ROI with OpenCV. I know what the definition of the function cvSetImageROI but I want to know if is possible to define a ROI with OpenCV with a different shape than rectangle. For example, define a ROI in a circle or in different form.
It is possible to do this?
cvSetImageROI(img1, cvRect(a, b, c, d));
The following code, which you could have found here or even here sets a circular ROI using a bit mask on your image.
For a pentagon or hexagon just adapt it so to change the geometric shape of the mask. Check this SO Question: Using ROI in OpenCV?.