JavaCV - Using cvCopy with semi-transparent mask

asked 2013-07-30 14:56:45 -0500

Hi,

I'm trying to composite 2 images using a semi-transparent alpha mask. I'm currently using the cvCopy function to do the compositing as shown in the JavaCV watermark example.

However, it seems that semi-transparency is not taken into account when mixing the images. A grayscale value of 0 will take nothing from the second image, while any value >0 will take 100% of the second image.

If we take the images used in the watermark example above, the result I'm looking for would be a watermark with ~50% transparency (because the mask is grayish and not completely white). What function would I need to accomplish this type of blending?

Thanks!

edit retag flag offensive close merge delete

Comments

You are mixing two libraries up. JavaCV isn't the same as OpenCV but rather a set of OpenCV wrappers for Java. In the future however there are talks of integration of JavaCV. However, if you want to know what functionality OpenCV provides with it Java bindings, go to http://docs.opencv.org/java/

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-30 15:26:57 -0500 )edit