Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 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

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);

Date Subject Author
12/16/10 Forrest
12/16/10 Sean
12/16/10 Forrest
12/16/10 Forrest
12/16/10 ImageAnalyst
12/16/10 ImageAnalyst
12/16/10 Forrest
12/19/10 Forrest
12/19/10 ImageAnalyst
12/19/10 Forrest
12/19/10 ImageAnalyst
12/20/10 Forrest
12/20/10 Forrest
12/20/10 ImageAnalyst
12/20/10 ImageAnalyst
12/21/10 Forrest
1/3/11 Forrest
1/19/11 Forrest
1/19/11 ImageAnalyst
1/19/11 Forrest
1/19/11 ImageAnalyst