To find the homography given calibration matrix, pixel coordinates and 3D coordinates in MATLAB, you can use the fitgeotrans
function. Here's an example code snippet:
main.m467 chars24 lines
In this code, fx
, fy
, cx
, and cy
are the intrinsic parameters of the camera, and u1
, u2
, u3
, ... , v1
, v2
, v3
, ... are the corresponding pixel coordinates. X1
, X2
, X3
, ... , Y1
, Y2
, Y3
, ... , Z1
, Z2
, Z3
, ... are the corresponding 3D coordinates. The fitgeotrans
function uses the 3D coordinates and their corresponding normalized pixel coordinates to compute the homography, which is returned as H
.
gistlibby LogSnag