简体   繁体   English

OpenCV-检测带有障碍物的粗略手绘圆

[英]OpenCV - Detect rough, hand-drawn circles with obstructions

I've been trying to extract hand-drawn circles from a document for a while now but every attempt I make doesn't have the level of consistency I need. 我一直在尝试从文档中提取手绘圆圈,但是我所做的每一次尝试都没有达到我所需要的一致性级别。

Process Album 处理专辑

The problem I keep coming up against is when 2 "circles" are too close they become a single contour, ruining my attempt to detect if a contour is curved. 我不断遇到的问题是,当两个“圆”距离太近时,它们变成单个轮廓,从而破坏了我检测轮廓是否弯曲的尝试。 I'm sure there must be a better way to extract these circles, but their imperfection and inconsistency are really stumping me. 我敢肯定,必须有一个更好的方法来提取这些圈子,但它们的不完善和前后矛盾确实让我感到困惑。


I've tried many other ways to single out the curves, the most accurate of which being: 我尝试了许多其他方法来选择曲线,其中最准确的方法是:

Rather than use dilation to bridge the gap between the segmented contours, find the endpoints and attempt to continue the curve until it hits another contour. 不要使用膨胀来弥合分割的轮廓之间的间隙,而要找到端点并尝试继续曲线直到其碰到另一个轮廓。
Problem: I can't effectively find the turning points of the contour, otherwise this would be my preferable method 问题:我无法有效地找到轮廓的转折点,否则这将是我的首选方法

I apologize if this question is deemed "too specific", but I feel like Computer Vision stuff like this can always be applied elsewhere. 如果这个问题被认为是“太具体了”,我深表歉意,但是我觉得像计算机视觉这样的东西总是可以应用在其他地方。

Thanks ahead of time for any and all help, I'm about at the end of my rope here. 提前感谢您提供的所有帮助,我在这里快结束了。

EDIT: I've just realized the album wasn't working correctly, I think it should be fixed now though. 编辑:我刚刚意识到专辑无法正常工作,但我认为现在应该修复它。

It looks like a very challenging problem so it is very likely that the things I am going to write wouldn't work very well in practice. 看来这是一个非常具有挑战性的问题,所以我要写的东西很可能在实践中无法很好地工作。

In order to ease the problem, I would probably try to remove as much of other stuff from the image as possible. 为了缓解此问题,我可能会尝试从图像中删除尽可能多的其他内容。

If the template of the document is always the same, it might be worth trying to remove horizontal and vertical lines along with grayed areas. 如果文档模板始终相同,则可能值得尝试删除水平线和垂直线以及灰色区域。 For example, given the empty template, substract it from the document that you are processing. 例如,给定空模板,从正在处理的文档中减去它。 Probably, it might be possible to get rid of the text also. 可能也有可能摆脱文本。 This would result in an image with only parts of hand drawn circles. 这将导致图像仅带有手绘圆的一部分。

On such image, detecting circles or ellipses with hough transform might give some results (although shapes might be far from circles or ellipses). 在此类图像上,使用霍夫变换检测圆或椭圆可能会产生一些结果(尽管形状可能与圆或椭圆相去甚远)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM