I would like to make a shape recognition program that would trace a mouse and record it's location at each 1/2 second. How could I use these points to find a rough polygon? In other words, if you just draw a shape resembling a triangle or square, it will more likely be a be a 50-100-gon, how can I simplify it to get the shape I were trying to draw? I know that you could do a genetic algorithm, but do not know exactly how that would work, and I would like to know any alternatives.
edit: convex hulls will not work, concavity is needed to be preserved.
i'll give this a shot.
you might be able to determine the shape simply by counting sides.
For each point along the 100-agon, find the area of the tiny triangle formed by that point and the points on either side. Remove the point that created the smallest triangle. Repeat until the smallest triangle is larger than some threshold.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.