I accidentally reinvented visual odometry on the Tube
I was on the Underground, on my way to the library, passing the time while the train moved. Then I started noticing the floor.
It was covered in small coloured dots. The longer I looked, the more they seemed to form patterns: shapes, lines, almost like arrows pointing at the doors or at the passengers. Either whoever designed it had done some very discreet work, or the music in my ears was rushing dopamine through my system and shaping the patterns for me. Probably a bit of both.
Then a different thought came. It couldn’t only be me who sees this. Another person could. And so could a robot: something with no consciousness at all, that could still pick out these patterns the way an algorithm would, and report them.
I think about AI every day, so I put myself in the robot’s position. What would it notice here? How would it perceive this, and how would it move?
That’s when the blinking clicked. Every time I blinked, I got a new snapshot of the floor, and my mind formed a new pattern every second. Time was moving, the train was moving, and the pattern shifted from one blink to the next. It was phenomenal.
If a robot compared those snapshots, it could work out how far and in which direction it had moved. No map, and no GPS. Fittingly, there’s no GPS underground anyway.
I was sure there had to be a field for this, something niche I just hadn’t heard of. So I looked it up. There is. It’s called visual odometry: estimating your own motion from a sequence of camera images. It’s how drones, rovers and robots keep track of where they are when GPS isn’t available.
The dots on the floor are what the field calls features. My blinks were frames. Matching features between frames to recover motion is the core of the whole idea.
So now I’m building it. The first step is feature matching in OpenCV: finding the same points in two images and linking them up. I’ll write about what I learn here as I go.