Detecting shapes in an array of points

I have an array of points. I want to know if this array represents a circle, square or triangle point.

Where to begin? (I use C #)

Thanks, John

+4
source share
4 answers

Depending on your problem, a good approach to this problem might be to use the Hough Transform and its entire derived algorithm.

It consists in converting the image space to another space, where the coordinate represents the parameters of the objects (the angle and the starting point for the line, the center coordinates and the radius for the circle)

The algorithm converts every point in your array of points into points in another space. Then you need to search in a new space if some points prevail. From these points you will get the parameters of your object.

Of course, you need to do this once to recognize the lines (so that you will know how many lines are in your bitmap and where they are), and it will recognize the circles (this is not exactly the same algorithm)

You can take a look at this lecture (for the Hough Circle Transform transform), but you can easily find the algorithm for the string

EDIT: you can also look at these answers

Shape recognition algorithm

Geometric detection of an object in an image

+5
source

Imagine that each of them is one after another, and try to put each of these figures in the data. For a square, you can find the four extreme points and try to make a square that goes through all of them ..
Once you have the shape in place, you can measure the distance between each of the points and the part of the shape closest to it. Then collect these distances and add them ... the shape that has the smallest sum of -of-squares is probably your best bet.

0
source

Use the Hough Transform .

0
source

I'm going to take a wild blow and say if you have 3 points, the shape is a triangle, 4 points is some kind of quadrangle, more than a circle.

You may be provided with additional information about your problem.

-2
source

All Articles