Pan Tilt #3: Colour Tracking
I finished Post 2 having calibrated the pan tilt mechanism.
For a given location of a detected target, we can look up the exact movement required to slew the servo's so that the camera is centered on that object.
With that as a base, I coded up a
colour tracking controller
for the pan tilt platform. Here it is in action on the Model B+:
The inset in the video shows what the Pi camera is seeing. The pixelated look is because it is capturing at 64x48 pixels. The lower the resolution, the less data to process, the more frames can be processed per second, thus making the tracking more responsive. As you can see colour tracking doesn't require particularly high resolution.
Below is a table of colour tracking frame rates observed at each resolution. The values don't come up to exactly what is shown in the video since these measurements were taken on pure colour tracking code without the pan tilt controller.
Framerate (ms) / 10 frames | |||
---|---|---|---|
Resolution (pixels) | Model B+ | Pi 2 (tbb=false) | Pi 2 (tbb=true) |
64x48 | 480 | 400 | 190 |
128x96 | 750 | 400 | 230 |
160x120 | 960-1400 | 400 | 270 |
320x240 | 2300 | 700 | 630-680 |
The video is made with the Model B+
UPDATE June - Now with Pi 2 timings.
Note there is a floor of 400ms/10 frames with TBB=false. The floor is because I didn't realise
that the classifier was eating up the default 25 fps. When I made the TBB=true measurements, I increased the capture framerate sufficiently to ensure the classifier wasn't starved of work.
So read tbb=false measurements of 400 as '400 or even faster'. At 320x240 we can see slight benefits of TBB.