detecting shapes in a bitmap

不问归期 提交于 2019-12-02 03:22:35

问题


looking for a good algorithm to do the following: I have a b&w image comprised solely of polygonal shapes, which i got by scanning in a document. I would like to find all the shapes in this image, smooth the edges, and in the end get the coordinates for the smooth shapes. Any good algorithms for doing the search and smoothing to get perfect shapes in the end?


回答1:


I would start with a connected component labeling in order to separate the different polygons.

A simple solution for smoothing would be to use opening and a closing, but if the polygons are REALLY thin, it may cut them. A more complex (but better) solution, would be to extract the contour as a parametric function (x(t),y(t)) and to smooth it with a 1D gaussian convolution.



来源:https://stackoverflow.com/questions/12903232/detecting-shapes-in-a-bitmap

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