检测点阵列中的形状 [英] Detect Shapes in an array of points
问题描述
我有很多观点.我想知道这个点数组是代表圆形,正方形还是三角形.
I have an array of points. I want to know if this array of point represents a circle, a square or a triangle.
我应该从哪里开始? (我使用C#)
Where should i begin? (i use C#)
谢谢 乔恩
推荐答案
Depending on your problem, a good approach for this problem may be to use the Hough transform and all its derived algorithm
它包括将图像空间转换为另一个空间,在该空间中,坐标表示对象参数(直线的角度和起始点,圆的中心和半径的坐标)
It consists in a transformation of the image space to an other space where the coordinate represents the objects parameters (angle and initial point for a line, coordinates of the center and radius for a circle)
该算法将点阵列中的每个点转换为其他空间中的点.然后,如果有某些问题占主导地位,则必须在新空间中进行搜索.从这些方面,您将获得对象的参数.
The algorithm transforms each point of your array of points in points in the other space. Then you have to search in the new space if some points are prevailing. From these points, you will get the parameters of your object.
当然,您只需要做一次就可以识别线(这样您就可以知道位图中有多少条线以及它们在哪里),并需要识别一次圆圈(算法不完全相同)
Of course, you need to do it once to recognize the lines (so you will know how many lines are in your bitmap and where they are) and to it to recognize the circles (it is not exactly the same algorithm)
您可以查看本讲座(用于Hough Circle Transform),但是您可以轻松找到线的算法
You may have a look to this lecture (for Hough Circle Transform), but you could easily find the algorithm for line
您也可以看看这些答案
这篇关于检测点阵列中的形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!