Commit a3341006 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

updated documentation

parent 8461cb3f
...@@ -6,10 +6,10 @@ Arithm Operations on Matrices ...@@ -6,10 +6,10 @@ Arithm Operations on Matrices
gpu::gemm gpu::gemm
------------------ ---------
Performs generalized matrix multiplication. Performs generalized matrix multiplication.
.. ocv:function:: void gpu::gemm(const GpuMat& src1, const GpuMat& src2, double alpha, const GpuMat& src3, double beta, GpuMat& dst, int flags = 0, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags = 0, Stream& stream = Stream::Null())
:param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type. :param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type.
...@@ -44,38 +44,40 @@ The function performs generalized matrix multiplication similar to the ``gemm`` ...@@ -44,38 +44,40 @@ The function performs generalized matrix multiplication similar to the ``gemm``
gpu::mulSpectrums gpu::mulSpectrums
--------------------- -----------------
Performs a per-element multiplication of two Fourier spectrums. Performs a per-element multiplication of two Fourier spectrums.
.. ocv:function:: void gpu::mulSpectrums( const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, bool conjB=false, Stream& stream=Stream::Null() ) .. ocv:function:: void gpu::mulSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, bool conjB=false, Stream& stream = Stream::Null())
:param a: First spectrum. :param src1: First spectrum.
:param b: Second spectrum with the same size and type as ``a`` . :param src2: Second spectrum with the same size and type as ``a`` .
:param c: Destination spectrum. :param dst: Destination spectrum.
:param flags: Mock parameter used for CPU/GPU interfaces similarity. :param flags: Mock parameter used for CPU/GPU interfaces similarity.
:param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication. :param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication.
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now. :param stream: Stream for the asynchronous version.
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
.. seealso:: :ocv:func:`mulSpectrums` .. seealso:: :ocv:func:`mulSpectrums`
gpu::mulAndScaleSpectrums gpu::mulAndScaleSpectrums
----------------------------- -------------------------
Performs a per-element multiplication of two Fourier spectrums and scales the result. Performs a per-element multiplication of two Fourier spectrums and scales the result.
.. ocv:function:: void gpu::mulAndScaleSpectrums( const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, float scale, bool conjB=false, Stream& stream=Stream::Null() ) .. ocv:function:: void gpu::mulAndScaleSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, float scale, bool conjB=false, Stream& stream = Stream::Null())
:param a: First spectrum. :param src1: First spectrum.
:param b: Second spectrum with the same size and type as ``a`` . :param src2: Second spectrum with the same size and type as ``a`` .
:param c: Destination spectrum. :param dst: Destination spectrum.
:param flags: Mock parameter used for CPU/GPU interfaces similarity. :param flags: Mock parameter used for CPU/GPU interfaces similarity.
...@@ -83,17 +85,17 @@ Performs a per-element multiplication of two Fourier spectrums and scales the re ...@@ -83,17 +85,17 @@ Performs a per-element multiplication of two Fourier spectrums and scales the re
:param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication. :param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication.
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now. Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
.. seealso:: :ocv:func:`mulSpectrums` .. seealso:: :ocv:func:`mulSpectrums`
gpu::dft gpu::dft
------------ --------
Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix. Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix.
.. ocv:function:: void gpu::dft( const GpuMat& src, GpuMat& dst, Size dft_size, int flags=0, Stream& stream=Stream::Null() ) .. ocv:function:: void gpu::dft(InputArray src, OutputArray dst, Size dft_size, int flags=0, Stream& stream = Stream::Null())
:param src: Source matrix (real or complex). :param src: Source matrix (real or complex).
...@@ -125,46 +127,25 @@ The source matrix should be continuous, otherwise reallocation and data copying ...@@ -125,46 +127,25 @@ The source matrix should be continuous, otherwise reallocation and data copying
gpu::ConvolveBuf gpu::Convolution
---------------- ----------------
.. ocv:struct:: gpu::ConvolveBuf .. ocv:class:: gpu::Convolution : public Algorithm
Class providing a memory buffer for :ocv:func:`gpu::convolve` function, plus it allows to adjust some specific parameters. :: Base class for convolution (or cross-correlation) operator. ::
struct CV_EXPORTS ConvolveBuf class CV_EXPORTS Convolution : public Algorithm
{ {
Size result_size; public:
Size block_size; virtual void convolve(InputArray image, InputArray templ, OutputArray result, bool ccorr = false, Stream& stream = Stream::Null()) = 0;
Size user_block_size;
Size dft_size;
int spect_len;
GpuMat image_spect, templ_spect, result_spect;
GpuMat image_block, templ_block, result_data;
void create(Size image_size, Size templ_size);
static Size estimateBlockSize(Size result_size, Size templ_size);
}; };
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
------------------------
.. ocv:function:: gpu::ConvolveBuf::create(Size image_size, Size templ_size)
Constructs a buffer for :ocv:func:`gpu::convolve` function with respective arguments. gpu::Convolution::convolve
---------------------------
gpu::convolve
-----------------
Computes a convolution (or cross-correlation) of two images. Computes a convolution (or cross-correlation) of two images.
.. ocv:function:: void gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr=false) .. ocv:function:: void gpu::Convolution::convolve(InputArray image, InputArray templ, OutputArray result, bool ccorr = false, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::convolve( const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr, ConvolveBuf& buf, Stream& stream=Stream::Null() )
:param image: Source image. Only ``CV_32FC1`` images are supported for now. :param image: Source image. Only ``CV_32FC1`` images are supported for now.
...@@ -174,38 +155,16 @@ Computes a convolution (or cross-correlation) of two images. ...@@ -174,38 +155,16 @@ Computes a convolution (or cross-correlation) of two images.
:param ccorr: Flags to evaluate cross-correlation instead of convolution. :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:struct:`gpu::ConvolveBuf`.
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`gpu::filter2D` .. seealso:: :ocv:func:`gpu::filter2D`
gpu::integral gpu::createConvolution
----------------- ----------------------
Computes an integral image. Creates implementation for :ocv:class:`gpu::Convolution` .
.. ocv:function:: void gpu::integral(const GpuMat& src, GpuMat& sum, Stream& stream = Stream::Null())
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
:param sum: Integral image containing 32-bit unsigned integer values packed into ``CV_32SC1`` .
:param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`integral`
.. ocv:function:: Ptr<Convolution> createConvolution(Size user_block_size = Size())
:param user_block_size: Block size. If you leave 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::sqrIntegral
--------------------
Computes a squared integral image.
.. ocv:function:: void gpu::sqrIntegral(const GpuMat& src, GpuMat& sqsum, Stream& stream = Stream::Null())
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
:param sqsum: Squared integral image containing 64-bit unsigned integer values packed into ``CV_64FC1`` .
:param stream: Stream for the asynchronous version.
...@@ -6,12 +6,12 @@ Core Operations on Matrices ...@@ -6,12 +6,12 @@ Core Operations on Matrices
gpu::merge gpu::merge
-------------- ----------
Makes a multi-channel matrix out of several single-channel matrices. Makes a multi-channel matrix out of several single-channel matrices.
.. ocv:function:: void gpu::merge(const GpuMat* src, size_t n, GpuMat& dst, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::merge(const GpuMat* src, size_t n, OutputArray dst, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::merge(const vector<GpuMat>& src, GpuMat& dst, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::merge(const std::vector<GpuMat>& src, OutputArray dst, Stream& stream = Stream::Null())
:param src: Array/vector of source matrices. :param src: Array/vector of source matrices.
...@@ -26,12 +26,12 @@ Makes a multi-channel matrix out of several single-channel matrices. ...@@ -26,12 +26,12 @@ Makes a multi-channel matrix out of several single-channel matrices.
gpu::split gpu::split
-------------- ----------
Copies each plane of a multi-channel matrix into an array. Copies each plane of a multi-channel matrix into an array.
.. ocv:function:: void gpu::split(const GpuMat& src, GpuMat* dst, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::split(InputArray src, GpuMat* dst, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::split(const GpuMat& src, vector<GpuMat>& dst, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::split(InputArray src, vector<GpuMat>& dst, Stream& stream = Stream::Null())
:param src: Source matrix. :param src: Source matrix.
...@@ -43,86 +43,108 @@ Copies each plane of a multi-channel matrix into an array. ...@@ -43,86 +43,108 @@ Copies each plane of a multi-channel matrix into an array.
gpu::copyMakeBorder gpu::transpose
----------------------- --------------
Forms a border around an image. Transposes a matrix.
.. ocv:function:: void gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom, int left, int right, int borderType, const Scalar& value = Scalar(), Stream& stream = Stream::Null()) .. ocv:function:: void gpu::transpose(InputArray src1, OutputArray dst, Stream& stream = Stream::Null())
:param src: Source image. ``CV_8UC1`` , ``CV_8UC4`` , ``CV_32SC1`` , and ``CV_32FC1`` types are supported. :param src1: Source matrix. 1-, 4-, 8-byte element sizes are supported for now.
:param dst: Destination image with the same type as ``src``. The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` . :param dst: Destination matrix.
:param top: :param stream: Stream for the asynchronous version.
:param bottom: .. seealso:: :ocv:func:`transpose`
:param left:
: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. gpu::flip
---------
Flips a 2D matrix around vertical, horizontal, or both axes.
:param value: Border value. .. ocv:function:: void gpu::flip(InputArray src, OutputArray dst, int flipCode, Stream& stream = Stream::Null())
:param stream: Stream for the asynchronous version. :param src: Source matrix. Supports 1, 3 and 4 channels images with ``CV_8U``, ``CV_16U``, ``CV_32S`` or ``CV_32F`` depth.
.. seealso:: :ocv:func:`copyMakeBorder` :param dst: Destination matrix.
:param flipCode: Flip mode for the source:
* ``0`` Flips around x-axis.
gpu::transpose * ``> 0`` Flips around y-axis.
------------------
Transposes a matrix.
.. ocv:function:: void gpu::transpose( const GpuMat& src1, GpuMat& dst, Stream& stream=Stream::Null() ) * ``< 0`` Flips around both axes.
:param src1: Source matrix. 1-, 4-, 8-byte element sizes are supported for now (CV_8UC1, CV_8UC4, CV_16UC2, CV_32FC1, etc). :param stream: Stream for the asynchronous version.
:param dst: Destination matrix. .. seealso:: :ocv:func:`flip`
:param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`transpose`
gpu::LookUpTable
----------------
.. ocv:class:: gpu::LookUpTable : public Algorithm
Base class for transform using lookup table. ::
gpu::flip class CV_EXPORTS LookUpTable : public Algorithm
------------- {
Flips a 2D matrix around vertical, horizontal, or both axes. public:
virtual void transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null()) = 0;
};
.. ocv:function:: void gpu::flip( const GpuMat& a, GpuMat& b, int flipCode, Stream& stream=Stream::Null() ) .. seealso:: :ocv:func:`LUT`
:param a: Source matrix. Supports 1, 3 and 4 channels images with ``CV_8U``, ``CV_16U``, ``CV_32S`` or ``CV_32F`` depth.
:param b: Destination matrix.
:param flipCode: Flip mode for the source: gpu::LookUpTable::transform
---------------------------
Transforms the source matrix into the destination matrix using the given look-up table: ``dst(I) = lut(src(I))`` .
* ``0`` Flips around x-axis. .. ocv:function:: void gpu::LookUpTable::transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null())
* ``>0`` Flips around y-axis. :param src: Source matrix. ``CV_8UC1`` and ``CV_8UC3`` matrices are supported for now.
* ``<0`` Flips around both axes. :param dst: Destination matrix.
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`flip`
gpu::createLookUpTable
----------------------
Creates implementation for :ocv:class:`gpu::LookUpTable` .
gpu::LUT .. ocv:function:: Ptr<LookUpTable> createLookUpTable(InputArray lut)
------------
Transforms the source matrix into the destination matrix using the given look-up table: ``dst(I) = lut(src(I))``
.. ocv:function:: void gpu::LUT(const GpuMat& src, const Mat& lut, GpuMat& dst, Stream& stream = Stream::Null()) :param lut: Look-up table of 256 elements. It is a continuous ``CV_8U`` matrix.
:param src: Source matrix. ``CV_8UC1`` and ``CV_8UC3`` matrices are supported for now.
:param lut: Look-up table of 256 elements. It is a continuous ``CV_8U`` matrix.
:param dst: Destination matrix with the same depth as ``lut`` and the same number of channels as ``src`` . gpu::copyMakeBorder
-----------------------
Forms a border around an image.
.. ocv:function:: void gpu::copyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, Scalar value = Scalar(), Stream& stream = Stream::Null())
:param src: Source image. ``CV_8UC1`` , ``CV_8UC4`` , ``CV_32SC1`` , and ``CV_32FC1`` types are supported.
:param dst: Destination image with the same type as ``src``. The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
:param top:
:param bottom:
:param left:
: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. :param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`LUT` .. seealso:: :ocv:func:`copyMakeBorder`
This diff is collapsed.
...@@ -381,7 +381,7 @@ Creates a non-separable linear filter. ...@@ -381,7 +381,7 @@ Creates a non-separable linear filter.
:param dstType: Output image type. The same type as ``src`` is supported. :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. 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:class:`gpu::Convolution`.
:param anchor: Anchor point. The default value Point(-1, -1) means that the anchor is at the kernel center. :param anchor: Anchor point. The default value Point(-1, -1) means that the anchor is at the kernel center.
...@@ -411,7 +411,7 @@ Applies the non-separable 2D linear filter to an image. ...@@ -411,7 +411,7 @@ Applies the non-separable 2D linear filter to an image.
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`filter2D`, :ocv:func:`gpu::convolve` .. seealso:: :ocv:func:`filter2D`, :ocv:class:`gpu::Convolution`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment