Straightening a curved contour

放肆的年华 提交于 2019-12-24 23:24:31

问题


Given a contour with an easily-identifiable edge, how would one straighten it and its contents, as pictured?


回答1:


Detect the black edge and fit a spline curve to it.

From that spline you will be able to draw normals, and mark points regularly along it. This forms a (u, v) mesh that is easy to straighten.

To compute the destination image, draw horizontal rows, which correspond to particular normals in the source. Then sampling along the horizontal corresponds to some fractional (x, y) coordinates in the source. You can perform bilinear interpolation around the neighboring pixels to achieve good quality resampling.



来源:https://stackoverflow.com/questions/50645077/straightening-a-curved-contour

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!