[][src]Function arrayfire::homography

pub fn homography<OutType>(
    x_src: &Array<f32>,
    y_src: &Array<f32>,
    x_dst: &Array<f32>,
    y_dst: &Array<f32>,
    htype: HomographyType,
    inlier_thr: f32,
    iterations: u32
) -> (Array<OutType>, i32) where
    OutType: HasAfEnum + RealFloating

Homography estimation

Homography estimation find a perspective transform between two sets of 2D points. Currently, two methods are supported for the estimation, RANSAC (RANdom SAmple Consensus) and LMedS (Least Median of Squares). Both methods work by randomly selecting a subset of 4 points of the set of source points, computing the eigenvectors of that set and finding the perspective transform. The process is repeated several times, a maximum of times given by the value passed to the iterations arguments for RANSAC (for the CPU backend, usually less than that, depending on the quality of the dataset, but for CUDA and OpenCL backends the transformation will be computed exactly the amount of times passed via the iterations parameter), the returned value is the one that matches the best number of inliers, which are all of the points that fall within a maximum L2 distance from the value passed to the inlier_thr argument.


Return Values

Returns a tuple of Array and int.