I have these two images, image 1 is a binary of image 2.
I would like to segment out the object from image 2 in the shape of image 1.
image 1 image 2
I have looked into several samples but none of them is helpful. Thought of overlaying image 2 onto image 1's white area, using copyTo function with the conditions, but I'm sure there's a better way. Would really appreciate if someone can tell me the method or C++ snippet code to solve this!