The Forums

You must be logged in to post
Search Forums:


 






Robot Vision 101 #3

No Status Selected
UserPost

6:18 pm
September 17, 2007


kymhorsell

Member

posts 119

There's nothing like getting a slap in the face from reality. (I mean the VR we all live in, of course).

I was plugging away trying to get this vision processing to go and it kept throwing up "wrong results". I kept hacking, trying to make the output fit my preconceptions. (Amusingly, this is exactlythe algorithm the vision s/w was trying to implement). It wouldn't fit. More hacking. More "bad output".

Finally I decided to actually measure things with a tapemeasure. Turned out my preconceptions were wrong and the s/w was right. :}

I'd 1/2-remembered the granny flat was 6m x 9m, but it turned out to be only 1/2 the size — 3m x 6m.

Anyway, let's look at the results of the present s/w.

As mentioned before, the idea I'm working on is a "top down" approach — trying to decide whether the scene you have matches your preconception.

There is a lot of info we know beforehand, when analysing the simple scene of a couple of joins near the ceiling. E.g. we assume the ceiling is 2.5m up (yes, I measured that and it's right!), that most corners are square, and the robot is probably close to the ground (in any case, that height can be assumed a priori because we built the robot).

It's a pity to waste that info and try to directly measure features from the scene assuming almost nothing a priori.

My s/w pans a small camera around and tries to capture the 4 corners of the room. It then internally makes a "wire model" of the room, and adjusts the parameters of length and width, as well as robot position and camera orientation, to decide whether those parameters actually appear to match what it can see in some of the scenes.

(In my granny flat I forced the camera to look at the "fifth corner" of the room, just to see what the s/w would make of it).

So instead of trying to "fit a line" into a bunch of pixels, the top-down approach requires you to come up with a "goodness of match" between the features you expect vs those you actually see. And most "correlation" measures will do, if you have some idea of how to decide whether the correlation is statisticall significant or not.

At first the s/w tried a "smart" approach in its parameter hunt. But it proved too smart and failed. So I went back to trying all possble parameters — e.g. room widths between 1m and 100m and robot positions at 1m gridpoints, and orientations in 10deg increments. Then find the "best fit" in the majority of scenes with a simple correlation between random locations in the model and assumed corresponding position in the scene.

The following are the "best fit" model it came up with. The red lines are hacked in by a badly-written bit of s/w — I am yet to find a proper tool that can insert some text or nice, thick red lines in a jpeg file — to show what features are expected according to the wire-frame model.

Corner 1 (from before):

Processed image with expected ceiling lines added:

Corner 2 (booshelving gives a false position, but is a better match than any other to the gridpoint):

Note the vertical line is about 1 ft in front of where the real wall is. Those damn books! :)

Corner 3:

 

It might seem amazing the s/w wasn't fooled by the vertical on the doorway. But we're using the info from all corners, here, so it's effectively filtered out along with all those coloured pixels. :)  

Corner 4:

Again, there were all sorts of verticals in those dangling wires and the bookshelf itself, but they were ignored because we're matching a simple "preconception" to an image, rather than operating from almost-complete ignorance on the single scene.

Finally, Corner 5:

Since the model only has 4 corners, this funny add-on doesn't match very well. But it actually matches well enough to add some certainty to the match.

The actual degree of matching was nearly 80% on 3 of the corners, about 50% on the corner with the bookshelf and clock, and 10% on problematic corner #5.

Without any fiddling, this was the only statistically-significant match at the 80% level, saving any embarrasment on having to choose randomly between >= 2 interpretations (i.e. the robot analogy of an optical illusion :) .

The model that produced this match was:

Which matches the actual room and actual robot position to within 10 cm.

The info took the pan on the camera about 20 secs to capture, and the PC about 0.1 sec to process. :)

4:08 am
September 18, 2007


rolandgpainter

Member

posts 4

This is some pretty cool stuff, I really should have a go at some home made vision, seeing as I play with the industrial stuff at work…

Roland

5:53 am
September 18, 2007


ash

Admin

posts 67

Thats great! :)

I fired up roborealm to see if there was an easy way to clean up those pics a bit more (although from the accuracy you are getting it sounds like you don't need it :) and ended up with these:

Me and the roof corner

My study doorway and corner

I am quite impressed that these actually came out given that the video I am taking is fairly dark.

The filter stack I used consisted of:

  1. Adaptive Threshold 19,7
  2. Sobel Edge

You can actually get away with just the adaptive threshold but it turns out white and i was experimenting to see if i could get the lines sharper. Adding a Straight Line filter would probably work but it is crashing RoboRealm all of a sudden so oh well.

A while ago I ran across an interesting localisation for small robots called NorthStar something (can't find the damn link now!). It is similar to your method but uses specially textured patches that are placed on the ceiling somewhere in the various rooms around the house. Each patch is optically coded in a way that allows the robot to work out which room it is in and I guess it uses a variation on the method above to work out exactly where in the room it is (if it doesn't then it should because it is a great idea).


I thought it was NorthStar but NorthStar is slightly different again. Check it out here if you are interested (PDF):

http://robotics.caltech.edu/~jerma/Images/NorthStar_Calibration.pdf

 

7:04 pm
September 18, 2007


kymhorsell

Member

posts 119

Wow!  You've saved me hours, there. I was playing with RR for about 45 mins and didn't come anywhere near this kind of detail.

 I'll start with those params for the "bottom-up" method that tries to measure ceiling angles directly. I was having a lot of trouble with my roll-yr-own "clustering and line fitting" on the pix I'm getting now. :)

 Ta muchly.



About the Ausrobotics II forum

Most Users Ever Online:

7


Currently Online:

5 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 130

Posts: 320

Membership:

There are 1279 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)