Computer Vision Project

Another project that I am working on is a computer vision problem for my software engineering class. Our goal is to use a robotic arm to find and pick up a fallen soda can to set it upright.
My position on the project is dealing with the computer vision. I’ve basically written all of the code for this rather large piece of the puzzle making good use of Intel’s OpenCV library. This library helps to connect to the webcam, capture a frame, conduct an edge detection algorithm, and to draw some pretty circles for me.
As far as the algorithm for detecting the corners, it’s rather expensive. It’s close to o(n²) 4 times, but it doesn’t really search the entire image. For each corner, I move in on the object. A picture would do better justice. Imagine each line moving along the image until it gets to the object. So the top left scans right, and moves down. The top right scans down, moving left…

It gets the job done for this project, but I can’t quite figure out how I could improve it (not that I’ve had a lot of time to think about it). The arm of the bot needs the center point of the object (x,y) and the angle of the object. The angle is computed with point B and the line intersection.
The project isn’t done. The next big step is figuring out what side of the can is the TOP. But I’m ahead of the curve and thought I’d share what I’ve been doing.



