Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Lim
Posts:
3
Registered:
7/27/11


Doubts in watershed transform command
Posted:
Jul 27, 2011 12:11 AM


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.



