machinevisiontoolbox.Image.rectify_homographies

Image.rectify_homographies(m, F)

Create rectification homographies

Parameters:
  • m (FeatureMatch) – corresponding points

  • F (ndarray(3,3)) – fundamental matrix

Returns:

rectification homographies

Return type:

ndarray(3,3), ndarray(3,3)

Given the epipolar geometry between two images, defined by the fundamental matrix and corresponding points, compute a pair of homographies that can be used to rectify the images so that they are epipolar aligned.

Examples:

>>> walls_l = Image.Read('walls-l.png', reduce=2)
>>> walls_r = Image.Read('walls-r.png', reduce=2)
>>> sf_l = walls_l.SIFT()
>>> sf_r = walls_r.SIFT()
>>> matches = sf_l.match(sf_r);
>>> F, resid = matches.estimate(CentralCamera.points2F, method="ransac", confidence=0.95);
>>> H_l, H_r = walls_l.rectify_homographies(matches, F)
>>> walls_l_rect = walls_l.warp_perspective(H_l)
>>> walls_r_rect = walls_r.warp_perspective(H_r)
References:
  • Robotics, Vision & Control for Python, Section 14.4.3, P. Corke, Springer 2023.

Seealso:

warp_perspective Match opencv.stereoRectifyUncalibrated