在 BMP 图像文件中搜索形状
我有一个图像处理问题,使用 C#。
假设我有一些 BMP 格式的原理图,该图包含相互连接的组件形状。
我编写了一个简单的程序来检测图中的正方形作为一个组件,并记录它的位置。然而,下一个级别是检测更复杂的形状,例如连接在一起的几个弧线。请注意,这些形状在图像中的大小可能不同。有谁知道有什么好的方法吗?无需下载任何库(这是我现在的限制)。
检测到形状后,我还需要记录哪个形状连接到哪个形状,以便稍后我可以重新绘制它们。我有一周的时间来做这件事,非常感谢您的帮助!
我正在使用 C#。
I have an image processing question, using C#.
Say I have some schematic diagrams in BMP format, the diagram contains component shapes which are connected to each other.
I wrote a simple program to detect square shapes in the diagram as one component, and record the location of it. However, the next level is to detect more complicated shapes like a few arcs joined together. Note that these shapes can be different sizes in the image. Does anyone know any good method of doing it? without downloading any library (this is my limitation now).
After detecting the shapes, I also need to record which shape is connected to which, so later on, I can redraw them. I have one week to do this, so thanks a lot for any help!!
I'm using C#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请查看本文。我对他们方法的理解:
这是一个相当困难的研究问题。即使拥有像 OpenCV 这样强大的计算机视觉库,在 1 周内实施有效的解决方案也是一项艰巨的任务。
Have a look at this paper. My understanding of their approach:
This is a fairly difficult research problem. Even with a powerful computer vision library like OpenCV, implementing an effective solution within 1 week would be a demanding task.
您是否使用过 EmguCV ?它是 OpenCV 的开源 C# 包装器。它还具有形状检测示例你可能感兴趣。
Have you taken a look at using EmguCV? It is an open-source C# wrapper of OpenCV. It also has a shape detection sample you might interested in.
为了回答我的旧帖子,我在两周内完成了我需要做的事情,效果很好。实际上我最终对不同的形状使用了不同的算法。这些算法有点自我发明,但我想提的一个好方法是获取直方图,然后在不同轴上使用投影有很大帮助。
To answer an old post I had, I have done what I needed to do in 2 weeks time, it worked well. I actually ended up using different algorithms for different shapes. The algorithms are a bit self inventions, but a good method I want to mention is that get the histogram and then use projection on different axis helped a lot.