..ocv:function:: void gpu::reprojectImageTo3D(const GpuMat& disp, GpuMat& xyzw, const Mat& Q, int dst_cn = 4, Stream& stream = Stream::Null())
: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)`` contains 3D coordinates ``(x,y,z,1)`` of the point ``(x,y)`` , computed from the disparity map.
:param xyzw:Output 3- or 4-channel floating-point image of the same size as ``disp`` . Each element of ``xyzw(x,y)`` contains 3D coordinates ``(x,y,z)`` or ``(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 :ocv:func:`stereoRectify` .
:param dst_cn:The number of channels for output image. Can be 3 or 4.
:param stream:Stream for the asynchronous version.
Class used for extracting Speeded Up Robust Features (SURF) from an image. ::
class SURF_GPU : public CvSURFParams
class SURF_GPU
{
public:
enum KeypointLayout
{
SF_X = 0,
SF_Y,
SF_LAPLACIAN,
SF_SIZE,
SF_DIR,
SF_HESSIAN,
SF_FEATURE_STRIDE
X_ROW = 0,
Y_ROW,
LAPLACIAN_ROW,
OCTAVE_ROW,
SIZE_ROW,
ANGLE_ROW,
HESSIAN_ROW,
ROWS_COUNT
};
//! the default constructor
@ -69,6 +70,13 @@ Class used for extracting Speeded Up Robust Features (SURF) from an image. ::
void releaseMemory();
// SURF parameters
double hessianThreshold;
int nOctaves;
int nOctaveLayers;
bool extended;
bool upright;
//! max keypoints = keypointsRatio * img.size().area()
float keypointsRatio;
@ -82,14 +90,15 @@ Class used for extracting Speeded Up Robust Features (SURF) from an image. ::
The class ``SURF_GPU`` implements Speeded Up Robust Features descriptor. There is a fast multi-scale Hessian keypoint detector that can be used to find the keypoints (which is the default option). But the descriptors can also be computed for the user-specified keypoints. Only 8-bit grayscale images are supported.
The class ``SURF_GPU`` can store results in the GPU and CPU memory. It provides functions to convert results between CPU and GPU version ( ``uploadKeypoints``, ``downloadKeypoints``, ``downloadDescriptors`` ). The format of CPU results is the same as ``SURF`` results. GPU results are stored in ``GpuMat``. The ``keypoints`` matrix is :math:`\texttt{nFeatures} \times 6` matrix with the ``CV_32FC1`` type.
The class ``SURF_GPU`` can store results in the GPU and CPU memory. It provides functions to convert results between CPU and GPU version ( ``uploadKeypoints``, ``downloadKeypoints``, ``downloadDescriptors`` ). The format of CPU results is the same as ``SURF`` results. GPU results are stored in ``GpuMat``. The ``keypoints`` matrix is :math:`\texttt{nFeatures} \times 7` matrix with the ``CV_32FC1`` type.
* ``keypoints.ptr<float>(SF_X)[i]`` contains x coordinate of the i-th feature.
* ``keypoints.ptr<float>(SF_Y)[i]`` contains y coordinate of the i-th feature.
* ``keypoints.ptr<float>(SF_LAPLACIAN)[i]`` contains the laplacian sign of the i-th feature.
* ``keypoints.ptr<float>(SF_SIZE)[i]`` contains the size of the i-th feature.
* ``keypoints.ptr<float>(SF_DIR)[i]`` contain orientation of the i-th feature.
* ``keypoints.ptr<float>(SF_HESSIAN)[i]`` contains the response of the i-th feature.
* ``keypoints.ptr<float>(X_ROW)[i]`` contains x coordinate of the i-th feature.
* ``keypoints.ptr<float>(Y_ROW)[i]`` contains y coordinate of the i-th feature.
* ``keypoints.ptr<float>(LAPLACIAN_ROW)[i]`` contains the laplacian sign of the i-th feature.
* ``keypoints.ptr<float>(OCTAVE_ROW)[i]`` contains the octave of the i-th feature.
* ``keypoints.ptr<float>(SIZE_ROW)[i]`` contains the size of the i-th feature.
* ``keypoints.ptr<float>(ANGLE_ROW)[i]`` contain orientation of the i-th feature.
* ``keypoints.ptr<float>(HESSIAN_ROW)[i]`` contains the response of the i-th feature.
The ``descriptors`` matrix is :math:`\texttt{nFeatures} \times \texttt{descriptorSize}` matrix with the ``CV_32FC1`` type.
@ -118,17 +127,17 @@ Class used for corner detection using the FAST algorithm. ::
..ocv:function:: Ptr<FilterEngine_GPU> gpu::createLinearFilter_GPU(int srcType, int dstType, const Mat& kernel, Point anchor = Point(-1,-1), int borderType = BORDER_DEFAULT)
..ocv:function:: Ptr<BaseFilter_GPU> gpu::getLinearFilter_GPU(int srcType, int dstType, const Mat& kernel, const Size& ksize, Point anchor = Point(-1, -1))
:param srcType:Input image type. ``CV_8UC1`` and ``CV_8UC4`` types are supported.
:param srcType:Input image type. Supports ``CV_8U`` , ``CV_16U`` and ``CV_32F`` one and four channel image.
:param dstType:Output image type. The same type as ``src`` is supported.
:param kernel:2D array of filter coefficients. Floating-point coefficients will be converted to fixed-point representation before the actual processing.
:param ksize:Kernel size. Supports size up to 16. For larger kernels use :ocv:func:`gpu::convolve`.
:param kernel:2D array of filter coefficients. Floating-point coefficients will be converted to fixed-point representation before the actual processing. Supports size up to 16. For larger kernels use :ocv:func:`gpu::convolve`.
:param anchor:Anchor point. The default value Point(-1, -1) means that the anchor is at the kernel center.
..note:: This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
:param borderType:Pixel extrapolation method. For details, see :ocv:func:`borderInterpolate` .
..seealso:::ocv:func:`createLinearFilter`
@ -393,9 +391,9 @@ gpu::filter2D
-----------------
Applies the non-separable 2D linear filter to an image.
..ocv:function:: void gpu::filter2D(const GpuMat& src, GpuMat& dst, int ddepth, const Mat& kernel, Point anchor=Point(-1,-1), Stream& stream = Stream::Null())
..ocv:function:: void gpu::filter2D(const GpuMat& src, GpuMat& dst, int ddepth, const Mat& kernel, Point anchor=Point(-1,-1), int borderType = BORDER_DEFAULT, Stream& stream = Stream::Null())
:param src:Source image. ``CV_8UC1`` , ``CV_8UC4`` and ``CV_32FC1`` source types are supported.
:param src:Source image. Supports ``CV_8U`` , ``CV_16U`` and ``CV_32F`` one and four channel image.
:param dst:Destination image. The size and the number of channels is the same as ``src`` .
@ -405,9 +403,9 @@ Applies the non-separable 2D linear filter to an image.
:param anchor:Anchor of the kernel that indicates the relative position of a filtered point within the kernel. The anchor resides within the kernel. The special default value (-1,-1) means that the anchor is at the kernel center.
:param stream:Stream for the asynchronous version.
:param borderType:Pixel extrapolation method. For details, see :ocv:func:`borderInterpolate` .
..note:: This filter does not check out-of-border accesses, so only a proper sub-matrix of a bigger matrix has to be passed to it.
:param stream:Stream for the asynchronous version.
You can use field `user_block_size` to set specific block size for :ocv:func:`gpu::convolve` function. If you leave its default value `Size(0,0)` then automatic estimation of block size will be used (which is optimized for speed). By varying `user_block_size` you can reduce memory requirements at the cost of speed.
gpu::ConvolveBuf::create
@ -283,7 +283,7 @@ Computes a convolution (or cross-correlation) of two images.
:param ccorr:Flags to evaluate cross-correlation instead of convolution.
:param buf:Optional buffer to avoid extra memory allocations and to adjust some specific parameters. See :ocv:class:`gpu::ConvolveBuf`.
:param stream:Stream for the asynchronous version.
..seealso:::ocv:func:`gpu::filter2D`
@ -320,9 +320,9 @@ Computes a proximity map for a raster template and an image where the template i
: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*.
:param method:Specifies the way to compare the template with the image.
:param buf:Optional buffer to avoid extra memory allocations and to adjust some specific parameters. See :ocv:class:`gpu::MatchTemplateBuf`.
:param stream:Stream for the asynchronous version.
The following methods are supported for the ``CV_8U`` depth images for now:
@ -355,7 +355,7 @@ Applies a generic geometrical transformation to an image.
:param xmap:X values. Only ``CV_32FC1`` type is supported.
:param ymap:Y values. Only ``CV_32FC1`` type is supported.
:param interpolation:Interpolation method (see :ocv:func:`resize` ). ``INTER_NEAREST`` , ``INTER_LINEAR`` and ``INTER_CUBIC`` are supported for now.
:param borderMode:Pixel extrapolation method (see :ocv:func:`borderInterpolate` ). ``BORDER_REFLECT101`` , ``BORDER_REPLICATE`` , ``BORDER_CONSTANT`` , ``BORDER_REFLECT`` and ``BORDER_WRAP`` are supported for now.
@ -495,6 +495,28 @@ Applies an affine transformation to an image.
gpu::buildWarpAffineMaps
------------------------
Builds transformation maps for affine transformation.
Rotates an image around the origin (0,0) and then shifts it.
@ -562,7 +606,7 @@ Forms a border around an image.
:param 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.
:param borderType:Border type. See :ocv:func:`borderInterpolate` for details. ``BORDER_REFLECT101`` , ``BORDER_REPLICATE`` , ``BORDER_CONSTANT`` , ``BORDER_REFLECT`` and ``BORDER_WRAP`` are supported for now.
:param value:Border value.
:param stream:Stream for the asynchronous version.
@ -796,17 +840,17 @@ Composites two images using alpha opacity values contained in each image.
:param alpha_op:Flag specifying the alpha-blending operation:
* **ALPHA_OVER**
* **ALPHA_IN**
* **ALPHA_OUT**
* **ALPHA_ATOP**
* **ALPHA_XOR**
* **ALPHA_PLUS**
* **ALPHA_OVER_PREMUL**
* **ALPHA_IN_PREMUL**
* **ALPHA_OUT_PREMUL**
* **ALPHA_ATOP_PREMUL**
* **ALPHA_XOR_PREMUL**
* **ALPHA_PLUS_PREMUL**
* **ALPHA_IN**
* **ALPHA_OUT**
* **ALPHA_ATOP**
* **ALPHA_XOR**
* **ALPHA_PLUS**
* **ALPHA_OVER_PREMUL**
* **ALPHA_IN_PREMUL**
* **ALPHA_OUT_PREMUL**
* **ALPHA_ATOP_PREMUL**
* **ALPHA_XOR_PREMUL**
* **ALPHA_PLUS_PREMUL**
* **ALPHA_PREMUL**
:param stream:Stream for the asynchronous version.
:param stream:Stream for the asynchronous version.
The function performs generalized matrix multiplication similar to the ``gemm`` functions in BLAS level 3. For example, ``gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)`` corresponds to
:param minDistance:Minimum possible Euclidean distance between the returned corners.
:param blockSize:Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See :ocv:func:`cornerEigenValsAndVecs` .
:param useHarrisDetector:Parameter indicating whether to use a Harris detector (see :ocv:func:`gpu::cornerHarris`) or :ocv:func:`gpu::cornerMinEigenVal`.
:param harrisK:Free parameter of the Harris detector.
@ -202,6 +202,7 @@ Class used for calculating an optical flow. ::
double derivLambda;
bool useInitialFlow;
float minEigThreshold;
bool getMinEigenVals;
void releaseMemory();
};
@ -228,7 +229,7 @@ Calculate an optical flow for a sparse feature set.
:param status:Output status vector (CV_8UC1 type). Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
:param err:Output vector (CV_32FC1 type) that contains min eigen value. It can be NULL, if not needed.
:param err:Output vector (CV_32FC1 type) that contains the difference between patches around the original and moved points or min eigen value if ``getMinEigenVals`` is checked. It can be NULL, if not needed.
:param nextImg:Second input image of the same size and the same type as ``prevImg`` .
:param u:Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
:param u:Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
:param v:Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
:param v:Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
:param err:Output vector (CV_32FC1 type) that contains min eigen value. It can be NULL, if not needed.
:param err:Output vector (CV_32FC1 type) that contains the difference between patches around the original and moved points or min eigen value if ``getMinEigenVals`` is checked. It can be NULL, if not needed.