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.
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.
StereoBeliefPropagation::StereoBeliefPropagation(\par int ndisp = DEFAULT\_NDISP, int iters = DEFAULT\_ITERS, \par int levels = DEFAULT\_LEVELS, int msg\_type = CV\_32F);\newline
StereoBeliefPropagation::StereoBeliefPropagation(\par int ndisp, int iters, int levels, \par float max\_data\_term, float data\_weight, \par float max\_disc\_term, float disc\_single\_jump, \par int msg\_type = CV\_32F);
}
\begin{description}
\cvarg{ndisp}{Number of disparities.}
\cvarg{iters}{Number of BP iterations on each level.}
\cvarg{levels}{Number of levels.}
\cvarg{max\_data\_term}{Truncation of data cost.}
\cvarg{data\_weight}{Data weight.}
\cvarg{max\_disc\_term}{Truncation of discontinuity.}
\cvarg{disc\_single\_jump}{Discontinuity single jump.}
\cvarg{msg\_type}{Type for messages. Supports \texttt{CV\_16SC1} and \texttt{CV\_32FC1}.}
\end{description}
\texttt{StereoBeliefPropagation} uses truncated linear model for the data cost and discontinuity term:
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.
Some heuristics that tries to compute 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);
\cvarg{left}{Left image; supports \texttt{CV\_8UC1}, \texttt{CV\_8UC3} and \texttt{CV\_8UC4} types.}
\cvarg{right}{Right image with the same size and the same type as the left one.}
\cvarg{disparity}{Output disparity map. If \texttt{disparity} is empty output type will be \texttt{CV\_16SC1}, otherwise output type will be \texttt{disparity.type()}.}
\cvarg{stream}{Stream for the asynchronous version.}
\cvarg{data}{The user specified data cost. It must have \texttt{msg\_type} type and $\texttt{imgRows}\cdot\texttt{ndisp}\times\texttt{imgCols}$ size.}
\cvarg{disparity}{Output disparity map. If \texttt{disparity} is empty output type will be \texttt{CV\_16SC1}, otherwise output type will be \texttt{disparity.type()}.}
\cvarg{stream}{Stream for the asynchronous version.}
\end{description}
\cvclass{gpu::StereoConstantSpaceBP}
The class for computing stereo correspondence using constant space belief propagation algorithm.
\begin{lstlisting}
class StereoConstantSpaceBP
{
public:
enum { DEFAULT_NDISP = 128 };
enum { DEFAULT_ITERS = 8 };
enum { DEFAULT_LEVELS = 4 };
enum { DEFAULT_NR_PLANE = 4 };
static void estimateRecommendedParams(int width, int height,
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}).
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.
Some heuristics that tries to compute parameters (\texttt{ndisp}, \texttt{iters}, \texttt{levels} and \texttt{nr\_plane}) for specified image size (\texttt{width} and \texttt{height}).
\cvdefCpp{
void StereoConstantSpaceBP::estimateRecommendedParams(\par int width, int height, \par int\& ndisp, int\& iters, int\& levels, int\& nr\_plane);
\cvarg{left}{Left image; supports \texttt{CV\_8UC1}, \texttt{CV\_8UC3} and \texttt{CV\_8UC4} types.}
\cvarg{right}{Right image with the same size and the same type as the left one.}
\cvarg{disparity}{Output disparity map. If \texttt{disparity} is empty output type will be \texttt{CV\_16SC1}, otherwise output type will be \texttt{disparity.type()}.}
\cvarg{stream}{Stream for the asynchronous version.}
\end{description}
\cvclass{gpu::DisparityBilateralFilter}
The class for disparity map refinement using joint bilateral filtering.
DisparityBilateralFilter::DisparityBilateralFilter(\par int ndisp = DEFAULT\_NDISP, int radius = DEFAULT\_RADIUS, \par int iters = DEFAULT\_ITERS);\newline
DisparityBilateralFilter::DisparityBilateralFilter(\par int ndisp, int radius, int iters, \par float edge\_threshold, float max\_disc\_threshold, \par float sigma\_range);
}
\begin{description}
\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{src\_disp}{Source disparity image. Supports \texttt{CV\_8UC1} and \texttt{CV\_16SC1} types.}
\cvarg{dst\_disp}{Output disparity image. Will have the same size as \texttt{src\_disp} and \texttt{CV\_8UC4} type in \texttt{BGRA} format (alpha = 255).}
\cvarg{ndisp}{Number of disparities.}
\cvarg{stream}{Stream for the asynchronous version.}
\end{description}
This function converts $[0..ndisp)$ interval to $[0..240, 1, 1]$ in \texttt{HSV} color space, than convert \texttt{HSV} color space to \texttt{RGB}.
\cvarg{disp}{Input disparity image; supports \texttt{CV\_8U} and \texttt{CV\_16S} types.}
\cvarg{xyzw}{Output 4-channel floating-point image of the same size as \texttt{disp}. Each element of \texttt{xyzw(x,y)} will contain the 3D coordinates \texttt{(x,y,z,1)} of the point \texttt{(x,y)}, computed from the disparity map.}
\cvarg{Q}{$4\times4$ perspective transformation matrix that can be obtained via \cvCross{StereoRectify}{stereoRectify}.}
\cvarg{stream}{Stream for the asynchronous version.}
Class for extracting Speeded Up Robust Features from an image.
...
...
@@ -112,10 +114,13 @@ public:
The class \texttt{SURF\_GPU} implements Speeded Up Robust Features descriptor. There is fast multi-scale Hessian keypoint detector that can be used to find the keypoints (which is the default option), but the descriptors can be also computed for the user-specified keypoints. Supports only 8 bit grayscale images.
The class \texttt{SURF\_GPU} can store results to GPU and CPU memory and provides static functions to convert results between CPU and GPU version (\texttt{uploadKeypoints}, \texttt{downloadKeypoints}, \texttt{downloadDescriptors}). CPU results has the same format as \hyperref[cv.class.SURF]{cv::SURF} results. GPU results is stored to \texttt{GpuMat}. \texttt{keypoints} matrix is one row matrix with \texttt{CV\_32FC6} type. It contains 6 float values per feature: \texttt{x, y, size, response, angle, octave}. \texttt{descriptors} matrix is \texttt{nFeatures} x \texttt{descriptorSize} matrix with \texttt{CV\_32FC1} type.
The class \texttt{SURF\_GPU} can store results to GPU and CPU memory and provides static functions to convert results between CPU and GPU version (\texttt{uploadKeypoints}, \texttt{downloadKeypoints}, \texttt{downloadDescriptors}). CPU results has the same format as \hyperref[cv.class.SURF]{cv::SURF} results. GPU results are stored to \texttt{GpuMat}. \texttt{keypoints} matrix is one row matrix with \texttt{CV\_32FC6} type. It contains 6 float values per feature: \texttt{x, y, size, response, angle, octave}. \texttt{descriptors} matrix is $\texttt{nFeatures}\times\texttt{descriptorSize}$ matrix with \texttt{CV\_32FC1} type.
The class \texttt{SURF\_GPU} uses some buffers and provides access to it. All buffers can be safely released between function calls.
See also: \hyperref[cv.class.SURF]{cv::SURF}.
\cvclass{gpu::BruteForceMatcher\_GPU}
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets.
...
...
@@ -203,61 +208,77 @@ private:
};
\end{lstlisting}
The class \texttt{BruteForceMatcher\_GPU} has the similar interface with class \hyperref[cv.class.DescriptorMatcher]{cv::DescriptorMatcher}. It has two groups of match methods: for matching descriptors of one image with other image or with image set. Also all functions have alternative: save results to GPU memory or to CPU memory. \texttt{BruteForceMatcher\_GPU} is templated on the distance metric as \hyperref[cv.class.BruteForceMatcher]{cv::BruteForceMatcher}, but supports only \texttt{L1} and \texttt{L2} distance types.
The class \texttt{BruteForceMatcher\_GPU} has the similar interface to class \hyperref[cv.class.DescriptorMatcher]{cv::DescriptorMatcher}. It has two groups of match methods: for matching descriptors of one image with other image or with image set. Also all functions have alternative: save results to GPU memory or to CPU memory.
\texttt{Distance} template parameter is kept for CPU/GPU interfaces similarity. \texttt{BruteForceMatcher\_GPU} supports only \texttt{L1<float>} and \texttt{L2<float>} distance types.
See also: \hyperref[cv.class.DescriptorMatcher]{cv::DescriptorMatcher}, \hyperref[cv.class.BruteForceMatcher]{cv::BruteForceMatcher}.
\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 best train index for each query. If some query descriptor masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{One row \texttt{CV\_32FC1} matrix. Will contain best distance for each query. If some query descriptor 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 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{mask}{Mask specifying permissible matches between input query and train matrices of descriptors.}
\cvarg{trainCollection}{\texttt{GpuMat}with 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 (matrix must have \texttt{CV\_32FC1} type).}
\cvarg{trainIdx}{One row \texttt{CV\_32SC1} matrix. Will contain best train index for each query. If some query descriptor masked out in \texttt{mask} it will contain -1.}
\cvarg{imgIdx}{One row \texttt{CV\_32SC1} matrix. Will contain image train index for each query. If some query descriptor masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{One row \texttt{CV\_32FC1} matrix. Will contain best distance for each query. If some query descriptor masked out in \texttt{mask} it will contain \texttt{FLT\_MAX}.}
\cvarg{maskCollection}{\texttt{GpuMat}with 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 (must have \texttt{CV\_8UC1} type).}
\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{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.}
Make gpu collection of train descriptors and masks in suitable format for \hyperref[cppfunc.gpu.BruteForceMatcher.matchCollection]{matchCollection} function.
Makes gpu collection of train descriptors and masks in suitable format for \hyperref[cppfunc.gpu.BruteForceMatcher.matchCollection]{matchCollection} function.
Download \texttt{trainIdx}, \texttt{imgIdx} and \texttt{distance} matrices obtained by \hyperref[cppfunc.gpu.BruteForceMatcher.matchSingle]{matchSingle} or \hyperref[cppfunc.gpu.BruteForceMatcher.matchCollection]{matchCollection} to CPU vector with \hyperref[cv.class.DMatch]{cv::DMatch}.
Downloads \texttt{trainIdx}, \texttt{imgIdx} and \texttt{distance} matrices obtained via \hyperref[cppfunc.gpu.BruteForceMatcher.matchSingle]{matchSingle} or \hyperref[cppfunc.gpu.BruteForceMatcher.matchCollection]{matchCollection} to CPU vector with \hyperref[cv.class.DMatch]{cv::DMatch}.
Find the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order. This function is equivalent of \cvCppCross{DescriptorMatcher::knnMatch}.
Finds the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order.
Find the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order. Results stored to GPU memory.
See also: \cvCppCross{DescriptorMatcher::knnMatch}.
Finds the k best matches for each descriptor from a query set with train descriptors. Found k (or less if not possible) matches are returned in distance increasing order. Results will be stored to GPU memory.
\cvarg{trainDescs}{Train set of descriptors. This will not be added to train descriptors collection stored in class object.}
\cvarg{trainIdx}{Matrix \texttt{nQueries} x \texttt{k} with type \texttt{CV\_32SC1}. \texttt{trainIdx.at<int>(queryIdx, i)} will contain index of i'th best trains. If some query descriptor masked out in \texttt{mask} it will contain -1.}
\cvarg{distance}{Matrix \texttt{nQuery} x \texttt{k} with type \texttt{CV\_32FC1}. Will contain distance for each query and i'th best trains. If some query descriptor 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 have size \texttt{nQuery} x \texttt{nTrain} and \texttt{CV\_32F} 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}{Count of best matches will be found per each query descriptor (or less if it's not possible).}
\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{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.}
Download \texttt{trainIdx} and \texttt{distance} matrices obtained by \hyperref[cppfunc.gpu.BruteForceMatcher.knnMatchSingle]{knnMatch} to CPU vector with \hyperref[cv.class.DMatch]{cv::DMatch}. If \texttt{compactResult} is true \texttt{matches} vector will not contain matches for fully masked out query descriptors.
Downloads \texttt{trainIdx} and \texttt{distance} matrices obtained via \hyperref[cppfunc.gpu.BruteForceMatcher.knnMatchSingle]{knnMatch} to CPU vector with \hyperref[cv.class.DMatch]{cv::DMatch}. If \texttt{compactResult} is true \texttt{matches} vector will not contain matches for fully masked out query descriptors.
Find the best matches for each query descriptor which have distance less than given threshold. Found matches are returned in distance increasing order. This function is equivalent of \cvCppCross{DescriptorMatcher::radiusMatch}. Works only on device with Compute Capability \texttt{>=} 1.1.
Finds the best matches for each query descriptor which have distance less than given threshold. Found matches are returned in distance increasing order.
Find the best matches for each query descriptor which have distance less than given threshold. Results stored to GPU memory. Results are not sorted by distance increasing order. Works only on device with Compute Capability \texttt{>=} 1.1.
This function works only on devices with Compute Capability $>=$ 1.1.
See also: \cvCppCross{DescriptorMatcher::radiusMatch}.
\cvarg{trainDescs}{Train set of descriptors. This will not be added to train descriptors collection stored in class object.}
\cvarg{trainIdx}{\texttt{trainIdx.at<int>(queryIdx, i)} will contain i'th train index \newline\texttt{(i < min(nMatches.at<unsigned int>(0, queryIdx), trainIdx.cols)}. If \texttt{trainIdx} is empty, it will be created with size \texttt{nQuery} x \texttt{nTrain}. Or it can be allocated by user (it must have \texttt{nQuery} rows and \texttt{CV\_32SC1} type). Cols can be less than \texttt{nTrain}, but it can be that matcher won't find all matches, because it haven't enough memory to store results.}
\cvarg{trainIdx}{\texttt{trainIdx.at<int>(queryIdx, i)} will contain i'th train index \newline\texttt{(i < min(nMatches.at<unsigned int>(0, queryIdx), trainIdx.cols)}. If \texttt{trainIdx} is empty, it will be created with size $\texttt{nQuery}\times\texttt{nTrain}$. Or it can be allocated by user (it must have \texttt{nQuery} rows and \texttt{CV\_32SC1} type). Cols can be less than \texttt{nTrain}, but it can be that matcher won't find all matches, because it haven't enough memory to store results.}
\cvarg{nMatches}{\texttt{nMatches.at<unsigned int>(0, queryIdx)} will contain matches count for \texttt{queryIdx}. Carefully, \texttt{nMatches} can be greater than \texttt{trainIdx.cols} - it means that matcher didn't find all matches, because it didn't have enough memory.}
\cvarg{distance}{\texttt{distance.at<int>(queryIdx, i)} will contain i'th distance \newline\texttt{(i < min(nMatches.at<unsigned int>(0, queryIdx), trainIdx.cols)}. If \texttt{trainIdx} is empty, it will be created with size \texttt{nQuery} x \texttt{nTrain}. Otherwise it must be also allocated by user (it must have the same size as \texttt{trainIdx} and \texttt{CV\_32FC1} type).}
\cvarg{maxDistance}{The threshold to found match distances.}
\cvarg{distance}{\texttt{distance.at<int>(queryIdx, i)} will contain i'th distance \newline\texttt{(i < min(nMatches.at<unsigned int>(0, queryIdx), trainIdx.cols)}. If \texttt{trainIdx} is empty, it will be created with size $\texttt{nQuery}\times\texttt{nTrain}$. Otherwise it must be also allocated by user (it must have the same size as \texttt{trainIdx} and \texttt{CV\_32FC1} type).}
\cvarg{maxDistance}{Distance threshold.}
\cvarg{mask}{Mask specifying permissible matches between input query and train matrices of descriptors.}
Download \texttt{trainIdx}, \texttt{nMatches} and \texttt{distance} matrices obtained by \hyperref[cppfunc.gpu.BruteForceMatcher.radiusMatchSingle]{radiusMatch} to CPU vector with \hyperref[cv.class.DMatch]{cv::DMatch}. If \texttt{compactResult} is true \texttt{matches} vector will not contain matches for fully masked out query descriptors.
In contrast to \hyperref[cppfunc.gpu.BruteForceMatcher.radiusMatch]{cv::gpu::BruteForceMather\_GPU::radiusMatch} results are not sorted by distance increasing order.
This function works only on devices with Compute Capability $>=$ 1.1.
Downloads \texttt{trainIdx}, \texttt{nMatches} and \texttt{distance} matrices obtained via \hyperref[cppfunc.gpu.BruteForceMatcher.radiusMatchSingle]{radiusMatch} to CPU vector with \hyperref[cv.class.DMatch]{cv::DMatch}. If \texttt{compactResult} is true \texttt{matches} vector will not contain matches for fully masked out query descriptors.
The base class for linear or non-linear filters that process rows of 2D arrays. Such filters are used for the "horizontal" filtering parts in separable filters.
The base class for linear or non-linear filters that processes rows of 2D arrays. Such filters are used for the "horizontal" filtering passes in separable filters.
The base class for linear or non-linear filters that process columns of 2D arrays. Such filters are used for the "vertical" filtering parts in separable filters.
The base class for linear or non-linear filters that processes columns of 2D arrays. Such filters are used for the "vertical" filtering passes in separable filters.
The class can be used to apply an arbitrary filtering operation to an image. It contains all the necessary intermediate buffers. Pointers to the initialized \texttt{FilterEngine\_GPU} instances are returned by various \texttt{create*Filter\_GPU} functions, see below, and they are used inside high-level functions such as \cvCppCross{gpu::filter2D}, \cvCppCross{gpu::erode}, \cvCppCross{gpu::Sobel} etc.
By using \texttt{FilterEngine\_GPU} instead functions you can avoid unnessesary memory allocation for intermediate buffers and get much better performance:
By using \texttt{FilterEngine\_GPU} instead of functions you can avoid unnecessary memory allocation for intermediate buffers and get much better performance:
\begin{lstlisting}
while (...)
...
...
@@ -91,159 +95,208 @@ filter.release();
The GPU filters doesn't support the in-place mode.
Create the non-separable filter engine with the specified filter.
\cvdefCpp{
Ptr<FilterEngine\_GPU> createFilter2D\_GPU(\par const Ptr<BaseFilter\_GPU>\& filter2D, \par int srcType, int dstType);
}
\begin{description}
\cvarg{filter2D}{The non separable 2D filter.}
\cvarg{srcType}{The input image type. It must be supported by \texttt{filter2D}.}
\cvarg{dstType}{The output image type. It must be supported by \texttt{filter2D}.}
\cvarg{filter2D}{Non-separable 2D filter.}
\cvarg{srcType}{Input image type. It must be supported by \texttt{filter2D}.}
\cvarg{dstType}{Output image type. It must be supported by \texttt{filter2D}.}
\end{description}
Usually this function is used inside high-level functions, like \hyperref[cppfunc.gpu.createLinearFilter]{createLinearFilter\_GPU}, \hyperref[cppfunc.gpu.createBoxFilter]{createBoxFilter\_GPU}.
Create the separable filter engine with the specified filters.
Usually this function is used inside high-level functions, like \hyperref[cppfunc.gpu.createLinearFilter]{cv::gpu::createLinearFilter\_GPU}, \hyperref[cppfunc.gpu.createBoxFilter]{cv::gpu::createBoxFilter\_GPU}.
Usually this function is used inside high-level functions, like \hyperref[cppfunc.gpu.createSeparableLinearFilter]{cv::gpu::createSeparableLinearFilter\_GPU}.
Ptr<BaseFilter\_GPU> getLinearFilter\_GPU(int srcType, int dstType, \par const Mat\& kernel, const Size\& ksize, \par Point anchor = Point(-1, -1));
}
\begin{description}
\cvarg{srcType}{The input image type. Now support\texttt{CV\_8UC1} and \texttt{CV\_8UC4}.}
\cvarg{dstType}{The output image type. Now support only the same as source type.}
\cvarg{kernel}{The 2D array of filter coefficients. This filter works with integers kernels, if \texttt{kernel} has \texttt{float} or \texttt{double} type it will be used fixed point arithmetic.}
\cvarg{ksize}{The kernel size.}
\cvarg{anchor}{The anchor point. The default value Point(-1, -1) means that the anchor is at the kernel center.}
\cvarg{srcType}{Input image type. Supports\texttt{CV\_8UC1} and \texttt{CV\_8UC4}.}
\cvarg{dstType}{Output image type. Supports only the same as source type.}
\cvarg{kernel}{2D array of filter coefficients. This filter works with integers kernels, if \texttt{kernel} has \texttt{float} or \texttt{double} type it will be used fixed point arithmetic.}
\cvarg{ksize}{Kernel size.}
\cvarg{anchor}{Anchor point. The default value Point(-1, -1) means that the anchor is at the kernel center.}
\end{description}
This filter doesn't check indexes outside the image, so it can process only inner area.\newline
This filter doesn't check indexes outside the image, so it can process only inner area.
See also: \cvCppCross{createLinearFilter}.
\cvCppFunc{gpu::filter2D}
Applies non-separable 2D linear filter to the image.
Applies non-separable 2D linear filter to image.
\cvdefCpp{
void filter2D(const GpuMat\& src, GpuMat\& dst, int ddepth, \par const Mat\& kernel, \par Point anchor=Point(-1,-1));
}
\begin{description}
\cvarg{src}{The source image. Supports \texttt{CV\_8UC1} and \texttt{CV\_8UC4} source type.}
\cvarg{dst}{The destination image. It will have the same size and the same number of channels as \texttt{src}}
\cvarg{ddepth}{The desired depth of the destination image. If it is negative, it will be the same as \texttt{src.depth()}. Now support only the same depth as source image.}
\cvarg{kernel}{The 2D array of filter coefficients. This filter works with integers kernels, if \texttt{kernel} has \texttt{float} or \texttt{double} type it will use fixed point arithmetic.}
\cvarg{anchor}{The anchor of the kernel that indicates the relative position of a filtered point within the kernel. The anchor should lie within the kernel. The special default value (-1,-1) means that the anchor is at the kernel center.}
\cvarg{src}{Source image. Supports \texttt{CV\_8UC1} and \texttt{CV\_8UC4} source types.}
\cvarg{dst}{Destination image. It will have the same size and the same number of channels as \texttt{src}.}
\cvarg{ddepth}{The desired depth of the destination image. If it is negative, it will be the same as \texttt{src.depth()}. Supports only the same depth as source image.}
\cvarg{kernel}{2D array of filter coefficients. This filter works with integers kernels, if \texttt{kernel} has \texttt{float} or \texttt{double} type it will use fixed point arithmetic.}
\cvarg{anchor}{Anchor of the kernel that indicates the relative position of a filtered point within the kernel. The anchor should lie within the kernel. The special default value (-1,-1) means that the anchor is at the kernel center.}
\end{description}
This filter doesn't check indexes outside the image, so it can process only inner area.\newline
See also: \cvCppCross{filter2D}, \hyperref[cppfunc.gpu.createLinearFilter]{createLinearFilter\_GPU}.
This filter doesn't check indexes outside the image, so it can process only inner area.
See also: \cvCppCross{filter2D}, \hyperref[cppfunc.gpu.createLinearFilter]{cv::gpu::createLinearFilter\_GPU}.
\cvCppFunc{gpu::Laplacian}
Applies Laplacian operator to the image.
Applies Laplacian operator to image.
\cvdefCpp{
void Laplacian(const GpuMat\& src, GpuMat\& dst, int ddepth, \par int ksize = 1, double scale = 1);
}
\begin{description}
\cvarg{src}{Source image. Supports \texttt{CV\_8UC1} and \texttt{CV\_8UC4} source type.}
\cvarg{src}{Source image. Supports \texttt{CV\_8UC1} and \texttt{CV\_8UC4} source types.}
\cvarg{dst}{Destination image; will have the same size and the same number of channels as \texttt{src}.}
\cvarg{ddepth}{The desired depth of the destination image. Now support only tha same depth as source image.}
\cvarg{ksize}{The aperture size used to compute the second-derivative filters, see \cvCppCross{getDerivKernels}. It must be positive and odd. Now supports only \texttt{ksize} = 1 and \texttt{ksize} = 3.}
\cvarg{scale}{The optional scale factor for the computed Laplacian values (by default, no scaling is applied, see \cvCppCross{getDerivKernels}).}
\cvarg{ddepth}{Desired depth of the destination image. Supports only tha same depth as source image depth.}
\cvarg{ksize}{Aperture size used to compute the second-derivative filters, see \cvCppCross{getDerivKernels}. It must be positive and odd. Supports only \texttt{ksize} = 1 and \texttt{ksize} = 3.}
\cvarg{scale}{Optional scale factor for the computed Laplacian values (by default, no scaling is applied, see \cvCppCross{getDerivKernels}).}
\end{description}
This filter doesn't check indexes outside the image, so it can process only inner area.\newline
This filter doesn't check indexes outside the image, so it can process only inner area.
See also: \cvCppCross{Laplacian}, \cvCppCross{gpu::filter2D}.
\cvarg{bufType}{Inermediate buffer type; must have as many channels as \texttt{srcType}.}
\cvarg{rowKernel}{Filter coefficients.}
\cvarg{anchor}{Anchor position within the kernel; negative values mean that anchor is positioned at the aperture center.}
\cvarg{borderType}{Pixel extrapolation method; see \cvCppCross{borderInterpolate}. About limitation see below.}
\end{description}
There are two version of algorithm: NPP and OpenCV. NPP calls when \texttt{srcType == CV\_8UC1} or \texttt{srcType == CV\_8UC4} and \texttt{bufType == srcType}, otherwise calls OpenCV version. NPP supports only \texttt{BORDER\_CONSTANT} border type and doesn't check indexes outside image. OpenCV version supports only \texttt{CV\_32F} as buffer depth and \texttt{BORDER\_REFLECT101}, \texttt{BORDER\_REPLICATE} and \texttt{BORDER\_CONSTANT} border types and checks indexes outside image.\newline
See also: \hyperref[cppfunc.gpu.getLinearColumnFilter]{getLinearColumnFilter\_GPU}, \cvCppCross{createSeparableLinearFilter}.
Create the primitive column filter with the specified kernel.
There are two version of algorithm: NPP and OpenCV. NPP calls when \texttt{srcType == CV\_8UC1} or \texttt{srcType == CV\_8UC4} and \texttt{bufType == srcType}, otherwise calls OpenCV version. NPP supports only \texttt{BORDER\_CONSTANT} border type and doesn't check indexes outside image. OpenCV version supports only \texttt{CV\_32F} buffer depth and \texttt{BORDER\_REFLECT101}, \texttt{BORDER\_REPLICATE} and \texttt{BORDER\_CONSTANT} border types and checks indexes outside image.
See also: \hyperref[cppfunc.gpu.getLinearColumnFilter]{cv::gpu::getLinearColumnFilter\_GPU}, \cvCppCross{createSeparableLinearFilter}.
\cvarg{anchor}{Anchor position within the kernel; negative values mean that anchor is positioned at the aperture center.}
\cvarg{borderType}{Pixel extrapolation method; see \cvCppCross{borderInterpolate}. About limitation see below.}
\end{description}
There are two version of algorithm: NPP and OpenCV. NPP calls when \texttt{dstType == CV\_8UC1} or \texttt{dstType == CV\_8UC4} and \texttt{bufType == dstType}, otherwise calls OpenCV version. NPP supports only \texttt{BORDER\_CONSTANT} border type and doesn't check indexes outside image. OpenCV version supports only \texttt{CV\_32F} as buffer depth and \texttt{BORDER\_REFLECT101}, \texttt{BORDER\_REPLICATE} and \texttt{BORDER\_CONSTANT} border types and checks indexes outside image.\newline
See also: \hyperref[cppfunc.gpu.getLinearRowFilter]{getLinearRowFilter\_GPU}, \cvCppCross{createSeparableLinearFilter}.
There are two version of algorithm: NPP and OpenCV. NPP calls when \texttt{dstType == CV\_8UC1} or \texttt{dstType == CV\_8UC4} and \texttt{bufType == dstType}, otherwise calls OpenCV version. NPP supports only \texttt{BORDER\_CONSTANT} border type and doesn't check indexes outside image. OpenCV version supports only \texttt{CV\_32F} buffer depth and \texttt{BORDER\_REFLECT101}, \texttt{BORDER\_REPLICATE} and \texttt{BORDER\_CONSTANT} border types and checks indexes outside image.\newline
See also: \hyperref[cppfunc.gpu.getLinearRowFilter]{cv::gpu::getLinearRowFilter\_GPU}, \cvCppCross{createSeparableLinearFilter}.
\cvarg{rowKernel}{The coefficients for filtering each row.}
\cvarg{columnKernel}{The coefficients for filtering each column.}
\cvarg{anchor}{The anchor position within the kernel; negative values mean that anchor is positioned at the aperture center.}
\cvarg{rowBorderType, columnBorderType}{The pixel extrapolation methods in the horizontal and the vertical directions; see \cvCppCross{borderInterpolate}. About limitation see \hyperref[cppfunc.gpu.getLinearRowFilter]{getLinearRowFilter\_GPU}, \hyperref[cppfunc.gpu.getLinearColumnFilter]{getLinearColumnFilter\_GPU}, \cvCppCross{createSeparableLinearFilter}.}
\cvarg{anchor}{Anchor position within the kernel; negative values mean that anchor is positioned at the aperture center.}
\cvarg{rowBorderType, columnBorderType}{Pixel extrapolation method in the horizontal and the vertical directions; see \cvCppCross{borderInterpolate}. About limitation see \hyperref[cppfunc.gpu.getLinearRowFilter]{cv::gpu::getLinearRowFilter\_GPU}, \hyperref[cppfunc.gpu.getLinearColumnFilter]{cv::gpu::getLinearColumnFilter\_GPU}.}
\end{description}
See also: \hyperref[cppfunc.gpu.getLinearRowFilter]{cv::gpu::getLinearRowFilter\_GPU}, \hyperref[cppfunc.gpu.getLinearColumnFilter]{cv::gpu::getLinearColumnFilter\_GPU}, \cvCppCross{createSeparableLinearFilter}.
\cvCppFunc{gpu::sepFilter2D}
Applies separable 2D linear filter to the image.
\cvdefCpp{
void sepFilter2D(const GpuMat\& src, GpuMat\& dst, int ddepth, \par const Mat\& kernelX, const Mat\& kernelY, \par Point anchor = Point(-1,-1), \par int rowBorderType = BORDER\_DEFAULT, \par int columnBorderType = -1);
}
\begin{description}
\cvarg{src}{The source image.}
\cvarg{dst}{The destination image; will have the same size and the same number of channels as \texttt{src}.}
\cvarg{ddepth}{The destination image depth.}
\cvarg{kernelX}{The coefficients for filtering each row.}
\cvarg{kernelY}{The coefficients for filtering each column.}
\cvarg{anchor}{The anchor position within the kernel; The default value $(-1, 1)$ means that the anchor is at the kernel center.}
\cvarg{rowBorderType, columnBorderType}{The pixel extrapolation method; see \cvCppCross{borderInterpolate}.}
Creates filter engine for the generalized Sobel operator.
\cvdefCpp{
Ptr<FilterEngine\_GPU> createDerivFilter\_GPU(int srcType, int dstType, \par int dx, int dy, int ksize, \par int rowBorderType = BORDER\_DEFAULT, \par int columnBorderType = -1);
}
\begin{description}
\cvarg{srcType}{The source image type.}
\cvarg{dstType}{The destination image type; must have as many channels as \texttt{srcType}.}
\cvarg{dx}{The derivative order in respect with x.}
\cvarg{dy}{The derivative order in respect with y.}
\cvarg{ksize}{The aperture size; see \cvCppCross{getDerivKernels}.}
\cvarg{rowBorderType, columnBorderType}{Which border type to use; see \cvCppCross{borderInterpolate}.}
\cvarg{dstType}{Destination image type; must have as many channels as \texttt{srcType}. Supports \texttt{CV\_8U}, \texttt{CV\_16S}, \texttt{CV\_32S} and \texttt{CV\_32F} depths.}
\cvarg{dx}{Derivative order in respect with x.}
\cvarg{dy}{Derivative order in respect with y.}
\cvarg{ksize}{Aperture size; see \cvCppCross{getDerivKernels}.}
\cvarg{rowBorderType, columnBorderType}{Pixel extrapolation method; see \cvCppCross{borderInterpolate}.}
\end{description}
See also: \hyperref[cppfunc.gpu.createSeparableLinearFilter]{createSeparableLinearFilter\_GPU}, \cvCppCross{createDerivFilter}.
See also: \hyperref[cppfunc.gpu.createSeparableLinearFilter]{cv::gpu::createSeparableLinearFilter\_GPU}, \cvCppCross{createDerivFilter}.
\cvCppFunc{gpu::Sobel}
Applies generalized Sobel operator to the image.
\cvdefCpp{
void Sobel(const GpuMat\& src, GpuMat\& dst, int ddepth, int dx, int dy, \par int ksize = 3, double scale = 1, \par int rowBorderType = BORDER\_DEFAULT, \par int columnBorderType = -1);
}
\begin{description}
\cvarg{srcType}{The source image.}
\cvarg{dstType}{The destination image. Will have the same size and number of channels as source image.}
\cvarg{ddepth}{The destination image depth.}
\cvarg{dx}{The derivative order in respect with x.}
\cvarg{dy}{The derivative order in respect with y.}
\cvarg{dst}{The destination image; will have the same size and the same type as \texttt{src}.}
\cvarg{ksize}{The Gaussian kernel size; \texttt{ksize.width} and \texttt{ksize.height} can differ, but they both must be positive and odd. Or, they can be zero's, then they are computed from \texttt{sigma*}.}
\cvarg{sigmaX, sigmaY}{The Gaussian kernel standard deviations in X and Y direction. If \texttt{sigmaY} is zero, it is set to be equal to \texttt{sigmaX}. If they are both zeros, they are computed from \texttt{ksize.width} and \texttt{ksize.height}, respectively, see \cvCppCross{getGaussianKernel}. To fully control the result regardless of possible future modification of all this semantics, it is recommended to specify all of \texttt{ksize}, \texttt{sigmaX} and \texttt{sigmaY}.}
\cvarg{rowBorderType, columnBorderType}{The pixel extrapolation method; see \cvCppCross{borderInterpolate}.}
\cvarg{dst}{Destination image; will have the same size and the same type as \texttt{src}.}
\cvarg{ksize}{Gaussian kernel size; \texttt{ksize.width} and \texttt{ksize.height} can differ, but they both must be positive and odd. Or, they can be zero's, then they are computed from \texttt{sigmaX} amd \texttt{sigmaY}.}
\cvarg{sigmaX, sigmaY}{Gaussian kernel standard deviations in X and Y direction. If \texttt{sigmaY} is zero, it is set to be equal to \texttt{sigmaX}. If they are both zeros, they are computed from \texttt{ksize.width} and \texttt{ksize.height}, respectively, see \cvCppCross{getGaussianKernel}. To fully control the result regardless of possible future modification of all this semantics, it is recommended to specify all of \texttt{ksize}, \texttt{sigmaX} and \texttt{sigmaY}.}
\cvarg{rowBorderType, columnBorderType}{Pixel extrapolation method; see \cvCppCross{borderInterpolate}.}
\end{description}
See also: \hyperref[cppfunc.gpu.createGaussianFilter]{createGaussianFilter\_GPU}, \cvCppCross{GaussianBlur}.
\cvarg{src\_disp}{Source disparity image. Supports \texttt{CV\_8UC1} and \texttt{CV\_16SC1} types.}
\cvarg{dst\_disp}{Output disparity image. Will have the same size as \texttt{src\_disp} and \texttt{CV\_8UC4} type in \texttt{BGRA} format (alpha = 255).}
\cvarg{ndisp}{Number of disparities.}
\cvarg{stream}{Stream fo async version.}
\end{description}
This function converts $[0..ndisp)$ interval to $[0..240, 1, 1]$ in \texttt{HSV} color space, than convert \texttt{HSV} color space to \texttt{RGB}.
Values of pixels with non-integer coordinates are computed using bilinear interpolation.
\cvarg{disp}{The input single-channel 8-bit unsigned ot 16-bit signed integer disparity image.}
\cvarg{xyzw}{The output 4-channel floating-point image of the same size as \texttt{disp}. Each element of \texttt{xyzw(x,y)} will contain the 3D coordinates \texttt{(x,y,z,1)} of the point \texttt{(x,y)}, computed from the disparity map.}
\cvarg{Q}{The $4\times4$ perspective transformation matrix that can be obtained with \cvCross{StereoRectify}{stereoRectify}.}
\cvarg{stream}{Stream fo async version.}
\end{description}
See also: \cvCppCross{reprojectImageTo3D}.
\cvCppFunc{gpu::cvtColor}
Converts image from one color space to another.
\cvdefCpp{
void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn = 0);
}
\cvdefCpp{
void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn = 0);\newline
void cvtColor(const GpuMat\& src, GpuMat\& dst, int code, int dcn, \par const Stream\& stream);
\cvarg{dst}{The destination image; will have the same size and the same depth as \texttt{src}.}
\cvarg{code}{The color space conversion code.}
\cvarg{dcn}{The number of channels in the destination image; if the parameter is 0, the number of the channels will be derived automatically from \texttt{src} and the \texttt{code}.}
\cvarg{stream}{Stream fo async version.}
\cvarg{src}{Source image with \texttt{CV\_8U}, \texttt{CV\_16U} or \texttt{CV\_32F} depth and 1, 3 or 4 channels.}
\cvarg{dst}{Destination image; will have the same size and the same depth as \texttt{src}.}
\cvarg{code}{Color space conversion code. For details see \cvCppCross{cvtColor}. Conversion to/from Luv and Bayer color spaces doesn't supported.}
\cvarg{dcn}{Number of channels in the destination image; if the parameter is 0, the number of the channels will be derived automatically from \texttt{src} and the \texttt{code}.}
\cvarg{stream}{Stream for the asynchronous version.}
\end{description}
3-channels color spaces (like \texttt{HSV}, \texttt{XYZ}, etc) can be stored to 4-channels image for better perfomance.\newline
3-channel color spaces (like \texttt{HSV}, \texttt{XYZ}, etc) can be stored to 4-channel image for better perfomance.
See also: \cvCppCross{cvtColor}.
\cvCppFunc{gpu::threshold}
Applies a fixed-level threshold to each array element.
\cvarg{dst}{Destination image. It will have size \texttt{dsize} (when it is non-zero) or the size computed from \texttt{src.size()} and \texttt{fx} and \texttt{fy}. The type of \texttt{dst} will be the same as of \texttt{src}.}
\cvarg{dsize}{The destination image size. If it is zero, then it is computed as: \[\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\] Either \texttt{dsize} or both \texttt{fx} or \texttt{fy} must be non-zero.}
\cvarg{fx}{The scale factor along the horizontal axis. When 0, it is computed as \[\texttt{(double)dsize.width/src.cols}\]}
\cvarg{fy}{The scale factor along the vertical axis. When 0, it is computed as \[\texttt{(double)dsize.height/src.rows}\]}
\cvarg{interpolation}{The interpolation method. Supports only \texttt{INTER\_NEAREST} and \texttt{INTER\_LINEAR}.}
\cvarg{dsize}{Destination image size. If it is zero, then it is computed as:
Either \texttt{dsize} or both \texttt{fx} or \texttt{fy} must be non-zero.}
\cvarg{fx}{Scale factor along the horizontal axis. When 0, it is computed as
\[
\texttt{(double)dsize.width/src.cols}
\]}
\cvarg{fy}{Scale factor along the vertical axis. When 0, it is computed as
\[
\texttt{(double)dsize.height/src.rows}
\]}
\cvarg{interpolation}{Interpolation method. Supports only \texttt{INTER\_NEAREST} and \texttt{INTER\_LINEAR}.}
\end{description}
See also: \cvCppCross{resize}.
\cvCppFunc{gpu::warpAffine}
Applies an affine transformation to an image.
\cvdefCpp{
void warpAffine(const GpuMat\& src, GpuMat\& dst, const Mat\& M, \par Size dsize, int flags = INTER\_LINEAR);
}
\begin{description}
\cvarg{src}{Source image. Supports 8-bit unsigned, 16-bit unsigned, 32-bit signed amd 32-bit floating one, three and four channels images.}
\cvarg{src}{Source image. Supports \texttt{CV\_8U}, \texttt{CV\_16U}, \texttt{CV\_32S} or \texttt{CV\_32F} depth and 1, 3 or 4 channels.}
\cvarg{dst}{Destination image; will have size \texttt{dsize} and the same type as \texttt{src}.}
\cvarg{M}{$2\times3$ transformation matrix.}
\cvarg{dsize}{Size of the destination image.}
\cvarg{flags}{A combination of interpolation methods, see \cvCppCross{resize}, and the optional flag \texttt{WARP\_INVERSE\_MAP} that means that \texttt{M} is the inverse transformation ($\texttt{dst}\rightarrow\texttt{src}$). Supports only \texttt{INTER\_NEAREST}, \texttt{INTER\_LINEAR} and \texttt{INTER\_CUBIC} interpolation methods.}
\cvarg{flags}{Combination of interpolation methods, see \cvCppCross{resize}, and the optional flag \texttt{WARP\_INVERSE\_MAP} that means that \texttt{M} is the inverse transformation ($\texttt{dst}\rightarrow\texttt{src}$). Supports only \texttt{INTER\_NEAREST}, \texttt{INTER\_LINEAR} and \texttt{INTER\_CUBIC} interpolation methods.}
\end{description}
See also: \cvCppCross{warpAffine}.
\cvCppFunc{gpu::warpPerspective}
Applies a perspective transformation to an image.
\cvdefCpp{
void warpPerspective(const GpuMat\& src, GpuMat\& dst, const Mat\& M, \par Size dsize, int flags = INTER\_LINEAR);
}
\begin{description}
\cvarg{src}{Source image. Supports 8-bit unsigned, 16-bit unsigned, 32-bit signed amd 32-bit floating one, three and four channels images.}
\cvarg{src}{Source image. Supports \texttt{CV\_8U}, \texttt{CV\_16U}, \texttt{CV\_32S} or \texttt{CV\_32F} depth and 1, 3 or 4 channels.}
\cvarg{dst}{Destination image; will have size \texttt{dsize} and the same type as \texttt{src}.}
\cvarg{M}{$2\times3$ transformation matrix.}
\cvarg{M}{$2
3$ transformation matrix.}
\cvarg{dsize}{Size of the destination image.}
\cvarg{flags}{A combination of interpolation methods, see \cvCppCross{resize}, and the optional flag \texttt{WARP\_INVERSE\_MAP} that means that \texttt{M} is the inverse transformation ($\texttt{dst}\rightarrow\texttt{src}$). Supports only \texttt{INTER\_NEAREST}, \texttt{INTER\_LINEAR} and \texttt{INTER\_CUBIC} interpolation methods.}
\cvarg{flags}{Combination of interpolation methods, see \cvCppCross{resize}, and the optional flag \texttt{WARP\_INVERSE\_MAP} that means that \texttt{M} is the inverse transformation ($\texttt{dst}\rightarrow\texttt{src}$). Supports only \texttt{INTER\_NEAREST}, \texttt{INTER\_LINEAR} and \texttt{INTER\_CUBIC} interpolation methods.}
\end{description}
See also: \cvCppCross{warpPerspective}.
\cvCppFunc{gpu::rotate}
Rotates an image around the origin (0,0) and then shifts it.
\cvarg{dst}{Destination image; will have size \texttt{dsize} and the same type as \texttt{src}.}
\cvarg{dsize}{Size of the destination image.}
\cvarg{angle}{The angle of rotation in degrees.}
\cvarg{angle}{Angle of rotation in degrees.}
\cvarg{xShift}{Shift along horizontal axis.}
\cvarg{yShift}{Shift along vertical axis.}
\cvarg{interpolation}{The interpolation method. Supports only \texttt{INTER\_NEAREST}, \texttt{INTER\_LINEAR} and \texttt{INTER\_CUBIC}.}
\cvarg{interpolation}{Interpolation method. Supports only \texttt{INTER\_NEAREST}, \texttt{INTER\_LINEAR} and \texttt{INTER\_CUBIC}.}
\end{description}
See also: \cvCppCross{gpu::warpAffine}.
\cvCppFunc{gpu::copyMakeBorder}
Copies 2D array to a larger destination array and pads borders with user-specifiable constant.
Copies 2D array to a larger destination array and pads borders with the given constant.
\cvdefCpp{
void copyMakeBorder(const GpuMat\& src, GpuMat\& dst, \par int top, int bottom, int left, int right, \par const Scalar\& value = Scalar());
}
\begin{description}
\cvarg{src}{The source image. Supports \texttt{CV\_8UC1}, \texttt{CV\_8UC4}, \texttt{CV\_32SC1} and \texttt{CV\_32FC1} types.}
\cvarg{src}{Source image. Supports \texttt{CV\_8UC1}, \texttt{CV\_8UC4}, \texttt{CV\_32SC1} and \texttt{CV\_32FC1} types.}
\cvarg{dst}{The destination image; will have the same type as \texttt{src} and the size \texttt{Size(src.cols+left+right, src.rows+top+bottom)}.}
\cvarg{top, bottom, left, right}{Specify how much pixels in each direction from the source image rectangle one needs to extrapolate, e.g. \texttt{top=1, bottom=1, left=1, right=1} mean that 1 pixel-wide border needs to be built.}
\cvarg{value}{The border value.}
\cvarg{value}{Border value.}
\end{description}
See also: \cvCppCross{copyMakeBorder}
\cvCppFunc{gpu::rectStdDev}
Computes the standard deviation of integral images.
\cvarg{src}{The source image. Supports only \texttt{CV\_32SC1} type.}
\cvarg{sqr}{The squared source image. Supports only \texttt{CV\_32FC1} type.}
\cvarg{dst}{The destination image; will have the same type and the same size as \texttt{src}.}
\cvarg{src}{Source image. Supports only \texttt{CV\_32SC1} type.}
\cvarg{sqr}{Squared source image. Supports only \texttt{CV\_32FC1} type.}
\cvarg{dst}{Destination image; will have the same type and the same size as \texttt{src}.}
\cvarg{rect}{Rectangular window.}
\end{description}
\cvCppFunc{gpu::evenLevels}
Compute levels with even distribution.
Computes levels with even distribution.
\cvdefCpp{
void evenLevels(GpuMat\& levels, int nLevels, \par int lowerLevel, int upperLevel);
}
\begin{description}
\cvarg{levels}{The destination array. \texttt{levels} will have 1 row and \texttt{nLevels} cols and \texttt{CV\_32SC1} type.}
\cvarg{nLevels}{The number of levels being computed. \texttt{nLevels} must be at least 2}
\cvarg{levels}{Destination array. \texttt{levels} will have 1 row and \texttt{nLevels} cols and \texttt{CV\_32SC1} type.}
\cvarg{nLevels}{Number of levels being computed. \texttt{nLevels} must be at least 2.}
\cvarg{lowerLevel}{Lower boundary value of the lowest level.}
\cvarg{upperLevel}{Upper boundary value of the greatest level.}
\end{description}
\cvCppFunc{gpu::histEven}
Calculates histogram with evenly distributed bins.
\cvdefCpp{
void histEven(const GpuMat\& src, GpuMat\& hist, \par int histSize, int lowerLevel, int upperLevel);
}
\cvdefCpp{
void histEven(const GpuMat\& src, GpuMat\& hist, \par int histSize, int lowerLevel, int upperLevel);\newline
void histEven(const GpuMat\& src, GpuMat hist[4], \par int histSize[4], int lowerLevel[4], int upperLevel[4]);
}
\begin{description}
\cvarg{src}{The source image. Supports 8-bit unsigned, 16-bit unsigned and 16-bit one or four channel images. For four channels image all channels are processed separately.}
\cvarg{src}{Source image. Supports \texttt{CV\_8U}, \texttt{CV\_16U} or \texttt{CV\_16S} depth and 1 or 4 channels. For four-channel image all channels are processed separately.}
\cvarg{hist}{Destination histogram. Will have one row, \texttt{histSize} cols and \texttt{CV\_32S} type.}
\cvarg{histSize}{Size of histogram.}
\cvarg{lowerLevel}{Lower boundary of lowest level bin.}
...
...
@@ -459,14 +476,14 @@ void histEven(const GpuMat\& src, GpuMat hist[4], \par int histSize[4], int lowe
\cvCppFunc{gpu::histRange}
Calculates histogram with bins determined by levels array.
\cvarg{src}{The source image. Supports 8-bit unsigned, 16-bit unsigned and 16-bit one or four channel images. For four channels image all channels are processed separately.}
\cvarg{src}{Source image. Supports \texttt{CV\_8U}, \texttt{CV\_16U} or \texttt{CV\_16S} depth and 1 or 4 channels. For four-channel image all channels are processed separately.}
\cvarg{hist}{Destination histogram. Will have one row, \texttt{(levels.cols-1)} cols and \texttt{CV\_32SC1} type.}
title = {A Constant-Space Belief Propagation Algorithm for Stereo Matching},
booktitle = {CVPR},
year = {2010}
}
@article{felzenszwalb_bp,
author = {Pedro F. Felzenszwalb and Daniel P. Huttenlocher},
title = {Efficient Belief Propagation for Early Vision},
journal = {International Journal of Computer Vision},
volume = {70},
number = {1},
year = {2006},
month = {October}
}
# '''[Bradski98]''' G.R. Bradski. Computer vision face tracking as a component of a perceptual user interface. In Workshop on Applications of Computer Vision, pages 214?219, Princeton, NJ, Oct. 1998.<<BR>> Updated version can be found at http://www.intel.com/technology/itj/q21998/articles/art\_2.htm.<<BR>> Also, it is included into OpenCV distribution ([[attachment:camshift.pdf]])
# '''[Burt81]''' P. J. Burt, T. H. Hong, A. Rosenfeld. Segmentation and Estimation of Image Region Properties Through Cooperative Hierarchical Computation. IEEE Tran. On SMC, Vol. 11, N.12, 1981, pp. 802-809.
# '''[Canny86]''' J. Canny. A Computational Approach to Edge Detection, IEEE Trans. on Pattern Analysis and Machine Intelligence, 8(6), pp. 679-698 (1986).