Ask Your Question

How to ignore background within objects

asked 2017-03-29 10:31:12 -0500

obszoenling gravatar image

I use the distance transform + watershed algorithm to segment objects in images. For that I use this example code:

Like in the example above in some cases there is background surrounded by objects which leads to mistakes. I want this pieces of background to be ignored from the algorithm. Is there any possibilty to archieve that? Every pixel of the image with the values 0/0/0 should be ignored.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-12-05 03:58:33 -0500

JamesBaxter gravatar image

Maybe post a sample image to get a better idea of your plroblem. The example code assumes that background has been segmented already and then proceeds to separate the objects individually because they are ocludded and form one big foreground blob. So If you already know which pixels are BG is just a matter of removing them from the resulting segmentation.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-03-29 10:31:12 -0500

Seen: 182 times

Last updated: Mar 29 '17