overlay image with offset
Hi,
I'm trying to get a function that do this. I attached and image to explain you. Have two images of same type and size, that are blue and green. I want to overlay the green image over the blue with an offset, in this case x and y are negative and only overlay the part of the image that is in common coordinates (red area). Are there an easy way to do this?
You can create mask for red region and use this mask for overlay. For creating mask, threshold both green and blue and perform bitwise_and on results.
maybe i have not explained well, sorry for my english. Colors are an example, blue and green are source images, and dst is blue with a part of green image overlayed (red area) in this case (negative offset).
So how will you decide the portion green overplayed on blue, do you have co-ordinates for it?
Yes, coordinates are obtained from another device. If the with of both images is 640pixels my x offsets values can be from -640 to 640. With other values images are not overlayed. In the example, x offset can be about -400pixels. if offset is 0, images are completely width overlayed Thank you.