Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Add padding to object in 4-channel image

Hi all,

I have a 4-channel image (.png, .tif) like this one:

image description

And I would like to add padding of type BORDER_REFLECT around the flower. copyMakeBorder is not useful, since it will add padding to the edges of the image.

I can add certain padding if I split the image in bgr + alpha and apply dilate with BORDER_REFLECT option on the bgr image, but that solution spoils all the pixels of the flower.

Is there any way to perform a selective BORDER_REFLECT padding addition on a ROI defined by a binary mask?

Thanks in advance.

Add padding to object in 4-channel image

Hi all,

I have a 4-channel image (.png, .tif) like this one:

image description

And I would like to add padding of type BORDER_REFLECT around the flower. copyMakeBorder is not useful, since it will add adds padding to the edges of the image.

I can add certain padding if I split the image in bgr + alpha and apply dilate with BORDER_REFLECT option on the bgr image, but that solution spoils all the pixels of the flower.

Is there any way to perform a selective BORDER_REFLECT padding addition on a ROI defined by a binary mask?

Thanks in advance.

Add padding to object in 4-channel image

Hi all,

I have a 4-channel image (.png, .tif) like this one:

image description

And I would like to add padding of type BORDER_REFLECT around the flower. copyMakeBorder is not useful, since it adds padding to the edges of the image.

I can add certain padding if I split the image in bgr + alpha and apply dilate with BORDER_REFLECT option on the bgr image, but that solution spoils all the pixels of the flower.

Is there any way to perform a selective BORDER_REFLECT padding addition on a ROI defined by a binary mask?

Thanks in advance.