pandora.cpp.interval_tools_cpp ============================== .. py:module:: pandora.cpp.interval_tools_cpp Functions --------- .. autoapisummary:: pandora.cpp.interval_tools_cpp.create_connected_graph pandora.cpp.interval_tools_cpp.graph_regularization Module Contents --------------- .. py:function:: create_connected_graph(border_left: numpy.ndarray, border_right: numpy.ndarray, depth: int) -> numpy.ndarray Create a boolean connection matrix from segment coordinates :param border_left: array containing the coordinates of segments left border :type border_left: (n, 2) np.ndarray where n is the number of segments :param border_right: array containing the coordinates of segments right border :type border_right: (n, 2) np.ndarray where n is the number of segments :param depth: the depth for regularization. It corresponds to the number of rows to explore below and above. :return: A symmetric boolean matrix of shape (n, n). 1 indicating that the segment are connected :rtype: np.ndarray of shape (n, n) .. py:function:: graph_regularization(interval_inf: numpy.ndarray, interval_sup: numpy.ndarray, border_left: numpy.ndarray, border_right: numpy.ndarray, connection_graph: numpy.ndarray, quantile: float) -> Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray] Regularize the intervals based on quantiles and a given connection graph. :param interval_inf: The lower estimation of the disparity to regularize :type interval_inf: (row, col) np.ndarray :param interval_sup: The upper estimation of the disparity to regularize :type interval_sup: (row, col) np.ndarray :param border_left: array containing the coordinates of segments left border :type border_left: (n, 2) np.ndarray where n is the number of segments :param border_right: array containing the coordinates of segments right border :type border_right: (n, 2) np.ndarray where n is the number of segments :param connection graph: A matrix indicating if the segments (n in total) are connected :type connection graph: (n, n) boolean symmetric np.ndarray :param quantile: Which quantile to select for the regularized value :type quantile: float. 0 <= quantile <= 1 :return: The regularized inf and sup of the disparity, and a boolean mask indicating regularization :rtype: Tuple[np.ndarray, np.ndarray, np.ndarray]