Image overlay when displayed in OpenCV

I have two images that I want to display on top of each other. one image is a single-channel image, and the second image is an RGB image, but most of the area is transparent.

How these two images are generated in different functions. I know that I simply display them one above the other, I can use the same window name when called cvShowImage(), but this does not work when they are extracted from different functions. When I tried this, I used cvCvtcolor()to convert its binary image from one channel to RGB and then display the second image from another function. But that did not work. Both images have the same size, depth and number of channels (after conversion).

I want to avoid passing one image to a second function and then draw them. So I'm looking for a quick dirty trick to display these two images overlapping.

thank

EDIT: alt text

+3
source share
3 answers

I do not think that's possible. You will need to create a new image or modify an existing one. Here's an article that shows how to do this: Transparent image overlay in OpenCV

+1
source

"" . cvShowImage() . /. .
, , AND, OR XOR, , Add, Multiply MultiplyScale ( , 255). , .
, , .

+1

Source: https://habr.com/ru/post/1783645/


All Articles