admin管理员组文章数量:1123160
I am fitting an incomplete ellipse-an ellipse cap (it is an image already processed). the problem is that, as you can see, at the bottom of fitted ellipse, two small parts on the left and right are not included in the fitted ellipse. These two segments are quite important to and I should include them into the fitted ellipse. I tried RANSAC in scikit-image and fitEllipse in opencv2, but none of them can do this, and as I know RANSAC cannot take weight, which I want to put on the two outlined part.
raw ellipse fitted ellipse
I am fitting an incomplete ellipse-an ellipse cap (it is an image already processed). the problem is that, as you can see, at the bottom of fitted ellipse, two small parts on the left and right are not included in the fitted ellipse. These two segments are quite important to and I should include them into the fitted ellipse. I tried RANSAC in scikit-image and fitEllipse in opencv2, but none of them can do this, and as I know RANSAC cannot take weight, which I want to put on the two outlined part.
raw ellipse fitted ellipse
Share Improve this question edited 1 hour ago Christoph Rackwitz 15.2k5 gold badges38 silver badges49 bronze badges asked 5 hours ago qiang yuqiang yu 11 bronze badge New contributor qiang yu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 2- Please provide enough code so others can better understand or reproduce the problem. – Community Bot Commented 5 hours ago
- I wouldn't call that an ellipse, not even a part of an ellipse. – Christoph Rackwitz Commented 1 hour ago
1 Answer
Reset to default 0To include the missing segments in the fitted ellipse, try these approaches:
Weighted Fitting: Assign higher weights to the points in the missing segments using scipy.optimize.least_squares for weighted ellipse fitting.
Add Missing Points: Manually add synthetic points along the missing segments and refit the ellipse using cv2.fitEllipse.
Custom Optimization: Use scipy.optimize.minimize to define a custom loss function that prioritizes including the missing parts in the fit.
These methods give more control than RANSAC or cv2.fitEllipse.
本文标签: incomplete ellipse image fitting by pythonStack Overflow
版权声明:本文标题:incomplete ellipse image fitting by python - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736549553a1944493.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论