cars.applications.sparse_matching.sparse_matching_algo ====================================================== .. py:module:: cars.applications.sparse_matching.sparse_matching_algo .. autoapi-nested-parse:: Sparse matching Sift module: contains sift sparse matching method Functions --------- .. autoapisummary:: cars.applications.sparse_matching.sparse_matching_algo.compute_matches cars.applications.sparse_matching.sparse_matching_algo.dataset_matching Module Contents --------------- .. py:function:: 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) Compute matches between left and right Convention for masks: True is a valid pixel :param left: left image as numpy array :type left: np.ndarray :param right: right image as numpy array :type right: np.ndarray :param left_mask: left mask as numpy array :type left_mask: np.ndarray :param right_mask: right mask as numpy array :type right_mask: np.ndarray :param left_origin: left image origin in the full image :type left_origin: [float, float] :param right_origin: right image origin in the full image :type right_origin: [float, float] :param matching_threshold: threshold for the ratio to nearest second match :type matching_threshold: float :param n_octave: the number of octaves of the DoG scale space :type n_octave: int :param n_scale_per_octave: the nb of levels / octave of the DoG scale space :type n_scale_per_octave: int :param peak_threshold: the peak selection threshold :type peak_threshold: float :param edge_threshold: the edge selection threshold :type edge_threshold: float :param magnification: set the descriptor magnification factor :type magnification: float :param window_size: size of the window :type window_size: int :param backmatching: also check that right vs. left gives same match :type backmatching: bool :return: matches :rtype: numpy buffer of shape (nb_matches,4) .. py:function:: 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) Compute sift matches between two datasets produced by stereo.epipolar_rectify_images :param ds1: Left image dataset :type ds1: xarray.Dataset as produced by stereo.epipolar_rectify_images :param ds2: Right image dataset :type ds2: xarray.Dataset as produced by stereo.epipolar_rectify_images :param matching_threshold: threshold for the ratio to nearest second match :type matching_threshold: float :param n_octave: the number of octaves of the DoG scale space :type n_octave: int :param n_scale_per_octave: the nb of levels / octave of the DoG scale space :type n_scale_per_octave: int :param peak_threshold: the peak selection threshold :type peak_threshold: int :param edge_threshold: the edge selection threshold. :param magnification: set the descriptor magnification factor :type magnification: float :param window_size: size of the window :type window_size: int :param backmatching: also check that right vs. left gives same match :type backmatching: bool :param classif_bands_to_mask: bands from classif to mask :type classif_bands_to_mask: list of str / int :return: matches :rtype: numpy buffer of shape (nb_matches,4)