pub fn dlt<R, N>(
world: &OMatrix<R, N, U3>,
cam: &OMatrix<R, N, U2>,
epsilon: R,
) -> Result<SMatrix<R, 3, 4>, &'static str>where
R: RealField + Copy,
N: DimMul<U2>,
DimProd<N, U2>: DimMin<U11>,
DimMinimum<DimProd<N, U2>, U11>: DimSub<U1>,
DefaultAllocator: Allocator<N, U3> + Allocator<<<N as DimMul<U2>>::Output as DimMin<U11>>::Output> + Allocator<N, U2> + Allocator<DimProd<N, U2>, U11> + Allocator<DimProd<N, U2>, U1> + Allocator<DimMinimum<DimProd<N, U2>, U11>, U11> + Allocator<DimProd<N, U2>, DimMinimum<DimProd<N, U2>, U11>> + Allocator<DimMinimum<DimProd<N, U2>, U11>, U1> + Allocator<DimDiff<DimMinimum<DimProd<N, U2>, U11>, U1>, U1>,
Expand description
Direct Linear Transformation (DLT) to find a camera calibration matrix.
Takes world
, a matrix of 3D world coordinates, and cam
a matrix of 2D
camera coordinates, which is the image of the world coordinates via the
desired projection matrix. Generic over N
, the number of points, which
must be at least nalgebra::U6
, and can also be nalgebra::Dyn
. Also
generic over R
, the data type, which must implement nalgebra::RealField
.
You may find it more ergonomic to use the
dlt_corresponding
function as a convenience
wrapper around this function.
Note that this approach is known to be “unstable” (see Hartley and Zissermann). We should add normalization to fix it. Also, I don’t like the notation used by kwon3d.com and prefer that from Carl Olsson as seen here. That said, kwon3d also suggests how to use the DLT to estimate distortion.
The DLT method will return intrinsic matrices with skew.