The Math Forum



Search All of the Math Forum:

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


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

Topic: Including an area into a circle
Replies: 20   Last Post: Jan 19, 2011 9:43 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
ImageAnalyst

Posts: 13,022
Registered: 12/26/06
Re: Including an area into a circle
Posted: Dec 19, 2010 11:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

D = bwdist(BW) computes the Euclidean distance transform of the binary
image BW. For each pixel in BW, the distance transform assigns a
number that is the distance between that pixel and the nearest nonzero
pixel of BW. bwdist uses the Euclidean distance metric by default.

So any pixel in the EDT that is greater than 5 will be greater than 5
pixels away from an object and thus you could fit a circle of radius 5
at that location. Thresholding just tells you what pixels have that
condition or not

% Calculate the EDT.
EDT_image = bwdist(binaryImage);

% Find which pixels are 5 or more away.
fartherThan5Away = EDT_image >= 5;

% Determine the row and column of
% those pixels that are farther than 5 away.
[rows cols] = find(fartherThan5Away);



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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.