Ask Your Question

Need bit of help with image constructing

asked 2020-05-13 09:20:36 -0500

trsh gravatar image

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

berak gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-05-20 18:50:12 -0500

kpachinger gravatar image
src.copyTo(dst, mask) //or dst.roi()
src.setTo(color, mask)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-05-13 09:20:36 -0500

Seen: 114 times

Last updated: May 20 '20