The class computes the disparity map using block matching algorithm. The class also does some pre- and post- processing steps: sobel prefilter (if use \texttt{PREFILTER\_XSOBEL} preset) and textureless threshold post processing (if \texttt{avergeTexThreshold}$>$ 0). If \texttt{avergeTexThreshold = 0} post procesing is disabled, otherwise disparity is set 0 in each point \texttt{(x, y)} where for left image $\sum HorizontalGradiensInWindow(x, y, winSize) < (winSize \cdot winSize)\cdot avergeTexThreshold$ i.e. input left image is low textured.
This class computes the disparity map using block matching algorithm. The class also performs pre- and post- filtering steps: sobel prefiltering (if PREFILTER\_XSOBEL flag is set) and low textureness filtering (if averageTexThreshols $>$ 0). If \texttt{avergeTexThreshold = 0} low textureness filtering is disabled, otherwise disparity is set to 0 in each point \texttt{(x, y)} where for left image $\sum HorizontalGradiensInWindow(x, y, winSize) < (winSize \cdot winSize)\cdot avergeTexThreshold$ i.e. input left image is low textured.
Some heuristics that tries to estmate if current GPU will be faster then CPU in this algorithm. It queries current active device.
Some heuristics that tries to estmate if the current GPU will be faster then CPU in this algorithm. It queries current active device.
\cvdefCpp{
bool StereoBM\_GPU::checkIfGpuCallReasonable();
...
...
@@ -127,6 +127,16 @@ public:
The class implements Pedro F. Felzenszwalb algorithm \cite{felzenszwalb_bp}. It can compute own data cost (using truncated linear model) or use user-provided data cost.
\textbf{Please note:}\texttt{StereoBeliefPropagation} requires a lot of memory:
For more details please see \cite{felzenszwalb_bp}.
By default \texttt{StereoBeliefPropagation} uses floating-point arithmetics and \texttt{CV\_32FC1} type for messages. But also it can use fixed-point arithmetics and \texttt{CV\_16SC1} type for messages for better perfomance.
By default \texttt{StereoBeliefPropagation} uses floating-point arithmetics and \texttt{CV\_32FC1} type for messages. But also it can use fixed-point arithmetics and \texttt{CV\_16SC1} type for messages for better perfomance. To avoid overflow in this case, the parameters must satisfy
Some heuristics that tries to compute parameters (\texttt{ndisp}, \texttt{iters} and \texttt{levels}) for specified image size (\texttt{width} and \texttt{height}).
Some heuristics that tries to compute recommended parameters (\texttt{ndisp}, \texttt{iters} and \texttt{levels}) for specified image size (\texttt{width} and \texttt{height}).
\cvdefCpp{
void StereoBeliefPropagation::estimateRecommendedParams(\par int width, int height, int\& ndisp, int\& iters, int\& levels);
...
...
@@ -248,7 +261,7 @@ public:
};
\end{lstlisting}
The class implements Q. Yang algorithm \cite{qx_csbp}. \texttt{StereoConstantSpaceBP}can use global minimum or local minimum selection method. By default it use local minimum selection method (\texttt{use\_local\_init\_data\_cost = true}).
The class implements Q. Yang algorithm \cite{qx_csbp}. \texttt{StereoConstantSpaceBP}supports both local minimum and global minimum data cost initialization algortihms. For more details please see the paper. By default local algorithm is used, and to enable global algorithm set \texttt{use\_local\_init\_data\_cost} to false.
By default \texttt{StereoConstantSpaceBP} uses floating-point arithmetics and \texttt{CV\_32FC1} type for messages. But also it can use fixed-point arithmetics and \texttt{CV\_16SC1} type for messages for better perfomance.
By default \texttt{StereoConstantSpaceBP} uses floating-point arithmetics and \texttt{CV\_32FC1} type for messages. But also it can use fixed-point arithmetics and \texttt{CV\_16SC1} type for messages for better perfomance. To avoid overflow in this case, the parameters must satisfy
DisparityBilateralFilter::DisparityBilateralFilter(\par int ndisp = DEFAULT\_NDISP, int radius = DEFAULT\_RADIUS, \par int iters = DEFAULT\_ITERS);\newline
...
...
@@ -350,8 +366,8 @@ DisparityBilateralFilter::DisparityBilateralFilter(\par int ndisp, int radius, i
\cvarg{ndisp}{Number of disparities.}
\cvarg{radius}{Filter radius.}
\cvarg{iters}{Number of iterations.}
\cvarg{edge\_threshold}{Truncation of data continuity.}
\cvarg{max\_disc\_threshold}{Truncation of disparity continuity.}
\cvarg{edge\_threshold}{Threshold for edges.}
\cvarg{max\_disc\_threshold}{Constant to reject outliers.}
\cvarg{trainDescs}{Train set of descriptors. This will not be added to train descriptors collection stored in class object.}
\cvarg{trainIdx}{One row \texttt{CV\_32SC1} matrix. Will contain the best train index for each query. If some query descriptors masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{One row \texttt{CV\_32FC1} matrix. Will contain the best distance for each query. If some query descriptors masked out in \texttt{mask} it will contain \texttt{FLT\_MAX}.}
\cvarg{trainIdx}{One row \texttt{CV\_32SC1} matrix. Will contain the best train index for each query. If some query descriptors are masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{One row \texttt{CV\_32FC1} matrix. Will contain the best distance for each query. If some query descriptors are masked out in \texttt{mask} it will contain \texttt{FLT\_MAX}.}
\cvarg{mask}{Mask specifying permissible matches between input query and train matrices of descriptors.}
\cvarg{trainCollection}{\texttt{GpuMat} containing train collection. It can be obtained from train descriptors collection that was set using \texttt{add} method by \hyperref[cppfunc.gpu.BruteForceMatcher.makeGpuCollection]{makeGpuCollection}. Or it can contain user defined collection. It must be one row matrix, each element is a \texttt{DevMem2D} that points to one train descriptors matrix.}
\cvarg{trainIdx}{One row \texttt{CV\_32SC1} matrix. Will contain the best train index for each query. If some query descriptors masked out in \texttt{maskCollection} it will contain -1.}
\cvarg{imgIdx}{One row \texttt{CV\_32SC1} matrix. Will contain image train index for each query. If some query descriptors masked out in \texttt{maskCollection} it will contain -1.}
\cvarg{distance}{One row \texttt{CV\_32FC1} matrix. Will contain the best distance for each query. If some query descriptors masked out in \texttt{maskCollection} it will contain \texttt{FLT\_MAX}.}
\cvarg{trainIdx}{One row \texttt{CV\_32SC1} matrix. Will contain the best train index for each query. If some query descriptors are masked out in \texttt{maskCollection} it will contain -1.}
\cvarg{imgIdx}{One row \texttt{CV\_32SC1} matrix. Will contain image train index for each query. If some query descriptors are masked out in \texttt{maskCollection} it will contain -1.}
\cvarg{distance}{One row \texttt{CV\_32FC1} matrix. Will contain the best distance for each query. If some query descriptors are masked out in \texttt{maskCollection} it will contain \texttt{FLT\_MAX}.}
\cvarg{maskCollection}{\texttt{GpuMat} containing set of masks. It can be obtained from \texttt{std::vector<GpuMat>} by \hyperref[cppfunc.gpu.BruteForceMatcher.makeGpuCollection]{makeGpuCollection}. Or it can contain user defined mask set. It must be empty matrix or one row matrix, each element is a \texttt{PtrStep} that points to one mask.}
\cvarg{trainDescs}{Train set of descriptors. This will not be added to train descriptors collection stored in class object.}
\cvarg{trainIdx}{Matrix with $\texttt{nQueries}\times\texttt{k}$ size and \texttt{CV\_32SC1} type. \texttt{trainIdx.at<int>(queryIdx, i)} will contain index of the i'th best trains. If some query descriptors masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{Matrix with $\texttt{nQuery}\times\texttt{k}$ and \texttt{CV\_32FC1} type. Will contain distance for each query and the i'th best trains. If some query descriptors masked out in \texttt{mask} it will contain \texttt{FLT\_MAX}.}
\cvarg{trainIdx}{Matrix with $\texttt{nQueries}\times\texttt{k}$ size and \texttt{CV\_32SC1} type. \texttt{trainIdx.at<int>(queryIdx, i)} will contain index of the i'th best trains. If some query descriptors are masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{Matrix with $\texttt{nQuery}\times\texttt{k}$ and \texttt{CV\_32FC1} type. Will contain distance for each query and the i'th best trains. If some query descriptors are masked out in \texttt{mask} it will contain \texttt{FLT\_MAX}.}
\cvarg{allDist}{Buffer to store all distances between query descriptors and train descriptors. It will have $\texttt{nQuery}\times\texttt{nTrain}$ size and \texttt{CV\_32FC1} type. \texttt{allDist.at<float>(queryIdx, trainIdx)} will contain \texttt{FLT\_MAX}, if \texttt{trainIdx} is one from k best, otherwise it will contain distance between \texttt{queryIdx} and \texttt{trainIdx} descriptors.}
\cvarg{k}{Number of the best matches will be found per each query descriptor (or less if it's not possible).}
\cvarg{mask}{Mask specifying permissible matches between input query and train matrices of descriptors.}