Simple geometric shape recognition in C #

I have a set of Strokes (from ink) and would like to find those strokes that participate in a geometric shape, such as a line, square, circle, triangle ... and identify them.

So far, I have seen many algorithms that work with bitmap images.

My problem is simpler, since I already have a good array of points. But still you need to find the nearest geometric shape. thanks John

+4
source share
2 answers

converts strokes to vectors (e.g. angles). for example, 272, 93, 42, 179 Now compare these angles with a table of saved angles for recognition:

eg. forms: {{0,90,180,270}, {270, 90, 45, 180}}

for each entry in the table, do the following: for each corner, do the following, take the absolute difference between the two angles and add their total number to save the current total amount

the lower end goal is the form that most resembles.

beware of finding the difference between the two corners. There is a workaround. angle: 359 and 1 are very close to each other ... but if you just subtract them, they look at a distance of 358 degrees.

I hope it was clear

+4
source

You can try machine learning methods to train your code with what interests you. This is similar to what many people do for Wii remote gesture recognition. Here is an example:

http://mm-werkstatt.informatik.uni-augsburg.de/project_details.php?id=46

+1
source

All Articles