jojomojo: (Default)
[personal profile] jojomojo

I made a New Year's resolution to get my geek on more. With that in mind I've spent some time today working on robot software. I now have stereoscopic robot vision, woo! Using my stereo webcam the robot can calculate angle to and distance of any object that its blob detection picks up (two normal webcams would work about as well, and that's what I tried first, but I've had distinct difficulty mounting the things parallel to each other with sufficient accuracy so I took the easy way out; besides, the Minoru is kind of cute).

Basically, I know the difference between the two eyes (60mm) and the FOV of the cameras (40 degrees). Using this and the X position of the detected blob in each webcam image, I can calculate angles from each lense to the blob giving this triangle -



where the object is at the apex, the cameras are at a and b, and angles a and b and length C are known. From there I calculate the top angle then use trigonometry to figure out the length of each remaining edge. For now I just average those, but at some point soon I should be able to break down the triangle into two right-angle triangles and figure out the Cartesian coordinates of the object. If I do the calculation twice, once for each edge of the blob, I should be able to calculate its width too.

The distance calculation looks mostly accurate with my red testing softball, at least at the 20-60cm range, but it tends to jump around a surprising amount for some reason. I suppose I might get better results with wider-placed lenses (which would require going back to my old camera system), but this is probably fine for now.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

jojomojo: (Default)
jojomojo

July 2017

S M T W T F S
      1
234567 8
91011121314 15
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 12th, 2025 10:39 pm
Powered by Dreamwidth Studios