Skip to main content

match_descriptors

Function match_descriptors 

Source
pub fn match_descriptors(
    a: &[Vec<f64>],
    b: &[Vec<f64>],
    ratio: f64,
    mutual: bool,
) -> Result<Vec<DescriptorMatch>, ErrorsJSL>
Expand description

Matches descriptors by nearest neighbour with Lowe’s ratio test.

For each descriptor in a the two nearest descriptors in b are found; the match is accepted only if the nearest is closer than ratio times the second nearest (0.75 is typical, smaller is stricter). This rejects ambiguous descriptors that resemble several candidates. With mutual set, a match must also be the nearest neighbour of its partner in the other direction.