The Forums

You must be logged in to post
Search Forums:


 






Robot Vision 101

No Status Selected
UserPost

9:21 pm
September 14, 2007


kymhorsell

Member

posts 119

I was amazed at how cheap pinhole cameras are these days. I just ordered some off ebay and they are selling for $us 10 each, including all the power supplies, and wifi receiver.

All you need to do it hook them up to frame-capture cards and Bob's my uncle!

The pix from the units I have are only very low res at 300×300 pixels, but it's colour and you can tell what you're looking at. They're better than my older webcam…

So now I have an easy way to add vision to any of my projects, and have it beamed 30-60 m to my "big iron" for processing.

But I'm starting simple. Although I have done some "blow off" grad courses in robo vision, I think I'll revert to genetic type (check up on Pournelle&Niven's "Motie") and just invent what I need as I go along. Books are only needed when things blow up and burn down.

So here's the first 1/2 of my first attempt.

Basically, taking the images from a low-res camera, pass them through some sharpening and edge-detection to get a view of the ceiling in the room your bot is in. With some simple trig — knowing that the ceiling is (say) 2.5 m off the floor and your camera is X off the floor — you can decide how big the room is and how far away from each corner and wall the bot is.

The 2nd stage will do the calcs and spit out the measurements, but here's the results from the pre-processing (image massaging) I managed to cobble together after the "hot glue engineering" with Talrik last night.

(I kinda check in on ausrobotics every hr or 2 o'night and I know I'm not the only one that works until dawn :)

Here are the initial pix from the spycam. These are the 5 corners of my granny flat where most of the major des^H^H^Hconstruction around here gets done.

And now we pass the above through some magical piece of cobbled-together s/w and we have (hopefully) just the ceiling and wall join lines:

Pretty, to be sure. :)

Now comes the fun part — dredging into that mess of pixels and measuring some angles.

The problem may seem difficult at this stage, but is actually easy to solve. We can use some a priori knowlege such as rooms usually have square corners, and normally there are 4 of them (in my granny flat this rule fails), ceilings are about 2.5 m up, and — in my case — the camera is  78 cm off the floor. (Additional knowlege such as the room in question is 6 x 9 m can be used for checking — but is not needed to solve the basic questions).

The method I'll use involves simply generating a "wire frame" model of a room, and changing its parameters — length, width and position of the robot  — so the angles in some selection of the observed ceiling-level lines match up. There will only be 1 or 2 possible answers, and the "correct" set should come out using the a priori knowlege.

OK. Sounds simple. I'll post some more tomorrow. :)

4:13 am
September 15, 2007


ash

Admin

posts 67

Good job Kym, you seem to be a pro at whipping up interesting mini-projects :)

You can probably eliminate most of the non-line artifacts by adding a blur step before the edge detection. The RoboRealm (http://www.roborealm.com) software I mentioned before is a pretty fun way to experiment with different vision algs without actually having to write anything. Then once you have worked out the various steps needed you can just implement them in code yourself or hook into RoboRealm using one of the many interfaces available.

C# is my language of choice for experimentation so this might not apply to you but if you are looking for an image processing lib (contains many useful image filters as well as other stuff) to speed up dev you should take a look at AForge.NET (http://code.google.com/p/aforge/).

More info is available on Codeproject:

(http://www.google.com.au/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fwww.codeproject.com%2Fcs%2Fmedia%2FImage_Processing_Lab.asp&ei=z73rRqPmNIOIgwOIspS8AQ&usg=AFQjCNHw8Wxh1QoS_FC0F8nQGLKofvs5uA&sig2=Wnm2reSo_fIzk9KH19ruKg)

I don't have time to write all my own stuff at the moment so it is awesome that there is so much out there to experiment with. :)

9:16 pm
September 15, 2007


kymhorsell

Member

posts 119

I uploaded that package when you suggested it before. But o'night I managed to LOOK at it. :)

There sure are enough options on the thing!

I played around but I couldn't get near where the tools I am used to get me. I'm sure it can do the processing, but I'm just not too familiar with the algorithms in RoboRealm. (I got the wintox version rather than the Linux version, BTW).

I've gone back and added in the blur phase as suggested, and it's much much better. All those artefacts like bookcases, etc are rendered low-level.

I'm posting another thread on this forum today giving some more details. I got it up to doing some approximate ranging last night, but from calcs it seems seeing 2 corners should get a position within 10 mm. Probably good enough for most of my work. :)



About the Ausrobotics II forum

Most Users Ever Online:

6


Currently Online:

3 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 130

Posts: 318

Membership:

There are 131 Members

There have been 14 Guests

There is 1 Admin

There are 0 Moderators

Top Posters:

kymhorsell – 119

PirCapAdi – 24

Quinn – 24

robotman – 16

Gillerire – 16

daveymilla – 6

Administrators: ash (67 Posts)