Log in

View Full Version : Detecting rectangles with the camera and Java


Djur
19-10-2011, 16:39
I'm a programmer for my team and I'm working on autonomous during the offseason, but for it to work properly, the robot has to be parallel with the sides of the field. I was thinking of aligning the robot to face the plexi sheet in front of the drivers' area, but I really have no idea how to make the robot actually recognize that rectangle. Help would be greatly appreciated.

shuhao
20-12-2011, 22:38
Apply an edge finding (both vertical and horizontal) algorithm. Try to scale your image down first (< 100x100) and take the grey scale for optimization.

Try the simplistic kernel of


1 -1


for horizontal edge and


1
-1


for vertical edge,

I assume that your "rectangle" will look like


/ \
/ \
/ \


as it seems to be on the ground, so go through your filtered image and try to recognize those pattern with something like a machine learning algorithm

Either way, it's pretty tough...