Fit curve, eliminating the outliers
5 次查看(过去 30 天)
显示 更早的评论
I am trying to implement a segmentation algorithm on a digital image. One of my code finds the edge pixels from the portion of the object. I want to fit a curve to these set of edge points. I thought of using non-linear curve fitting for the same. But the set of coordinates thus found are having many outliers, which are not true edge pixels. How do I eliminate these points and fit the curve for the remaining true edge points only?
The above figure is a scatter plot of the pixels. As can be seen, above 210 on x-axis, there is a lot of noise, or non-edge pixels. How do I fit a curve for only the 0 to 210 portion? This range may vary from image to image, and hence can't be hard coded.
Any suggestions, and inputs are welcome.
Thank you
0 个评论
回答(1 个)
Image Analyst
2017-12-14
编辑:Image Analyst
2017-12-14
How did you actually get these (x,y) locations from the edges in the image? Did you use the edge() function? Or something else?
Do you want an analytical equation for a curve? If so, what is the model? Quadratic, exponential decay? Something else? Or do you want a smoothed numerical array, like maybe just smooth it a bit with smooth() or sgolayfilt() or something?
Have you tried to use movstd() to identify when the "curve" starts to go crazy? If you can't, then post your data in a .mat file and I'll do it. Post 2 or 3 data sets so I can see how well it works with different images.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!