Utility and system functions and macros#
Topics#
Detailed Description#
Namespaces#
Classes#
Name |
Description |
|---|---|
|
|
Automatically Allocated Buffer Class. View details |
|
|
Manages memory block shared by muliple buffers. View details |
|
Designed for command line parsing. View details |
|
Class passed to an error. View details |
|
|
|
Base class for parallel data processors. View details |
|
a Class to measure passing time. View details |
Simple TLS data class. View details |
|
TLS data accumulator with gathering methods. View details |
|
|
Enumerations#
enum cv::AlgorithmHint {
cv::ALGO_HINT_DEFAULT = 0,
cv::ALGO_HINT_ACCURATE = 1,
cv::ALGO_HINT_APPROX = 2
}Flags that allow to modify some functions’ behavior. Used as set of flags. View details
enum CpuFeatures {
CPU_MMX = 1,
CPU_SSE = 2,
CPU_SSE2 = 3,
CPU_SSE3 = 4,
CPU_SSSE3 = 5,
CPU_SSE4_1 = 6,
CPU_SSE4_2 = 7,
CPU_POPCNT = 8,
CPU_FP16 = 9,
CPU_AVX = 10,
CPU_AVX2 = 11,
CPU_FMA3 = 12,
CPU_AVX_512F = 13,
CPU_AVX_512BW = 14,
CPU_AVX_512CD = 15,
CPU_AVX_512DQ = 16,
CPU_AVX_512ER = 17,
CPU_AVX_512IFMA512 = 18,
CPU_AVX_512IFMA = 18,
CPU_AVX_512PF = 19,
CPU_AVX_512VBMI = 20,
CPU_AVX_512VL = 21,
CPU_AVX_512VBMI2 = 22,
CPU_AVX_512VNNI = 23,
CPU_AVX_512BITALG = 24,
CPU_AVX_512VPOPCNTDQ = 25,
CPU_AVX_5124VNNIW = 26,
CPU_AVX_5124FMAPS = 27,
CPU_AVX_VNNI = 28,
CPU_NEON = 100,
CPU_NEON_DOTPROD = 101,
CPU_NEON_FP16 = 102,
CPU_NEON_BF16 = 103,
CPU_SVE = 104,
CPU_MSA = 150,
CPU_RISCVV = 170,
CPU_VSX = 200,
CPU_VSX3 = 201,
CPU_RVV = 210,
CPU_RVV_ZVFH = 211,
CPU_LSX = 230,
CPU_LASX = 231,
CPU_AVX512_SKX = 256,
CPU_AVX512_COMMON = 257,
CPU_AVX512_KNL = 258,
CPU_AVX512_KNM = 259,
CPU_AVX512_CNL = 260,
CPU_AVX512_CLX = 261,
CPU_AVX512_ICL = 262,
CPU_MAX_FEATURE = 512
}Available CPU features. View details
enum cv::SortFlags {
cv::SORT_EVERY_ROW = 0,
cv::SORT_EVERY_COLUMN = 1,
cv::SORT_ASCENDING = 0,
cv::SORT_DESCENDING = 16
}Functions#
Return |
Name |
Description |
|---|---|---|
|
|
Aligns a pointer to the specified number of bytes. |
|
|
Aligns a buffer size to the specified number of bytes. |
|
|
Returns true if the specified feature is supported by the host hardware. |
|
|
|
|
|
|
|
|
|
|
|
Computes the cube root of an argument. |
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
Constructs the ‘fourcc’ code, used in video codecs and many other places. Simply call it with 4 chars like CV_FOURCC(‘I, ‘Y’, ‘U’, ‘V’)`. |
|
|
Rounds floating-point number to the nearest integer not smaller than the original. |
|
|
|
|
|
|
|
|
Rounds floating-point number to the nearest integer not larger than the original. |
|
|
|
|
|
|
|
|
Determines if the argument is Infinity. |
|
|
|
|
|
Determines if the argument is Not A Number. |
|
|
|
|
|
Rounds floating-point number to the nearest integer. |
|
|
|
|
|
|
|
|
Integer division with result round up. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
||
|
||
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
||
|
||
|
Signals an error and raises the exception. |
|
|
|
Signals an error and raises the exception. |
|
|
Calculates the angle of a 2D vector in degrees. |
|
|
Deallocates a memory buffer. |
|
|
Allocates an aligned memory buffer. |
|
|
|
|
Returns a text string formatted using the printf-like expression. |
|
|
Returns full configuration time cmake output. |
|
|
Returns list of CPU features enabled during compilation. |
|
Returns the number of CPU ticks. |
||
Returns AlgorithmHint defined during OpenCV compilation. Defines ALGO_HINT_DEFAULT behavior. |
||
|
|
|
|
Returns feature name by ID. |
|
|
Returns the number of logical CPUs available for the process. |
|
|
Returns the number of threads used by OpenCV for parallel regions. |
|
|
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. |
|
|
Returns major library version. |
|
|
Returns minor library version. |
|
|
Returns revision field of the library version. |
|
Returns library version string. |
||
|
|
Searches for files matching the specified pattern in a directory. |
|
|
Alignment check of passed values. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output operator |
|
Sets the new error handler and the optional user data. |
|
|
|
Round first value up to the nearest multiple of second value. |
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
||
|
||
|
|
|
|
Template function for accurate conversion from one primitive type to another. |
|
|
||
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
||
|
|
|
|
||
|
|
|
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
|
|
|
|
|
|
|
|
||
|
||
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
|
|
|
|
|
||
|
||
|
||
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
|
Sets/resets the break-on-error mode. |
|
|
OpenCV will try to set the number of threads for subsequent parallel regions. |
|
|
Enables or disables the optimized code. |
|
Generates a unique temporary file name. |
|
|
|
Signals an error and terminate application. |
|
Returns the status of optimized code usage. |
Typedef Documentation#
AutoLock#
typedef std::lock_guard< cv::Mutex > cv::AutoLock
#include <opencv2/core/utility.hpp>
ErrorCallback#
typedef int(* cv::ErrorCallback)(int status, const char *func_name, const char *err_msg, const char *file_name, int line, void *userdata)
#include <opencv2/core/utility.hpp>
HammingLUT#
typedef Hamming cv::HammingLUT
#include <opencv2/core/base.hpp>
Mutex#
typedef std::recursive_mutex cv::Mutex
#include <opencv2/core/utility.hpp>
Enumeration Type Documentation#
AlgorithmHint#
enum cv::AlgorithmHint
#include <opencv2/core/utility.hpp>
Flags that allow to modify some functions’ behavior. Used as set of flags.
Enumerator:
|
Default algorithm behaviour defined during OpenCV build. |
|
Use generic portable implementation. |
|
Allow alternative approximations to get faster implementation. Behaviour and result depends on a platform. |
CpuFeatures#
enum CpuFeatures
#include <opencv2/core/cvdef.h>
Available CPU features.
Enumerator:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Skylake-X with AVX-512F/CD/BW/DQ/VL. |
|
Common instructions AVX-512F/CD for all CPUs that support AVX-512. |
|
Knights Landing with AVX-512F/CD/ER/PF. |
|
Knights Mill with AVX-512F/CD/ER/PF/4FMAPS/4VNNIW/VPOPCNTDQ. |
|
Cannon Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI. |
|
Cascade Lake with AVX-512F/CD/BW/DQ/VL/VNNI. |
|
Ice Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI/VNNI/VBMI2/BITALG/VPOPCNTDQ. |
|
SortFlags#
enum cv::SortFlags
#include <opencv2/core.hpp>
Enumerator:
|
each matrix row is sorted independently |
|
each matrix column is sorted independently; this flag and the previous one are mutually exclusive. |
|
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. |
Function Documentation#
alignPtr()#
template<typename _Tp>
static inline _Tp * cv::alignPtr(
_Tp * ptr,
int n = (int) sizeof(_Tp) )
#include <opencv2/core/utility.hpp>
Aligns a pointer to the specified number of bytes.
The function returns the aligned pointer of the same type as the input pointer:
Parameters
ptr— Aligned pointer.n— Alignment size that must be a power of two.
alignSize()#
static inline size_t cv::alignSize(
size_t sz,
int n )
#include <opencv2/core/utility.hpp>
Aligns a buffer size to the specified number of bytes.
The function returns the minimum number that is greater than or equal to sz and is divisible by n :
Parameters
sz— Buffer size to align.n— Alignment size that must be a power of two.
checkHardwareSupport()#
bool cv::checkHardwareSupport(int feature)
#include <opencv2/core/utility.hpp>
Returns true if the specified feature is supported by the host hardware.
The function returns true if the host hardware supports the specified feature. When user calls setUseOptimized(false), the subsequent calls to checkHardwareSupport() will return false until setUseOptimized(true) is called. This way user can dynamically switch on and off the optimized code in OpenCV.
Parameters
feature— The feature of interest, one of cv::CpuFeatures
Cholesky() [1/2]#
bool cv::Cholesky(
double * A,
size_t astep,
int m,
double * b,
size_t bstep,
int n )
#include <opencv2/core/base.hpp>
proxy for hal::Cholesky
Cholesky() [2/2]#
bool cv::Cholesky(
float * A,
size_t astep,
int m,
float * b,
size_t bstep,
int n )
#include <opencv2/core/base.hpp>
proxy for hal::Cholesky
cubeRoot() [1/2]#
static inline double cv::cubeRoot(double val)
#include <opencv2/core/base.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cubeRoot with argument of double type calls std::cbrt(double)
cubeRoot() [2/2]#
float cv::cubeRoot(float val)
#include <opencv2/core/base.hpp>
Computes the cube root of an argument.
The function cubeRoot computes \(\sqrt[3]{\texttt{val}}\). Negative arguments are handled correctly. NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for single-precision data.
Parameters
val— A function argument.
cv_abs() [1/11]#
template<typename _Tp>
inline _Tp cv::cv_abs(_Tp x)
#include <opencv2/core/base.hpp>
cv_abs() [2/11]#
inline float cv::cv_abs(bfloat x)
#include <opencv2/core/base.hpp>
cv_abs() [3/11]#
inline float cv::cv_abs(hfloat x)
#include <opencv2/core/base.hpp>
cv_abs() [4/11]#
inline unsigned cv::cv_abs(int x)
#include <opencv2/core/base.hpp>
cv_abs() [5/11]#
inline uint64 cv::cv_abs(int64 x)
#include <opencv2/core/base.hpp>
cv_abs() [6/11]#
inline int cv::cv_abs(schar x)
#include <opencv2/core/base.hpp>
cv_abs() [7/11]#
inline int cv::cv_abs(short x)
#include <opencv2/core/base.hpp>
cv_abs() [8/11]#
inline int cv::cv_abs(uchar x)
#include <opencv2/core/base.hpp>
cv_abs() [9/11]#
inline uint64 cv::cv_abs(uint64 x)
#include <opencv2/core/base.hpp>
cv_abs() [10/11]#
inline unsigned cv::cv_abs(unsigned x)
#include <opencv2/core/base.hpp>
cv_abs() [11/11]#
inline int cv::cv_abs(ushort x)
#include <opencv2/core/base.hpp>
cv_absdiff() [1/10]#
template<typename _Tp>
inline _Tp cv::cv_absdiff(
_Tp x,
_Tp y )
#include <opencv2/core/base.hpp>
cv_absdiff() [2/10]#
inline float cv::cv_absdiff(
bfloat x,
bfloat y )
#include <opencv2/core/base.hpp>
cv_absdiff() [3/10]#
inline float cv::cv_absdiff(
hfloat x,
hfloat y )
#include <opencv2/core/base.hpp>
cv_absdiff() [4/10]#
inline unsigned cv::cv_absdiff(
int x,
int y )
#include <opencv2/core/base.hpp>
cv_absdiff() [5/10]#
inline int cv::cv_absdiff(
schar x,
schar y )
#include <opencv2/core/base.hpp>
cv_absdiff() [6/10]#
inline int cv::cv_absdiff(
short x,
short y )
#include <opencv2/core/base.hpp>
cv_absdiff() [7/10]#
inline int cv::cv_absdiff(
uchar x,
uchar y )
#include <opencv2/core/base.hpp>
cv_absdiff() [8/10]#
inline uint64 cv::cv_absdiff(
uint64 x,
uint64 y )
#include <opencv2/core/base.hpp>
cv_absdiff() [9/10]#
inline unsigned cv::cv_absdiff(
unsigned x,
unsigned y )
#include <opencv2/core/base.hpp>
cv_absdiff() [10/10]#
inline int cv::cv_absdiff(
ushort x,
ushort y )
#include <opencv2/core/base.hpp>
CV_FOURCC()#
int CV_FOURCC(
char c1,
char c2,
char c3,
char c4 )
#include <opencv2/core/cvdef.h>
Constructs the ‘fourcc’ code, used in video codecs and many other places. Simply call it with 4 chars like CV_FOURCC(‘I, ‘Y’, ‘U’, ‘V’)`.
cvCeil() [1/3]#
int cvCeil(double value)
#include <opencv2/core/fast_math.hpp>
Rounds floating-point number to the nearest integer not smaller than the original.
The function computes an integer i such that:
Parameters
value— floating-point number. If the value is outside of INT_MIN … INT_MAX range, the result is not defined.
cvCeil() [2/3]#
int cvCeil(float value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvCeil() [3/3]#
int cvCeil(int value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvFloor() [1/3]#
int cvFloor(double value)
#include <opencv2/core/fast_math.hpp>
Rounds floating-point number to the nearest integer not larger than the original.
The function computes an integer i such that:
Parameters
value— floating-point number. If the value is outside of INT_MIN … INT_MAX range, the result is not defined.
cvFloor() [2/3]#
CV_DISABLE_UBSAN int cvFloor(float value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvFloor() [3/3]#
int cvFloor(int value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvIsInf() [1/2]#
int cvIsInf(double value)
#include <opencv2/core/fast_math.hpp>
Determines if the argument is Infinity.
The function returns 1 if the argument is a plus or minus infinity (as defined by IEEE754 standard) and 0 otherwise.
Parameters
value— The input floating-point value
cvIsInf() [2/2]#
int cvIsInf(float value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvIsNaN() [1/2]#
int cvIsNaN(double value)
#include <opencv2/core/fast_math.hpp>
Determines if the argument is Not A Number.
The function returns 1 if the argument is Not A Number (as defined by IEEE754 standard), 0 otherwise.
Parameters
value— The input floating-point value
cvIsNaN() [2/2]#
int cvIsNaN(float value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvRound() [1/3]#
int cvRound(double value)
#include <opencv2/core/fast_math.hpp>
Rounds floating-point number to the nearest integer.
Parameters
value— floating-point number. If the value is outside of INT_MIN … INT_MAX range, the result is not defined.
cvRound() [2/3]#
int cvRound(float value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cvRound() [3/3]#
int cvRound(int value)
#include <opencv2/core/fast_math.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
divUp() [1/2]#
static inline int cv::divUp(
int a,
unsigned int b )
#include <opencv2/core/utility.hpp>
Integer division with result round up.
Use this function instead of ceil((float)a / b) expressions.
See also
divUp() [2/2]#
static inline size_t cv::divUp(
size_t a,
unsigned int b )
#include <opencv2/core/utility.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
dumpBool()#
static inline String cv::utils::dumpBool(bool argument)
#include <opencv2/core/bindings_utils.hpp>
dumpCString()#
static inline String cv::utils::dumpCString(const char * argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpDouble()#
static inline String cv::utils::dumpDouble(double argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpFloat()#
static inline String cv::utils::dumpFloat(float argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpInputArray()#
String cv::utils::dumpInputArray(InputArray argument)
#include <opencv2/core/bindings_utils.hpp>
dumpInputArrayOfArrays()#
String cv::utils::dumpInputArrayOfArrays(InputArrayOfArrays argument)
#include <opencv2/core/bindings_utils.hpp>
dumpInputOutputArray()#
String cv::utils::dumpInputOutputArray(InputOutputArray argument)
#include <opencv2/core/bindings_utils.hpp>
dumpInputOutputArrayOfArrays()#
String cv::utils::dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument)
#include <opencv2/core/bindings_utils.hpp>
dumpInt()#
static inline String cv::utils::dumpInt(int argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpInt64()#
static inline String cv::utils::dumpInt64(int64 argument)
#include <opencv2/core/bindings_utils.hpp>
dumpRange()#
static inline String cv::utils::dumpRange(const Range & argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpRect()#
static inline String cv::utils::dumpRect(const Rect & argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpRotatedRect()#
static inline String cv::utils::dumpRotatedRect(const RotatedRect & argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpSizeT()#
static inline String cv::utils::dumpSizeT(size_t argument)
#include <opencv2/core/bindings_utils.hpp>
dumpString()#
static inline String cv::utils::dumpString(const String & argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpTermCriteria()#
static inline String cv::utils::dumpTermCriteria(const TermCriteria & argument)
#include <opencv2/core/bindings_utils.hpp>
Here is the call graph for this function:
dumpVectorOfDouble()#
String cv::utils::dumpVectorOfDouble(const std::vector< double > & vec)
#include <opencv2/core/bindings_utils.hpp>
dumpVectorOfInt()#
String cv::utils::dumpVectorOfInt(const std::vector< int > & vec)
#include <opencv2/core/bindings_utils.hpp>
dumpVectorOfRect()#
String cv::utils::dumpVectorOfRect(const std::vector< Rect > & vec)
#include <opencv2/core/bindings_utils.hpp>
error() [1/2]#
void cv::error(const Exception & exc)
#include <opencv2/core/exception.hpp>
Signals an error and raises the exception.
By default the function prints information about the error to stderr, then it either stops if cv::setBreakOnError() had been called before or raises the exception. It is possible to alternate error processing by using redirectError().
Deprecated
drop this version
Parameters
exc— the exception raisen.
error() [2/2]#
void cv::error(
Error::Code code,
const String & err,
const char * func,
const char * file,
int line )
#include <opencv2/core/exception.hpp>
Signals an error and raises the exception.
By default the function prints information about the error to stderr, then it either stops if setBreakOnError() had been called before or raises the exception. It is possible to alternate error processing by using redirectError().
See also
Parameters
code— - error code (Error::Code)err— - error descriptionfunc— - function name. Available only when the compiler supports getting itfile— - source file name where the error has occurredline— - line number in the source file where the error has occurred
fastAtan2()#
float cv::fastAtan2(
float y,
float x )
#include <opencv2/core/base.hpp>
Calculates the angle of a 2D vector in degrees.
The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured in degrees and varies from 0 to 360 degrees. The accuracy is about 0.3 degrees.
Parameters
x— x-coordinate of the vector.y— y-coordinate of the vector.
fastFree()#
void cv::fastFree(void * ptr)
#include <opencv2/core/cvstd.hpp>
Deallocates a memory buffer.
The function deallocates the buffer allocated with fastMalloc . If NULL pointer is passed, the function does nothing. C version of the function clears the pointer pptr to avoid problems with double memory deallocation.
Parameters
ptr— Pointer to the allocated buffer.
fastMalloc()#
void * cv::fastMalloc(size_t bufSize)
#include <opencv2/core/cvstd.hpp>
Allocates an aligned memory buffer.
The function allocates the buffer of the specified size and returns it. When the buffer size is 16 bytes or more, the returned buffer is aligned to 16 bytes.
Parameters
bufSize— Allocated buffer size.
format()#
String cv::format(
const char * fmt,
… )
#include <opencv2/core/operations.hpp>
Returns a text string formatted using the printf-like expression.
The function acts like sprintf but forms and returns an STL string. It can be used to form an error message in the Exception constructor. Note**:
Type |
Specifier |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Parameters
fmt— printf-compatible formatting specifiers.
getBuildInformation()#
const String & cv::getBuildInformation()
#include <opencv2/core/utility.hpp>
Returns full configuration time cmake output.
Returned value is raw cmake output including version control system revision, compiler version, compiler flags, enabled modules and third party libraries, etc. Output format depends on target architecture.
getCPUFeaturesLine()#
std::string cv::getCPUFeaturesLine()
#include <opencv2/core/utility.hpp>
Returns list of CPU features enabled during compilation.
Returned value is a string containing space separated list of CPU features with following markers:
no markers - baseline features
prefix
*- features enabled in dispatchersuffix
?- features enabled but not available in HW
Example: SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?
getCPUTickCount()#
int64 cv::getCPUTickCount()
#include <opencv2/core/utility.hpp>
Returns the number of CPU ticks.
The function returns the current number of CPU ticks on some architectures (such as x86, x64, PowerPC). On other platforms the function is equivalent to getTickCount. It can also be used for very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU systems a thread, from which getCPUTickCount is called, can be suspended and resumed at another CPU with its own counter. So, theoretically (and practically) the subsequent calls to the function do not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU frequency depending on the load, the number of CPU clocks spent in some code cannot be directly converted to time units. Therefore, getTickCount is generally a preferable solution for measuring execution time.
getDefaultAlgorithmHint()#
AlgorithmHint cv::getDefaultAlgorithmHint()
#include <opencv2/core/utility.hpp>
Returns AlgorithmHint defined during OpenCV compilation. Defines ALGO_HINT_DEFAULT behavior.
getElemSize()#
static inline size_t cv::getElemSize(int type)
#include <opencv2/core/utility.hpp>
getHardwareFeatureName()#
String cv::getHardwareFeatureName(int feature)
#include <opencv2/core/utility.hpp>
Returns feature name by ID.
Returns empty string if feature is not defined
getNumberOfCPUs()#
int cv::getNumberOfCPUs()
#include <opencv2/core/utility.hpp>
Returns the number of logical CPUs available for the process.
getNumThreads()#
int cv::getNumThreads()
#include <opencv2/core/utility.hpp>
Returns the number of threads used by OpenCV for parallel regions.
Always returns 1 if OpenCV is built without threading support.
The exact meaning of return value depends on the threading framework used by OpenCV library:
TBB- The number of threads, that OpenCV will try to use for parallel regions. If there is any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns default number of threads used by TBB library.OpenMP- An upper bound on the number of threads that could be used to form a new team.Concurrency- The number of threads, that OpenCV will try to use for parallel regions.GCD- Unsupported; returns the GCD thread pool limit (512) for compatibility.C=- The number of threads, that OpenCV will try to use for parallel regions, if before called setNumThreads with threads > 0, otherwise returns the number of logical CPUs, available for the process.
getThreadNum()#
int cv::getThreadNum()
#include <opencv2/core/utility.hpp>
Returns the index of the currently executed thread within the current parallel region. Always returns 0 if called outside of parallel region.
Deprecated
Current implementation doesn’t corresponding to this documentation.
The exact meaning of the return value depends on the threading framework used by OpenCV library:
TBB- Unsupported with current 4.1 TBB release. Maybe will be supported in future.OpenMP- The thread number, within the current team, of the calling thread.Concurrency- An ID for the virtual processor that the current context is executing on (0 for master thread and unique number for others, but not necessary 1,2,3,…).GCD- System calling thread’s ID. Never returns 0 inside parallel region.C=- The index of the current parallel task.
getTickCount()#
int64 cv::getTickCount()
#include <opencv2/core/utility.hpp>
Returns the number of ticks.
The function returns the number of ticks after the certain event (for example, when the machine was turned on). It can be used to initialize RNG or to measure a function execution time by reading the tick count before and after the function call.
See also
getTickFrequency()#
double cv::getTickFrequency()
#include <opencv2/core/utility.hpp>
Returns the number of ticks per second.
The function returns the number of ticks per second. That is, the following code computes the execution time in seconds:
double t = (double)getTickCount();
// do something ...
t = ((double)getTickCount() - t)/getTickFrequency();
See also
getVersionMajor()#
int cv::getVersionMajor()
#include <opencv2/core/utility.hpp>
Returns major library version.
getVersionMinor()#
int cv::getVersionMinor()
#include <opencv2/core/utility.hpp>
Returns minor library version.
getVersionRevision()#
int cv::getVersionRevision()
#include <opencv2/core/utility.hpp>
Returns revision field of the library version.
getVersionString()#
String cv::getVersionString()
#include <opencv2/core/utility.hpp>
Returns library version string.
For example “3.4.1-dev”.
See also
getMajorVersion, getMinorVersion, getRevisionVersion
glob()#
void cv::glob(
String pattern,
std::vector< String > & result,
bool recursive = false )
#include <opencv2/core/utility.hpp>
Searches for files matching the specified pattern in a directory.
This function searches for files that match a given pattern (e.g., *.jpg) in the specified directory. The search can be limited to the directory itself or be recursive, including subdirectories.
Parameters
pattern— The file search pattern, which can include wildcards like*(for matching multiple characters) or?(for matching a single character).result— Output vector where the file paths matching the search pattern will be stored.recursive— (optional) Boolean flag indicating whether to search subdirectories recursively. If true, the search will include all subdirectories. The default value isfalse.
isAligned() [1/5]#
template<int N, typename T>
static inline bool cv::isAligned(const T & data)
#include <opencv2/core/utility.hpp>
Alignment check of passed values.
Usage: isAligned<sizeof(int)>(...)
Note
Alignment(N) must be a power of 2 (2**k, 2^k)
isAligned() [2/5]#
template<int N>
static inline bool cv::isAligned(const void * p1)
#include <opencv2/core/utility.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Here is the call graph for this function:
isAligned() [3/5]#
template<int N>
static inline bool cv::isAligned(
const void * p1,
const void * p2 )
#include <opencv2/core/utility.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Here is the call graph for this function:
isAligned() [4/5]#
template<int N>
static inline bool cv::isAligned(
const void * p1,
const void * p2,
const void * p3 )
#include <opencv2/core/utility.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Here is the call graph for this function:
isAligned() [5/5]#
template<int N>
static inline bool cv::isAligned(
const void * p1,
const void * p2,
const void * p3,
const void * p4 )
#include <opencv2/core/utility.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Here is the call graph for this function:
LU() [1/2]#
int cv::LU(
double * A,
size_t astep,
int m,
double * b,
size_t bstep,
int n )
#include <opencv2/core/base.hpp>
proxy for hal::LU
LU() [2/2]#
int cv::LU(
float * A,
size_t astep,
int m,
float * b,
size_t bstep,
int n )
#include <opencv2/core/base.hpp>
proxy for hal::LU
normInf() [1/2]#
template<typename _Tp, typename _AccTp>
static inline _AccTp cv::normInf(
const _Tp * a,
const _Tp * b,
int n )
#include <opencv2/core/base.hpp>
Here is the call graph for this function:
normInf() [2/2]#
template<typename _Tp, typename _AccTp>
static inline _AccTp cv::normInf(
const _Tp * a,
int n )
#include <opencv2/core/base.hpp>
Here is the call graph for this function:
normL1() [1/2]#
template<typename _Tp, typename _AccTp>
static inline _AccTp cv::normL1(
const _Tp * a,
const _Tp * b,
int n )
#include <opencv2/core/base.hpp>
Here is the call graph for this function:
normL1() [2/2]#
template<typename _Tp, typename _AccTp>
static inline _AccTp cv::normL1(
const _Tp * a,
int n )
#include <opencv2/core/base.hpp>
Here is the call graph for this function:
normL2Sqr() [1/2]#
template<typename _Tp, typename _AccTp>
static inline _AccTp cv::normL2Sqr(
const _Tp * a,
const _Tp * b,
int n )
#include <opencv2/core/base.hpp>
normL2Sqr() [2/2]#
template<typename _Tp, typename _AccTp>
static inline _AccTp cv::normL2Sqr(
const _Tp * a,
int n )
#include <opencv2/core/base.hpp>
operator<<()#
static inline std::ostream & cv::operator<<(
std::ostream & out,
const TickMeter & tm )
#include <opencv2/core/utility.hpp>
output operator
Here is the call graph for this function:
redirectError()#
ErrorCallback cv::redirectError(
ErrorCallback errCallback,
void * userdata = 0,
void ** prevUserdata = 0 )
#include <opencv2/core/utility.hpp>
Sets the new error handler and the optional user data.
The function sets the new error handler, called from cv::error().
Parameters
errCallback— the new error handler. If NULL, the default error handler is used.userdata— the optional user data pointer, passed to the callback.prevUserdata— the optional output parameter where the previous user data pointer is stored
Returns — the previous error handler
roundUp() [1/2]#
static inline int cv::roundUp(
int a,
unsigned int b )
#include <opencv2/core/utility.hpp>
Round first value up to the nearest multiple of second value.
Use this function instead of ceil((float)a / b) * b expressions.
See also
roundUp() [2/2]#
static inline size_t cv::roundUp(
size_t a,
unsigned int b )
#include <opencv2/core/utility.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [1/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(bfloat v)
#include <opencv2/core/saturate.hpp>
Here is the call graph for this function:
saturate_cast() [2/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(bool v)
#include <opencv2/core/saturate.hpp>
Here is the call graph for this function:
saturate_cast() [3/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(double v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [4/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(float v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [5/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(hfloat v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Here is the call graph for this function:
saturate_cast() [6/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(int v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [7/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(int64 v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [8/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(schar v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [9/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(short v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [10/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(uchar v)
#include <opencv2/core/saturate.hpp>
Template function for accurate conversion from one primitive type to another.
The function saturate_cast resembles the standard C++ cast operations, such as static_cast
uchar a = saturate_cast<uchar>(-100); // a = 0 (UCHAR_MIN)
short b = saturate_cast<short>(33333.33333); // b = 32767 (SHRT_MAX)
Such clipping is done when the target type is unsigned char , signed char , unsigned short or signed short . For 32-bit integers, no clipping is done.
When the parameter is a floating-point value and the target type is an integer (8-, 16- or 32-bit), the floating-point value is first rounded to the nearest integer and then clipped if needed (when the target type is 8- or 16-bit).
See also
Parameters
v— Function parameter.
saturate_cast() [11/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(uint64 v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [12/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(unsigned v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
saturate_cast() [13/13]#
template<typename _Tp>
static inline _Tp cv::saturate_cast(ushort v)
#include <opencv2/core/saturate.hpp>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
setBreakOnError()#
bool cv::setBreakOnError(bool flag)
#include <opencv2/core/utility.hpp>
Sets/resets the break-on-error mode.
When the break-on-error mode is set, the default error handler issues a hardware exception, which can make debugging more convenient.
Returns — the previous state
setNumThreads()#
void cv::setNumThreads(int nthreads)
#include <opencv2/core/utility.hpp>
OpenCV will try to set the number of threads for subsequent parallel regions.
If threads == 1, OpenCV will disable threading optimizations and run all it’s functions sequentially. Passing threads < 0 will reset threads number to system default. The function is not thread-safe. It must not be called in parallel region or concurrent threads.
OpenCV will try to run its functions with specified threads number, but some behaviour differs from framework:
TBB- User-defined parallel constructions will run with the same threads number, if another is not specified. If later on user creates his own scheduler, OpenCV will use it.OpenMP- No special defined behaviour.Concurrency- If threads == 1, OpenCV will disable threading optimizations and run its functions sequentially.GCD- Supports only values <= 0.C=- No special defined behaviour.
nthreads
Number of threads used by OpenCV.
setUseOptimized()#
void cv::setUseOptimized(bool onoff)
#include <opencv2/core/utility.hpp>
Enables or disables the optimized code.
The function can be used to dynamically turn on and off optimized dispatched code (code that uses SSE4.2, AVX/AVX2, and other instructions on the platforms that support it). It sets a global flag that is further checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only safe to call the function on the very top level in your application where you can be sure that no other OpenCV function is currently executed.
By default, the optimized code is enabled unless you disable it in CMake. The current status can be retrieved using useOptimized.
Parameters
onoff— The boolean flag specifying whether the optimized code should be used (onoff=true) or not (onoff=false).
tempfile()#
String cv::tempfile(const char * suffix = 0)
#include <opencv2/core/utility.hpp>
Generates a unique temporary file name.
This function generates a full, unique file path for a temporary file, which can be used to create temporary files for various purposes.
Note
The function does not create the file, it only generates the name.
The file name is unique for the system session.
Works cross-platform (Windows, Linux, macOS).
Parameters
suffix— (optional) The desired file extension or suffix for the temporary file (e.g., “.png”, “.txt”). If no suffix is provided (suffix = 0), the file will not have a specific extension.
Returns — cv::String A full unique path for the temporary file.
terminate()#
void cv::terminate(
Error::Code code,
const String & err,
const char * func,
const char * file,
int line )
#include <opencv2/core/exception.hpp>
Signals an error and terminate application.
By default the function prints information about the error to stderr, then it terminates application with std::terminate. The function is designed for invariants check in functions and methods with noexcept attribute.
See also
Parameters
code— - error code (Error::Code)err— - error descriptionfunc— - function name. Available only when the compiler supports getting itfile— - source file name where the error has occurredline— - line number in the source file where the error has occurred
useOptimized()#
bool cv::useOptimized()
#include <opencv2/core/utility.hpp>
Returns the status of optimized code usage.
The function returns true if the optimized code is enabled. Otherwise, it returns false.
Macro Definition Documentation#
__has_cpp_attribute#
#define __has_cpp_attribute(__x)
#include <opencv2/core/cvdef.h>
Value:
0
CV_2PI#
#define CV_2PI
#include <opencv2/core/cvdef.h>
Value:
6.283185307179586476925286766559
CV_ALWAYS_INLINE#
#define CV_ALWAYS_INLINE
#include <opencv2/core/cvdef.h>
Value:
inline
CV_Assert#
#define CV_Assert(expr)
#include <opencv2/core/exception.hpp>
Value:
do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
Checks a condition at runtime and throws exception if it fails.
The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression. If it is 0, the macros raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release configurations while CV_DbgAssert is only retained in the Debug configuration. CV_AssertTerminate is analog of CV_Assert for invariants check in functions with noexcept attribute. It does not throw exception, but terminates the application.
CV_AssertTerminate#
#define CV_AssertTerminate(expr)
#include <opencv2/core/exception.hpp>
Value:
do { if(!!(expr)) ; else cv::terminate( #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
CV_AUTOSTEP#
#define CV_AUTOSTEP
#include <opencv2/core/cvdef.h>
Value:
0x7fffffff
CV_CDECL#
#define CV_CDECL
#include <opencv2/core/cvdef.h>
CV_CMP#
#define CV_CMP(a, b)
#include <opencv2/core/cvdef.h>
Value:
(((a) > (b)) - ((a) < (b)))
CV_CONSTEXPR#
#define CV_CONSTEXPR
#include <opencv2/core/cvdef.h>
Value:
constexpr
CV_CPU_AVX#
#define CV_CPU_AVX
#include <opencv2/core/cvdef.h>
Value:
10
CV_CPU_AVX2#
#define CV_CPU_AVX2
#include <opencv2/core/cvdef.h>
Value:
11
CV_CPU_AVX512_CLX#
#define CV_CPU_AVX512_CLX
#include <opencv2/core/cvdef.h>
Value:
261
CV_CPU_AVX512_CNL#
#define CV_CPU_AVX512_CNL
#include <opencv2/core/cvdef.h>
Value:
260
CV_CPU_AVX512_COMMON#
#define CV_CPU_AVX512_COMMON
#include <opencv2/core/cvdef.h>
Value:
257
CV_CPU_AVX512_ICL#
#define CV_CPU_AVX512_ICL
#include <opencv2/core/cvdef.h>
Value:
262
CV_CPU_AVX512_KNL#
#define CV_CPU_AVX512_KNL
#include <opencv2/core/cvdef.h>
Value:
258
CV_CPU_AVX512_KNM#
#define CV_CPU_AVX512_KNM
#include <opencv2/core/cvdef.h>
Value:
259
CV_CPU_AVX512_SKX#
#define CV_CPU_AVX512_SKX
#include <opencv2/core/cvdef.h>
Value:
256
CV_CPU_AVX_5124FMAPS#
#define CV_CPU_AVX_5124FMAPS
#include <opencv2/core/cvdef.h>
Value:
27
CV_CPU_AVX_5124VNNIW#
#define CV_CPU_AVX_5124VNNIW
#include <opencv2/core/cvdef.h>
Value:
26
CV_CPU_AVX_512BITALG#
#define CV_CPU_AVX_512BITALG
#include <opencv2/core/cvdef.h>
Value:
24
CV_CPU_AVX_512BW#
#define CV_CPU_AVX_512BW
#include <opencv2/core/cvdef.h>
Value:
14
CV_CPU_AVX_512CD#
#define CV_CPU_AVX_512CD
#include <opencv2/core/cvdef.h>
Value:
15
CV_CPU_AVX_512DQ#
#define CV_CPU_AVX_512DQ
#include <opencv2/core/cvdef.h>
Value:
16
CV_CPU_AVX_512ER#
#define CV_CPU_AVX_512ER
#include <opencv2/core/cvdef.h>
Value:
17
CV_CPU_AVX_512F#
#define CV_CPU_AVX_512F
#include <opencv2/core/cvdef.h>
Value:
13
CV_CPU_AVX_512IFMA#
#define CV_CPU_AVX_512IFMA
#include <opencv2/core/cvdef.h>
Value:
18
CV_CPU_AVX_512IFMA512#
#define CV_CPU_AVX_512IFMA512
#include <opencv2/core/cvdef.h>
Value:
18
CV_CPU_AVX_512PF#
#define CV_CPU_AVX_512PF
#include <opencv2/core/cvdef.h>
Value:
19
CV_CPU_AVX_512VBMI#
#define CV_CPU_AVX_512VBMI
#include <opencv2/core/cvdef.h>
Value:
20
CV_CPU_AVX_512VBMI2#
#define CV_CPU_AVX_512VBMI2
#include <opencv2/core/cvdef.h>
Value:
22
CV_CPU_AVX_512VL#
#define CV_CPU_AVX_512VL
#include <opencv2/core/cvdef.h>
Value:
21
CV_CPU_AVX_512VNNI#
#define CV_CPU_AVX_512VNNI
#include <opencv2/core/cvdef.h>
Value:
23
CV_CPU_AVX_512VPOPCNTDQ#
#define CV_CPU_AVX_512VPOPCNTDQ
#include <opencv2/core/cvdef.h>
Value:
25
CV_CPU_AVX_VNNI#
#define CV_CPU_AVX_VNNI
#include <opencv2/core/cvdef.h>
Value:
28
CV_CPU_FMA3#
#define CV_CPU_FMA3
#include <opencv2/core/cvdef.h>
Value:
12
CV_CPU_FP16#
#define CV_CPU_FP16
#include <opencv2/core/cvdef.h>
Value:
9
CV_CPU_LASX#
#define CV_CPU_LASX
#include <opencv2/core/cvdef.h>
Value:
231
CV_CPU_LSX#
#define CV_CPU_LSX
#include <opencv2/core/cvdef.h>
Value:
230
CV_CPU_MMX#
#define CV_CPU_MMX
#include <opencv2/core/cvdef.h>
Value:
1
CV_CPU_MSA#
#define CV_CPU_MSA
#include <opencv2/core/cvdef.h>
Value:
150
CV_CPU_NEON#
#define CV_CPU_NEON
#include <opencv2/core/cvdef.h>
Value:
100
CV_CPU_NEON_BF16#
#define CV_CPU_NEON_BF16
#include <opencv2/core/cvdef.h>
Value:
103
CV_CPU_NEON_DOTPROD#
#define CV_CPU_NEON_DOTPROD
#include <opencv2/core/cvdef.h>
Value:
101
CV_CPU_NEON_FP16#
#define CV_CPU_NEON_FP16
#include <opencv2/core/cvdef.h>
Value:
102
CV_CPU_NONE#
#define CV_CPU_NONE
#include <opencv2/core/cvdef.h>
Value:
0
CV_CPU_POPCNT#
#define CV_CPU_POPCNT
#include <opencv2/core/cvdef.h>
Value:
8
CV_CPU_RISCVV#
#define CV_CPU_RISCVV
#include <opencv2/core/cvdef.h>
Value:
170
CV_CPU_RVV#
#define CV_CPU_RVV
#include <opencv2/core/cvdef.h>
Value:
210
CV_CPU_RVV_ZVFH#
#define CV_CPU_RVV_ZVFH
#include <opencv2/core/cvdef.h>
Value:
211
CV_CPU_SSE#
#define CV_CPU_SSE
#include <opencv2/core/cvdef.h>
Value:
2
CV_CPU_SSE2#
#define CV_CPU_SSE2
#include <opencv2/core/cvdef.h>
Value:
3
CV_CPU_SSE3#
#define CV_CPU_SSE3
#include <opencv2/core/cvdef.h>
Value:
4
CV_CPU_SSE4_1#
#define CV_CPU_SSE4_1
#include <opencv2/core/cvdef.h>
Value:
6
CV_CPU_SSE4_2#
#define CV_CPU_SSE4_2
#include <opencv2/core/cvdef.h>
Value:
7
CV_CPU_SSSE3#
#define CV_CPU_SSSE3
#include <opencv2/core/cvdef.h>
Value:
5
CV_CPU_SVE#
#define CV_CPU_SVE
#include <opencv2/core/cvdef.h>
Value:
104
CV_CPU_VSX#
#define CV_CPU_VSX
#include <opencv2/core/cvdef.h>
Value:
200
CV_CPU_VSX3#
#define CV_CPU_VSX3
#include <opencv2/core/cvdef.h>
Value:
201
CV_CXX11#
#define CV_CXX11
#include <opencv2/core/cvdef.h>
Value:
1
CV_DbgAssert#
#define CV_DbgAssert(expr)
#include <opencv2/core/exception.hpp>
replaced with CV_Assert(expr) in Debug configuration
CV_DECL_ALIGNED#
#define CV_DECL_ALIGNED(x)
#include <opencv2/core/cvdef.h>
CV_DISABLE_UBSAN#
#define CV_DISABLE_UBSAN
#include <opencv2/core/cvdef.h>
CV_ELEM_SIZE#
#define CV_ELEM_SIZE(type)
#include <opencv2/core/cvdef.h>
Value:
CV_ELEM_SIZE1#
#define CV_ELEM_SIZE1(type)
#include <opencv2/core/cvdef.h>
Value:
((int)((0x4881228442211ULL >> (CV_MAT_DEPTH(type) * 4)) & 15))
Size of an array/scalar single-channel value, 4 bits per type: CV_8U - 1 byte CV_8S - 1 byte CV_16U - 2 bytes …
CV_ENABLE_UNROLLED#
#define CV_ENABLE_UNROLLED
#include <opencv2/core/cvdef.h>
Value:
1
CV_ENUM_CLASS_EXPOSE#
#define CV_ENUM_CLASS_EXPOSE(EnumType, …)
#include <opencv2/core/cvdef.h>
Value:
__CV_EXPAND(__CV_CAT(__CV_ENUM_CLASS_EXPOSE_, __CV_VA_NUM_ARGS(__VA_ARGS__))(EnumType, __VA_ARGS__)); \
CV_ENUM_FLAGS#
#define CV_ENUM_FLAGS(EnumType)
#include <opencv2/core/cvdef.h>
Value:
__CV_ENUM_FLAGS_LOGICAL_NOT (EnumType) \
__CV_ENUM_FLAGS_LOGICAL_EQ (EnumType, int) \
__CV_ENUM_FLAGS_LOGICAL_NOT_EQ (EnumType, int) \
\
__CV_ENUM_FLAGS_BITWISE_NOT (EnumType) \
__CV_ENUM_FLAGS_BITWISE_OR (EnumType, EnumType, EnumType) \
__CV_ENUM_FLAGS_BITWISE_AND (EnumType, EnumType, EnumType) \
__CV_ENUM_FLAGS_BITWISE_XOR (EnumType, EnumType, EnumType) \
\
__CV_ENUM_FLAGS_BITWISE_OR_EQ (EnumType, EnumType) \
__CV_ENUM_FLAGS_BITWISE_AND_EQ (EnumType, EnumType) \
__CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType) \
CV_Error#
#define CV_Error(code, msg)
#include <opencv2/core/exception.hpp>
Value:
cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
Call the error handler.
Currently, the error handler prints the error code and the error message to the standard error stream stderr. In the Debug configuration, it then provokes memory access violation, so that the execution stack and all the parameters can be analyzed by the debugger. In the Release configuration, the exception is thrown.
Parameters
code— one of Error::Codemsg— error message
CV_Error_#
#define CV_Error_(code, args)
#include <opencv2/core/exception.hpp>
Value:
cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
Call the error handler.
This macro can be used to construct an error message on-fly to include some dynamic information, for example:
// note the extra parentheses around the formatted text message
CV_Error_(Error::StsOutOfRange,
("the value at (%d, %d)=%g is out of range", badPt.x, badPt.y, badValue));
Parameters
code— one of Error::Codeargs— printf-like formatted error message in parentheses
CV_EXPORTS_AS#
#define CV_EXPORTS_AS(synonym)
#include <opencv2/core/cvdef.h>
Value:
CV_EXPORTS
CV_EXPORTS_TEMPLATE#
#define CV_EXPORTS_TEMPLATE
#include <opencv2/core/cvdef.h>
Value:
CV_EXPORTS
CV_EXPORTS_W#
#define CV_EXPORTS_W
#include <opencv2/core/cvdef.h>
Value:
CV_EXPORTS
CV_EXPORTS_W_MAP#
#define CV_EXPORTS_W_MAP
#include <opencv2/core/cvdef.h>
Value:
CV_EXPORTS
CV_EXPORTS_W_PARAMS#
#define CV_EXPORTS_W_PARAMS
#include <opencv2/core/cvdef.h>
Value:
CV_EXPORTS
CV_EXPORTS_W_SIMPLE#
#define CV_EXPORTS_W_SIMPLE
#include <opencv2/core/cvdef.h>
Value:
CV_EXPORTS
CV_EXTERN_C#
#define CV_EXTERN_C
#include <opencv2/core/cvdef.h>
Value:
extern "C"
CV_FINAL#
#define CV_FINAL
#include <opencv2/core/cvdef.h>
Value:
final
CV_FOURCC_MACRO#
#define CV_FOURCC_MACRO(c1, c2, c3, c4)
#include <opencv2/core/cvdef.h>
Value:
(((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))
Macro to construct the fourcc code of the codec. Same as CV_FOURCC()
CV_FP16_TYPE#
#define CV_FP16_TYPE
#include <opencv2/core/cvdef.h>
Value:
0
CV_HARDWARE_MAX_FEATURE#
#define CV_HARDWARE_MAX_FEATURE
#include <opencv2/core/cvdef.h>
Value:
512
CV_IMAX#
#define CV_IMAX(a, b)
#include <opencv2/core/cvdef.h>
Value:
((a) ^ (((a)^(b)) & (((a) > (b)) - 1)))
CV_IMIN#
#define CV_IMIN(a, b)
#include <opencv2/core/cvdef.h>
Value:
((a) ^ (((a)^(b)) & (((a) < (b)) - 1)))
min & max without jumps
CV_IN_OUT#
#define CV_IN_OUT
#include <opencv2/core/cvdef.h>
CV_IS_CONT_MAT#
#define CV_IS_CONT_MAT
#include <opencv2/core/cvdef.h>
Value:
CV_IS_MAT_CONT
CV_IS_MAT_CONT#
#define CV_IS_MAT_CONT(flags)
#include <opencv2/core/cvdef.h>
Value:
((flags) & CV_MAT_CONT_FLAG)
CV_IS_SUBMAT#
#define CV_IS_SUBMAT(flags)
#include <opencv2/core/cvdef.h>
Value:
((flags) & CV_MAT_SUBMAT_FLAG)
CV_LOG2#
#define CV_LOG2
#include <opencv2/core/cvdef.h>
Value:
0.69314718055994530941723212145818
CV_MAT_CN#
#define CV_MAT_CN(flags)
#include <opencv2/core/cvdef.h>
Value:
((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
CV_MAT_CN_MASK#
#define CV_MAT_CN_MASK
#include <opencv2/core/cvdef.h>
Value:
((CV_CN_MAX - 1) << CV_CN_SHIFT)
CV_MAT_CONT_FLAG#
#define CV_MAT_CONT_FLAG
#include <opencv2/core/cvdef.h>
Value:
(1 << CV_MAT_CONT_FLAG_SHIFT)
CV_MAT_CONT_FLAG_SHIFT#
#define CV_MAT_CONT_FLAG_SHIFT
#include <opencv2/core/cvdef.h>
Value:
14
CV_MAT_TYPE#
#define CV_MAT_TYPE(flags)
#include <opencv2/core/cvdef.h>
Value:
((flags) & CV_MAT_TYPE_MASK)
CV_MAT_TYPE_MASK#
#define CV_MAT_TYPE_MASK
#include <opencv2/core/cvdef.h>
Value:
(CV_DEPTH_MAX*CV_CN_MAX - 1)
CV_MAX_DIM#
#define CV_MAX_DIM
#include <opencv2/core/cvdef.h>
Value:
32
CV_ND#
#define CV_ND
#include <opencv2/core/cvdef.h>
CV_NODISCARD_STD#
#define CV_NODISCARD_STD
#include <opencv2/core/cvdef.h>
Value:
/* nothing by default */
CV_NOEXCEPT#
#define CV_NOEXCEPT
#include <opencv2/core/cvdef.h>
Value:
noexcept
CV_OUT#
#define CV_OUT
#include <opencv2/core/cvdef.h>
CV_OVERRIDE#
#define CV_OVERRIDE
#include <opencv2/core/cvdef.h>
Value:
override
CV_PI#
#define CV_PI
#include <opencv2/core/cvdef.h>
Value:
3.1415926535897932384626433832795
CV_PROP#
#define CV_PROP
#include <opencv2/core/cvdef.h>
CV_PROP_RW#
#define CV_PROP_RW
#include <opencv2/core/cvdef.h>
CV_SIGN#
#define CV_SIGN(a)
#include <opencv2/core/cvdef.h>
Value:
CV_CMP((a),0)
CV_STDCALL#
#define CV_STDCALL
#include <opencv2/core/cvdef.h>
CV_STRONG_ALIGNMENT#
#define CV_STRONG_ALIGNMENT
#include <opencv2/core/cvdef.h>
Value:
0
CV_SUBMAT_FLAG#
#define CV_SUBMAT_FLAG
#include <opencv2/core/cvdef.h>
Value:
(1 << CV_SUBMAT_FLAG_SHIFT)
CV_SUBMAT_FLAG_SHIFT#
#define CV_SUBMAT_FLAG_SHIFT
#include <opencv2/core/cvdef.h>
Value:
15
CV_SWAP#
#define CV_SWAP(a, b, t)
#include <opencv2/core/cvdef.h>
Value:
((t) = (a), (a) = (b), (b) = (t))
CV_WRAP#
#define CV_WRAP
#include <opencv2/core/cvdef.h>
CV_WRAP_AS#
#define CV_WRAP_AS(synonym)
#include <opencv2/core/cvdef.h>
CV_WRAP_DEFAULT#
#define CV_WRAP_DEFAULT(val)
#include <opencv2/core/cvdef.h>
CV_WRAP_FILE_PATH#
#define CV_WRAP_FILE_PATH
#include <opencv2/core/cvdef.h>
CV_WRAP_MAPPABLE#
#define CV_WRAP_MAPPABLE(mappable)
#include <opencv2/core/cvdef.h>
CV_WRAP_PHANTOM#
#define CV_WRAP_PHANTOM(phantom_header)
#include <opencv2/core/cvdef.h>
MAX#
#define MAX(a, b)
#include <opencv2/core/cvdef.h>
Value:
((a) < (b) ? (b) : (a))
MIN#
#define MIN(a, b)
#include <opencv2/core/cvdef.h>
Value:
((a) > (b) ? (b) : (a))
OPENCV_ABI_COMPATIBILITY#
#define OPENCV_ABI_COMPATIBILITY
#include <opencv2/core/cvdef.h>
Value:
500