ellipse fitting from a plot in MATLAB
2 次查看(过去 30 天)
显示 更早的评论
I have datapoints in text file which I have imported and ploted. Now I want to do ellipse fitting of that data. Can you please help me with that?
0 个评论
采纳的回答
Image Analyst
2021-3-25
See my attached ellipse fitting demo.
Also see the FAQ:
6 个评论
Image Analyst
2021-3-26
Are you sure you actually tried to adapt my demo? Anyway, it was rather straightforward and you just needed to add a call to fitellipse() at the end of your code. It's attached and produces this plot.
更多回答(1 个)
Matt J
2021-3-31
编辑:Matt J
2021-3-31
Theta should come araound zero degree but it is giving 68 degree and 44 degree.
Using ellipticalFit() in,
[X,Y]=deal( smoothX(jdx:jdx+200000,1),smoothY(idx:idx+200000,1) );
fitobj=ellipticalFit([X,Y].')
[hFit,hData]=plot(fitobj,{'Color','r','LineWidth',3},{'SizeData',2});
xlabel 'X'
ylabel 'Y'
legend([hFit,hData],'Fit','Data')
gives me and angle of about 79 degrees (or 11 degrees to the Y axis). I don't know how close to zero degrees you expected, but the tilt angle in your samples is very visible, so it couldn't be too close.
fitobj =
ellipticalFit with properties:
center: [-0.0156 -0.0130]
a: 0.5679
b: 0.4198
angle: 79.2091
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!