Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Resize boundaries of object

I have object's bounding rect and contour. I want to use a contour as a mask to enlarge boundaries of this object to the size of bounding rect. In other words if object with green boundary pixels fitted in rectangle is on black background I want to make black pixels green.

How to do that?

Resize boundaries of object

I have object's bounding rect and contour. I want to use a contour as a mask to enlarge boundaries of this object to the size of bounding rect. In other words if object with green boundary pixels fitted in rectangle is on black background I want to make black pixels green.

How to do that?

image description This is image after thresholding and applying findContours. I want to use this contour as a mask to extract leaf from original image and expand its boundaries to fill rectangle. I need to perform texture calculations and don't want to have black pixels around.

Resize boundaries of object

I have object's bounding rect and contour. I want to use a contour as a mask to enlarge boundaries of this object to the size of bounding rect. In other words if object with green boundary pixels fitted in rectangle is on black background I want to make black pixels green.

How to do that?

image description

This is image after thresholding and applying findContours. I want to use this contour as a mask to extract leaf from original image and expand its boundaries to fill rectangle. I need to perform texture calculations and don't want to have black pixels around.