Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Doubts in watershed transform command
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Lim

Posts: 3
Registered: 7/27/11
Doubts in watershed transform command
Posted: Jul 27, 2011 12:11 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

One of the image processing method I'm using and studying now is watershed segmentation, and I find the examples available in Matlab is very useful. I tried it on my own image and it works just fine with some modification.
However, there's few commands that I don't understand in the example, and I hope someone can help me with it:

2.Compute the distance transform of the complement of the binary image.
D = bwdist(~bw);
figure, imshow(D,[],'InitialMagnification','fit')
title('Distance transform of ~bw')

3.Complement the distance transform, and force pixels that don't belong to the objects to be at -Inf.
D = -D;
D(~bw) = -Inf;


Q1. What does '~ ' do in (~bw)? Why does it affect the gradient of image in computing the distance transform?
Q2. In 3, why does the D needed to be complemented?
Q3. What is the purpose of making the 'unrelated' pixels -Inf?

Thanks.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.