pandora.matching_cost.cpp.matching_cost_cpp
Functions
|
Given a left image and right images (multiple when doing subpixellic), compute the Census matching costs for all disparities, with the given window. |
|
Create the right_cv from the left_one by reindexing (i,j,d) -> (i, j + d, -d) |
|
Create the right disp ranges from the left disp ranges |
Module Contents
- pandora.matching_cost.cpp.matching_cost_cpp.compute_matching_costs(img_left, imgs_right, cv, disps, census_width, census_height)[source]
Given a left image and right images (multiple when doing subpixellic), compute the Census matching costs for all disparities, with the given window.
- Parameters:
img_left (2D np.array (row, col) dtype = np.float32) – the left image
imgs_right (List of 2D np.array (row, col) dtype = np.float32) – the right images
cv (3D np.array (row, col, disps) dtype = np.float32) – cost volume to fill
disps (np.array (disps) dtype = np.float32) – the disparities to sample, sorted
census_width (int) – the width of the census window
census_height (int) – the height of the census window
- Returns:
the filled cost volume
- Return type:
3D np.array (row, col, disps) dtype = np.float32
- pandora.matching_cost.cpp.matching_cost_cpp.reverse_cost_volume(left_cv, disp_min)[source]
Create the right_cv from the left_one by reindexing (i,j,d) -> (i, j + d, -d) :param left_cv: the 3D cost_colume data array, with dimensions row, col, disp :type left_cv: np.ndarray(dtype=float32) :param disp_min: the minimum of the right disparities :type min_disp: int64 :return: The right cost volume data :rtype: 3D np.ndarray of type float32
- pandora.matching_cost.cpp.matching_cost_cpp.reverse_disp_range(left_min, left_max)[source]
Create the right disp ranges from the left disp ranges :param left_min: the 2D left disp min array, with dimensions row, col :type left_min: np.ndarray(dtype=float32) :param left_max: the 2D left disp max array, with dimensions row, col :type left_max: np.ndarray(dtype=float32) :return: The min and max disp ranges for the right image :rtype: Tuple[np.ndarray(dtype=float32), np.ndarray(dtype=float32)]