4.27273

4.3 | 11 ratings Rate this file 103 Downloads (last 30 days) File Size: 1.83 KB File ID: #5557
image thumbnail

Circle fit

by Izhak Bucher

 

26 Jul 2004 (Updated 29 Jul 2004)

Fit a circle to a set of measured x,y points.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

Revival of a 14 years old code (written in 1991 for MATLAB 2.x).

Given a set of measured x,y pairs that a re supposed to reside on a circle, but with some added noise. A circle to these points, i.e. find xc,yc,R, such that (x-xc)^2+(y-yc)^2=R^2

The method minimizes the sum of squared radial deviations.

Acknowledgements
This submission has inspired the following:
Ellipse Fit, Circle Fit (Kasa method), Circle Fit (Pratt method), Circle Fit (Taubin method)
MATLAB release MATLAB 5.2 (R10)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (18)
18 Aug 2004 Yuri Slobo...

Can someone please enlighten me where one meets such distributions to be fitted by a circle ?

25 Sep 2004 Yogesh Mehta

Yuri,

It can be extremely useful. For example, trying to fit a nyquist plot to an experimentally acquired FRFs... Ideally, nyquist plot is supposed to be a circle, but is not due 'noise'

05 Nov 2004 Bjorn Hemming

I have used this function to verify a feature in a Metrology software giving correctly first 4 digits, so it seems OK

22 Dec 2004 Knut C. Naue

Nice tool for data covering almost a complete circle. But if data exists describing only an arc, circfit fails identifying the assumed center and radius.

14 Mar 2005 Hedi Kawano

http://www.math.niu.edu/~rusin/known-math/99/circlefi tells you that the equation used in this "circle_fit.m" gives an approximate solution.

14 Mar 2005 Hedi Kawano

Sorry, it is
http://www.math.niu.edu/~rusin/known-math/99/circlefit
 (last "t" was missing)

21 Nov 2005 Tomaz Pepelnjak

Very useful if you need to fit measured points to the circle function and compare it further to reference value.

20 Feb 2006 Luigi Rosa

High-quality code, simple and effective

21 Feb 2006 shmi braun

Re: Hedi Kawano

  see also
http://www.pitchup.com/matlab/print.aspx?article=168

29 Sep 2006 Sanjeev Sharma

I found it to be very effective.

10 Dec 2006 Hendro Nurhadi

Just... Excellent.. thanks.
:-)

22 May 2007 Richard Brown

Note: This code doesn't minimise the sum of squared radial deviations - that is a nonlinear least squares problem

This code minimises sum((x.^2 + y.^2 - R^2).^2)

04 Dec 2007 Sebastian Laechele

Works very well!
I don't really know how, but it works! :D
You saved me a bunch of hours there.
Thank you very much!

31 Jan 2008 Darren Hewett  
08 Sep 2008 Mehmet Alpay

Works like a charm :-)

07 Jan 2009 Nikolai Chernov

This circle fit has been first published by P.Delogne and I.Kasa in the 1970s and is known as "Kasa method" in statistics. It works well when points cover a large part of the circle but is heavily biased when points are restricted to a small arc. Better fits were proposed by Pratt and Taubin.

26 Apr 2010 SengChoy Liew

I have come to a death end in Image processing toolbox to evaluate the circles in a gray scale image.

Anyone how how to use the codes given to fit into those circles in the image so that an histogram for the distribution of circles diameter can be plot ?

10 Aug 2010 Yasmine

Hi,

Does anyone know how to calculate deviation from circularity of the measured points compared to the fitted circle using this code?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
approximation Izhak Bucher 22 Oct 2008 07:28:18
interpolation Izhak Bucher 22 Oct 2008 07:28:18
least squares Izhak Bucher 22 Oct 2008 07:28:18
circle fit Izhak Bucher 22 Oct 2008 07:28:18
approximations Izhak Bucher 22 Oct 2008 07:28:19
circle Izhak Bucher 22 Oct 2008 07:28:19
potw Cristina McIntire 07 Nov 2008 13:23:47
circle fit Alex Alehin 09 Jul 2010 04:03:23
circle fit Heather Cirka 21 Oct 2010 21:32:31
pick of the week Jiro Doke 11 Feb 2011 20:17:29

Contact us at files@mathworks.com