-1
$\begingroup$

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

enter image description here

I am using OpenCV, 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?

$\endgroup$
-1
$\begingroup$

FYI, the issue has been already addressed and solved here:

http://answers.opencv.org/question/90229/add-padding-to-object-in-4-channel-image/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.