The Ramer Douglas Peucker Algorithm:
We decided to use the Ramer Douglas Peucker algorithm in order to perform shape recognition. This algorithm takes a set of points as an input and attempts to extrapolate away all extraneous points and reduce the number of points down to the essentials that make up the shape. The idea behind using this algorithm for our project was to see if we could find a range of points that generally characterizes certain shapes. In other words, if we could determine that a general sphere could be made up by, say, five points after being refined to no longer contain extraneous points, we could set that as a known value for spheres and recognize all shapes with five points as spheres.
However, we ran into some trouble actually using this algorithm because we needed contours, or lists of points, to run through the algorithm. Because contour detection isn’t something we planned to have implemented yet, we are currently using OpenCV’s edge detection to get our contours. This is only a temporary solution until we implement our own edge detection and finish refining the Peucker algorithm.
The plan moving forward is to be sure the algorithm works by using a template image that only contains a sphere in order to calibrate the algorithm, and ultimately run it on a video feed that has spheres in it and see if the algorithm can correctly identify where the spheres are. We would do this by taking a list of all the contours and running them through the algorithm while comparing each to the number of points in the template sphere.
Ideally, we will be able to expand this model to a variety of other shapes like cones or cubes without needing to add much code.
Comments
Post a Comment