v9.1.1
Menu

Feature Track Length

easyPROBundle Adjustment for SfMSfMCV: Structure from Motion and SLAM

Count how many cameras observe a particular 3D point.

In Structure from Motion, a track is the set of 2D observations of a single 3D point across multiple images. The track length is the number of images where the point is observed.

Longer tracks are valuable because:

  • More observations lead to better triangulation accuracy
  • They provide more constraints for bundle adjustment
  • They help verify the correctness of feature matching

Typically, we filter out points with very short tracks (e.g., < 3) as they may be noise or outliers.

Example

Input
track_length([True, True, False, True, False])
Output
3
Reasoning
  • visibility has one entry per camera, in camera order: entry ii says whether the 3D point was detected and matched in image ii. Here there are 5 cameras.
  • The track is the set of cameras that see the point: cameras 0, 1 and 3. Cameras 2 and 4 contribute nothing, because the point was not observed there (occluded, out of frame, or the match was rejected).
  • Writing vi=1v_i = 1 for a visible camera and vi=0v_i = 0 otherwise, the track length is L=∑i=04vi=1+1+0+1+0=3L = \sum_{i=0}^{4} v_i = 1 + 1 + 0 + 1 + 0 = 3.
  • The output 3 is a plain integer count, not a list of camera indices. It can range from 00 (no camera sees the point) up to the number of cameras.
  • Notice that the order of the cameras does not matter, only how many are visible. With the usual "at least 3 views" filter this point just survives.

Constraints

  • visibility: list of boolean values, one per camera
  • Return count of True values (cameras that see the point)

Learn this in

More from CV: Structure from Motion and SLAM

PRO

Editor locked

The code editor is locked for Pro problems. It is only available for free problems. Please upgrade to gain access to the code editor for all problems.

solution.py

Test results

Sign in to run your code against the test cases.