Skip to main content

First Algorithm Implementation

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

Popular posts from this blog

Blog Post 2

Debugging the RDP Algorithm   The Problem Even though we had the proper input for the RDP algorithm, we weren't getting useful or consistent results from it. This was partially due to our not knowing the algorithm very well, but even when we managed to understand enough to see what it was supposed to be doing, we found that it wasn't performing correctly. We consistently got results that varied between runs and were impossible for a given shape because there were either no lines or far too few to actually make up the shape. After checking the logic of the algorithm numerous times with as many sources as we could, in addition to going over the code with a fine toothed comb, we found nothing out of place or wrong. It was only at that point that we decided it would be worthwhile to check what the contoured image actually looked like and see what was happening. The Hunt   It turned out that the cv2.blur() function we were using to simulate the effect