All problems
RANSAC Homography Iteration
Problem
Run one seeded RANSAC iteration for homography estimation.
Seed the random module and sample 4 distinct correspondence indices, fit a homography with the DLT, then count inliers whose reprojection error is at most threshold. Return [sorted_sample_indices, inlier_count]; if the sample is degenerate return a count of 0.
Test cases
case 1
in: [[[0,0],[1,0],[2,0],[0,1],[1,1],[2,1]],[[1,1],[2,1],[3,1],[9,9],[8,8],[3,2]],0.5,1]
expected: [[0,1,4,5],4]
case 2
in: [[[0,0],[1,0],[2,0],[0,1],[1,1],[2,1]],[[1,1],[2,1],[3,1],[9,9],[8,8],[3,2]],0.5,3]
expected: [[1,3,4,5],1]
case 3
in: [[[0,0],[1,0],[2,0],[0,1]],[[1,1],[2,1],[3,1],[1,2]],0.5,0]
expected: [[0,1,2,3],0]
Starter codePython
def ransac_iteration(src, dst, threshold, seed):
# Your code here
pass3 test cases · run your code against them in the editor