在BMP图像文件中搜索形状 [英] search for shapes in BMP image file

查看:67
本文介绍了在BMP图像文件中搜索形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用C#的图像处理问题.

I have an image processing question, using C#.

说我有一些BMP格式的示意图,该示意图包含相互连接的组件形状.

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!!

我正在使用C#.

推荐答案

要回答我的一篇旧帖子,我已经完成了两周后需要做的工作,效果很好.我实际上最终针对不同的形状使用了不同的算法.这些算法是一些自我发明,但是我想提到的一个好方法是获得直方图,然后在不同的轴上使用投影很有帮助.

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.

这篇关于在BMP图像文件中搜索形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆