@ -248,7 +248,7 @@ CV_EXPORTS void swap( UMat& a, UMat& b );
The function computes and returns the coordinate of a donor pixel corresponding to the specified
extrapolated pixel when using the specified extrapolation border mode . For example , if you use
cv : : BORDER_WRAP mode in the horizontal direction , cv : : BORDER_REFLECT_101 in the vertical direction and
want to compute value of the " virtual " pixel Point ( - 5 , 100 ) in a floating - point image img , it
want to compute value of the " virtual " pixel Point ( - 5 , 100 ) in a floating - point image img , it
looks like :
@ code { . cpp }
float val = img . at < float > ( borderInterpolate ( 100 , img . rows , cv : : BORDER_REFLECT_101 ) ,
@ -259,7 +259,7 @@ copyMakeBorder.
@ param p 0 - based coordinate of the extrapolated pixel along one of the axes , likely \ < 0 or \ > = len
@ param len Length of the array along the corresponding axis .
@ param borderType Border type , one of the # BorderTypes , except for # BORDER_TRANSPARENT and
# BORDER_ISOLATED . When borderType==#BORDER_CONSTANT , the function always returns -1, regardless
# BORDER_ISOLATED. When borderType==#BORDER_CONSTANT, the function always returns -1, regardless
of p and len .
@ sa copyMakeBorder
@ -585,8 +585,18 @@ CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);
/** @brief Checks for the presence of at least one non-zero array element.
The function returns whether there are non - zero elements in src
The function do not work with multi - channel arrays . If you need to check non - zero array
elements across all the channels , use Mat : : reshape first to reinterpret the array as
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
@ note
- If the location of non - zero array elements is important , @ ref findNonZero is helpful .
- If the count of non - zero array elements is important , @ ref countNonZero is helpful .
@ param src single - channel array .
@ sa mean , meanStdDev , norm , minMaxLoc , calcCovarMatrix
@ sa findNonZero , countNonZero
*/
CV_EXPORTS_W bool hasNonZero ( InputArray src ) ;
@ -594,8 +604,18 @@ CV_EXPORTS_W bool hasNonZero( InputArray src );
The function returns the number of non - zero elements in src :
\ f [ \ sum _ { I : \ ; \ texttt { src } ( I ) \ ne0 } 1 \ f ]
The function do not work with multi - channel arrays . If you need to count non - zero array
elements across all the channels , use Mat : : reshape first to reinterpret the array as
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
@ note
- If only whether there are non - zero elements is important , @ ref hasNonZero is helpful .
- If the location of non - zero array elements is important , @ ref findNonZero is helpful .
@ param src single - channel array .
@ sa mean , meanStdDev , norm , minMaxLoc , calcCovarMatrix
@ sa findNonZero , hasNonZero
*/
CV_EXPORTS_W int countNonZero ( InputArray src ) ;
@ -622,8 +642,18 @@ or
// access pixel coordinates
Point pnt = locations [ i ] ;
@ endcode
The function do not work with multi - channel arrays . If you need to find non - zero
elements across all the channels , use Mat : : reshape first to reinterpret the array as
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
@ note
- If only count of non - zero array elements is important , @ ref countNonZero is helpful .
- If only whether there are non - zero elements is important , @ ref hasNonZero is helpful .
@ param src single - channel array
@ param idx the output array , type of cv : : Mat or std : : vector < Point > , corresponding to non - zero indices in the input
@ sa countNonZero , hasNonZero
*/
CV_EXPORTS_W void findNonZero ( InputArray src , OutputArray idx ) ;
@ -830,8 +860,8 @@ array region.
The function do not work with multi - channel arrays . If you need to find minimum or maximum
elements across all the channels , use Mat : : reshape first to reinterpret the array as
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
@ param src input single - channel array .
@ param minVal pointer to the returned minimum value ; NULL is used if not required .
@ param maxVal pointer to the returned maximum value ; NULL is used if not required .
@ -884,8 +914,8 @@ The function cv::minMaxIdx finds the minimum and maximum element values and thei
extremums are searched across the whole array or , if mask is not an empty array , in the specified
array region . The function does not work with multi - channel arrays . If you need to find minimum or
maximum elements across all the channels , use Mat : : reshape first to reinterpret the array as
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split . In case of a sparse matrix , the minimum is found among non - zero elements
single - channel . Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split . In case of a sparse matrix , the minimum is found among non - zero elements
only .
@ note When minIdx is not NULL , it must have at least 2 elements ( as well as maxIdx ) , even if src is
a single - row or single - column matrix . In OpenCV ( following MATLAB ) each array has at least 2
@ -921,8 +951,8 @@ CV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal,
The function # reduce reduces the matrix to a vector by treating the matrix rows / columns as a set of
1 D vectors and performing the specified operation on the vectors until a single row / column is
obtained . For example , the function can be used to compute horizontal and vertical projections of a
raster image . In case of # REDUCE_MAX and # REDUCE_MIN , the output image should have the same type as the source one .
In case of # REDUCE_SUM , # REDUCE_SUM2 and # REDUCE_AVG , the output may have a larger element bit - depth to preserve accuracy .
raster image . In case of # REDUCE_MAX and # REDUCE_MIN , the output image should have the same type as the source one .
In case of # REDUCE_SUM , # REDUCE_SUM2 and # REDUCE_AVG , the output may have a larger element bit - depth to preserve accuracy .
And multi - channel arrays are also supported in these two reduction modes .
The following code demonstrates its usage for a single channel matrix .
@ -976,7 +1006,7 @@ CV_EXPORTS_W void merge(InputArrayOfArrays mv, OutputArray dst);
The function cv : : split splits a multi - channel array into separate single - channel arrays :
\ f [ \ texttt { mv } [ c ] ( I ) = \ texttt { src } ( I ) _c \ f ]
If you need to extract a single channel or do some other sophisticated channel permutation , use
mixChannels .
mixChannels .
The following example demonstrates how to split a 3 - channel matrix into 3 single channel matrices .
@ snippet snippets / core_split . cpp example
@ -1117,7 +1147,7 @@ The example scenarios of using the function are the following:
flipping around the x - axis and positive value ( for example , 1 ) means
flipping around y - axis . Negative value ( for example , - 1 ) means flipping
around both axes .
@ sa transpose , repeat , completeSymm
@ sa transpose , repeat , completeSymm
*/
CV_EXPORTS_W void flip ( InputArray src , OutputArray dst , int flipCode ) ;
@ -1149,7 +1179,7 @@ The function cv::rotate rotates the array in one of three different ways:
@ param dst output array of the same type as src . The size is the same with ROTATE_180 ,
and the rows and cols are switched for ROTATE_90_CLOCKWISE and ROTATE_90_COUNTERCLOCKWISE .
@ param rotateCode an enum to specify how to rotate the array ; see the enum # RotateFlags
@ sa transpose , repeat , completeSymm , flip , RotateFlags
@ sa transpose , repeat , completeSymm , flip , RotateFlags
*/
CV_EXPORTS_W void rotate ( InputArray src , OutputArray dst , int rotateCode ) ;
@ -1583,7 +1613,7 @@ converts denormalized values to zeros on output. Special values (NaN,
Inf ) are not handled .
@ param src input array .
@ param dst output array of the same size and type as src .
@ sa log , cartToPolar , polarToCart , phase , pow , sqrt , magnitude
@ sa log , cartToPolar , polarToCart , phase , pow , sqrt , magnitude
*/
CV_EXPORTS_W void exp ( InputArray src , OutputArray dst ) ;
@ -1727,7 +1757,7 @@ should have the same type as src1 and src2.
@ param dst output matrix ; it has the proper size and the same type as
input matrices .
@ param flags operation flags ( cv : : GemmFlags )
@ sa mulTransposed , transform
@ sa mulTransposed , transform
*/
CV_EXPORTS_W void gemm ( InputArray src1 , InputArray src2 , double alpha ,
InputArray src3 , double beta , OutputArray dst , int flags = 0 ) ;
@ -1737,7 +1767,7 @@ CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
The function cv : : mulTransposed calculates the product of src and its
transposition :
\ f [ \ texttt { dst } = \ texttt { scale } ( \ texttt { src } - \ texttt { delta } ) ^ T ( \ texttt { src } - \ texttt { delta } ) \ f ]
if aTa = true , and
if aTa = true , and
\ f [ \ texttt { dst } = \ texttt { scale } ( \ texttt { src } - \ texttt { delta } ) ( \ texttt { src } - \ texttt { delta } ) ^ T \ f ]
otherwise . The function is used to calculate the covariance matrix . With
zero delta , it can be used as a faster substitute for general matrix
@ -1750,7 +1780,7 @@ description below.
@ param delta Optional delta matrix subtracted from src before the
multiplication . When the matrix is empty ( delta = noArray ( ) ) , it is
assumed to be zero , that is , nothing is subtracted . If it has the same
size as src , it is simply subtracted . Otherwise , it is " repeated " ( see
size as src , it is simply subtracted . Otherwise , it is " repeated " ( see
repeat ) to cover the full src and then subtracted . Type of the delta
matrix , when it is not empty , must be the same as the type of created
output matrix . See the dtype parameter description below .
@ -2024,7 +2054,7 @@ in the descending order.
@ param eigenvectors output matrix of eigenvectors ; it has the same size and type as src ; the
eigenvectors are stored as subsequent matrix rows , in the same order as the corresponding
eigenvalues .
@ sa eigenNonSymmetric , completeSymm , PCA
@ sa eigenNonSymmetric , completeSymm , PCA
*/
CV_EXPORTS_W bool eigen ( InputArray src , OutputArray eigenvalues ,
OutputArray eigenvectors = noArray ( ) ) ;
@ -2164,7 +2194,7 @@ So, the function chooses an operation mode depending on the flags and size of th
If # DFT_SCALE is set , the scaling is done after the transformation .
Unlike dct , the function supports arrays of arbitrary size . But only those arrays are processed
Unlike dct , the function supports arrays of arbitrary size . But only those arrays are processed
efficiently , whose sizes can be factorized in a product of small prime numbers ( 2 , 3 , and 5 in the
current implementation ) . Such an efficient DFT size can be calculated using the getOptimalDFTSize
method .
@ -2247,8 +2277,8 @@ nonzeroRows rows of the input array (#DFT_INVERSE is not set) or only the first
output array ( # DFT_INVERSE is set ) contain non - zeros , thus , the function can handle the rest of the
rows more efficiently and save some time ; this technique is very useful for calculating array
cross - correlation or convolution using DFT .
@ sa dct , getOptimalDFTSize , mulSpectrums , filter2D , matchTemplate , flip , cartToPolar ,
magnitude , phase
@ sa dct , getOptimalDFTSize , mulSpectrums , filter2D , matchTemplate , flip , cartToPolar ,
magnitude , phase
*/
CV_EXPORTS_W void dft ( InputArray src , OutputArray dst , int flags = 0 , int nonzeroRows = 0 ) ;
@ -2285,9 +2315,9 @@ floating-point array:
\ f [ X = \ left ( C ^ { ( N ) } \ right ) ^ T \ cdot X \ cdot C ^ { ( N ) } \ f ]
The function chooses the mode of operation by looking at the flags and size of the input array :
- If ( flags & # DCT_INVERSE ) = = 0 , the function does a forward 1 D or 2 D transform . Otherwise , it
- If ( flags & # DCT_INVERSE ) = = 0 , the function does a forward 1 D or 2 D transform . Otherwise , it
is an inverse 1 D or 2 D transform .
- If ( flags & # DCT_ROWS ) ! = 0 , the function performs a 1 D transform of each row .
- If ( flags & # DCT_ROWS ) ! = 0 , the function performs a 1 D transform of each row .
- If the array is a single column or a single row , the function performs a 1 D transform .
- If none of the above is true , the function performs a 2 D transform .
@ -2303,7 +2333,7 @@ of a vector of size N/2 . Thus, the optimal DCT size N1 \>= N can be calculated
@ param src input floating - point array .
@ param dst output array of the same size and type as src .
@ param flags transformation flags as a combination of cv : : DftFlags ( DCT_ * )
@ sa dft , getOptimalDFTSize , idct
@ sa dft , getOptimalDFTSize , idct
*/
CV_EXPORTS_W void dct ( InputArray src , OutputArray dst , int flags = 0 ) ;
@ -2322,7 +2352,7 @@ CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags = 0);
The function cv : : mulSpectrums performs the per - element multiplication of the two CCS - packed or complex
matrices that are results of a real or complex Fourier transform .
The function , together with dft and idft , may be used to calculate convolution ( pass conjB = false )
The function , together with dft and idft , may be used to calculate convolution ( pass conjB = false )
or correlation ( pass conjB = true ) of two arrays rapidly . When the arrays are complex , they are
simply multiplied ( per element ) with an optional conjugation of the second - array elements . When the
arrays are real , they are assumed to be CCS - packed ( see dft for details ) .
@ -2356,7 +2386,7 @@ While the function cannot be used directly to estimate the optimal vector size f
( since the current DCT implementation supports only even - size vectors ) , it can be easily processed
as getOptimalDFTSize ( ( vecsize + 1 ) / 2 ) \ * 2.
@ param vecsize vector size .
@ sa dft , dct , idft , idct , mulSpectrums
@ sa dft , dct , idft , idct , mulSpectrums
*/
CV_EXPORTS_W int getOptimalDFTSize ( int vecsize ) ;
@ -2908,7 +2938,7 @@ public:
The methods transform the state using the MWC algorithm and return the
next random number . The first form is equivalent to RNG : : next . The
second form returns the random number modulo N , which means that the
second form returns the random number modulo N , which means that the
result is in the range [ 0 , N ) .
*/
unsigned operator ( ) ( ) ;