Arithmetic Operations
add
InputArray
First input array or scalar
InputArray
Second input array or scalar
OutputArray
Output array with the same size and number of channels as input arrays
InputArray
Optional 8-bit single channel mask that specifies elements to be changed
int
Optional depth of the output array. Default is -1 (same as input)
Saturation is not applied when the output array has depth CV_32S. You may get incorrect sign in case of overflow.
subtract
InputArray
First input array or scalar
InputArray
Second input array or scalar
OutputArray
Output array
InputArray
Optional operation mask
int
Optional depth of the output array
multiply
InputArray
First input array
InputArray
Second input array of the same size and type as src1
OutputArray
Output array
double
Optional scale factor
int
Optional depth of the output array
For matrix multiplication (not element-wise), use gemm() function.
divide
InputArray
First input array (numerator)
InputArray
Second input array (denominator)
double
Scalar factor
OutputArray
Output array
scaleAdd
InputArray
First input array
double
Scale factor for the first array
InputArray
Second input array (same size and type as src1)
OutputArray
Output array
addWeighted
InputArray
First input array
double
Weight of the first array elements
InputArray
Second input array
double
Weight of the second array elements
double
Scalar added to each sum
OutputArray
Output array
Bitwise Operations
bitwise_and
InputArray
First input array or scalar
InputArray
Second input array or scalar
OutputArray
Output array
InputArray
Optional operation mask
bitwise_or
bitwise_xor
bitwise_not
InputArray
Input array
OutputArray
Output array
Comparison Operations
compare
InputArray
First input array or scalar
InputArray
Second input array or scalar
OutputArray
Output array of type CV_8U (0 or 255 values)
int
Comparison operation: CMP_EQ, CMP_GT, CMP_GE, CMP_LT, CMP_LE, CMP_NE
min
max
inRange
InputArray
Input array
InputArray
Inclusive lower boundary array or scalar
InputArray
Inclusive upper boundary array or scalar
OutputArray
Output array of type CV_8U (0 or 255)
Mathematical Operations
sqrt
pow
InputArray
Input array
double
Exponent of power
OutputArray
Output array
exp
log
absdiff
magnitude
InputArray
Floating-point array of x-coordinates
InputArray
Floating-point array of y-coordinates (same size as x)
OutputArray
Output array of magnitudes
phase
InputArray
Array of x-coordinates (floating-point)
InputArray
Array of y-coordinates (same size and type as x)
OutputArray
Output array of angles
bool
When true, angles are in degrees (0-360), otherwise radians (0-2π)
cartToPolar
polarToCart
InputArray
Array of vector magnitudes
InputArray
Array of vector angles
OutputArray
Output array of x-coordinates
OutputArray
Output array of y-coordinates
Matrix Operations
gemm
InputArray
First input matrix
InputArray
Second input matrix
double
Weight for src1 * src2
InputArray
Third input matrix (added to product)
double
Weight for src3
OutputArray
Output matrix
int
Operation flags: GEMM_1_T (transpose src1), GEMM_2_T (transpose src2), GEMM_3_T (transpose src3)
transpose
transform
InputArray
Input array (must be continuous)
OutputArray
Output array
InputArray
Transformation matrix (2x2, 2x3, 3x3, or 3x4 for 2D, 3x3 or 3x4 for 3D)
mulTransposed
InputArray
Input matrix
OutputArray
Output square matrix
bool
If true, computes src^T * src; if false, computes src * src^T
InputArray
Optional delta matrix subtracted from src before multiplication
double
Optional scale factor for the matrix product
Array Manipulation
flip
InputArray
Input array
OutputArray
Output array
int
Flip type: 0 (vertical flip), positive (horizontal flip), negative (both axes)
rotate
int
Rotation type: ROTATE_90_CLOCKWISE, ROTATE_180, ROTATE_90_COUNTERCLOCKWISE
repeat
int
Number of times to repeat along the vertical axis
int
Number of times to repeat along the horizontal axis
hconcat
vconcat
Channel Operations
split
InputArray
Input multi-channel array
OutputArrayOfArrays
Output vector of arrays
merge
mixChannels
const int*
Array of index pairs: fromTo[k2] is source channel, fromTo[k2+1] is destination channel
Channel indexing starts from 0. Use -1 to set a channel to zero.
