4.33333

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

Circle fit

by

 

26 Jul 2004 (Updated )

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 file inspired Aquiles, Ellipse Fit, Circle Fit (Kasa Method), Circle Fit (Pratt Method), Circle Fit (Taubin Method), and Circle Fit Using Landau Method.

MATLAB release MATLAB 5.2 (R10)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
21 Jul 2014 Daniel Golden  
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?

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 ?

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.

08 Sep 2008 Mehmet Alpay

Works like a charm :-)

31 Jan 2008 Darren Hewett  
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!

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)

10 Dec 2006 Hendro Nurhadi

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

29 Sep 2006 Sanjeev Sharma

I found it to be very effective.

21 Feb 2006 shmi braun

Re: Hedi Kawano

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

20 Feb 2006 Luigi Rosa

High-quality code, simple and effective

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.

14 Mar 2005 Hedi Kawano

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

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.

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.

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

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'

18 Aug 2004 Yuri Slobo...

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

Contact us