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

