(I'm starting a new topic to avoid lots of indentation).
I've now reached the stage where my vision bot can tell where it is in the room to about 1 m accuracy. As I said before, the room in question is about (let me just check my scrappy bit of paper…) 6 x 9 m. So about 10%.
I'm aiming for much, much better.
The whole idea of this project is to get position queues off corners at ceiling level.
There are some advantages:
- Even a small bot can see the ceiling from most places in the room.
- The ceiling has an uncluttered format — easy to process.
- Finding the corners is relatively simple — aim the camera at 45 deg to the ground and at least a join is bound to be in the field.
There are at least 2 ways to analyse the scene. In theorem-proving terminology these would be called "forward" and "backward", or elsewhere known as "bottom up" and "top down", respectively. (Yes, I know that sounds backward
In the usual bottom-up approach you can just find a 3-way corner and measure the angles of the lines. Simple projective geometry will then tell you where you are.
Here's a simple example:
This is the view I get when laying down in bed. How far is my eye from the nearest wall? I'll give you a minute to think…
OK. From symmetry we can tell my eye is 1 unit away from the vertical join and sqrt(2) units away from the 3-way corner. It is therefore 1 unit away from either wall seen in the scene. 1 unit, of course, is the height of the ceiling — about 2.5 m.
Thiking only about "average positions" in a room we can come up with some limiting cases.
E.g.
In this scene we see a more typical view — the angle between the 2 walls appears to be at an angle of more than 120 deg (the prev case). But looking left and right we can see we're still at an equi-distance point from each wall.
We can image as we get further and further from the corner, it'll eventually appear the marked angle gets closer and closer to 180 deg.
At the other end, we can get closer and closer to the corner.
If the robot is in the corner, we can see a right-angle (presuming walls are at right-angles
at the corner.
So we have the 3 cases:
| r (m) |
angle (deg) |
| 0 |
90 |
| 2.5 |
120 |
| inf |
180 |
And this suggests an approximation formula to determine the distance to the floor-level corner:
For angles <= 120 deg:
r = (angle - 90)/12
(i.e. linear interpolation between first 2 cases);
For angles >= 120 deg:
r = 150/(180 - angle)
(i.e. hyperbolic interpolation between last 2 points).
For this very simple method, you can ignore everything but the topmost angle; by ranging on 2 corners using this method a bot can determine its position in the room to within about 50% of a unit — 1 m.
Now — as for the "top down" method; that's what I'm interested in.
As I sometimes say — "use top-down methods when you know what you're doing; and use bottom-up most of the time".
In this room scenario we do know quite a bit about angles and ceiling height. So I would argue a top-down method would be useful.
That's what I alluded to before — that the robot keep a simple "wire model" of the room, and use simple geometry to "binary search" for the parameters that make that model match up against what it sees.
Some of the nuts-and-bolts for these 2 approaches will be the same. You have to process the images well enough to get some ceiling joins out of it.
But the bottom-up method requires measuring angles, while the top-down method requires comparing a wire-frame model against scenery.
I hope the comparison alg will be fairly simple — it only has to determine whether set of params X is better than param set Y, and I expect this will "even out a lot of errors" rather than allowing them to add up as for the above bottom-up method.
I have a simple s/w to perform this top-down thing. But the hardest thing so far (apart from having to recover the s/w after I accidentally deleted it sometime in the past 48 hrs) is to get it to produce some nice pix I can paste up here.
I think I'm gunna have to ask Murray Cox what he uses to make his nice pix.