OpenCV  4.1.0
Open Source Computer Vision
Functions
Graph API: Pixelwise operations

Functions

GMat cv::gapi::bitwise_and (const GMat &src1, const GMat &src2)
 computes bitwise conjunction of the two matrixes (src1 & src2) Calculates the per-element bit-wise logical conjunction of two matrices of the same size.
 
GMat cv::gapi::bitwise_and (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::bitwise_not (const GMat &src)
 Inverts every bit of an array. The function bitwise_not calculates per-element bit-wise inversion of the input matrix:

\[\texttt{dst} (I) = \neg \texttt{src} (I)\]

.

 
GMat cv::gapi::bitwise_or (const GMat &src1, const GMat &src2)
 computes bitwise disjunction of the two matrixes (src1 | src2) Calculates the per-element bit-wise logical disjunction of two matrices of the same size.
 
GMat cv::gapi::bitwise_or (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::bitwise_xor (const GMat &src1, const GMat &src2)
 computes bitwise logical "exclusive or" of the two matrixes (src1 ^ src2) Calculates the per-element bit-wise logical "exclusive or" of two matrices of the same size.
 
GMat cv::gapi::bitwise_xor (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::cmpEQ (const GMat &src1, const GMat &src2)
 Performs the per-element comparison of two matrices checking if elements from first matrix are equal to elements in second.
 
GMat cv::gapi::cmpEQ (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::cmpGE (const GMat &src1, const GMat &src2)
 Performs the per-element comparison of two matrices checking if elements from first matrix are greater or equal compare to elements in second.
 
GMat cv::gapi::cmpGE (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::cmpGT (const GMat &src1, const GMat &src2)
 Performs the per-element comparison of two matrices checking if elements from first matrix are greater compare to elements in second.
 
GMat cv::gapi::cmpGT (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::cmpLE (const GMat &src1, const GMat &src2)
 Performs the per-element comparison of two matrices checking if elements from first matrix are less or equal compare to elements in second.
 
GMat cv::gapi::cmpLE (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::cmpLT (const GMat &src1, const GMat &src2)
 Performs the per-element comparison of two matrices checking if elements from first matrix are less than elements in second.
 
GMat cv::gapi::cmpLT (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::cmpNE (const GMat &src1, const GMat &src2)
 Performs the per-element comparison of two matrices checking if elements from first matrix are not equal to elements in second.
 
GMat cv::gapi::cmpNE (const GMat &src1, const GScalar &src2)
 
GMat cv::gapi::select (const GMat &src1, const GMat &src2, const GMat &mask)
 Select values from either first or second of input matrices by given mask. The function set to the output matrix either the value from the first input matrix if corresponding value of mask matrix is 255, or value from the second input matrix (if value of mask matrix set to 0).
 

Detailed Description

gapi_math

Function Documentation

GMat cv::gapi::bitwise_and ( const GMat &  src1,
const GMat &  src2 
)

computes bitwise conjunction of the two matrixes (src1 & src2) Calculates the per-element bit-wise logical conjunction of two matrices of the same size.

In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrices.

Supported matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.bitwise_and"
Parameters
src1first input matrix.
src2second input matrix.
GMat cv::gapi::bitwise_and ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.bitwise_andS"
Parameters
src1first input matrix.
src2scalar, which will be per-lemenetly conjuncted with elements of src1.
GMat cv::gapi::bitwise_not ( const GMat &  src)

Inverts every bit of an array. The function bitwise_not calculates per-element bit-wise inversion of the input matrix:

\[\texttt{dst} (I) = \neg \texttt{src} (I)\]

.

In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrix.

Supported matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.bitwise_not"
Parameters
srcinput matrix.
GMat cv::gapi::bitwise_or ( const GMat &  src1,
const GMat &  src2 
)

computes bitwise disjunction of the two matrixes (src1 | src2) Calculates the per-element bit-wise logical disjunction of two matrices of the same size.

In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrices.

Supported matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.bitwise_or"
Parameters
src1first input matrix.
src2second input matrix.
GMat cv::gapi::bitwise_or ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.bitwise_orS"
Parameters
src1first input matrix.
src2scalar, which will be per-lemenetly disjuncted with elements of src1.
GMat cv::gapi::bitwise_xor ( const GMat &  src1,
const GMat &  src2 
)

computes bitwise logical "exclusive or" of the two matrixes (src1 ^ src2) Calculates the per-element bit-wise logical "exclusive or" of two matrices of the same size.

In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrices.

Supported matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.bitwise_xor"
Parameters
src1first input matrix.
src2second input matrix.
GMat cv::gapi::bitwise_xor ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.bitwise_xorS"
Parameters
src1first input matrix.
src2scalar, for which per-lemenet "logical or" operation on elements of src1 will be performed.
GMat cv::gapi::cmpEQ ( const GMat &  src1,
const GMat &  src2 
)

Performs the per-element comparison of two matrices checking if elements from first matrix are equal to elements in second.

The function compares elements of two matrices src1 and src2 of the same size:

\[\texttt{dst} (I) = \texttt{src1} (I) == \texttt{src2} (I)\]

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

\[\texttt{dst} = \texttt{src1} == \texttt{src2}\]

Output matrix of depth CV_8U must have the same size and the same number of channels as the input matrices.

Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpEQ"
Parameters
src1first input matrix.
src2second input matrix/scalar of the same depth as first input matrix.
See Also
min, max, threshold, cmpNE
GMat cv::gapi::cmpEQ ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpEQScalar"
GMat cv::gapi::cmpGE ( const GMat &  src1,
const GMat &  src2 
)

Performs the per-element comparison of two matrices checking if elements from first matrix are greater or equal compare to elements in second.

The function compares elements of two matrices src1 and src2 of the same size:

\[\texttt{dst} (I) = \texttt{src1} (I) >= \texttt{src2} (I)\]

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

\[\texttt{dst} = \texttt{src1} >= \texttt{src2}\]

Output matrix of depth CV_8U must have the same size and the same number of channels as the input matrices.

Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpGE"
Parameters
src1first input matrix.
src2second input matrix/scalar of the same depth as first input matrix.
See Also
min, max, threshold, cmpLE, cmpGT, cmpLS
GMat cv::gapi::cmpGE ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpLGEcalar"
GMat cv::gapi::cmpGT ( const GMat &  src1,
const GMat &  src2 
)

Performs the per-element comparison of two matrices checking if elements from first matrix are greater compare to elements in second.

The function compares elements of two matrices src1 and src2 of the same size:

\[\texttt{dst} (I) = \texttt{src1} (I) > \texttt{src2} (I)\]

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

\[\texttt{dst} = \texttt{src1} > \texttt{src2}\]

Output matrix of depth CV_8U must have the same size and the same number of channels as the input matrices/matrix.

Supported input matrix data types are CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpGT"
Parameters
src1first input matrix.
src2second input matrix/scalar of the same depth as first input matrix.
See Also
min, max, threshold, cmpLE, cmpGE, cmpLS
GMat cv::gapi::cmpGT ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpGTScalar"
GMat cv::gapi::cmpLE ( const GMat &  src1,
const GMat &  src2 
)

Performs the per-element comparison of two matrices checking if elements from first matrix are less or equal compare to elements in second.

The function compares elements of two matrices src1 and src2 of the same size:

\[\texttt{dst} (I) = \texttt{src1} (I) <= \texttt{src2} (I)\]

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

\[\texttt{dst} = \texttt{src1} <= \texttt{src2}\]

Output matrix of depth CV_8U must have the same size and the same number of channels as the input matrices.

Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpLE"
Parameters
src1first input matrix.
src2second input matrix/scalar of the same depth as first input matrix.
See Also
min, max, threshold, cmpGT, cmpGE, cmpLS
GMat cv::gapi::cmpLE ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpLEScalar"
GMat cv::gapi::cmpLT ( const GMat &  src1,
const GMat &  src2 
)

Performs the per-element comparison of two matrices checking if elements from first matrix are less than elements in second.

The function compares elements of two matrices src1 and src2 of the same size:

\[\texttt{dst} (I) = \texttt{src1} (I) < \texttt{src2} (I)\]

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

\[\texttt{dst} = \texttt{src1} < \texttt{src2}\]

Output matrix of depth CV_8U must have the same size and the same number of channels as the input matrices/matrix.

Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpLT"
Parameters
src1first input matrix.
src2second input matrix/scalar of the same depth as first input matrix.
See Also
min, max, threshold, cmpLE, cmpGE, cmpGT
GMat cv::gapi::cmpLT ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpLTScalar"
GMat cv::gapi::cmpNE ( const GMat &  src1,
const GMat &  src2 
)

Performs the per-element comparison of two matrices checking if elements from first matrix are not equal to elements in second.

The function compares elements of two matrices src1 and src2 of the same size:

\[\texttt{dst} (I) = \texttt{src1} (I) != \texttt{src2} (I)\]

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

\[\texttt{dst} = \texttt{src1} != \texttt{src2}\]

Output matrix of depth CV_8U must have the same size and the same number of channels as the input matrices.

Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpNE"
Parameters
src1first input matrix.
src2second input matrix/scalar of the same depth as first input matrix.
See Also
min, max, threshold, cmpEQ
GMat cv::gapi::cmpNE ( const GMat &  src1,
const GScalar &  src2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Function textual ID is "org.opencv.core.pixelwise.compare.cmpNEScalar"
GMat cv::gapi::select ( const GMat &  src1,
const GMat &  src2,
const GMat &  mask 
)

Select values from either first or second of input matrices by given mask. The function set to the output matrix either the value from the first input matrix if corresponding value of mask matrix is 255, or value from the second input matrix (if value of mask matrix set to 0).

Input mask matrix must be of CV_8UC1 type, two other inout matrices and output matrix should be of the same type. The size should be the same for all input and output matrices. Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1.

Note
Function textual ID is "org.opencv.core.pixelwise.select"
Parameters
src1first input matrix.
src2second input matrix.
maskmask input matrix.