The class for computing stereo correspondence using block matching algorithm. ::
This class computes stereo correspondence (disparity map) using the block matching algorithm.
::
class StereoBM_GPU
{
@ -39,30 +40,30 @@ The class for computing stereo correspondence using block matching algorithm. ::
};
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 ``avergeTexThreshold = 0``, low textureness filtering is disabled, otherwise the disparity is set to 0 in each point ``(x, y)``, where for the left image
The class also performs pre- and post-filtering steps: Sobel pre-filtering (if ``PREFILTER_XSOBEL`` flag is set) and low textureness filtering (if ``averageTexThreshols > 0``). If ``avergeTexThreshold = 0``, low textureness filtering is disabled. Otherwise, the disparity is set to 0 in each point ``(x, y)``, where for the left image
..math::
\sum HorizontalGradiensInWindow(x, y, winSize) < (winSize \cdot winSize) \cdot avergeTexThreshold
i.e. input left image is low textured.
This means that the input left image is low textured.
Some heuristics that tries to estmate if the current GPU will be faster then CPU in this algorithm. It queries current active device.
Uses a heuristic method to estimate whether the current GPU is faster than the CPU in this algorithm. It queries the currently active device.
..index:: gpu::StereoBeliefPropagation
@ -100,7 +101,7 @@ gpu::StereoBeliefPropagation
----------------------------
..cpp:class:: gpu::StereoBeliefPropagation
The class for computing stereo correspondence using belief propagation algorithm. ::
This class computes stereo correspondence using the belief propagation algorithm. ::
class StereoBeliefPropagation
{
@ -143,21 +144,21 @@ The class for computing stereo correspondence using belief propagation algorithm
...
};
The class implements Pedro F. Felzenszwalb algorithm [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006]. It can compute own data cost (using truncated linear model) or use user-provided data cost.
The class implements Pedro F. Felzenszwalb algorithm [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006]. It can compute own data cost (using a truncated linear model) or use a user-provided data cost.
**Note:**``StereoBeliefPropagation`` requires a lot of memory:
**Note:**``StereoBeliefPropagation`` requires a lot of memory for message storage:
..cpp:function:: gpu::StereoBeliefPropagation::StereoBeliefPropagation( int ndisp, int iters, int levels, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int msg_type = CV_32F)
StereoBeliefPropagation constructors.
Enables the ``StereoBeliefPropagation`` constructors.
DiscTerm = \min (disc \_ single \_ jump \cdot \lvert f_1-f_2 \rvert , max \_ disc \_ term)
For more details please see [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006].
For more details, see [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006].
By default, :cpp:class:`StereoBeliefPropagation` uses floating-point arithmetics and ``CV_32FC1`` type for messages. But also it can use fixed-point arithmetics and ``CV_16SC1``type for messages for better performance. To avoid overflow in this case, the parameters must satisfy
By default, :cpp:class:`StereoBeliefPropagation` uses floating-point arithmetics and the ``CV_32FC1`` type for messages. But it can also use fixed-point arithmetics and the ``CV_16SC1``message type for better performance. To avoid an overflow in this case, the parameters must satisfy the following requirement:
..cpp:function:: void gpu::StereoBeliefPropagation::estimateRecommendedParams( int width, int height, int& ndisp, int& iters, int& levels)
Some heuristics that tries to compute recommended parameters (``ndisp``, ``iters`` and ``levels``) for specified image size (``width`` and ``height``).
Uses a heuristic method to compute the recommended parameters (``ndisp``, ``iters`` and ``levels``) for the specified image size (``width`` and ``height``).
The stereo correspondence operator. Finds the disparity for the specified rectified stereo pair or data cost.
Enables the stereo correspondence operator that finds the disparity for the specified rectified stereo pair or data cost.
:param left:Left image; supports ``CV_8UC1`` , ``CV_8UC3`` and ``CV_8UC4`` types.
:param left:Left image. ``CV_8UC1`` , ``CV_8UC3`` and ``CV_8UC4`` types are supported.
:param right:Right image with the same size and the same type as the left one.
:param disparity:Output disparity map. If ``disparity`` is empty output type will be ``CV_16SC1`` , otherwise output type will be ``disparity.type()`` .
:param disparity:Output disparity map. If ``disparity`` is empty, the output type is ``CV_16SC1`` . Otherwise, the output type is ``disparity.type()`` .
:param stream:Stream for the asynchronous version.
:param data:The userspecified data cost, a matrix of ``msg_type`` type and ``Size(<image columns>*ndisp, <image rows>)`` size.
:param data:The user-specified data cost, a matrix of ``msg_type`` type and ``Size(<image columns>*ndisp, <image rows>)`` size.
:param disparity:Output disparity map. If the matrix is empty, it will be created as ``CV_16SC1`` matrix, otherwise the type will be retained.
:param disparity:Output disparity map. If the matrix is empty, it is created as the ``CV_16SC1`` matrix. Otherwise, the type is retained.
:param stream:Stream for the asynchronous version.
@ -246,7 +247,7 @@ gpu::StereoConstantSpaceBP
--------------------------
..cpp:class:: gpu::StereoConstantSpaceBP
The class for computing stereo correspondence using constant space belief propagation algorithm. ::
This class computes stereo correspondence using the constant space belief propagation algorithm. ::
class StereoConstantSpaceBP
{
@ -297,7 +298,7 @@ The class for computing stereo correspondence using constant space belief propag
};
The class implements Q. Yang algorithm [Q. Yang, L. Wang, and N. Ahuja. A constant-space belief propagation algorithm for stereo matching. In CVPR, 2010]. ``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 ``use_local_init_data_cost`` to false.
The class implements Q. Yang algorithm [Q. Yang, L. Wang, and N. Ahuja. A constant-space belief propagation algorithm for stereo matching. In CVPR, 2010]. ``StereoConstantSpaceBP`` supports both local minimum and global minimum data cost initialization algortihms. For more details, see the paper. By default, a local algorithm is used. To enable a global algorithm, set ``use_local_init_data_cost`` to ``false``.
..cpp:function:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int min_disp_th = 0, int msg_type = CV_32F)
DiscTerm = \min (disc \_ single \_ jump \cdot \lvert f_1-f_2 \rvert , max \_ disc \_ term)
For more details please see
qx_csbp
For more details, see
qx_csbp ??
.
By default ``StereoConstantSpaceBP`` uses floating-point arithmetics and ``CV_32FC1`` type for messages. But also it can use fixed-point arithmetics and ``CV_16SC1``type for messages for better perfomance. To avoid overflow in this case, the parameters must satisfy
By default,``StereoConstantSpaceBP`` uses floating-point arithmetics and the ``CV_32FC1`` type for messages. But it can also use fixed-point arithmetics and the ``CV_16SC1``message type for better perfomance. To avoid an overflow in this case, the parameters must satisfy the following requirement:
The stereo correspondence operator. Finds the disparity for the specified rectified stereo pair.
Enables the stereo correspondence operator that finds the disparity for the specified rectified stereo pair.
:param left:Left image; supports ``CV_8UC1`` , ``CV_8UC3`` and ``CV_8UC4`` types.
:param left:Left image. ``CV_8UC1`` , ``CV_8UC3`` and ``CV_8UC4`` types are supported.
:param right:Right image with the same size and the same type as the left one.
:param disparity:Output disparity map. If ``disparity`` is empty output type will be ``CV_16SC1`` , otherwise output type will be ``disparity.type()`` .
:param disparity:Output disparity map. If ``disparity`` is empty, the output type is ``CV_16SC1`` . Otherwise, the output type is ``disparity.type()`` .
:param stream:Stream for the asynchronous version.
@ -384,7 +385,7 @@ gpu::DisparityBilateralFilter
-----------------------------
..cpp:class:: gpu::DisparityBilateralFilter
The class for disparity map refinement using joint bilateral filtering. ::
This class refines a disparity map using joint bilateral filtering. ::
..cpp:function:: gpu::DisparityBilateralFilter::DisparityBilateralFilter( int ndisp, int radius, int iters, float edge_threshold, float max_disc_threshold, float sigma_range)
``DisparityBilateralFilter`` constructors.
Enables the ``DisparityBilateralFilter`` constructors.
:param src_disp:Source disparity image. Supports ``CV_8UC1`` and ``CV_16SC1`` types.
:param src_disp:Source disparity image. ``CV_8UC1`` and ``CV_16SC1`` types are supported.
:param dst_disp:Output disparity image. Will have the same size as ``src_disp`` and ``CV_8UC4`` type in ``BGRA`` format (alpha = 255).
:param dst_disp:Output disparity image. It has the same size as ``src_disp`` . The type is ``CV_8UC4`` in ``BGRA`` format (alpha = 255).
:param ndisp:Number of disparities.
:param stream:Stream for the asynchronous version.
This function draws a colorized disparity map by converting disparity values from ``[0..ndisp)`` interval first to ``HSV`` color space (where different disparity values correspond to different hues) and then converting the pixels to ``RGB`` for visualization.
This function draws a colored disparity map by converting disparity values from ``[0..ndisp)`` interval first to ``HSV`` color space (where different disparity values correspond to different hues) and then converting the pixels to ``RGB`` for visualization.
:param disp:Input disparity image; supports ``CV_8U`` and ``CV_16S`` types.
:param disp:Input disparity image. ``CV_8U`` and ``CV_16S`` types are supported.
:param xyzw:Output 4-channel floating-point image of the same size as ``disp`` . Each element of ``xyzw(x,y)`` will contain the 3D coordinates ``(x,y,z,1)`` of the point ``(x,y)`` , computed from the disparity map.
:param xyzw:Output 4-channel floating-point image of the same size as ``disp`` . Each element of ``xyzw(x,y)`` contains 3D coordinates ``(x,y,z,1)`` of the point ``(x,y)`` , computed from the disparity map.
:param Q::math:`4 \times 4` perspective transformation matrix that can be obtained via :ref:`StereoRectify` .
Finds the object pose from the 3D-2D point correspondences.
Finds the object pose from 3D-2D point correspondences.
:param object:Single-row matrix of object points.
@ -512,13 +513,13 @@ gpu::solvePnPRansac
:param tvec:Output 3D translation vector.
:param use_extrinsic_guess:Indicates the function must use ``rvec`` and ``tvec`` as initial transformation guess. It isn't supported for now.
:param use_extrinsic_guess:Flag to indicate that the function must use ``rvec`` and ``tvec`` as an initial transformation guess. It is not supported for now.
:param num_iters:Maximum number of RANSAC iterations.
:param max_dist:Euclidean distance threshold to detect whether point is inlier or not.
:param min_inlier_count:Indicates the function must stop if greater or equal number of inliers is achieved. It isn't supported for now.
:param min_inlier_count:Flag to indicate that the function must stop if greater or equal number of inliers is achieved. It is not supported for now.
:param trainDescs:Training set of descriptors.It is not added to train descriptors collection stored in the class object.
:param trainDescs:Training set of descriptors.It is not added to train descriptors collection stored in the class object.
:param trainIdx:``trainIdx.at<int>(i, j)`` is the index of j-th training descriptor which is close enough to i-th query descriptor. If ``trainIdx`` is empty, it is created with the size ``queryDescs.rows x trainDescs.rows``. When the matrix is pre-allocated, it can have less than ``trainDescs.rows`` columns. Then the function will return as many matches for each query descriptors as fit into the matrix.
:param nMatches:``nMatches.at<unsigned int>(0, i)`` contains the number of matching descriptors for the i-th query descriptor. The value can be larger than ``trainIdx.cols`` - it means that the function could not store all the matches since it did not have enough memory.
:param distance:``distance.at<int>(i, j)`` is the distance between the j-th match for the j-th query descriptor and the this very query descriptor. The matrix will have ``CV_32FC1`` type and the same size as ``trainIdx``.
:param distance:``distance.at<int>(i, j)`` Distance between the j-th match for the j-th query descriptor and this very query descriptor. The matrix has the ``CV_32FC1`` type and the same size as ``trainIdx``.
:param srcType:Input image type. Supports ``CV_8UC1`` and ``CV_8UC4``.
:param dstType:Output image type. Supports only the same as source type.
:param dstType:Output image type. It supports only the same as the source type.
:param ksize:Kernel size.
@ -225,7 +225,7 @@ gpu::boxFilter
:param dst:Output image type. The size and type is the same as ``src``.
:param ddepth:Output image depth. If -1, the output image will have the same depth as the input one. The only values allowed here are ``CV_8U`` and -1.
:param ddepth:Output image depth. If -1, the output image has the same depth as the input one. The only values allowed here are ``CV_8U`` and -1.
:param ksize:Kernel size.
@ -245,7 +245,7 @@ gpu::blur
:param src:Input image. ``CV_8UC1`` and ``CV_8UC4`` source types are supported.
:param dst:Output image type. The size and type is the same as ``src`` .
:param dst:Output image type with the same size and type as ``src`` .
:param ksize:Kernel size.
@ -289,7 +289,7 @@ gpu::erode
:param src:Source image. Only ``CV_8UC1`` and ``CV_8UC4`` types are supported.
:param dst:Destination image. The size and type is the same as ``src`` .
:param dst:Destination image with the same size and type as ``src`` .
:param kernel:Structuring element used for dilation. If ``kernel=Mat()``, a 3x3 rectangular structuring element is used.
@ -311,7 +311,7 @@ gpu::dilate
:param src:Source image. ``CV_8UC1`` and ``CV_8UC4`` source types are supported.
:param dst:Destination image. The size and type is the same as ``src``.
:param dst:Destination image with the same size and type as ``src``.
:param kernel:Structuring element used for dilation. If ``kernel=Mat()``, a 3x3 rectangular structuring element is used.
@ -333,7 +333,7 @@ gpu::morphologyEx
:param src:Source image. ``CV_8UC1`` and ``CV_8UC4`` source types are supported.
:param dst:Destination image. The size and type is the same as ``src``
:param dst:Destination image with the same size and type as ``src``
:param op:Type of morphological operation. The following types are possible:
:param dst:Destination image. The size and type is the same as ``src`` has.
:param dst:Destination image with the same size and type as ``src``.
:param ksize:Gaussian kernel size. ``ksize.width`` and ``ksize.height`` can differ but they both must be positive and odd. If they are zeros, they are computed from ``sigmaX`` and ``sigmaY`` .
:param src:Source image. Only ``CV_8UC4`` images are supported for now.
:param dst:Destination image containing the color of mapped points. The size and type is the same as ``src`` .
:param dst:Destination image containing the color of mapped points. It has the same size and type as ``src`` .
:param sp:Spatial window radius.
@ -38,7 +38,7 @@ gpu::meanShiftProc
:param dstr:Destination image containing the color of mapped points. The size and type is the same as ``src`` .
:param dstsp:Destination image containing the position of mapped points. The size is the same as ``src``. The type is ``CV_16SC2``.
:param dstsp:Destination image containing the position of mapped points. The size is the same as ``src`` size. The type is ``CV_16SC2``.
:param sp:Spatial window radius.
@ -59,7 +59,7 @@ gpu::meanShiftSegmentation
:param src:Source image. Only ``CV_8UC4`` images are supported for now.
:param dst:Segmented image. The size and type is the same as ``src`` .
:param dst:Segmented image with the same size and type as ``src`` .
:param sp:Spatial window radius.
@ -172,7 +172,7 @@ gpu::mulSpectrums
:param a:First spectrum.
:param b:Second spectrum. The size and type is the same as ``a`` .
:param b:Second spectrum with the same size and type as ``a`` .
:param c:Destination spectrum.
@ -196,7 +196,7 @@ gpu::mulAndScaleSpectrums
:param a:First spectrum.
:param b:Second spectrum. The size and type is the same as ``a`` .
:param b:Second spectrum with the same size and type as ``a`` .
:param c:Destination spectrum.
@ -321,7 +321,7 @@ gpu::matchTemplate
:param image:Source image. ``CV_32F`` and ``CV_8U`` depth images (1..4 channels) are supported for now.
:param templ:Template image. The size and type is the same as ``image`` .
:param templ:Template image with the size and type the same as ``image`` .
:param result:Map containing comparison results ( ``CV_32FC1`` ). If ``image`` is *W x H* and ``templ`` is *w x h*, then ``result`` must be *W-w+1 x H-h+1*.
@ -354,7 +354,7 @@ gpu::remap
:param src:Source image. Only ``CV_8UC1`` and ``CV_8UC3`` source types are supported.
:param dst:Destination image. The size is the same as ``xmap`` . The type is the same as ``src`` .
:param dst:Destination image with the size the same as ``xmap`` and the type the same as ``src`` .
:param xmap:X values. Only ``CV_32FC1`` type is supported.
@ -382,7 +382,7 @@ gpu::cvtColor
:param src:Source image with ``CV_8U``, ``CV_16U``, or ``CV_32F`` depth and 1, 3, or 4 channels.
:param dst:Destination image. The size and depth is the same as ``src`` .
:param dst:Destination image with the same size and depth as ``src`` .
:param code:Color space conversion code. For details, see :func:`cvtColor` . Conversion to/from Luv and Bayer color spaces is not supported.
@ -407,7 +407,7 @@ gpu::threshold
:param src:Source array (single-channel). ``CV_64F`` depth is not supported.
:param dst:Destination array. The size and type is the same as ``src`` .
:param dst:Destination array with the same size and type as ``src`` .
:param thresh:Threshold value.
@ -430,7 +430,7 @@ gpu::resize
:param src:Source image. Supports the ``CV_8UC1`` and ``CV_8UC4`` types.
:param dst:Destination image. The size is ``dsize`` (when it is non-zero) or the size is computed from ``src.size()``, ``fx``, and ``fy`` . The type is the same as ``src`` .
:param dst:Destination image with the same type as ``src`` . The size is ``dsize`` (when it is non-zero) or the size is computed from ``src.size()``, ``fx``, and ``fy`` .
:param dsize:Destination image size. If it is zero, it is computed as:
@ -465,7 +465,7 @@ gpu::warpAffine
:param src:Source image. Supports ``CV_8U``, ``CV_16U``, ``CV_32S``, or ``CV_32F`` depth and 1, 3, or 4 channels.
:param dst:Destination image. The size is ``dsize`` . The type is the same as ``src`` .
:param dst:Destination image with the same type as ``src`` . The size is ``dsize`` .
:param M:*2x3* transformation matrix.
@ -486,7 +486,7 @@ gpu::warpPerspective
:param src:Source image. Supports ``CV_8U``, ``CV_16U``, ``CV_32S``, or ``CV_32F`` depth and 1, 3, or 4 channels.
:param dst:Destination image. The size is ``dsize`` . The type is the same as ``src`` .
:param dst:Destination image with the same type as ``src`` . The size is ``dsize`` .
:param M:*3x3* transformation matrix.
@ -507,7 +507,7 @@ gpu::rotate
:param src:Source image. Supports ``CV_8UC1`` and ``CV_8UC4`` types.
:param dst:Destination image. The size is ``dsize`` . The type is the same as ``src`` .
:param dst:Destination image with the same type as ``src`` . The size is ``dsize`` .
:param dsize:Size of the destination image.
@ -532,7 +532,7 @@ gpu::copyMakeBorder
:param src:Source image. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1``, and ``CV_32FC1`` types are supported.
:param dst:Destination image. The type is the same as ``src`` . The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
:param dst:Destination image with the same type as ``src`` . The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
:param top, bottom, left, right:Number of pixels in each direction from the source image rectangle to extrapolate. For example: ``top=1, bottom=1, left=1, right=1`` mean that 1 pixel-wide border needs to be built.
@ -552,7 +552,7 @@ gpu::rectStdDev
:param sqr:Squared source image. Only the ``CV_32FC1`` type is supported.
:param dst:Destination image. The type and size is the same as ``src`` .
:param dst:Destination image with the same type and size as ``src`` .
Histogram of Oriented Gradients [Navneet Dalal and Bill Triggs. Histogram of oriented gradients for human detection. 2005.] descriptor and detector.
Provides a histogram of Oriented Gradients [Navneet Dalal and Bill Triggs. Histogram of oriented gradients for human detection. 2005.] descriptor and detector.
::
struct CV_EXPORTS HOGDescriptor
@ -61,7 +61,7 @@ gpu::HOGDescriptor
}
Interfaces of all methods are kept similar to the ``CPU HOG`` descriptor and detector analogues as much as possible.
Interfaces of all methods are kept similar to the ``CPU HOG`` descriptor and detector analogues as much as possible.