circle fitting to set of 2D data contain noise data

조회 수: 6 (최근 30일)
ha ha
ha ha 2018년 12월 21일
댓글: Image Analyst 2018년 12월 22일
Let's say: I want to fit the circle through the set of data points (17 point with x & y coordinate- Please see attachment test1.txt file).
I use the code provided by Nikolai Chernov:
And, I get the good result as follow:
Now, I assume that I add 1 more "noise point" to the old data to make a new data as follow:
My question: How can i fit the circle through all new data points? It is obviously hope that the new fitting circle is same as old fitting circle (not consider the noise points)?
  댓글 수: 3
ha ha
ha ha 2018년 12월 21일
If I use the code provided by Nikolai Chernov:
The result will be like this (his code cover the noise data):
untitled.jpg
The result is NOT my expectation.
Image Analyst
Image Analyst 2018년 12월 22일
Like John said, why do you think that you can start tossing in additional data and get the exact same answer as if that data were not in there? That's just crazy thinking. Your expectation is just plain wrong.
The circle you got looks reasonable considering you said you want to " fit the circle through ALL new data points".
The only way it would be the same as before is if you used the same data as before, in other words, ignore the additional, noisy data. Hence the suggestions to use rmoutliers(), RANSAC, MAD, etc. to identify and remove the outliers. Once the're removed, you'll get the same data because you'll be using the same points.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2018년 12월 21일
How do you know it's a noise point? I mean if that point was moved over so that it was still really far away but on the circle, it wouldn't be a noise point, or would it?
I suggest you try rmoutliers() to remove outliers from your x and y data.
If that doesn't work, then you can just do the fit and find the residuals and throw out any point with a huge residual.
  댓글 수: 2
ha ha
ha ha 2018년 12월 21일
I suggest you try rmoutliers() to remove outliers from your x and y data.
i can not find "rmoutliers" in matlab. Which version are you using?
Image Analyst
Image Analyst 2018년 12월 21일
R2018b, which is when it was introduced. Can you upgrade?
Otherwise you can use fitPolynomialRANSAC introduced in the Computer Vision System Toolbox in R2017a, or movmad() introduced in base MATLAB in R2017a.
Or you can compute your own MAD using directions in Wikipedia: Median_absolute_deviation

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2018년 12월 21일
Use RANSAC.
  댓글 수: 4
Matt J
Matt J 2018년 12월 22일
The ransac command which I linked you to is for arbitrary models.
Image Analyst
Image Analyst 2018년 12월 22일
For some reason the ransac capability is in the Computer Vision System Toolbox, which is not too common, rather than the Statistics and Machine Learning Toolbox, which is more common. Do you have the Computer Vision System Toolbox? RANSAC will work with extraordinarily noisy data - much noisier than MAD - but if you don't have that toolbox and your data doesn't have that many noise points, then MAD should work pretty good.
800px-Fitted_line.svg.png

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by