在 BMP 图像文件中搜索形状

发布于 2024-12-09 19:36:11 字数 279 浏览 0 评论 0原文

我有一个图像处理问题,使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

陌伤浅笑 2024-12-16 19:36:11

请查看本文。我对他们方法的理解:

  • 检测边缘
  • 通过寻找垂直边缘来检测角
  • 通过寻找角组
  • 来检测多边形 使用霍夫变换检测圆

这是一个相当困难的研究问题。即使拥有像 OpenCV 这样强大的计算机视觉库,在 1 周内实施有效的解决方案也是一项艰巨的任务。

Have a look at this paper. My understanding of their approach:

  • Detect edges
  • Detect corners by looking for perpendicular edges
  • Detect polygons by looking for groups of corners
  • Detect circles using Hough transform

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.

冷…雨湿花 2024-12-16 19:36:11

您是否使用过 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.

羁〃客ぐ 2024-12-16 19:36:11

为了回答我的旧帖子,我在两周内完成了我需要做的事情,效果很好。实际上我最终对不同的形状使用了不同的算法。这些算法有点自我发明,但我想提的一个好方法是获取直方图,然后在不同轴上使用投影有很大帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文