Module opencv::core [−][src]
Expand description
Core functionality
Basic structures
C structures and operations
Operations on arrays
Asynchronous API
XML/YAML Persistence
Clustering
Utility and system functions and macros
OpenGL interoperability
Intel IPP Asynchronous C/C++ Converters
Optimization Algorithms
DirectX interoperability
Eigen support
OpenCL support
Intel VA-API/OpenCL (CL-VA) interoperability
Hardware Acceleration Layer
Parallel Processing
Modules
Structs
This is a base class for all more or less complex algorithms in OpenCV
Wrapper for OpenGL Client-Side Vertex arrays.
Returns result of asynchronous operations
Provides result of asynchronous operations
Smart pointer for OpenGL buffer object with reference counting.
BufferPool for use with CUDA streams
Designed for command line parsing
Class for matching keypoint descriptors
Class providing functionality for querying the specified GPU properties.
! Class passed to an error.
File Storage Node class.
used to iterate through sequences and mappings.
XML/YAML/JSON file storage class that encapsulates all the information necessary for writing or reading data to/from a file.
Base storage class for GPU memory with reference counting.
Class with reference counting wrapping special memory type allocation functions from CUDA.
Data structure for salient point detectors.
Linear Discriminant Analysis @todo document this class
n-dimensional dense array class \anchor CVMat_Details
/////////////////////////////// MatConstIterator //////////////////////////////////
Matrix expression representation @anchor MatrixExpressions This is a list of implemented matrix operations that can be combined in arbitrary complex expressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a real-valued scalar ( double )):
@cond IGNORED
struct returned by cv::moments
Principal Component Analysis
@deprecated
Random Number Generator
Mersenne Twister random number generator
Template class specifying a continuous subsequence (slice) of a sequence.
The class represents rotated (i.e. not up-right) rectangles on a plane.
Singular Value Decomposition
The class SparseMat represents multi-dimensional sparse numerical arrays.
Read-Only Sparse Matrix Iterator.
Read-write Sparse Matrix Iterator
the sparse matrix header
sparse matrix node - element of a hash table
This class encapsulates a queue of asynchronous calls.
Class providing a set of static methods to check what NVIDIA* card architecture the CUDA module was built for.
The class defining termination criteria for iterative algorithms.
Smart pointer for OpenGL 2D texture memory with reference counting.
a Class to measure passing time.
@todo document
Wrapper for C++ std::vector
This is the proxy class for passing read-only input arrays into OpenCV functions.
This type is very similar to InputArray except that it is used for input/output and output function parameters.
Enums
Various border types, image boundaries are denoted with |
The target defines how you intend to use the buffer object.
comparison types
error codes
Covariation flags
Available CPU features.
matrix decomposition types
Enumeration providing CUDA computing features.
file storage mode
generalized matrix multiplication flags
k-Means flags
Supported logging levels and their semantic
norm types
render mode
return codes for cv::solveLP() function
Criteria type, can be one of: COUNT, EPS or COUNT + EPS
An Image Format describes the way that the images in Textures store their data.
Usage flags for allocator
Constants
iiiiii|abcdefgh|iiiiiii
with some specified i
same as BORDER_REFLECT_101
do not look outside of ROI
fedcba|abcdefgh|hgfedcb
same as BORDER_REFLECT_101
gfedcb|abcdefgh|gfedcba
aaaaaa|abcdefgh|hhhhhhh
uvwxyz|abcdefgh|ijklmno
cdefgh|abcdefgh|abcdefg
incorrect input align
input COI is not supported
input image depth is not supported by the function
image size is invalid
bad number of channels, for example, some functions accept only single channel matrices.
offset is invalid
number of dimensions is out of range
incorrect input origin
incorrect input roi
image step is wrong, this may happen for a non-continuous matrix.
src1 is equal to src2.
src1 is greater than or equal to src2.
src1 is greater than src2.
src1 is less than or equal to src2.
src1 is less than src2.
src1 is unequal to src2.
If the flag is specified, all the input vectors are stored as columns of the samples matrix. mean should be a single-column vector in this case.
The output covariance matrix is calculated as:
block formula
covar will be a square matrix of the same size as the total number of elements in each input vector. One and only one of #COVAR_SCRAMBLED and #COVAR_NORMAL must be specified.If the flag is specified, all the input vectors are stored as rows of the samples matrix. mean should be a single-row vector in this case.
If the flag is specified, the covariance matrix is scaled. In the “normal” mode, scale is 1./nsamples . In the “scrambled” mode, scale is the reciprocal of the total number of elements in each input vector. By default (if the flag is not specified), the covariance matrix is not scaled ( scale=1 ).
The output covariance matrix is calculated as:
block formula
The covariance matrix will be nsamples x nsamples. Such an unusual covariance matrix is used for fast PCA of a set of very large vectors (see, for example, the EigenFaces technique for face recognition). Eigenvalues of this “scrambled” matrix match the eigenvalues of the true covariance matrix. The “true” eigenvectors can be easily calculated from the eigenvectors of the “scrambled” covariance matrix.If the flag is specified, the function does not calculate mean from the input vectors but, instead, uses the passed mean vector. This is useful if mean has been pre-calculated or known in advance, or if the covariance matrix is calculated by parts. In this case, mean is not a mean vector of the input sub-set of vectors but rather the mean vector of the whole set.
Cascade Lake with AVX-512F/CD/BW/DQ/VL/VNNI
Cannon Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI
Common instructions AVX-512F/CD for all CPUs that support AVX-512
Ice Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI/VNNI/VBMI2/BITALG/VPOPCNTDQ
Knights Landing with AVX-512F/CD/ER/PF
Knights Mill with AVX-512F/CD/ER/PF/4FMAPS/4VNNIW/VPOPCNTDQ
Skylake-X with AVX-512F/CD/BW/DQ/VL
performs an inverse 1D or 2D transform instead of the default forward transform.
performs a forward or inverse transform of every individual row of the input matrix. This flag enables you to transform multiple vectors simultaneously and can be used to decrease the overhead (which is sometimes several times larger than the processing itself) to perform 3D and higher-dimensional transforms and so forth.
Cholesky
inline formula
factorization; the matrix src1 must be symmetrical and positively definedeigenvalue decomposition; the matrix src1 must be symmetrical
Gaussian elimination with the optimal pivot element chosen.
while all the previous flags are mutually exclusive, this flag can be used together with any of the previous; it means that the normal equations
inline formula
are solved instead of the original systeminline formula
QR factorization; the system can be over-defined and/or the matrix src1 can be singular
singular value decomposition (SVD) method; the system can be over-defined and/or the matrix src1 can be singular
specifies that input is complex input. If this flag is set, the input must have 2 channels. On the other hand, for backwards compatibility reason, if input has 2 channels, input is already considered complex.
performs a forward transformation of 1D or 2D real array; the result, though being a complex array, has complex-conjugate symmetry (CCS, see the function description below for details), and such an array can be packed into a real array of the same size as input, which is the fastest option and which is what the function does by default; however, you may wish to get a full complex array (for simpler spectrum analysis, and so on) - pass the flag to enable the function to produce a full-size complex output array.
performs an inverse 1D or 2D transform instead of the default forward transform.
performs an inverse transformation of a 1D or 2D complex array; the result is normally a complex array of the same size, however, if the input array has conjugate-complex symmetry (for example, it is a result of forward transformation with DFT_COMPLEX_OUTPUT flag), the output is a real array; while the function itself does not check whether the input is symmetrical or not, you can pass the flag and then the function will assume the symmetry and produce the real output array (note that when the input is packed into a real array and inverse transformation is executed, the function treats the input as a packed complex-conjugate symmetrical array, and the output will also be a real array).
performs a forward or inverse transform of every individual row of the input matrix; this flag enables you to transform multiple vectors simultaneously and can be used to decrease the overhead (which is sometimes several times larger than the processing itself) to perform 3D and higher-dimensional transformations and so forth.
scales the result: divide it by the number of array elements. Normally, it is combined with DFT_INVERSE.
empty structure (sequence or mapping)
synonym or REAL
compact representation of a sequence or mapping. Used only by YAML writer
an integer
mapping
the node has a name (i.e. it is element of a mapping).
empty node
floating-point number
sequence
text string in UTF-8 encoding
synonym for STR
if set, means that all the collection elements are numbers of the same type (real’s or int’s). UNIFORM is used only when reading FileStorage; FLOW is used only when writing. So they share the same bit
transposes src1
transposes src2
transposes src3
GPU API call error
no CUDA support
image header is NULL
Use kmeans++ center initialization by Arthur and Vassilvitskii [Arthur2007].
Select random initial centers in each attempt.
During the first (and possibly the only) attempt, use the user-supplied labels instead of computing them from the initial centers. For the second and further attempts, use the random or semi-random centers. Use one of KMEANS_*_CENTERS flag to specify the exact method.
Debug message. Disabled in the “Release” build.
Error message
Fatal (critical) error (unrecoverable internal error)
Info message
for using in setLogVevel() call
Verbose (trace) messages. Requires verbosity level. Disabled in the “Release” build.
Warning message
In the case of one input array, calculates the Hamming distance of the array from zero, In the case of two input arrays, calculates the Hamming distance between the arrays.
Similar to NORM_HAMMING, but in the calculation, each two bits of the input sequence will be added and treated as a single bit to be used in the same calculation as NORM_HAMMING.
block formula
block formula
block formula
block formula
flag
flag
bit-mask which can be used to separate norm type from norm flags
OpenCL API call error
OpenCL initialization error
OpenGL API call error
no OpenGL support
the output is the mean vector of all rows/columns of the matrix.
the output is the maximum (column/row-wise) of all rows/columns of the matrix.
the output is the minimum (column/row-wise) of all rows/columns of the matrix.
the output is the sum of all rows/columns of the matrix.
Rotate 90 degrees clockwise
Rotate 270 degrees clockwise
Rotate 180 degrees clockwise
there are multiple maxima for target function - the arbitrary one is returned
there is only one maximum for target function
problem is unbounded (target function can achieve arbitrary high values)
problem is unfeasible (there are no points that satisfy all the constraints imposed)
each matrix row is sorted in the ascending order.
each matrix row is sorted in the descending order; this flag and the previous one are also mutually exclusive.
each matrix column is sorted independently; this flag and the previous one are mutually exclusive.
each matrix row is sorted independently
assertion failed
tracing
pseudo error for back trace
function arg/param is bad
flag is wrong or not supported
unsupported function
bad format of mask (neither 8uC1 nor 8sC1)
an allocated block has been corrupted
bad CvPoint
the input/output structure size is incorrect
division by zero
unknown /unspecified error
incorrect filter offset value
incorrect filter structure content
in-place operation is not supported
internal error (bad state)
incorrect transform kernel content
iteration didn’t converge
insufficient memory
the requested function/feature is not implemented
null pointer
request can’t be completed
everything is ok
some of parameters are out of range
invalid syntax/structure of the parsed file
formats of input/output arrays differ
sizes of input/output structures do not match
the data format/type is not supported by the function
incorrect vector length
Traits
This is a base class for all more or less complex algorithms in OpenCV
Wrapper for OpenGL Client-Side Vertex arrays.
Returns result of asynchronous operations
Provides result of asynchronous operations
BufferPool for use with CUDA streams
Smart pointer for OpenGL buffer object with reference counting.
Designed for command line parsing
This class is used to perform the non-linear non-constrained minimization of a function with known gradient,
This sealed trait is implemented for types that are valid to use as Mat elements
Class providing functionality for querying the specified GPU properties.
This class is used to perform the non-linear non-constrained minimization of a function,
! Class passed to an error.
used to iterate through sequences and mappings.
File Storage Node class.
XML/YAML/JSON file storage class that encapsulates all the information necessary for writing or reading data to/from a file.
@todo document
@todo document
Base storage class for GPU memory with reference counting.
Class with reference counting wrapping special memory type allocation functions from CUDA.
Linear Discriminant Analysis @todo document this class
/////////////////////////////// MatConstIterator //////////////////////////////////
Matrix expression representation @anchor MatrixExpressions This is a list of implemented matrix operations that can be combined in arbitrary complex expressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a real-valued scalar ( double )):
////////////////////////////// Matrix Expressions /////////////////////////////////
n-dimensional dense array class \anchor CVMat_Details
@cond IGNORED
Basic interface for all solvers
Represents function being optimized
Principal Component Analysis
Base class for parallel data processors
@deprecated
Random Number Generator
Mersenne Twister random number generator
Template class specifying a continuous subsequence (slice) of a sequence.
The class represents rotated (i.e. not up-right) rectangles on a plane.
Singular Value Decomposition
Read-Only Sparse Matrix Iterator.
Read-write Sparse Matrix Iterator
The class SparseMat represents multi-dimensional sparse numerical arrays.
the sparse matrix header
sparse matrix node - element of a hash table
This class encapsulates a queue of asynchronous calls.
TLS container base implementation
Class providing a set of static methods to check what NVIDIA* card architecture the CUDA module was built for.
Smart pointer for OpenGL 2D texture memory with reference counting.
a Class to measure passing time.
Trait to serve as a replacement for InputArray
in C++ OpenCV
Trait to serve as a replacement for InputOutputArray
in C++ OpenCV
Trait to serve as a replacement for OutputArray
in C++ OpenCV
@todo document
This sealed trait is implemented for types that are valid to use in corresponding context
This sealed trait is implemented for types that are valid to use in corresponding context
This sealed trait is implemented for types that are valid to use in corresponding context
This sealed trait is implemented for types that are valid to use in corresponding context
This sealed trait is implemented for types that are valid to use in corresponding context
This sealed trait is implemented for types that are valid to use in corresponding context
This sealed trait is implemented for types that are valid to use in corresponding context
This trait is implemented by any type that can be stored inside Vector
.
This is the proxy class for passing read-only input arrays into OpenCV functions.
This type is very similar to InputArray except that it is used for input/output and output function parameters.
Functions
Calculates an absolute value of each matrix element.
Calculates an absolute value of each matrix element.
Calculates the per-element absolute difference between two arrays or between an array and a scalar.
Calculates the per-element sum of two arrays or an array and a scalar.
@relates cv::MatExpr
Override search data path by adding new search location
Append samples search data sub directory
Calculates the weighted sum of two arrays.
Attaches OpenCL context to OpenCV
naive nearest neighbor finder
computes bitwise conjunction of the two arrays (dst = src1 & src2) Calculates the per-element bit-wise conjunction of two arrays or an array and a scalar.
Inverts every bit of an array.
Calculates the per-element bit-wise disjunction of two arrays or an array and a scalar.
Calculates the per-element bit-wise “exclusive or” operation on two arrays or an array and a scalar.
Computes the source location of an extrapolated pixel.
Calculates the covariance matrix of a set of vectors.
Calculates the magnitude and angle of 2D vectors.
Returns true if the specified feature is supported by the host hardware.
C++ default parameters
Checks every element of an input array for invalid values.
proxy for hal::Cholesky
proxy for hal::Cholesky
Performs the per-element comparison of two arrays or an array and scalar value.
Copies the lower or the upper half of a square matrix to its another half.
Converts an array to half precision floating number.
Convert OpenCL buffer to UMat
Converts Texture2D object to OutputArray.
Convert OpenCL image2d_t to UMat
Converts VASurfaceID object to OutputArray.
Scales, calculates absolute values, and converts the result to 8-bit.
Converts InputArray to Texture2D object.
Converts InputArray to VASurfaceID object.
Forms a border around an image.
This is an overloaded member function, provided for convenience (python) Copies the matrix to another one. When the operation mask is specified, if the Mat::create call shown above reallocates the matrix, the newly allocated matrix is initialized with all zeros before copying the data.
Counts non-zero array elements.
Creates a continuous matrix.
Computes the cube root of an argument.
Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
Returns string of cv::Mat depth value: CV_8U -> “CV_8U” or “
Returns the determinant of a square floating-point matrix.
checks whether current device supports the given feature
Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array.
Performs per-element division of two arrays or a scalar by an array.
Performs per-element division of two arrays or a scalar by an array.
Calculates eigenvalues and eigenvectors of a symmetric matrix.
Calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).
Ensures that the size of a matrix is big enough and the matrix has a proper type.
! Signals an error and raises the exception.
! Signals an error and raises the exception.
Calculates the exponent of every array element.
Extracts a single channel from src (coi is 0-based index)
Calculates the angle of a 2D vector in degrees.
Try to find requested data file
C++ default parameters
Returns the list of locations of non-zero pixels
Flips a 2D array around vertical, horizontal, or both axes.
Performs generalized matrix multiplication.
Returns full configuration time cmake output.
Returns list of CPU features enabled during compilation.
Returns the number of CPU ticks.
Returns the number of installed CUDA-enabled devices.
Returns the current device index set by cuda::setDevice or initialized by default.
Get global log tag
Returns feature name by ID
Get global logging level
Returns the number of threads used by OpenCV for parallel regions.
Returns the number of logical CPUs available for the process.
Returns the optimal DFT size for a given vector size.
Returns the index of the currently executed thread within the current parallel region. Always returns 0 if called outside of parallel region.
Returns the number of ticks.
Returns the number of ticks per second.
Get OpenCV type from DirectX type
Get OpenCV type from DirectX type
Returns major library version
Returns minor library version
Returns revision field of the library version
Returns library version string
C++ default parameters
Check if use of OpenVX is possible
Applies horizontal concatenation to given matrices.
Applies horizontal concatenation to given matrices.
Calculates the inverse Discrete Cosine Transform of a 1D or 2D array.
Calculates the inverse Discrete Fourier Transform of a 1D or 2D array.
Checks if array elements lie between the elements of two other arrays.
Creates OpenCL context from GL.
Creates OpenCL context from VA.
Inserts a single channel to dst (coi is 0-based index)
Finds the inverse or pseudo-inverse of a matrix.
C++ default parameters
Finds centers of clusters and groups input samples around the clusters.
Calculates the natural logarithm of every array element.
proxy for hal::LU
proxy for hal::LU
Performs a look-up table transform of an array.
Calculates the magnitude of 2D vectors.
Calculates the Mahalanobis distance between two vectors.
Maps Buffer object to process on CL side (convert to UMat).
Calculates per-element maximum of two arrays or an array and a scalar.
Calculates per-element maximum of two arrays or an array and a scalar.
Calculates per-element maximum of two arrays or an array and a scalar.
Calculates an average (mean) of array elements.
Calculates a mean and standard deviation of array elements.
Creates one multi-channel array out of several single-channel ones.
Creates one multi-channel array out of several single-channel ones.
Calculates per-element minimum of two arrays or an array and a scalar.
Calculates per-element minimum of two arrays or an array and a scalar.
Finds the global minimum and maximum in an array
Finds the global minimum and maximum in an array.
Finds the global minimum and maximum in an array.
Calculates per-element minimum of two arrays or an array and a scalar.
Copies specified channels from input arrays to the specified channels of output arrays.
Copies specified channels from input arrays to the specified channels of output arrays.
Performs the per-element multiplication of two Fourier spectrums.
Calculates the product of a matrix and its transposition.
Calculates the per-element scaled product of two arrays.
Calculates the absolute norm of an array.
Calculates an absolute difference norm or a relative difference norm.
Calculates an absolute difference norm or a relative difference norm.
Normalizes the norm or value range of an array.
Normalizes the norm or value range of an array.
Parallel data processor
converts NaNs to the given number
wrap PCA::backProject
wrap PCA::operator()
wrap PCA::operator() and add eigenvalues output parameter
wrap PCA::operator() and add eigenvalues output parameter
wrap PCA::operator()
wrap PCA::project
Performs the perspective matrix transformation of vectors.
Calculates the rotation angle of 2D vectors.
Calculates x and y coordinates of 2D vectors from their magnitude and angle.
Raises every array element to a power.
C++ default parameters
C++ default parameters
Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.
Shuffles the array elements randomly.
Fills the array with normally distributed random numbers.
Generates a single uniformly-distributed random number or an array of random numbers.
@relates cv::FileNode
C++ default parameters
C++ default parameters
Reduces a matrix to a vector.
Page-locks the memory of matrix and maps it for the device(s).
Render OpenGL texture or primitives.
Render OpenGL texture or primitives.
Render OpenGL texture or primitives.
Fills the output array with repeated copies of the input array.
Fills the output array with repeated copies of the input array.
Explicitly destroys and cleans up all resources associated with the current device in the current process.
Rotates a 2D array in multiples of 90 degrees. The function cv::rotate rotates the array in one of three different ways:
Calculates the sum of a scaled array and another array.
Sets/resets the break-on-error mode.
BufferPool management (must be called before Stream creation)
Sets a device and initializes it for the current thread.
Sets a CUDA device and initializes it for the current thread with OpenGL interoperability.
Initializes a scaled identity matrix.
C++ default parameters
Set global logging level
@cond IGNORED
OpenCV will try to set the number of threads for the next parallel region.
Sets state of default random number generator.
Enable/disable use of OpenVX
Enables or disables the optimized code.
Solves one or more linear systems or least-squares problems.
Finds the real roots of a cubic equation.
Solve given (non-integer) linear programming problem using the Simplex Algorithm (Simplex Method).
Finds the real or complex roots of a polynomial equation.
Sorts each row or each column of a matrix.
Sorts each row or each column of a matrix.
Divides a multi-channel array into several single-channel arrays.
Divides a multi-channel array into several single-channel arrays.
Calculates a square root of array elements.
Calculates the per-element difference between two arrays or array and a scalar.
Calculates the sum of array elements.
wrap SVD::backSubst
wrap SVD::compute
Swaps two matrices
Swaps two matrices
C++ default parameters
C++ default parameters
Returns the default random number generator.
Returns the trace of a matrix.
Performs the matrix transformation of every array element.
Transposes a matrix.
Returns string of cv::Mat depth value: CV_8UC3 -> “CV_8UC3” or “
Unmaps Buffer object (releases UMat, previously mapped from Buffer).
Unmaps the memory of matrix and makes it pageable again.
Check if use of OpenVX is enabled
Returns the status of optimized code usage.
Applies vertical concatenation to given matrices.
Applies vertical concatenation to given matrices.
@relates cv::FileStorage
Write log message
Write log message
Type Definitions
@name Shorter aliases for the most popular specializations of Vec<T,n>