查找圆的边缘: 这是我发布的两个示例图像,我需要一种算法来找到这些圆的边缘.是否有可能开发一种通用圆算法,该算法可以在以下所有情况下找到所有可能的圆?
Finding circle''s edges: Here are the two sample images I have posted and I need an algorithm to find the edges of these circles. Is it possible to develop one generic circle algorithm, that could find all possible circles in all scenarios like the ones below?
针对此任务,我想到了几件事.
- 创建图像的副本并转换为灰度
- 在图像上运行边缘检测滤镜(这将突出显示特征边界处对比度的差异
- 我依稀想起了阅读霍夫变换的一种方法,该方法可以检测到圆,而不是最常见的直线. A couple of things spring to mind for such a task.
- Create a copy of the image and convert to grey-scale
- Run an edge-detect filter on it (this will highlight the differences in contrast at feature boundaries
- I vaguely recall reading of an adaption to the Hough transform that allows circles to be detected, rather than the most common straight-line
这需要更多的预处理步骤.快速回答中不容易描述.它更像一个完整的图像处理项目.我认为您要做的是: *应用胡椒盐过滤器去除结构(中值过滤器) *应用2D边缘查找器(例如Canny) *可以使用霍夫变换(Hough Transform)(如果您可以对圆弧的半径进行一些假设,则可能会产生更好的结果) *或假定一个近似的圆位置,从那里应用径向一维边缘查找器,然后应用通用的圆查找器算法来计算精确的中心 这些步骤中的任何一个都不是真正的琐碎,并且需要大量的图像处理专业知识来解决该问题.抱歉,如果您不满意. This requires some more preprocessing steps. Not easy to describe in a quick answer. it is more like a full image processing project. What you have to do in my opinion is: * apply a pepper and salt filter to get rid of the structure (median filter) * apply a 2D edge finder (Canny for example) * either go with a Hough Transform (possibly it will deliver better results if you can put in some assumption about the radius of the cirles) * or assume an approximate circle location, apply radial 1D edge finders from there and apply a common circle finder algorithm to calculate the exact center None of these steps are really trivial and it takes quite a bit of image processing know-how to solve that problem. Sorry, if that discourages you.