First time here? Check out the FAQ!

Ask Your Question
0

Mask + Image without black on destination

asked Jul 21 '12

Pat gravatar image

Hi, essentially I have a mask and I make a bitwise_and between the mask and an image. This works wonderfully, but I cannot find a way to ignore the black on the destination image. Here's the process for more clarification :

http://img.photobucket.com/albums/v220/jaeko/mask.png

Essentially, I do something like this:

//Should dst have an alpha channel to replace black by a zero-opacity pixel?
cv::bitwise_and(image, mask, dst, mask???);
Preview: (hide)

Comments

What values do you want to get on border?

AlexanderShishkov gravatar imageAlexanderShishkov (Jul 21 '12)edit

1 answer

Sort by » oldest newest most voted
2

answered Jul 21 '12

AlexanderShishkov gravatar image

I don't understand what is the purpose of using bitwise_and in this case. If you want to copy some part of image to the other image, you should use:

image.copyTo(dst, mask);
Preview: (hide)

Question Tools

Stats

Asked: Jul 21 '12

Seen: 781 times

Last updated: Jul 21 '12