cars.applications.sparse_matching.sparse_matching_algo

Sparse matching Sift module: contains sift sparse matching method

Functions

compute_matches(left, right[, left_mask, right_mask, ...])

Compute matches between left and right

dataset_matching(ds1, ds2, used_band[, ...])

Compute sift matches between two datasets

Module Contents

cars.applications.sparse_matching.sparse_matching_algo.compute_matches(left: numpy.ndarray, right: numpy.ndarray, left_mask: numpy.ndarray = None, right_mask: numpy.ndarray = None, left_origin: [float, float] = None, right_origin: [float, float] = None, matching_threshold: float = 0.7, n_octave: int = 8, n_scale_per_octave: int = 3, peak_threshold: float = 4.0, edge_threshold: float = 10.0, magnification: float = 7.0, window_size: int = 2, backmatching: bool = True, disp_lower_bound=None, disp_upper_bound=None)[source]

Compute matches between left and right Convention for masks: True is a valid pixel

Parameters:
  • left (np.ndarray) – left image as numpy array

  • right (np.ndarray) – right image as numpy array

  • left_mask (np.ndarray) – left mask as numpy array

  • right_mask (np.ndarray) – right mask as numpy array

  • left_origin ([float, float]) – left image origin in the full image

  • right_origin ([float, float]) – right image origin in the full image

  • matching_threshold (float) – threshold for the ratio to nearest second match

  • n_octave (int) – the number of octaves of the DoG scale space

  • n_scale_per_octave (int) – the nb of levels / octave of the DoG scale space

  • peak_threshold (float) – the peak selection threshold

  • edge_threshold (float) – the edge selection threshold

  • magnification (float) – set the descriptor magnification factor

  • window_size (int) – size of the window

  • backmatching (bool) – also check that right vs. left gives same match

Returns:

matches

Return type:

numpy buffer of shape (nb_matches,4)

cars.applications.sparse_matching.sparse_matching_algo.dataset_matching(ds1, ds2, used_band, matching_threshold=0.7, n_octave=8, n_scale_per_octave=3, peak_threshold=4.0, edge_threshold=10.0, magnification=7.0, window_size=2, backmatching=True, disp_lower_bound=None, disp_upper_bound=None, classif_bands_to_mask=None)[source]

Compute sift matches between two datasets produced by stereo.epipolar_rectify_images

Parameters:
  • ds1 (xarray.Dataset as produced by stereo.epipolar_rectify_images) – Left image dataset

  • ds2 (xarray.Dataset as produced by stereo.epipolar_rectify_images) – Right image dataset

  • matching_threshold (float) – threshold for the ratio to nearest second match

  • n_octave (int) – the number of octaves of the DoG scale space

  • n_scale_per_octave (int) – the nb of levels / octave of the DoG scale space

  • peak_threshold (int) – the peak selection threshold

  • edge_threshold – the edge selection threshold.

  • magnification (float) – set the descriptor magnification factor

  • window_size (int) – size of the window

  • backmatching (bool) – also check that right vs. left gives same match

  • classif_bands_to_mask (list of str / int) – bands from classif to mask

Returns:

matches

Return type:

numpy buffer of shape (nb_matches,4)