Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Need bit of help with image constructing

Hello! I'm using this syntax:

new_rect_area = target[y: y + h, x: x + w]
new_rect_area = cv2.add(new_rect_area, masked_image_sample)
target[y: y + h, x: x + w] = new_rect_area

to construct / populate certain areas of my empty image. The problem is when when pixels overlap, they sum up and create mostly white areas. What I want is that masked_image_sample goes over (like layer) and doesn't sum up. How can achieve this?

click to hide/show revision 2
retagged

updated 2020-05-21 01:15:58 -0600

berak gravatar image

Need bit of help with image constructing

Hello! I'm using this syntax:

new_rect_area = target[y: y + h, x: x + w]
new_rect_area = cv2.add(new_rect_area, masked_image_sample)
target[y: y + h, x: x + w] = new_rect_area

to construct / populate certain areas of my empty image. The problem is when when pixels overlap, they sum up and create mostly white areas. What I want is that masked_image_sample goes over (like layer) and doesn't sum up. How can achieve this?