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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167688/image.jpeg)
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.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!