Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-386

SfM Track Length

Problem

Measure the average structure-from-motion track length.

Each row of visibility is a feature with a 0/1 flag per frame. Return the mean number of frames in which a feature is visible, rounded to 4 decimal places. No features returns 0.0.

Hint

Longer tracks give more stable triangulated 3D points.

Test cases

case 1
in: [[[1,1,0],[0,1,1]]]
expected: 2
case 2
in: [[[1,1,1]]]
expected: 3
case 3
in: [[[]]]
expected: 0
case 4
in: [[[0,0],[1,0],[1,1,1]]]
expected: 1.3333
Starter codePython
def sfm_track_lengths(visibility):
    # Your code here
    pass

4 test cases · run your code against them in the editor