Skip to content

Commit a334100

Browse files
author
Vladislav Vinogradov
committed
updated documentation
1 parent 8461cb3 commit a334100

File tree

5 files changed

+337
-347
lines changed

5 files changed

+337
-347
lines changed

modules/gpuarithm/doc/arithm.rst

+32-73
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Arithm Operations on Matrices
66

77

88
gpu::gemm
9-
------------------
9+
---------
1010
Performs generalized matrix multiplication.
1111

12-
.. 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())
12+
.. ocv:function:: void gpu::gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags = 0, Stream& stream = Stream::Null())
1313
1414
:param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type.
1515

@@ -44,56 +44,58 @@ The function performs generalized matrix multiplication similar to the ``gemm``
4444

4545

4646
gpu::mulSpectrums
47-
---------------------
47+
-----------------
4848
Performs a per-element multiplication of two Fourier spectrums.
4949

50-
.. ocv:function:: void gpu::mulSpectrums( const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, bool conjB=false, Stream& stream=Stream::Null() )
50+
.. ocv:function:: void gpu::mulSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, bool conjB=false, Stream& stream = Stream::Null())
5151
52-
:param a: First spectrum.
52+
:param src1: First spectrum.
5353

54-
:param b: Second spectrum with the same size and type as ``a`` .
54+
:param src2: Second spectrum with the same size and type as ``a`` .
5555

56-
:param c: Destination spectrum.
56+
:param dst: Destination spectrum.
5757

5858
:param flags: Mock parameter used for CPU/GPU interfaces similarity.
5959

6060
:param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication.
6161

62-
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
62+
:param stream: Stream for the asynchronous version.
63+
64+
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
6365

6466
.. seealso:: :ocv:func:`mulSpectrums`
6567

6668

6769

6870
gpu::mulAndScaleSpectrums
69-
-----------------------------
71+
-------------------------
7072
Performs a per-element multiplication of two Fourier spectrums and scales the result.
7173

72-
.. ocv:function:: void gpu::mulAndScaleSpectrums( const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, float scale, bool conjB=false, Stream& stream=Stream::Null() )
74+
.. ocv:function:: void gpu::mulAndScaleSpectrums(InputArray src1, InputArray src2, OutputArray dst, int flags, float scale, bool conjB=false, Stream& stream = Stream::Null())
7375
74-
:param a: First spectrum.
76+
:param src1: First spectrum.
7577

76-
:param b: Second spectrum with the same size and type as ``a`` .
78+
:param src2: Second spectrum with the same size and type as ``a`` .
7779

78-
:param c: Destination spectrum.
80+
:param dst: Destination spectrum.
7981

8082
:param flags: Mock parameter used for CPU/GPU interfaces similarity.
8183

8284
:param scale: Scale constant.
8385

8486
:param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication.
8587

86-
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
88+
Only full (not packed) ``CV_32FC2`` complex spectrums in the interleaved format are supported for now.
8789

8890
.. seealso:: :ocv:func:`mulSpectrums`
8991

9092

9193

9294
gpu::dft
93-
------------
95+
--------
9496
Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix.
9597

96-
.. ocv:function:: void gpu::dft( const GpuMat& src, GpuMat& dst, Size dft_size, int flags=0, Stream& stream=Stream::Null() )
98+
.. ocv:function:: void gpu::dft(InputArray src, OutputArray dst, Size dft_size, int flags=0, Stream& stream = Stream::Null())
9799
98100
:param src: Source matrix (real or complex).
99101

@@ -125,46 +127,25 @@ The source matrix should be continuous, otherwise reallocation and data copying
125127

126128

127129

128-
gpu::ConvolveBuf
130+
gpu::Convolution
129131
----------------
130-
.. ocv:struct:: gpu::ConvolveBuf
132+
.. ocv:class:: gpu::Convolution : public Algorithm
131133
132-
Class providing a memory buffer for :ocv:func:`gpu::convolve` function, plus it allows to adjust some specific parameters. ::
134+
Base class for convolution (or cross-correlation) operator. ::
133135

134-
struct CV_EXPORTS ConvolveBuf
136+
class CV_EXPORTS Convolution : public Algorithm
135137
{
136-
Size result_size;
137-
Size block_size;
138-
Size user_block_size;
139-
Size dft_size;
140-
int spect_len;
141-
142-
GpuMat image_spect, templ_spect, result_spect;
143-
GpuMat image_block, templ_block, result_data;
144-
145-
void create(Size image_size, Size templ_size);
146-
static Size estimateBlockSize(Size result_size, Size templ_size);
138+
public:
139+
virtual void convolve(InputArray image, InputArray templ, OutputArray result, bool ccorr = false, Stream& stream = Stream::Null()) = 0;
147140
};
148141

149-
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.
150-
151-
152142

153-
gpu::ConvolveBuf::create
154-
------------------------
155-
.. ocv:function:: gpu::ConvolveBuf::create(Size image_size, Size templ_size)
156143

157-
Constructs a buffer for :ocv:func:`gpu::convolve` function with respective arguments.
158-
159-
160-
161-
gpu::convolve
162-
-----------------
144+
gpu::Convolution::convolve
145+
---------------------------
163146
Computes a convolution (or cross-correlation) of two images.
164147

165-
.. ocv:function:: void gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr=false)
166-
167-
.. ocv:function:: void gpu::convolve( const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr, ConvolveBuf& buf, Stream& stream=Stream::Null() )
148+
.. ocv:function:: void gpu::Convolution::convolve(InputArray image, InputArray templ, OutputArray result, bool ccorr = false, Stream& stream = Stream::Null())
168149
169150
:param image: Source image. Only ``CV_32FC1`` images are supported for now.
170151

@@ -174,38 +155,16 @@ Computes a convolution (or cross-correlation) of two images.
174155

175156
:param ccorr: Flags to evaluate cross-correlation instead of convolution.
176157

177-
:param buf: Optional buffer to avoid extra memory allocations and to adjust some specific parameters. See :ocv:struct:`gpu::ConvolveBuf`.
178-
179158
:param stream: Stream for the asynchronous version.
180159

181160
.. seealso:: :ocv:func:`gpu::filter2D`
182161

183162

184163

185-
gpu::integral
186-
-----------------
187-
Computes an integral image.
188-
189-
.. ocv:function:: void gpu::integral(const GpuMat& src, GpuMat& sum, Stream& stream = Stream::Null())
190-
191-
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
192-
193-
:param sum: Integral image containing 32-bit unsigned integer values packed into ``CV_32SC1`` .
194-
195-
:param stream: Stream for the asynchronous version.
196-
197-
.. seealso:: :ocv:func:`integral`
164+
gpu::createConvolution
165+
----------------------
166+
Creates implementation for :ocv:class:`gpu::Convolution` .
198167

168+
.. ocv:function:: Ptr<Convolution> createConvolution(Size user_block_size = Size())
199169
200-
201-
gpu::sqrIntegral
202-
--------------------
203-
Computes a squared integral image.
204-
205-
.. ocv:function:: void gpu::sqrIntegral(const GpuMat& src, GpuMat& sqsum, Stream& stream = Stream::Null())
206-
207-
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
208-
209-
:param sqsum: Squared integral image containing 64-bit unsigned integer values packed into ``CV_64FC1`` .
210-
211-
:param stream: Stream for the asynchronous version.
170+
: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.

modules/gpuarithm/doc/core.rst

+69-47
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Core Operations on Matrices
66

77

88
gpu::merge
9-
--------------
9+
----------
1010
Makes a multi-channel matrix out of several single-channel matrices.
1111

12-
.. ocv:function:: void gpu::merge(const GpuMat* src, size_t n, GpuMat& dst, Stream& stream = Stream::Null())
12+
.. ocv:function:: void gpu::merge(const GpuMat* src, size_t n, OutputArray dst, Stream& stream = Stream::Null())
1313
14-
.. ocv:function:: void gpu::merge(const vector<GpuMat>& src, GpuMat& dst, Stream& stream = Stream::Null())
14+
.. ocv:function:: void gpu::merge(const std::vector<GpuMat>& src, OutputArray dst, Stream& stream = Stream::Null())
1515
1616
:param src: Array/vector of source matrices.
1717

@@ -26,12 +26,12 @@ Makes a multi-channel matrix out of several single-channel matrices.
2626

2727

2828
gpu::split
29-
--------------
29+
----------
3030
Copies each plane of a multi-channel matrix into an array.
3131

32-
.. ocv:function:: void gpu::split(const GpuMat& src, GpuMat* dst, Stream& stream = Stream::Null())
32+
.. ocv:function:: void gpu::split(InputArray src, GpuMat* dst, Stream& stream = Stream::Null())
3333
34-
.. ocv:function:: void gpu::split(const GpuMat& src, vector<GpuMat>& dst, Stream& stream = Stream::Null())
34+
.. ocv:function:: void gpu::split(InputArray src, vector<GpuMat>& dst, Stream& stream = Stream::Null())
3535
3636
:param src: Source matrix.
3737

@@ -43,86 +43,108 @@ Copies each plane of a multi-channel matrix into an array.
4343

4444

4545

46-
gpu::copyMakeBorder
47-
-----------------------
48-
Forms a border around an image.
46+
gpu::transpose
47+
--------------
48+
Transposes a matrix.
4949

50-
.. 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())
50+
.. ocv:function:: void gpu::transpose(InputArray src1, OutputArray dst, Stream& stream = Stream::Null())
5151
52-
:param src: Source image. ``CV_8UC1`` , ``CV_8UC4`` , ``CV_32SC1`` , and ``CV_32FC1`` types are supported.
52+
:param src1: Source matrix. 1-, 4-, 8-byte element sizes are supported for now.
5353

54-
:param dst: Destination image with the same type as ``src``. The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
54+
:param dst: Destination matrix.
5555

56-
:param top:
56+
:param stream: Stream for the asynchronous version.
5757

58-
:param bottom:
58+
.. seealso:: :ocv:func:`transpose`
5959

60-
:param left:
6160

62-
: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.
6361

64-
: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.
62+
gpu::flip
63+
---------
64+
Flips a 2D matrix around vertical, horizontal, or both axes.
6565

66-
:param value: Border value.
66+
.. ocv:function:: void gpu::flip(InputArray src, OutputArray dst, int flipCode, Stream& stream = Stream::Null())
6767
68-
:param stream: Stream for the asynchronous version.
68+
:param src: Source matrix. Supports 1, 3 and 4 channels images with ``CV_8U``, ``CV_16U``, ``CV_32S`` or ``CV_32F`` depth.
6969

70-
.. seealso:: :ocv:func:`copyMakeBorder`
70+
:param dst: Destination matrix.
7171

72+
:param flipCode: Flip mode for the source:
7273

74+
* ``0`` Flips around x-axis.
7375

74-
gpu::transpose
75-
------------------
76-
Transposes a matrix.
76+
* ``> 0`` Flips around y-axis.
7777

78-
.. ocv:function:: void gpu::transpose( const GpuMat& src1, GpuMat& dst, Stream& stream=Stream::Null() )
78+
* ``< 0`` Flips around both axes.
7979

80-
:param src1: Source matrix. 1-, 4-, 8-byte element sizes are supported for now (CV_8UC1, CV_8UC4, CV_16UC2, CV_32FC1, etc).
80+
:param stream: Stream for the asynchronous version.
8181

82-
:param dst: Destination matrix.
82+
.. seealso:: :ocv:func:`flip`
8383

84-
:param stream: Stream for the asynchronous version.
8584

86-
.. seealso:: :ocv:func:`transpose`
8785

86+
gpu::LookUpTable
87+
----------------
88+
.. ocv:class:: gpu::LookUpTable : public Algorithm
8889
90+
Base class for transform using lookup table. ::
8991

90-
gpu::flip
91-
-------------
92-
Flips a 2D matrix around vertical, horizontal, or both axes.
92+
class CV_EXPORTS LookUpTable : public Algorithm
93+
{
94+
public:
95+
virtual void transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null()) = 0;
96+
};
9397

94-
.. ocv:function:: void gpu::flip( const GpuMat& a, GpuMat& b, int flipCode, Stream& stream=Stream::Null() )
98+
.. seealso:: :ocv:func:`LUT`
9599

96-
:param a: Source matrix. Supports 1, 3 and 4 channels images with ``CV_8U``, ``CV_16U``, ``CV_32S`` or ``CV_32F`` depth.
97100

98-
:param b: Destination matrix.
99101

100-
:param flipCode: Flip mode for the source:
102+
gpu::LookUpTable::transform
103+
---------------------------
104+
Transforms the source matrix into the destination matrix using the given look-up table: ``dst(I) = lut(src(I))`` .
101105

102-
* ``0`` Flips around x-axis.
106+
.. ocv:function:: void gpu::LookUpTable::transform(InputArray src, OutputArray dst, Stream& stream = Stream::Null())
103107
104-
* ``>0`` Flips around y-axis.
108+
:param src: Source matrix. ``CV_8UC1`` and ``CV_8UC3`` matrices are supported for now.
105109

106-
* ``<0`` Flips around both axes.
110+
:param dst: Destination matrix.
107111

108112
:param stream: Stream for the asynchronous version.
109113

110-
.. seealso:: :ocv:func:`flip`
111114

112115

116+
gpu::createLookUpTable
117+
----------------------
118+
Creates implementation for :ocv:class:`gpu::LookUpTable` .
113119

114-
gpu::LUT
115-
------------
116-
Transforms the source matrix into the destination matrix using the given look-up table: ``dst(I) = lut(src(I))``
120+
.. ocv:function:: Ptr<LookUpTable> createLookUpTable(InputArray lut)
117121
118-
.. ocv:function:: void gpu::LUT(const GpuMat& src, const Mat& lut, GpuMat& dst, Stream& stream = Stream::Null())
122+
:param lut: Look-up table of 256 elements. It is a continuous ``CV_8U`` matrix.
119123

120-
:param src: Source matrix. ``CV_8UC1`` and ``CV_8UC3`` matrices are supported for now.
121124

122-
:param lut: Look-up table of 256 elements. It is a continuous ``CV_8U`` matrix.
123125

124-
:param dst: Destination matrix with the same depth as ``lut`` and the same number of channels as ``src`` .
126+
gpu::copyMakeBorder
127+
-----------------------
128+
Forms a border around an image.
129+
130+
.. 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())
131+
132+
:param src: Source image. ``CV_8UC1`` , ``CV_8UC4`` , ``CV_32SC1`` , and ``CV_32FC1`` types are supported.
133+
134+
:param dst: Destination image with the same type as ``src``. The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
135+
136+
:param top:
137+
138+
:param bottom:
139+
140+
:param left:
141+
142+
: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.
143+
144+
: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.
145+
146+
:param value: Border value.
125147

126148
:param stream: Stream for the asynchronous version.
127149

128-
.. seealso:: :ocv:func:`LUT`
150+
.. seealso:: :ocv:func:`copyMakeBorder`

0 commit comments

Comments
 (0)