Why object tracking is easier
Object tracking is the process of continuously searching for where an object found in the previous frame is in the current frame. It is the foundation of many uses, such as measuring the trajectory of a ball, having a robot follow parts, and counting the movements of people or cars.
This page explains why tracking becomes easier when you capture at 1,000 fps.
What makes tracking difficult
Section titled “What makes tracking difficult”When you follow a fast object with a conventional camera (30 fps), the following happens:
- The search area is large: The object moves a lot during one frame, so you have to search a large part of the screen.
- Objects get mixed up: With a large search area, you may follow a similar object by mistake (a ball of the same color, a part of the same shape, and so on).
- The appearance changes: During one frame, the object may rotate or change direction or brightness, so it looks different from the previous frame.
- The object gets lost: When it moves in or out at the edge of the screen, or goes behind another object, you can no longer tell where it went.
All of these are caused by the object changing a lot between one frame and the next.
What changes at 1,000 fps
Section titled “What changes at 1,000 fps”Motion per frame is only a few pixels on screen
Section titled “Motion per frame is only a few pixels on screen”Suppose you capture a ball flying at 100 km/h (about 27.8 m/s), with a field of view 2 m wide. On an 800-pixel-wide image, one pixel is about 2.5 mm.
| 30 fps | 1,000 fps | |
|---|---|---|
| Distance traveled during one frame | About 93 cm | About 2.8 cm |
| Movement on screen | About 370 pixels (nearly half the screen) | About 11 pixels |
At 30 fps, the ball moves nearly half the screen in one frame, and appears only 2 to 3 times in the 2 m wide field of view. At 1,000 fps, the movement per frame is about 11 pixels. If you search right around the position in the previous frame, you will always find it.
The search area is about 1/1,000
Section titled “The search area is about 1/1,000”When the movement per frame becomes about 1/33, the search range shrinks both vertically and horizontally, so the search area becomes about 1/1,100.
- Because the search area is small, the processing per frame is lighter, and it is easier to finish within 1 ms.
- Because similar objects are less likely to enter the search area, objects are less likely to get mixed up.
Almost the same appearance as the previous frame
Section titled “Almost the same appearance as the previous frame”In 1 ms, the direction, shape and brightness of an object hardly change. Even a method that uses the appearance in the previous frame directly as a template (template matching) can follow the object well.
The next position is easy to predict
Section titled “The next position is easy to predict”The speed and direction of an object hardly change in 1 ms. From the motion over the previous few frames, you can predict the position in the next frame quite accurately. Even if the object is briefly hidden behind another object, you can find it as soon as it comes out by searching near the predicted position.
A technique unique to INFINICAM: decoding only what you need
Section titled “A technique unique to INFINICAM: decoding only what you need”INFINICAM images are compressed inside the camera before they reach the PC. This compression is fixed-length (each 8 × 8 pixel block always becomes data of the same size), so you can immediately tell where in the data each part of the screen is stored (see Image compression mechanism and specifications). Thanks to this, you can do the following, which is useful for tracking.
Decoding only the area around the tracked object
Section titled “Decoding only the area around the tracked object”When converting compressed data back into an image (decoding), you can decode only a specified area (ROI), not the whole screen. At 1,000 fps the motion per frame is small, so it is enough to decode a slightly larger area around the object you are tracking.
For example, if you decode only a 64 × 64 pixel area near the object out of an 800 × 600 pixel screen, the amount to decode is about 1/100 of the whole screen. Decoding takes less time, so you can spend that time on image analysis instead. You can try ROI decoding in SingleImage + ROI decoding (Python) and the C++ version.
Splitting areas and processing them in parallel
Section titled “Splitting areas and processing them in parallel”You can freely split the areas to decode. This suggests uses such as:
- Dividing the screen into several parts, and decoding and analyzing each part in a separate process (or thread)
- When tracking multiple objects, assigning a process to each object, and decoding and analyzing only the area around it
Because the processing of one image can be shared among multiple CPU cores, it is easier to keep the processing of each image within 1 ms.
Key points and limitations
Section titled “Key points and limitations”Reducing blur
Section titled “Reducing blur”If an object moves while a frame is being captured (while the shutter is open), the image is blurred and the position becomes unclear. The ball in the example above moves about 2.8 cm (about 11 pixels) during a shutter speed of 1/1,000 s. At 1/10,000 s, it moves about 2.8 mm (about 1 pixel). The shorter the shutter speed, the more light is needed to capture the image.
Processing each image within 1 ms
Section titled “Processing each image within 1 ms”Because 1,000 images arrive every second, each image must be processed within 1 ms. Besides decoding only the nearby area (ROI) and splitting areas for parallel processing as explained above, it also helps to search roughly in a scaled-down image (DC components) first and then examine in detail.
Note that the position and size of the ROI are specified in units of 8 pixels. If the object moves fast and leaves the ROI, it will be lost, so make the ROI a little larger than the object’s motion.
Resolution
Section titled “Resolution”At 1,000 fps, the image size is 800 × 600 pixels. If you capture a wide area, each pixel covers a larger size, and small objects appear as only a few pixels. Choose the lens by balancing the size of the objects you want to track against the size of the area you capture.
Try it
Section titled “Try it”You can try the ideas of tracking with the application programs.
- Measuring the speed of a ball: finds the position of a white ball every frame and shows its trajectory and speed.
- Tracking ArUco markers: follows the position and orientation of printed markers at full 1,000 fps.
- Finding moving objects: finds the areas that moved, every frame.
Related pages
Section titled “Related pages”- Possibilities of INFINICAM (overview): what changes when the camera is fast, and the shared ideas
- Autonomous driving and in-vehicle cameras: reading the motion of other cars and people
