2011-02-22 21:43:26 +01:00
Image Processing
================
.. highlight :: cpp
.. index :: gpu::meanShiftFiltering
2011-03-23 11:56:20 +01:00
gpu::meanShiftFiltering
2011-02-22 21:43:26 +01:00
---------------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::meanShiftFiltering(const GpuMat& src, GpuMat& dst, int sp, int sr,TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1))
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
Performs mean-shift filtering for each point of the source image. It maps each point of the source image into another point. As a result, you have a new color and new position of each point.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC4`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image containing the color of mapped points. It has the same size and type as ``src`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param sp: Spatial window radius.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param sr: Color window radius.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param criteria: Termination criteria. See :ocv:class:`TermCriteria`.
2011-03-23 11:56:20 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::meanShiftProc
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::meanShiftProc
2011-02-22 21:43:26 +01:00
----------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::meanShiftProc(const GpuMat& src, GpuMat& dstr, GpuMat& dstsp, int sp, int sr, TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1))
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Performs a mean-shift procedure and stores information about processed points (their colors and positions) in two images.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC4`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param dstr: Destination image containing the color of mapped points. The size and type is the same as ``src`` .
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dstsp: Destination image containing the position of mapped points. The size is the same as ``src`` size. The type is ``CV_16SC2``.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param sp: Spatial window radius.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param sr: Color window radius.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param criteria: Termination criteria. See :ocv:class:`TermCriteria`.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `gpu::meanShiftFiltering`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::meanShiftSegmentation
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::meanShiftSegmentation
2011-02-22 21:43:26 +01:00
------------------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::meanShiftSegmentation(const GpuMat& src, Mat& dst, int sp, int sr, int minsize, TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 5, 1))
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
Performs a mean-shift segmentation of the source image and eliminates small segments.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC4`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Segmented image with the same size and type as ``src`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param sp: Spatial window radius.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param sr: Color window radius.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param minsize: Minimum segment size. Smaller segements are merged.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param criteria: Termination criteria. See :ocv:class:`TermCriteria`.
2011-03-23 11:56:20 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::integral
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::integral
2011-02-22 21:43:26 +01:00
-----------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::integral(const GpuMat& src, GpuMat& sum)
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::integral(const GpuMat& src, GpuMat& sum, GpuMat& sqsum)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Computes an integral image and a squared integral image.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param sum: Integral image containing 32-bit unsigned integer values packed into ``CV_32SC1`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param sqsum: Squared integral image of the ``CV_32FC1`` type.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `integral`
2011-02-22 21:43:26 +01:00
.. index :: gpu::sqrIntegral
2011-03-23 11:56:20 +01:00
gpu::sqrIntegral
2011-02-22 21:43:26 +01:00
--------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::sqrIntegral(const GpuMat& src, GpuMat& sqsum)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Computes a squared integral image.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param sqsum: Squared integral image containing 64-bit unsigned integer values packed into ``CV_64FC1`` .
2011-02-22 21:43:26 +01:00
.. index :: gpu::columnSum
2011-03-23 11:56:20 +01:00
gpu::columnSum
2011-02-22 21:43:26 +01:00
------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::columnSum(const GpuMat& src, GpuMat& sum)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Computes a vertical (column) sum.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_32FC1`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param sum: Destination image of the ``CV_32FC1`` type.
2011-02-22 21:43:26 +01:00
.. index :: gpu::cornerHarris
2011-03-23 11:56:20 +01:00
gpu::cornerHarris
2011-02-22 21:43:26 +01:00
---------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::cornerHarris(const GpuMat& src, GpuMat& dst, int blockSize, int ksize, double k, int borderType=BORDER_REFLECT101)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Computes the Harris cornerness criteria at each image pixel.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC1`` and ``CV_32FC1`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-04-19 13:41:12 +02:00
:param dst: Destination image containing cornerness values. It has the same size as ``src`` and ``CV_32FC1`` type.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param blockSize: Neighborhood size.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param ksize: Aperture parameter for the Sobel operator.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param k: Harris detector free parameter.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
2011-02-26 12:05:10 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `cornerHarris`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::cornerMinEigenVal
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::cornerMinEigenVal
2011-02-22 21:43:26 +01:00
--------------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, int blockSize, int ksize, int borderType=BORDER_REFLECT101)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Computes the minimum eigen value of 2x2 derivative covariation matrix at each pixel (the cornerness criteria).
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC1`` and ``CV_32FC1`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param dst: Destination image containing cornerness values. The size is the same. The type is ``CV_32FC1``.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param blockSize: Neighborhood size.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param ksize: Aperture parameter for the Sobel operator.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param k: Harris detector free parameter.
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
:param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
2011-06-16 14:48:23 +02:00
See also: :ocv:func: `cornerMinEigenVal`
2011-03-23 11:56:20 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::mulSpectrums
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::mulSpectrums
2011-02-22 21:43:26 +01:00
---------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::mulSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, bool conjB=false)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Performs a per-element multiplication of two Fourier spectrums.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param a: First spectrum.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param b: Second spectrum with the same size and type as ``a`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param c: Destination spectrum.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param flags: Mock parameter used for CPU/GPU interfaces similarity.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
Only full (not packed) `` CV_32FC2 `` complex spectrums in the interleaved format are supported for now.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `mulSpectrums`
2011-02-26 12:05:10 +01:00
.. index :: gpu::mulAndScaleSpectrums
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::mulAndScaleSpectrums
2011-02-22 21:43:26 +01:00
-----------------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::mulAndScaleSpectrums(const GpuMat& a, const GpuMat& b, GpuMat& c, int flags, float scale, bool conjB=false)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Performs a per-element multiplication of two Fourier spectrums and scales the result.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param a: First spectrum.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param b: Second spectrum with the same size and type as ``a`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param c: Destination spectrum.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param flags: Mock parameter used for CPU/GPU interfaces similarity.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param scale: Scale constant.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param conjB: Optional flag to specify if the second spectrum needs to be conjugated before the multiplication.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
Only full (not packed) `` CV_32FC2 `` complex spectrums in the interleaved format are supported for now.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `mulSpectrums`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::dft
2011-03-23 11:56:20 +01:00
gpu::dft
2011-03-03 08:29:55 +01:00
------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::dft(const GpuMat& src, GpuMat& dst, Size dft_size, int flags=0)
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
Performs a forward or inverse discrete Fourier transform (1D or 2D) of the floating point matrix. Use to handle real matrices (`` CV32FC1 `` ) and complex matrices in the interleaved format (`` CV32FC2 `` ).
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param src: Source matrix (real or complex).
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param dst: Destination matrix (real or complex).
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
:param dft_size: Size of a discrete Fourier transform.
2011-02-22 21:43:26 +01:00
2011-02-28 22:26:43 +01:00
:param flags: Optional flags:
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
* **DFT_ROWS** Transform each individual row of the source matrix.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
* **DFT_SCALE** Scale the result: divide it by the number of elements in the transform (obtained from `` dft_size `` ).
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
* **DFT_INVERSE** Invert DFT. Use for complex-complex cases (real-complex and complex-real cases are always forward and inverse, respectively).
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
* **DFT_REAL_OUTPUT** Specify the output as real. The source matrix is the result of real-complex transform, so the destination matrix must be real.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
The source matrix should be continuous, otherwise reallocation and data copying is performed. The function chooses an operation mode depending on the flags, size, and channel count of the source matrix:
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
*
2011-04-01 00:07:17 +02:00
If the source matrix is complex and the output is not specified as real, the destination matrix is complex and has the `` dft_size `` size and `` CV_32FC2 `` type. The destination matrix contains a full result of the DFT (forward or inverse).
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
*
If the source matrix is complex and the output is specified as real, the function assumes that its input is the result of the forward transform (see next item). The destionation matrix has the `` dft_size `` size and `` CV_32FC1 `` type. It contains the result of the inverse DFT.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
*
If the source matrix is real (its type is `` CV_32FC1 `` ), forward DFT is performed. The result of the DFT is packed into complex ( `` CV_32FC2 `` ) matrix. So, the width of the destination matrix is `` dft_size.width / 2 + 1 `` . But if the source is a single column, the height is reduced instead of the width.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `dft`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::convolve
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::convolve
2011-02-22 21:43:26 +01:00
-----------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr=false)
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::convolve(const GpuMat& image, const GpuMat& templ, GpuMat& result, bool ccorr, ConvolveBuf& buf)
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
Computes a convolution (or cross-correlation) of two images.
2011-02-26 12:05:10 +01:00
2011-03-29 01:16:20 +02:00
:param image: Source image. Only ``CV_32FC1`` images are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param templ: Template image. The size is not greater than the ``image`` size. The type is the same as ``image`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param result: Result image. The size and type is the same as ``image`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param ccorr: Flags to evaluate cross-correlation instead of convolution.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes).
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
.. index :: gpu::ConvolveBuf
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
.. _gpu :: ConvolveBuf:
2011-02-22 21:43:26 +01:00
gpu::ConvolveBuf
----------------
2011-06-16 14:48:23 +02:00
.. ocv:class :: gpu::ConvolveBuf
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
This class provides a memory buffer for the
2011-06-16 14:48:23 +02:00
:ocv:func: `gpu::convolve` function.
2011-03-29 01:16:20 +02:00
::
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
struct CV_EXPORTS ConvolveBuf
2011-02-26 12:05:10 +01:00
{
ConvolveBuf() {}
ConvolveBuf(Size image_size, Size templ_size)
{ create(image_size, templ_size); }
void create(Size image_size, Size templ_size);
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
private:
// Hidden
};
2011-02-28 22:26:43 +01:00
2011-02-22 21:43:26 +01:00
.. index :: gpu::ConvolveBuf::ConvolveBuf
2011-03-23 11:56:20 +01:00
gpu::ConvolveBuf::ConvolveBuf
2011-02-22 21:43:26 +01:00
---------------------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: ConvolveBuf::ConvolveBuf()
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
Constructs an empty buffer that is properly resized after the first call of the
2011-06-16 14:48:23 +02:00
:ocv:func: `convolve` function.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: ConvolveBuf::ConvolveBuf(Size image_size, Size templ_size)
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
Constructs a buffer for the
2011-06-16 14:48:23 +02:00
:ocv:func: `convolve` function with respective arguments.
2011-03-23 11:56:20 +01:00
2011-02-22 21:43:26 +01:00
.. index :: gpu::matchTemplate
2011-03-23 11:56:20 +01:00
gpu::matchTemplate
2011-02-22 21:43:26 +01:00
----------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::matchTemplate(const GpuMat& image, const GpuMat& templ, GpuMat& result, int method)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Computes a proximity map for a raster template and an image where the template is searched for.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param image: Source image. ``CV_32F`` and ``CV_8U`` depth images (1..4 channels) are supported for now.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param templ: Template image with the size and type the same as ``image`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
: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*.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param method: Specifies the way to compare the template with the image.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
The following methods are supported for the `` CV_8U `` depth images for now:
2011-02-26 12:05:10 +01:00
2011-04-01 00:07:17 +02:00
* `` CV_TM_SQDIFF ``
* `` CV_TM_SQDIFF_NORMED ``
* `` CV_TM_CCORR ``
* `` CV_TM_CCORR_NORMED ``
* `` CV_TM_CCOEFF ``
* `` CV_TM_CCOEFF_NORMED ``
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
The following methods are supported for the `` CV_32F `` images for now:
2011-03-23 11:56:20 +01:00
2011-04-01 00:07:17 +02:00
* `` CV_TM_SQDIFF ``
* `` CV_TM_CCORR ``
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `matchTemplate`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::remap
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::remap
2011-02-22 21:43:26 +01:00
--------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const GpuMat& ymap)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Applies a generic geometrical transformation to an image.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only ``CV_8UC1`` and ``CV_8UC3`` source types are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image with the size the same as ``xmap`` and the type the same as ``src`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param xmap: X values. Only ``CV_32FC1`` type is supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param ymap: Y values. Only ``CV_32FC1`` type is supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
The function transforms the source image using the specified map:
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
.. math ::
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
\texttt{dst} (x,y) = \texttt{src} (xmap(x,y), ymap(x,y))
2011-03-23 11:56:20 +01:00
2011-04-01 00:07:17 +02:00
Values of pixels with non-integer coordinates are computed using bilinear the interpolation.
2011-03-23 11:56:20 +01:00
2011-06-16 14:48:23 +02:00
See Also: :ocv:func: `remap`
2011-02-22 21:43:26 +01:00
.. index :: gpu::cvtColor
2011-03-23 11:56:20 +01:00
gpu::cvtColor
2011-02-22 21:43:26 +01:00
-----------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn = 0)
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, const Stream& stream)
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
Converts an image from one color space to another.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image with ``CV_8U``, ``CV_16U``, or ``CV_32F`` depth and 1, 3, or 4 channels.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image with the same size and depth as ``src`` .
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param code: Color space conversion code. For details, see :ocv:func:`cvtColor` . Conversion to/from Luv and Bayer color spaces is not supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param dcn: Number of channels in the destination image. If the parameter is 0, the number of the channels is derived automatically from ``src`` and the ``code`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param stream: Stream for the asynchronous version.
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
3-channel color spaces (like `` HSV `` , `` XYZ `` , and so on) can be stored in a 4-channel image for better perfomance.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `cvtColor`
2011-02-22 21:43:26 +01:00
.. index :: gpu::threshold
2011-03-23 11:56:20 +01:00
gpu::threshold
2011-02-22 21:43:26 +01:00
------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: double gpu::threshold(const GpuMat& src, GpuMat& dst, double thresh, double maxval, int type)
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: double gpu::threshold(const GpuMat& src, GpuMat& dst, double thresh, double maxval, int type, const Stream& stream)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Applies a fixed-level threshold to each array element.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source array (single-channel). ``CV_64F`` depth is not supported.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination array with the same size and type as ``src`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param thresh: Threshold value.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param maxVal: Maximum value to use with ``THRESH_BINARY`` and ``THRESH_BINARY_INV`` threshold types.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param thresholdType: Threshold type. For details, see :ocv:func:`threshold` . The ``THRESH_OTSU`` threshold type is not supported.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param stream: Stream for the asynchronous version.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `threshold`
2011-02-22 21:43:26 +01:00
.. index :: gpu::resize
2011-03-23 11:56:20 +01:00
gpu::resize
2011-02-22 21:43:26 +01:00
---------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx=0, double fy=0, int interpolation = INTER_LINEAR)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Resizes an image.
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
:param src: Source image. ``CV_8UC1`` and ``CV_8UC4`` types are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
: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`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param dsize: Destination image size. If it is zero, it is computed as:
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. math ::
2011-03-29 01:16:20 +02:00
\texttt{dsize = Size(round(fx*src.cols), round(fy* src.rows))}
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Either `` dsize `` or both `` fx `` and `` fy `` must be non-zero.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param fx: Scale factor along the horizontal axis. If it is zero, it is computed as:
2011-02-22 21:43:26 +01:00
.. math ::
2011-02-26 12:05:10 +01:00
2011-03-29 01:16:20 +02:00
\texttt{(double)dsize.width/src.cols}
2011-02-26 12:05:10 +01:00
2011-03-29 01:16:20 +02:00
:param fy: Scale factor along the vertical axis. If it is zero, it is computed as:
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
.. math ::
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
\texttt{(double)dsize.height/src.rows}
2011-02-26 12:05:10 +01:00
2011-03-29 01:16:20 +02:00
:param interpolation: Interpolation method. Only ``INTER_NEAREST`` and ``INTER_LINEAR`` are supported.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
See Also: :ocv:func: `resize`
2011-02-26 12:05:10 +01:00
.. index :: gpu::warpAffine
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::warpAffine
2011-02-22 21:43:26 +01:00
-------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::warpAffine(const GpuMat& src, GpuMat& dst, const Mat& M, Size dsize, int flags = INTER_LINEAR)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Applies an affine transformation to an image.
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
:param src: Source image. ``CV_8U``, ``CV_16U``, ``CV_32S``, or ``CV_32F`` depth and 1, 3, or 4 channels are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image with the same type as ``src`` . The size is ``dsize`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param M: *2x3* transformation matrix.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param dsize: Size of the destination image.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param flags: Combination of interpolation methods (see :ocv:func:`resize`) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is an inverse transformation (``dst=>src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `warpAffine`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::warpPerspective
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::warpPerspective
2011-02-22 21:43:26 +01:00
------------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::warpPerspective(const GpuMat& src, GpuMat& dst, const Mat& M, Size dsize, int flags = INTER_LINEAR)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Applies a perspective transformation to an image.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Supports ``CV_8U``, ``CV_16U``, ``CV_32S``, or ``CV_32F`` depth and 1, 3, or 4 channels.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image with the same type as ``src`` . The size is ``dsize`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param M: *3x3* transformation matrix.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param dsize: Size of the destination image.
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
:param flags: Combination of interpolation methods (see :ocv:func:`resize` ) and the optional flag ``WARP_INVERSE_MAP`` specifying that ``M`` is the inverse transformation (``dst => src``). Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` interpolation methods are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `warpPerspective`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::rotate
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::rotate
2011-02-22 21:43:26 +01:00
---------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::rotate(const GpuMat& src, GpuMat& dst, Size dsize, double angle, double xShift = 0, double yShift = 0, int interpolation = INTER_LINEAR)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Rotates an image around the origin (0,0) and then shifts it.
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
:param src: Source image. ``CV_8UC1`` and ``CV_8UC4`` types are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image with the same type as ``src`` . The size is ``dsize`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param dsize: Size of the destination image.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param angle: Angle of rotation in degrees.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param xShift: Shift along the horizontal axis.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param yShift: Shift along the vertical axis.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
:param interpolation: Interpolation method. Only ``INTER_NEAREST``, ``INTER_LINEAR``, and ``INTER_CUBIC`` are supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `gpu::warpAffine`
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::copyMakeBorder
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::copyMakeBorder
2011-02-26 12:05:10 +01:00
-----------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom, int left, int right, const Scalar& value = Scalar())
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Copies a 2D array to a larger destination array and pads borders with the given constant.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. ``CV_8UC1``, ``CV_8UC4``, ``CV_32SC1``, and ``CV_32FC1`` types are supported.
2011-02-22 21:43:26 +01:00
2011-04-01 00:07:17 +02:00
:param dst: Destination image with the same type as ``src``. The size is ``Size(src.cols+left+right, src.rows+top+bottom)`` .
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
: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.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param value: Border value.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
See Also:
2011-06-16 14:48:23 +02:00
:ocv:func: `copyMakeBorder`
2011-04-01 00:07:17 +02:00
2011-02-22 21:43:26 +01:00
.. index :: gpu::rectStdDev
2011-03-23 11:56:20 +01:00
gpu::rectStdDev
2011-02-22 21:43:26 +01:00
-------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::rectStdDev(const GpuMat& src, const GpuMat& sqr, GpuMat& dst, const Rect& rect)
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Computes a standard deviation of integral images.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. Only the ``CV_32SC1`` type is supported.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param sqr: Squared source image. Only the ``CV_32FC1`` type is supported.
2011-02-22 21:43:26 +01:00
2011-03-29 23:48:36 +02:00
:param dst: Destination image with the same type and size as ``src`` .
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param rect: Rectangular window.
2011-02-22 21:43:26 +01:00
.. index :: gpu::evenLevels
2011-03-23 11:56:20 +01:00
gpu::evenLevels
2011-02-22 21:43:26 +01:00
-------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::evenLevels(GpuMat& levels, int nLevels, int lowerLevel, int upperLevel)
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
Computes levels with even distribution.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param levels: Destination array. ``levels`` has 1 row, ``nLevels`` columns, and the ``CV_32SC1`` type.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param nLevels: Number of computed levels. ``nLevels`` must be at least 2.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param lowerLevel: Lower boundary value of the lowest level.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
:param upperLevel: Upper boundary value of the greatest level.
2011-02-22 21:43:26 +01:00
.. index :: gpu::histEven
2011-03-23 11:56:20 +01:00
gpu::histEven
2011-02-22 21:43:26 +01:00
-----------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::histEven(const GpuMat& src, GpuMat& hist, int histSize, int lowerLevel, int upperLevel)
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::histEven(const GpuMat& src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4])
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
Calculates a histogram with evenly distributed bins.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. ``CV_8U``, ``CV_16U``, or ``CV_16S`` depth and 1 or 4 channels are supported. For a four-channel image, all channels are processed separately.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param hist: Destination histogram with one row, ``histSize`` columns, and the ``CV_32S`` type.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param histSize: Size of the histogram.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param lowerLevel: Lower boundary of lowest-level bin.
2011-03-23 11:56:20 +01:00
2011-03-29 01:16:20 +02:00
:param upperLevel: Upper boundary of highest-level bin.
2011-03-23 11:56:20 +01:00
2011-02-26 12:05:10 +01:00
.. index :: gpu::histRange
2011-02-22 21:43:26 +01:00
2011-03-23 11:56:20 +01:00
gpu::histRange
2011-02-22 21:43:26 +01:00
------------------
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::histRange(const GpuMat& src, GpuMat& hist, const GpuMat& levels)
2011-02-22 21:43:26 +01:00
2011-06-16 14:48:23 +02:00
.. ocv:function :: void gpu::histRange(const GpuMat& src, GpuMat hist[4], const GpuMat levels[4])
2011-03-29 01:16:20 +02:00
Calculates a histogram with bins determined by the `levels` array.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param src: Source image. ``CV_8U``, ``CV_16U``, or ``CV_16S`` depth and 1 or 4 channels are supported. For a four-channel image, all channels are processed separately.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param hist: Destination histogram with one row, ``(levels.cols-1)`` columns, and the ``CV_32SC1`` type.
2011-02-22 21:43:26 +01:00
2011-03-29 01:16:20 +02:00
:param levels: Number of levels in the histogram.
2011-02-22 21:43:26 +01:00