Commit 9498f820 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

updated documentation

parent 62a5a70c
...@@ -6,16 +6,16 @@ Color space processing ...@@ -6,16 +6,16 @@ Color space processing
gpu::cvtColor gpu::cvtColor
----------------- -------------
Converts an image from one color space to another. Converts an image from one color space to another.
.. ocv:function:: void gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn = 0, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::cvtColor(InputArray src, OutputArray dst, int code, int dcn = 0, Stream& stream = Stream::Null())
:param src: Source image with ``CV_8U`` , ``CV_16U`` , or ``CV_32F`` depth and 1, 3, or 4 channels. :param src: Source image with ``CV_8U`` , ``CV_16U`` , or ``CV_32F`` depth and 1, 3, or 4 channels.
:param dst: Destination image with the same size and depth as ``src`` . :param dst: Destination image.
:param code: Color space conversion code. For details, see :ocv:func:`cvtColor` . Conversion to/from Luv and Bayer color spaces is not supported. :param code: Color space conversion code. For details, see :ocv:func:`cvtColor` .
: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`` . :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`` .
...@@ -27,11 +27,45 @@ Converts an image from one color space to another. ...@@ -27,11 +27,45 @@ Converts an image from one color space to another.
gpu::demosaicing
----------------
Converts an image from Bayer pattern to RGB or grayscale.
.. ocv:function:: void gpu::demosaicing(InputArray src, OutputArray dst, int code, int dcn = -1, Stream& stream = Stream::Null())
:param src: Source image (8-bit or 16-bit single channel).
:param dst: Destination image.
:param code: Color space conversion code (see the description below).
: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`` .
:param stream: Stream for the asynchronous version.
The function can do the following transformations:
* Demosaicing using bilinear interpolation
* ``COLOR_BayerBG2GRAY`` , ``COLOR_BayerGB2GRAY`` , ``COLOR_BayerRG2GRAY`` , ``COLOR_BayerGR2GRAY``
* ``COLOR_BayerBG2BGR`` , ``COLOR_BayerGB2BGR`` , ``COLOR_BayerRG2BGR`` , ``COLOR_BayerGR2BGR``
* Demosaicing using Malvar-He-Cutler algorithm ([MHT2011]_)
* ``COLOR_BayerBG2GRAY_MHT`` , ``COLOR_BayerGB2GRAY_MHT`` , ``COLOR_BayerRG2GRAY_MHT`` , ``COLOR_BayerGR2GRAY_MHT``
* ``COLOR_BayerBG2BGR_MHT`` , ``COLOR_BayerGB2BGR_MHT`` , ``COLOR_BayerRG2BGR_MHT`` , ``COLOR_BayerGR2BGR_MHT``
.. seealso:: :ocv:func:`cvtColor`
gpu::swapChannels gpu::swapChannels
----------------- -----------------
Exchanges the color channels of an image in-place. Exchanges the color channels of an image in-place.
.. ocv:function:: void gpu::swapChannels(GpuMat& image, const int dstOrder[4], Stream& stream = Stream::Null()) .. ocv:function:: void gpu::swapChannels(InputOutputArray image, const int dstOrder[4], Stream& stream = Stream::Null())
:param image: Source image. Supports only ``CV_8UC4`` type. :param image: Source image. Supports only ``CV_8UC4`` type.
...@@ -43,11 +77,27 @@ The methods support arbitrary permutations of the original channels, including r ...@@ -43,11 +77,27 @@ The methods support arbitrary permutations of the original channels, including r
gpu::gammaCorrection
--------------------
Routines for correcting image color gamma.
.. ocv:function:: void gpu::gammaCorrection(InputArray src, OutputArray dst, bool forward = true, Stream& stream = Stream::Null())
:param src: Source image (3- or 4-channel 8 bit).
:param dst: Destination image.
:param forward: ``true`` for forward gamma correction or ``false`` for inverse gamma correction.
:param stream: Stream for the asynchronous version.
gpu::alphaComp gpu::alphaComp
------------------- --------------
Composites two images using alpha opacity values contained in each image. Composites two images using alpha opacity values contained in each image.
.. ocv:function:: void gpu::alphaComp(const GpuMat& img1, const GpuMat& img2, GpuMat& dst, int alpha_op, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::alphaComp(InputArray img1, InputArray img2, OutputArray dst, int alpha_op, Stream& stream = Stream::Null())
:param img1: First image. Supports ``CV_8UC4`` , ``CV_16UC4`` , ``CV_32SC4`` and ``CV_32FC4`` types. :param img1: First image. Supports ``CV_8UC4`` , ``CV_16UC4`` , ``CV_32SC4`` and ``CV_32FC4`` types.
...@@ -72,3 +122,7 @@ Composites two images using alpha opacity values contained in each image. ...@@ -72,3 +122,7 @@ Composites two images using alpha opacity values contained in each image.
* **ALPHA_PREMUL** * **ALPHA_PREMUL**
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
.. [MHT2011] Pascal Getreuer, Malvar-He-Cutler Linear Image Demosaicking, Image Processing On Line, 2011
...@@ -5,15 +5,41 @@ Feature Detection ...@@ -5,15 +5,41 @@ Feature Detection
gpu::cornerHarris gpu::CornernessCriteria
--------------------- -----------------------
Computes the Harris cornerness criteria at each image pixel. .. ocv:class:: gpu::CornernessCriteria : public Algorithm
.. ocv:function:: void gpu::cornerHarris(const GpuMat& src, GpuMat& dst, int blockSize, int ksize, double k, int borderType=BORDER_REFLECT101) Base class for Cornerness Criteria computation. ::
:param src: Source image. Only ``CV_8UC1`` and ``CV_32FC1`` images are supported for now. class CV_EXPORTS CornernessCriteria : public Algorithm
{
public:
virtual void compute(InputArray src, OutputArray dst, Stream& stream = Stream::Null()) = 0;
};
gpu::CornernessCriteria::compute
--------------------------------
Computes the cornerness criteria at each image pixel.
.. ocv:function:: void gpu::CornernessCriteria::compute(InputArray src, OutputArray dst, Stream& stream = Stream::Null())
:param src: Source image.
:param dst: Destination image containing cornerness values. It will have the same size as ``src`` and ``CV_32FC1`` type.
:param dst: Destination image containing cornerness values. It has the same size as ``src`` and ``CV_32FC1`` type. :param stream: Stream for the asynchronous version.
gpu::createHarrisCorner
-----------------------
Creates implementation for Harris cornerness criteria.
.. ocv:function:: Ptr<CornernessCriteria> gpu::createHarrisCorner(int srcType, int blockSize, int ksize, double k, int borderType = BORDER_REFLECT101)
:param srcType: Input source type. Only ``CV_8UC1`` and ``CV_32FC1`` are supported for now.
:param blockSize: Neighborhood size. :param blockSize: Neighborhood size.
...@@ -27,55 +53,70 @@ Computes the Harris cornerness criteria at each image pixel. ...@@ -27,55 +53,70 @@ Computes the Harris cornerness criteria at each image pixel.
gpu::cornerMinEigenVal gpu::createMinEigenValCorner
-------------------------- ----------------------------
Computes the minimum eigen value of a 2x2 derivative covariation matrix at each pixel (the cornerness criteria). Creates implementation for the minimum eigen value of a 2x2 derivative covariation matrix (the cornerness criteria).
.. ocv:function:: void gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, int blockSize, int ksize, int borderType=BORDER_REFLECT101)
.. ocv:function:: void gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, int blockSize, int ksize, int borderType=BORDER_REFLECT101)
.. ocv:function:: void gpu::cornerMinEigenVal(const GpuMat& src, GpuMat& dst, GpuMat& Dx, GpuMat& Dy, GpuMat& buf, int blockSize, int ksize, int borderType=BORDER_REFLECT101, Stream& stream = Stream::Null())
:param src: Source image. Only ``CV_8UC1`` and ``CV_32FC1`` images are supported for now. .. ocv:function:: Ptr<CornernessCriteria> gpu::createMinEigenValCorner(int srcType, int blockSize, int ksize, int borderType = BORDER_REFLECT101)
:param dst: Destination image containing cornerness values. The size is the same. The type is ``CV_32FC1`` . :param srcType: Input source type. Only ``CV_8UC1`` and ``CV_32FC1`` are supported for now.
:param blockSize: Neighborhood size. :param blockSize: Neighborhood size.
:param ksize: Aperture parameter for the Sobel operator. :param ksize: Aperture parameter for the Sobel operator.
:param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now. :param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now.
.. seealso:: :ocv:func:`cornerMinEigenVal` .. seealso:: :ocv:func:`cornerMinEigenVal`
gpu::GoodFeaturesToTrackDetector_GPU gpu::CornersDetector
------------------------------------ --------------------
.. ocv:class:: gpu::GoodFeaturesToTrackDetector_GPU .. ocv:class:: gpu::CornersDetector : public Algorithm
Class used for strong corners detection on an image. :: Base class for Corners Detector. ::
class GoodFeaturesToTrackDetector_GPU class CV_EXPORTS CornersDetector : public Algorithm
{ {
public: public:
explicit GoodFeaturesToTrackDetector_GPU(int maxCorners_ = 1000, double qualityLevel_ = 0.01, double minDistance_ = 0.0, virtual void detect(InputArray image, OutputArray corners, InputArray mask = noArray()) = 0;
int blockSize_ = 3, bool useHarrisDetector_ = false, double harrisK_ = 0.04); };
void operator ()(const GpuMat& image, GpuMat& corners, const GpuMat& mask = GpuMat());
int maxCorners;
double qualityLevel;
double minDistance;
int blockSize; gpu::CornersDetector::detect
bool useHarrisDetector; ----------------------------
double harrisK; Determines strong corners on an image.
void releaseMemory(); .. ocv:function:: void gpu::CornersDetector::detect(InputArray image, OutputArray corners, InputArray mask = noArray())
};
:param image: Input 8-bit or floating-point 32-bit, single-channel image.
:param corners: Output vector of detected corners (1-row matrix with CV_32FC2 type with corners positions).
:param mask: Optional region of interest. If the image is not empty (it needs to have the type ``CV_8UC1`` and the same size as ``image`` ), it specifies the region in which the corners are detected.
gpu::createGoodFeaturesToTrackDetector
--------------------------------------
Creates implementation for :ocv:class:`gpu::CornersDetector` .
.. ocv:function:: Ptr<CornersDetector> gpu::createGoodFeaturesToTrackDetector(int srcType, int maxCorners = 1000, double qualityLevel = 0.01, double minDistance = 0.0, int blockSize = 3, bool useHarrisDetector = false, double harrisK = 0.04)
:param srcType: Input source type. Only ``CV_8UC1`` and ``CV_32FC1`` are supported for now.
:param maxCorners: Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned.
:param qualityLevel: Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see :ocv:func:`cornerMinEigenVal` ) or the Harris function response (see :ocv:func:`cornerHarris` ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the ``qualityLevel=0.01`` , then all the corners with the quality measure less than 15 are rejected.
: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:`cornerHarris`) or :ocv:func:`cornerMinEigenVal`.
The class finds the most prominent corners in the image. :param harrisK: Free parameter of the Harris detector.
.. seealso:: :ocv:func:`goodFeaturesToTrack` .. seealso:: :ocv:func:`goodFeaturesToTrack`
...@@ -5,11 +5,89 @@ Histogram Calculation ...@@ -5,11 +5,89 @@ Histogram Calculation
gpu::calcHist
-------------
Calculates histogram for one channel 8-bit image.
.. ocv:function:: void gpu::calcHist(InputArray src, OutputArray hist, Stream& stream = Stream::Null())
:param src: Source image with ``CV_8UC1`` type.
:param hist: Destination histogram with one row, 256 columns, and the ``CV_32SC1`` type.
:param stream: Stream for the asynchronous version.
gpu::equalizeHist
-----------------
Equalizes the histogram of a grayscale image.
.. ocv:function:: void gpu::equalizeHist(InputArray src, OutputArray dst, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::equalizeHist(InputArray src, OutputArray dst, InputOutputArray buf, Stream& stream = Stream::Null())
:param src: Source image with ``CV_8UC1`` type.
:param dst: Destination image.
:param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes).
:param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`equalizeHist`
gpu::CLAHE
----------
.. ocv:class:: gpu::CLAHE : public cv::CLAHE
Base class for Contrast Limited Adaptive Histogram Equalization. ::
class CV_EXPORTS CLAHE : public cv::CLAHE
{
public:
using cv::CLAHE::apply;
virtual void apply(InputArray src, OutputArray dst, Stream& stream) = 0;
};
gpu::CLAHE::apply
-----------------
Equalizes the histogram of a grayscale image using Contrast Limited Adaptive Histogram Equalization.
.. ocv:function:: void gpu::CLAHE::apply(InputArray src, OutputArray dst)
.. ocv:function:: void gpu::CLAHE::apply(InputArray src, OutputArray dst, Stream& stream)
:param src: Source image with ``CV_8UC1`` type.
:param dst: Destination image.
:param stream: Stream for the asynchronous version.
gpu::createCLAHE
----------------
Creates implementation for :ocv:class:`gpu::CLAHE` .
.. ocv:function:: Ptr<gpu::CLAHE> createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8))
:param clipLimit: Threshold for contrast limiting.
:param tileGridSize: Size of grid for histogram equalization. Input image will be divided into equally sized rectangular tiles. ``tileGridSize`` defines the number of tiles in row and column.
gpu::evenLevels gpu::evenLevels
------------------- ---------------
Computes levels with even distribution. Computes levels with even distribution.
.. ocv:function:: void gpu::evenLevels(GpuMat& levels, int nLevels, int lowerLevel, int upperLevel) .. ocv:function:: void gpu::evenLevels(OutputArray levels, int nLevels, int lowerLevel, int upperLevel)
:param levels: Destination array. ``levels`` has 1 row, ``nLevels`` columns, and the ``CV_32SC1`` type. :param levels: Destination array. ``levels`` has 1 row, ``nLevels`` columns, and the ``CV_32SC1`` type.
...@@ -22,16 +100,16 @@ Computes levels with even distribution. ...@@ -22,16 +100,16 @@ Computes levels with even distribution.
gpu::histEven gpu::histEven
----------------- -------------
Calculates a histogram with evenly distributed bins. Calculates a histogram with evenly distributed bins.
.. ocv:function:: void gpu::histEven(const GpuMat& src, GpuMat& hist, int histSize, int lowerLevel, int upperLevel, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::histEven(InputArray src, OutputArray hist, int histSize, int lowerLevel, int upperLevel, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::histEven(const GpuMat& src, GpuMat& hist, GpuMat& buf, int histSize, int lowerLevel, int upperLevel, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::histEven(InputArray src, OutputArray hist, InputOutputArray buf, int histSize, int lowerLevel, int upperLevel, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::histEven( const GpuMat& src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4], Stream& stream=Stream::Null() ) .. ocv:function:: void gpu::histEven(InputArray src, GpuMat hist[4], int histSize[4], int lowerLevel[4], int upperLevel[4], Stream& stream = Stream::Null())
.. ocv:function:: void gpu::histEven( const GpuMat& src, GpuMat hist[4], GpuMat& buf, int histSize[4], int lowerLevel[4], int upperLevel[4], Stream& stream=Stream::Null() ) .. ocv:function:: void gpu::histEven(InputArray src, GpuMat hist[4], InputOutputArray buf, int histSize[4], int lowerLevel[4], int upperLevel[4], Stream& stream = Stream::Null())
: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. :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.
...@@ -50,12 +128,16 @@ Calculates a histogram with evenly distributed bins. ...@@ -50,12 +128,16 @@ Calculates a histogram with evenly distributed bins.
gpu::histRange gpu::histRange
------------------ --------------
Calculates a histogram with bins determined by the ``levels`` array. Calculates a histogram with bins determined by the ``levels`` array.
.. ocv:function:: void gpu::histRange(const GpuMat& src, GpuMat& hist, const GpuMat& levels, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::histRange(InputArray src, OutputArray hist, InputArray levels, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::histRange(InputArray src, OutputArray hist, InputArray levels, InputOutputArray buf, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::histRange(const GpuMat& src, GpuMat& hist, const GpuMat& levels, GpuMat& buf, Stream& stream = Stream::Null()) .. ocv:function:: void gpu::histRange(InputArray src, GpuMat hist[4], const GpuMat levels[4], Stream& stream = Stream::Null())
.. ocv:function:: void gpu::histRange(InputArray src, GpuMat hist[4], const GpuMat levels[4], InputOutputArray buf, Stream& stream = Stream::Null())
: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. :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.
...@@ -66,39 +148,3 @@ Calculates a histogram with bins determined by the ``levels`` array. ...@@ -66,39 +148,3 @@ Calculates a histogram with bins determined by the ``levels`` array.
:param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes). :param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes).
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
gpu::calcHist
------------------
Calculates histogram for one channel 8-bit image.
.. ocv:function:: void gpu::calcHist(const GpuMat& src, GpuMat& hist, Stream& stream = Stream::Null())
:param src: Source image.
:param hist: Destination histogram with one row, 256 columns, and the ``CV_32SC1`` type.
:param stream: Stream for the asynchronous version.
gpu::equalizeHist
------------------
Equalizes the histogram of a grayscale image.
.. ocv:function:: void gpu::equalizeHist(const GpuMat& src, GpuMat& dst, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::equalizeHist(const GpuMat& src, GpuMat& dst, GpuMat& hist, GpuMat& buf, Stream& stream = Stream::Null())
:param src: Source image.
:param dst: Destination image.
:param hist: Destination histogram with one row, 256 columns, and the ``CV_32SC1`` type.
:param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes).
:param stream: Stream for the asynchronous version.
.. seealso:: :ocv:func:`equalizeHist`
This diff is collapsed.
This diff is collapsed.
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