Watershed. Basic question
Hello and thanks always for your help.
I have a question regarding the concept and application of watershed in OpenCV
So far I have tried several examples both the example in the opencv library as well as other. It seems the concept is:
1) First , mark several markers 2) Then apply the watershed function
However for it to work well I have to mark these markers or find them somehow. Now, let's say I have the following
(disregard, the duplicate, both images are the same)
In it you can see that I have the areas which are not background, and I want to use watershed to separate those areas. (the original image have some dark edges if that helps). If I erode these areas, they are still be connected right?
So what if I apply watershed then. I tried and I obtain the areas a one piece and not as separated objects.
My question is that if I have to find the markers other way, what good is the watershed then? I want to use watershed function precisely to separate these areas.
What I am doing wrong? Any advice on how to separate these areas??
Thanks a thousand
I think that is because you have the same value on the markers (255). In wathershed, the markers shall have different values. So the markers' mask shall be something like this: 0,0,0,0,1,1,1,1,0,0,0,0,0,2,2,2,2,0,0,0,0,0,3,3,3,3,3,3,3.... If you understand what I mean
Yes, but that is precisely why I am using watershed. to differentiate those areas.