What this is
A bird a hundred metres away is a few dark pixels in a phone's picture. This project works out how a phone can still find them, follow them, and say where they are heading, while the person holding it turns their head.
It has two parts. A simulator flies birds and other targets by their physics and draws the picture an iPhone 15 Pro's ultra-wide camera would take, so every idea can be measured against the truth. BirdTrack is the tracker itself, a single file with no dependencies that runs in any web page. It started as the Bird tracker in VR Portal.
Try it
How well it works
Every version is measured on the same 48 simulated flights: a pigeon, a crow, a gull and four other small flying shapes of different sizes and speeds, each on several paths. A right sighting means the tracker had the target that moment; a false one means it had something that was not there.
| Version | Right sightings | False, per 100 looks | Box error |
|---|---|---|---|
| VR Portal's tracker as it was | 16.4% | 1.4 | 3.70° |
| VR Portal's tracker, improved | 34.1% | 1.9 | 0.80° |
| BirdTrack 0.1 | 22.1% | 0.0 | 0.50° |
| BirdTrack 0.2 | 27.4% | 0.0 | 0.20° |
| BirdTrack 0.3 | 45.9% | 0.0 | 0.25° |
| BirdTrack 0.4 | 51.3% | 0.1 | 0.20° |
Box error is the median, over flights, of how far the tracker's box was from the target's centre. These results come from the simulator on a desktop computer, not from a phone.
What changed, version by version
- The tracker became a library of its own, finding things that moved against the sky after allowing for the camera's own turn, and learning the lens's width and the camera's delay from the pictures.
- A finer picture for tiny targets, faint sightings kept when their path is steady, and things that hover found once the head turns a little. Marks on the lens are ignored.
- Matching sightings to targets with windows scaled to how fast each can move. A bird circling the person had been starting a new target at every sighting.
- Two methods at once, a motion finder and a spot finder, their sightings merged. Any other recogniser's boxes can be added.
Which method sees what
Each method measured on its own: the share of moments it saw the bird.
| Target | Motion | Spots | Phone's recogniser |
|---|---|---|---|
| Crow | 84% | 78% | 2% |
| Gull | 78% | 66% | 1% |
| Pigeon | 78% | 72% | 0% |
The phone's built-in object recogniser was made for larger things and rarely sees targets this small.
Use the tracker
Give it the camera's turn as often as it is known, and each picture as it arrives. It gives back every target it is following.
const bt = BirdTrack.create({ across: 100, aspect: 9 / 16 });
bt.head(timeMs, quaternion); // from the phone's motion sensor
const targets = bt.frame(video, timeMs); // a video, a canvas, or plain pixels
// each target: where it is, its velocity, where it will be, which methods saw it
Install it in another project with npm install github:tbirdpower3000/Bird-Tracking, or copy birdtrack.js.
Read more
- Every test run and the change from the one before
- Where the error comes from, explained by physics
- Each method on its own, by kind of target
- How others do it: a checked review of published work
- The code on GitHub