Commit 5a333bff authored by Alexander Alekhin's avatar Alexander Alekhin

ocl: update documentation

parent f2241e3d
...@@ -86,8 +86,6 @@ Enables the stereo correspondence operator that finds the disparity for the spec ...@@ -86,8 +86,6 @@ Enables the stereo correspondence operator that finds the disparity for the spec
:param disparity: Output disparity map. It is a ``CV_8UC1`` image with the same size as the input images. :param disparity: Output disparity map. It is a ``CV_8UC1`` image with the same size as the input images.
:param stream: Stream for the asynchronous version.
ocl::StereoBM_OCL::checkIfGpuCallReasonable ocl::StereoBM_OCL::checkIfGpuCallReasonable
----------------------------------------------- -----------------------------------------------
...@@ -218,8 +216,6 @@ Enables the stereo correspondence operator that finds the disparity for the spec ...@@ -218,8 +216,6 @@ Enables the stereo correspondence operator that finds the disparity for the spec
:param disparity: Output disparity map. If ``disparity`` is empty, the output type is ``CV_16SC1`` . Otherwise, the type is retained. :param disparity: Output disparity map. If ``disparity`` is empty, the output type is ``CV_16SC1`` . Otherwise, the type is retained.
:param stream: Stream for the asynchronous version.
ocl::StereoConstantSpaceBP ocl::StereoConstantSpaceBP
------------------------------ ------------------------------
.. ocv:class:: ocl::StereoConstantSpaceBP .. ocv:class:: ocl::StereoConstantSpaceBP
...@@ -330,5 +326,3 @@ Enables the stereo correspondence operator that finds the disparity for the spec ...@@ -330,5 +326,3 @@ Enables the stereo correspondence operator that finds the disparity for the spec
:param right: Right image with the same size and the same type as the left one. :param right: Right image with the same size and the same type as the left one.
:param disparity: Output disparity map. If ``disparity`` is empty, the output type is ``CV_16SC1`` . Otherwise, the output type is ``disparity.type()`` . :param disparity: Output disparity map. If ``disparity`` is empty, the output type is ``CV_16SC1`` . Otherwise, the output type is ``disparity.type()`` .
:param stream: Stream for the asynchronous version.
\ No newline at end of file
...@@ -37,7 +37,7 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -37,7 +37,7 @@ OpenCV C++ 1-D or 2-D dense array class ::
oclMat &operator = (const oclMat &m); oclMat &operator = (const oclMat &m);
//! assignment operator. Perfom blocking upload to device. //! assignment operator. Perfom blocking upload to device.
oclMat &operator = (const Mat &m); oclMat &operator = (const Mat &m);
oclMat &operator = (const oclMatExpr& expr);
//! pefroms blocking upload data to oclMat. //! pefroms blocking upload data to oclMat.
void upload(const cv::Mat &m); void upload(const cv::Mat &m);
...@@ -47,6 +47,11 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -47,6 +47,11 @@ OpenCV C++ 1-D or 2-D dense array class ::
operator Mat() const; operator Mat() const;
void download(cv::Mat &m) const; void download(cv::Mat &m) const;
//! convert to _InputArray
operator _InputArray();
//! convert to _OutputArray
operator _OutputArray();
//! returns a new oclMatrix header for the specified row //! returns a new oclMatrix header for the specified row
oclMat row(int y) const; oclMat row(int y) const;
...@@ -61,25 +66,21 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -61,25 +66,21 @@ OpenCV C++ 1-D or 2-D dense array class ::
//! returns deep copy of the oclMatrix, i.e. the data is copied //! returns deep copy of the oclMatrix, i.e. the data is copied
oclMat clone() const; oclMat clone() const;
//! copies the oclMatrix content to "m".
//! copies those oclMatrix elements to "m" that are marked with non-zero mask elements.
// It calls m.create(this->size(), this->type()). // It calls m.create(this->size(), this->type()).
// It supports any data type // It supports any data type
void copyTo( oclMat &m ) const; void copyTo( oclMat &m, const oclMat &mask = oclMat()) const;
//! copies those oclMatrix elements to "m" that are marked with non-zero mask elements.
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4
void copyTo( oclMat &m, const oclMat &mask ) const;
//! converts oclMatrix to another datatype with optional scalng. See cvConvertScale. //! converts oclMatrix to another datatype with optional scalng. See cvConvertScale.
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4
void convertTo( oclMat &m, int rtype, double alpha = 1, double beta = 0 ) const; void convertTo( oclMat &m, int rtype, double alpha = 1, double beta = 0 ) const;
void assignTo( oclMat &m, int type = -1 ) const; void assignTo( oclMat &m, int type = -1 ) const;
//! sets every oclMatrix element to s //! sets every oclMatrix element to s
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 oclMat& operator = (const Scalar &s);
oclMat &operator = (const Scalar &s);
//! sets some of the oclMatrix elements to s, according to the mask //! sets some of the oclMatrix elements to s, according to the mask
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 oclMat& setTo(const Scalar &s, const oclMat &mask = oclMat());
oclMat &setTo(const Scalar &s, const oclMat &mask = oclMat());
//! creates alternative oclMatrix header for the same data, with different //! creates alternative oclMatrix header for the same data, with different
// number of channels and/or different number of rows. see cvReshape. // number of channels and/or different number of rows. see cvReshape.
oclMat reshape(int cn, int rows = 0) const; oclMat reshape(int cn, int rows = 0) const;
...@@ -88,6 +89,11 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -88,6 +89,11 @@ OpenCV C++ 1-D or 2-D dense array class ::
// previous data is unreferenced if needed. // previous data is unreferenced if needed.
void create(int rows, int cols, int type); void create(int rows, int cols, int type);
void create(Size size, int type); void create(Size size, int type);
//! allocates new oclMatrix with specified device memory type.
void createEx(int rows, int cols, int type, DevMemRW rw_type, DevMemType mem_type);
void createEx(Size size, int type, DevMemRW rw_type, DevMemType mem_type);
//! decreases reference counter; //! decreases reference counter;
// deallocate the data when reference counter reaches 0. // deallocate the data when reference counter reaches 0.
void release(); void release();
...@@ -98,12 +104,17 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -98,12 +104,17 @@ OpenCV C++ 1-D or 2-D dense array class ::
//! locates oclMatrix header within a parent oclMatrix. See below //! locates oclMatrix header within a parent oclMatrix. See below
void locateROI( Size &wholeSize, Point &ofs ) const; void locateROI( Size &wholeSize, Point &ofs ) const;
//! moves/resizes the current oclMatrix ROI inside the parent oclMatrix. //! moves/resizes the current oclMatrix ROI inside the parent oclMatrix.
oclMat &adjustROI( int dtop, int dbottom, int dleft, int dright ); oclMat& adjustROI( int dtop, int dbottom, int dleft, int dright );
//! extracts a rectangular sub-oclMatrix //! extracts a rectangular sub-oclMatrix
// (this is a generalized form of row, rowRange etc.) // (this is a generalized form of row, rowRange etc.)
oclMat operator()( Range rowRange, Range colRange ) const; oclMat operator()( Range rowRange, Range colRange ) const;
oclMat operator()( const Rect &roi ) const; oclMat operator()( const Rect &roi ) const;
oclMat& operator+=( const oclMat& m );
oclMat& operator-=( const oclMat& m );
oclMat& operator*=( const oclMat& m );
oclMat& operator/=( const oclMat& m );
//! returns true if the oclMatrix data is continuous //! returns true if the oclMatrix data is continuous
// (i.e. when there are no gaps between successive rows). // (i.e. when there are no gaps between successive rows).
// similar to CV_IS_oclMat_CONT(cvoclMat->type) // similar to CV_IS_oclMat_CONT(cvoclMat->type)
...@@ -134,7 +145,7 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -134,7 +145,7 @@ OpenCV C++ 1-D or 2-D dense array class ::
bool empty() const; bool empty() const;
//! returns pointer to y-th row //! returns pointer to y-th row
uchar *ptr(int y = 0); uchar* ptr(int y = 0);
const uchar *ptr(int y = 0) const; const uchar *ptr(int y = 0) const;
//! template version of the above method //! template version of the above method
...@@ -176,14 +187,11 @@ OpenCV C++ 1-D or 2-D dense array class :: ...@@ -176,14 +187,11 @@ OpenCV C++ 1-D or 2-D dense array class ::
int wholecols; int wholecols;
}; };
Basically speaking, the oclMat is the mirror of Mat with the extension of ocl feature, the members have the same meaning and useage of Mat except following: Basically speaking, the ``oclMat`` is the mirror of ``Mat`` with the extension of OCL feature, the members have the same meaning and useage of ``Mat`` except following:
datastart and dataend are replaced with wholerows and wholecols
add clCxt for oclMat
Only basic flags are supported in oclMat(i.e. depth number of channels) * ``datastart`` and ``dataend`` are replaced with ``wholerows`` and ``wholecols``
All the 3-channel matrix(i.e. RGB image) are represented by 4-channel matrix in oclMat. It means 3-channel image have 4-channel space with the last channel unused. We provide a transparent interface to handle the difference between OpenCV Mat and oclMat. * Only basic flags are supported in ``oclMat`` (i.e. depth number of channels)
For example: If a oclMat has 3 channels, channels() returns 3 and oclchannels() returns 4 * All the 3-channel matrix (i.e. RGB image) are represented by 4-channel matrix in ``oclMat``. It means 3-channel image have 4-channel space with the last channel unused. We provide a transparent interface to handle the difference between OpenCV ``Mat`` and ``oclMat``.
For example: If a ``oclMat`` has 3 channels, ``channels()`` returns 3 and ``oclchannels()`` returns 4
...@@ -146,7 +146,7 @@ Returns void ...@@ -146,7 +146,7 @@ Returns void
.. ocv:function:: void ocl::remap(const oclMat &src, oclMat &dst, oclMat &map1, oclMat &map2, int interpolation, int bordertype, const Scalar &value = Scalar()) .. ocv:function:: void ocl::remap(const oclMat &src, oclMat &dst, oclMat &map1, oclMat &map2, int interpolation, int bordertype, const Scalar &value = Scalar())
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. :param src: Source image.
:param dst: Destination image containing cornerness values. It has 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.
...@@ -156,11 +156,11 @@ Returns void ...@@ -156,11 +156,11 @@ Returns void
:param interpolation: The interpolation method :param interpolation: The interpolation method
:param bordertype: Pixel extrapolation method. Only BORDER_CONSTANT are supported now. :param bordertype: Pixel extrapolation method.
:param value: The border value if borderType==BORDER CONSTANT :param value: The border value if borderType==BORDER CONSTANT
The function remap transforms the source image using the specified map: dst (x ,y) = src (map1(x , y) , map2(x , y)) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. map1 and map2 can be encoded as separate floating-point maps in map1 and map2 respectively, or interleaved floating-point maps of (x,y) in map1. Supports CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1 , CV_32FC3 and CV_32FC4 data types. The function remap transforms the source image using the specified map: dst (x ,y) = src (map1(x , y) , map2(x , y)) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. map1 and map2 can be encoded as separate floating-point maps in map1 and map2 respectively, or interleaved floating-point maps of (x,y) in map1.
ocl::resize ocl::resize
------------------ ------------------
...@@ -222,7 +222,7 @@ ocl::cvtColor ...@@ -222,7 +222,7 @@ ocl::cvtColor
------------------ ------------------
Returns void Returns void
.. ocv:function:: void ocl::cvtColor(const oclMat &src, oclMat &dst, int code , int dcn = 0) .. ocv:function:: void ocl::cvtColor(const oclMat &src, oclMat &dst, int code, int dcn = 0)
:param src: Source image. :param src: Source image.
...@@ -250,7 +250,7 @@ Returns Threshold value ...@@ -250,7 +250,7 @@ Returns Threshold value
:param type: Thresholding type :param type: Thresholding type
The function applies fixed-level thresholding to a single-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image or for removing a noise, i.e. filtering out pixels with too small or too large values. There are several types of thresholding that the function supports that are determined by thresholdType. Supports only CV_32FC1 and CV_8UC1 data type. The function applies fixed-level thresholding to a single-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image or for removing a noise, i.e. filtering out pixels with too small or too large values. There are several types of thresholding that the function supports that are determined by thresholdType.
ocl::buildWarpPlaneMaps ocl::buildWarpPlaneMaps
----------------------- -----------------------
......
This diff is collapsed.
...@@ -117,7 +117,6 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm. ...@@ -117,7 +117,6 @@ Computes a dense optical flow using the Gunnar Farneback's algorithm.
:param frame1: Second 8-bit gray-scale input image :param frame1: Second 8-bit gray-scale input image
:param flowx: Flow horizontal component :param flowx: Flow horizontal component
:param flowy: Flow vertical component :param flowy: Flow vertical component
:param s: Stream
.. seealso:: :ocv:func:`calcOpticalFlowFarneback` .. seealso:: :ocv:func:`calcOpticalFlowFarneback`
...@@ -230,8 +229,6 @@ Interpolates frames (images) using provided optical flow (displacement field). ...@@ -230,8 +229,6 @@ Interpolates frames (images) using provided optical flow (displacement field).
:param buf: Temporary buffer, will have width x 6*height size, CV_32FC1 type and contain 6 oclMat: occlusion masks for first frame, occlusion masks for second, interpolated forward horizontal flow, interpolated forward vertical flow, interpolated backward horizontal flow, interpolated backward vertical flow. :param buf: Temporary buffer, will have width x 6*height size, CV_32FC1 type and contain 6 oclMat: occlusion masks for first frame, occlusion masks for second, interpolated forward horizontal flow, interpolated forward vertical flow, interpolated backward horizontal flow, interpolated backward vertical flow.
:param stream: Stream for the asynchronous version.
ocl::KalmanFilter ocl::KalmanFilter
-------------------- --------------------
.. ocv:class:: ocl::KalmanFilter .. ocv:class:: ocl::KalmanFilter
...@@ -418,8 +415,6 @@ Updates the background model and returns the foreground mask. ...@@ -418,8 +415,6 @@ Updates the background model and returns the foreground mask.
:param fgmask: The output foreground mask as an 8-bit binary image. :param fgmask: The output foreground mask as an 8-bit binary image.
:param stream: Stream for the asynchronous version.
ocl::MOG::getBackgroundImage ocl::MOG::getBackgroundImage
-------------------------------- --------------------------------
...@@ -429,8 +424,6 @@ Computes a background image. ...@@ -429,8 +424,6 @@ Computes a background image.
:param backgroundImage: The output background image. :param backgroundImage: The output background image.
:param stream: Stream for the asynchronous version.
ocl::MOG::release ocl::MOG::release
--------------------- ---------------------
...@@ -443,7 +436,9 @@ ocl::MOG2 ...@@ -443,7 +436,9 @@ ocl::MOG2
------------- -------------
.. ocv:class:: ocl::MOG2 : public ocl::BackgroundSubtractor .. ocv:class:: ocl::MOG2 : public ocl::BackgroundSubtractor
Gaussian Mixture-based Background/Foreground Segmentation Algorithm. :: Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [MOG2004]_. ::
class CV_EXPORTS MOG2: public cv::ocl::BackgroundSubtractor class CV_EXPORTS MOG2: public cv::ocl::BackgroundSubtractor
{ {
...@@ -485,10 +480,6 @@ Gaussian Mixture-based Background/Foreground Segmentation Algorithm. :: ...@@ -485,10 +480,6 @@ Gaussian Mixture-based Background/Foreground Segmentation Algorithm. ::
/* hidden */ /* hidden */
}; };
The class discriminates between foreground and background pixels by building and maintaining a model of the background. Any pixel which does not fit this model is then deemed to be foreground. The class implements algorithm described in [MOG2004]_.
Here are important members of the class that control the algorithm, which you can set after constructing the class instance:
.. ocv:member:: float backgroundRatio .. ocv:member:: float backgroundRatio
Threshold defining whether the component is significant enough to be included into the background model. ``cf=0.1 => TB=0.9`` is default. For ``alpha=0.001``, it means that the mode should exist for approximately 105 frames before it is considered foreground. Threshold defining whether the component is significant enough to be included into the background model. ``cf=0.1 => TB=0.9`` is default. For ``alpha=0.001``, it means that the mode should exist for approximately 105 frames before it is considered foreground.
...@@ -525,6 +516,7 @@ Gaussian Mixture-based Background/Foreground Segmentation Algorithm. :: ...@@ -525,6 +516,7 @@ Gaussian Mixture-based Background/Foreground Segmentation Algorithm. ::
Parameter defining whether shadow detection should be enabled. Parameter defining whether shadow detection should be enabled.
.. seealso:: :ocv:class:`BackgroundSubtractorMOG2` .. seealso:: :ocv:class:`BackgroundSubtractorMOG2`
...@@ -549,8 +541,6 @@ Updates the background model and returns the foreground mask. ...@@ -549,8 +541,6 @@ Updates the background model and returns the foreground mask.
:param fgmask: The output foreground mask as an 8-bit binary image. :param fgmask: The output foreground mask as an 8-bit binary image.
:param stream: Stream for the asynchronous version.
ocl::MOG2::getBackgroundImage ocl::MOG2::getBackgroundImage
--------------------------------- ---------------------------------
...@@ -560,8 +550,6 @@ Computes a background image. ...@@ -560,8 +550,6 @@ Computes a background image.
:param backgroundImage: The output background image. :param backgroundImage: The output background image.
:param stream: Stream for the asynchronous version.
ocl::MOG2::release ocl::MOG2::release
---------------------- ----------------------
......
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