Re: circle fit to array with error term



Chandan wrote:



Ann wrote:
I have 1200X1200 arrays (images input with imread function)
that represent a time series of a dynamic irregular circlular
black
blob on a white field. One "circle" at one time step per array.

I need to fit the largest possible radius circle to the
interior
of
the circular blob shape and have an output error of the fit.

Thanks for any help.

First sum the pixel values of each image to get a total intensity
value:

sum(sum(arrayElement1);

then you can use morphological filtering to highlight the edges of
your
image (see Image Processing Toolbox help for this one):

imcontour(arrayElement1);

Then you could draw circles of increasing radius until they
intesect
the edges of the contour plot. If the images are binary, then its
really easy, just recreate the circle, and subtract the sum of this
from the sum obtained above. If not, then you just sum the elements
of
the first image that fall inside the circle and subtract this value
from the above sum.

Hope this helps



-----------------------------------------------------------------
Chandan Das
MIT Department of Mechanical Engineering


Thanks. I like the pour it in a bucket and weigh it feeling of this.

I've been picking random triplets of points on the blob periphery
(black pixels with nearest neighbor white pixels) and computing the
center of the circle defined by these points. I get a cloud of
approximate centers (one for each triplet). I take the median x,y as
my first app of the actual center and build circles of larger and
larger radii until the circle hits the edge.

I also tried closed spline fit, but had some trouble with consistency
of outcome.

It is the error (non-circleness) I am interested in, and I never
would have thought to sum intensities. This is a huge help.

B.T.W. I don't have the image processing pkg.

Ann
.



Relevant Pages