watershed not filling regions as anticipated

2 views (last 30 days)
Hi everyone,
I am doing a project using marker controlled watershed segmentation to delineate individual trees. Each tree (or guess at where a tree might be) is marked with regional max. I then take the complement of the image and impose the min (-Inf) where the max was. All pixels outside of the canopy are -Inf. I've posted photos of the matrix I ran watershed on and the unanticipated result.
http://i.imgur.com/ZeEvEsw.png (note: the perimeter not part of calculation)
I do not understand why, in this case (and many others in my image), the watershed doesn't flood-fill to the boundaries. There are no other local minima. It seems arbitrary to me where the flooding stops. Also note how in the result image the min is shifted right by one pixel... I don't know why but maybe that's a sign of something gone wrong.
I am simply doing: L = watershed(comp_image_w_imposed_mins);
Any thoughts? Am i misunderstanding how this function works?
Edit: I'm adding another image that I think helps to further clarify. What you're seeing on the left is the watershed output with the imposed mins. On the right is an image that shows (I believe) that the flood is stopping in arbitrary locations (e.g. in the middle of a plateau of exactly the same values). There are zero local mins except for the imposed ones you see.
Thank you, Mike

Answers (1)

Image Analyst
Image Analyst on 5 Jun 2013
I don't understand what you're doing or why. So I have some questions.
  1. Why are you setting the max of each clump/blob to -inf?
  2. The blobs seem already distinct. Why are you wanting to split these blobs further?
  3. Where are the desired lines that you'd split each blob?
  4. What is a canopy? Is that a blob? So that in your gray scale image you have 9 blobs (canopies)?
  5. Can you post your original code, including the code to display the image, take the watershed, and draw the outlines over each image?
  1 Comment
Mike Alonzo
Mike Alonzo on 5 Jun 2013
Good questions:
1. If the borders of the blob are the highest value and the surrounding background is -Inf, the flood will not spill over into the background.
2. Ah yes, in this image, that is true but in others, it is not. With this particular question I am simply asking how to make sure the watershed does not stop arbitrarily before the blob boundaries.
3. There will be no splits in these blobs but in others there will be.
4. Sorry, canopy is tree canopy. Each blob here is a tree.
5. My code to get to this point is a bit messy right now but I'll get it up eventually. That said, I thought I had processed this image to the point where simply:
L = watershed(image)
should be sufficient. There is an imposed minimum, high walls, and a -Inf background. I'm interested in understanding if my theory here is incorrect.
Thanks for your thoughts! Mike

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!