Ask Your Question
0

Need bit of help with image constructing

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

trsh gravatar image

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

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
0

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

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

Question Tools

1 follower

Stats

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

Seen: 195 times

Last updated: May 20 '20