OpenCV  3.0.0-dev
Open Source Computer Vision
Namespaces | Classes | Macros | Enumerations | Functions
Platform-dependent utils

Namespaces

 cv
 
 cv::hal
 

Classes

union  Cv32suf
 
union  Cv64suf
 

Macros

#define CV_2PI   6.283185307179586476925286766559
 
#define CV_AVX   0
 
#define CV_AVX2   0
 
#define CV_AVX_512BW   0
 
#define CV_AVX_512CD   0
 
#define CV_AVX_512DQ   0
 
#define CV_AVX_512ER   0
 
#define CV_AVX_512F   0
 
#define CV_AVX_512IFMA512   0
 
#define CV_AVX_512PF   0
 
#define CV_AVX_512VBMI   0
 
#define CV_AVX_512VL   0
 
#define CV_CPU_AVX   10
 
#define CV_CPU_AVX2   11
 
#define CV_CPU_AVX_512BW   14
 
#define CV_CPU_AVX_512CD   15
 
#define CV_CPU_AVX_512DQ   16
 
#define CV_CPU_AVX_512ER   17
 
#define CV_CPU_AVX_512F   13
 
#define CV_CPU_AVX_512IFMA512   18
 
#define CV_CPU_AVX_512PF   19
 
#define CV_CPU_AVX_512VBMI   20
 
#define CV_CPU_AVX_512VL   21
 
#define CV_CPU_FMA3   12
 
#define CV_CPU_MMX   1
 
#define CV_CPU_NEON   100
 
#define CV_CPU_NONE   0
 
#define CV_CPU_POPCNT   8
 
#define CV_CPU_SSE   2
 
#define CV_CPU_SSE2   3
 
#define CV_CPU_SSE3   4
 
#define CV_CPU_SSE4_1   6
 
#define CV_CPU_SSE4_2   7
 
#define CV_CPU_SSSE3   5
 
#define CV_DECL_ALIGNED(x)
 
#define CV_ENABLE_UNROLLED   1
 
#define CV_FMA3   0
 
#define CV_HARDWARE_MAX_FEATURE   255
 
#define CV_LOG2   0.69314718055994530941723212145818
 
#define CV_MMX   0
 
#define CV_PI   3.1415926535897932384626433832795
 
#define CV_POPCNT   0
 
#define CV_SSE   0
 
#define CV_SSE2   0
 
#define CV_SSE3   0
 
#define CV_SSE4_1   0
 
#define CV_SSE4_2   0
 
#define CV_SSSE3   0
 
#define CV_VFP   0
 
#define USE_AVX   (cv::hal::checkHardwareSupport(CV_CPU_AVX))
 
#define USE_AVX2   (cv::hal::checkHardwareSupport(CV_CPU_AVX2))
 
#define USE_SSE2   (cv::hal::checkHardwareSupport(CV_CPU_SSE))
 
#define USE_SSE4_2   (cv::hal::checkHardwareSupport(CV_CPU_SSE4_2))
 

Enumerations

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_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_512PF = 19,
  CPU_AVX_512VBMI = 20,
  CPU_AVX_512VL = 21,
  CPU_NEON = 100
}
 Available CPU features. More...
 

Functions

int cvCeil (double value)
 Rounds floating-point number to the nearest integer not smaller than the original. More...
 
int cvCeil (float value)
 
int cvCeil (int value)
 
int cvFloor (double value)
 Rounds floating-point number to the nearest integer not larger than the original. More...
 
int cvFloor (float value)
 
int cvFloor (int value)
 
int cvIsInf (double value)
 Determines if the argument is Infinity. More...
 
int cvIsInf (float value)
 
int cvIsNaN (double value)
 Determines if the argument is Not A Number. More...
 
int cvIsNaN (float value)
 
int cvRound (double value)
 Rounds floating-point number to the nearest integer. More...
 
int cvRound (float value)
 
int cvRound (int value)
 
template<typename _Tp >
static _Tp cv::saturate_cast (uchar v)
 Template function for accurate conversion from one primitive type to another. More...
 
template<typename _Tp >
static _Tp cv::saturate_cast (schar v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (ushort v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (short v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (unsigned v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (int v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (float v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (double v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (int64 v)
 
template<typename _Tp >
static _Tp cv::saturate_cast (uint64 v)
 
template<>
schar cv::saturate_cast< schar > (uchar v)
 
template<>
schar cv::saturate_cast< schar > (ushort v)
 
template<>
schar cv::saturate_cast< schar > (int v)
 
template<>
schar cv::saturate_cast< schar > (short v)
 
template<>
schar cv::saturate_cast< schar > (unsigned v)
 
template<>
schar cv::saturate_cast< schar > (float v)
 
template<>
schar cv::saturate_cast< schar > (double v)
 
template<>
schar cv::saturate_cast< schar > (int64 v)
 
template<>
schar cv::saturate_cast< schar > (uint64 v)
 
template<>
short cv::saturate_cast< short > (ushort v)
 
template<>
short cv::saturate_cast< short > (int v)
 
template<>
short cv::saturate_cast< short > (unsigned v)
 
template<>
short cv::saturate_cast< short > (float v)
 
template<>
short cv::saturate_cast< short > (double v)
 
template<>
short cv::saturate_cast< short > (int64 v)
 
template<>
short cv::saturate_cast< short > (uint64 v)
 
template<>
uchar cv::saturate_cast< uchar > (schar v)
 
template<>
uchar cv::saturate_cast< uchar > (ushort v)
 
template<>
uchar cv::saturate_cast< uchar > (int v)
 
template<>
uchar cv::saturate_cast< uchar > (short v)
 
template<>
uchar cv::saturate_cast< uchar > (unsigned v)
 
template<>
uchar cv::saturate_cast< uchar > (float v)
 
template<>
uchar cv::saturate_cast< uchar > (double v)
 
template<>
uchar cv::saturate_cast< uchar > (int64 v)
 
template<>
uchar cv::saturate_cast< uchar > (uint64 v)
 
template<>
unsigned cv::saturate_cast< unsigned > (float v)
 
template<>
unsigned cv::saturate_cast< unsigned > (double v)
 
template<>
ushort cv::saturate_cast< ushort > (schar v)
 
template<>
ushort cv::saturate_cast< ushort > (short v)
 
template<>
ushort cv::saturate_cast< ushort > (int v)
 
template<>
ushort cv::saturate_cast< ushort > (unsigned v)
 
template<>
ushort cv::saturate_cast< ushort > (float v)
 
template<>
ushort cv::saturate_cast< ushort > (double v)
 
template<>
ushort cv::saturate_cast< ushort > (int64 v)
 
template<>
ushort cv::saturate_cast< ushort > (uint64 v)
 

Detailed Description

Macro Definition Documentation

#define CV_2PI   6.283185307179586476925286766559
#define CV_AVX   0
#define CV_AVX2   0
#define CV_AVX_512BW   0
#define CV_AVX_512CD   0
#define CV_AVX_512DQ   0
#define CV_AVX_512ER   0
#define CV_AVX_512F   0
#define CV_AVX_512IFMA512   0
#define CV_AVX_512PF   0
#define CV_AVX_512VBMI   0
#define CV_AVX_512VL   0
#define CV_CPU_AVX   10
#define CV_CPU_AVX2   11
#define CV_CPU_AVX_512BW   14
#define CV_CPU_AVX_512CD   15
#define CV_CPU_AVX_512DQ   16
#define CV_CPU_AVX_512ER   17
#define CV_CPU_AVX_512F   13
#define CV_CPU_AVX_512IFMA512   18
#define CV_CPU_AVX_512PF   19
#define CV_CPU_AVX_512VBMI   20
#define CV_CPU_AVX_512VL   21
#define CV_CPU_FMA3   12
#define CV_CPU_MMX   1
#define CV_CPU_NEON   100
#define CV_CPU_NONE   0
#define CV_CPU_POPCNT   8
#define CV_CPU_SSE   2
#define CV_CPU_SSE2   3
#define CV_CPU_SSE3   4
#define CV_CPU_SSE4_1   6
#define CV_CPU_SSE4_2   7
#define CV_CPU_SSSE3   5
#define CV_DECL_ALIGNED (   x)
#define CV_ENABLE_UNROLLED   1
#define CV_FMA3   0
#define CV_HARDWARE_MAX_FEATURE   255
#define CV_LOG2   0.69314718055994530941723212145818
#define CV_MMX   0
#define CV_PI   3.1415926535897932384626433832795
#define CV_POPCNT   0
#define CV_SSE   0
#define CV_SSE2   0
#define CV_SSE3   0
#define CV_SSE4_1   0
#define CV_SSE4_2   0
#define CV_SSSE3   0
#define CV_VFP   0
#define USE_AVX   (cv::hal::checkHardwareSupport(CV_CPU_AVX))
#define USE_AVX2   (cv::hal::checkHardwareSupport(CV_CPU_AVX2))
#define USE_SSE2   (cv::hal::checkHardwareSupport(CV_CPU_SSE))
#define USE_SSE4_2   (cv::hal::checkHardwareSupport(CV_CPU_SSE4_2))

Enumeration Type Documentation

Available CPU features.

Enumerator
CPU_MMX 
CPU_SSE 
CPU_SSE2 
CPU_SSE3 
CPU_SSSE3 
CPU_SSE4_1 
CPU_SSE4_2 
CPU_POPCNT 
CPU_AVX 
CPU_AVX2 
CPU_FMA3 
CPU_AVX_512F 
CPU_AVX_512BW 
CPU_AVX_512CD 
CPU_AVX_512DQ 
CPU_AVX_512ER 
CPU_AVX_512IFMA512 
CPU_AVX_512PF 
CPU_AVX_512VBMI 
CPU_AVX_512VL 
CPU_NEON 

Function Documentation

int cvCeil ( double  value)

Rounds floating-point number to the nearest integer not smaller than the original.

The function computes an integer i such that:

\[i \le \texttt{value} < i+1\]

Parameters
valuefloating-point number. If the value is outside of INT_MIN ... INT_MAX range, the result is not defined.
int cvCeil ( float  value)

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

int cvCeil ( int  value)

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

int cvFloor ( double  value)

Rounds floating-point number to the nearest integer not larger than the original.

The function computes an integer i such that:

\[i \le \texttt{value} < i+1\]

Parameters
valuefloating-point number. If the value is outside of INT_MIN ... INT_MAX range, the result is not defined.
int cvFloor ( float  value)

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

int cvFloor ( int  value)

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

int cvIsInf ( double  value)

Determines if the argument is Infinity.

Parameters
valueThe input floating-point value

The function returns 1 if the argument is a plus or minus infinity (as defined by IEEE754 standard) and 0 otherwise.

int cvIsInf ( float  value)

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

int cvIsNaN ( double  value)

Determines if the argument is Not A Number.

Parameters
valueThe input floating-point value

The function returns 1 if the argument is Not A Number (as defined by IEEE754 standard), 0 otherwise.

int cvIsNaN ( float  value)

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

int cvRound ( double  value)

Rounds floating-point number to the nearest integer.

Parameters
valuefloating-point number. If the value is outside of INT_MIN ... INT_MAX range, the result is not defined.
Examples:
contours2.cpp, demhist.cpp, distrans.cpp, and minarea.cpp.
int cvRound ( float  value)

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

int cvRound ( int  value)

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

template<typename _Tp >
static _Tp cv::saturate_cast ( uchar  v)
inlinestatic

Template function for accurate conversion from one primitive type to another.

The functions saturate_cast resemble the standard C++ cast operations, such as static_cast<T>() and others. They perform an efficient and accurate conversion from one primitive type to another (see the introduction chapter). saturate in the name means that when the input value v is out of the range of the target type, the result is not formed just by taking low bits of the input, but instead the value is clipped. For example:

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).

This operation is used in the simplest or most complex image processing functions in OpenCV.

Parameters
vFunction parameter.
See also
add, subtract, multiply, divide, Mat::convertTo
template<typename _Tp >
static _Tp cv::saturate_cast ( schar  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( ushort  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( short  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( unsigned  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( int  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( float  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( double  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( int64  v)
inlinestatic

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

template<typename _Tp >
static _Tp cv::saturate_cast ( uint64  v)
inlinestatic

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

template<>
schar cv::saturate_cast< schar > ( uchar  v)
inline
template<>
schar cv::saturate_cast< schar > ( ushort  v)
inline
template<>
schar cv::saturate_cast< schar > ( int  v)
inline
template<>
schar cv::saturate_cast< schar > ( short  v)
inline
template<>
schar cv::saturate_cast< schar > ( unsigned  v)
inline
template<>
schar cv::saturate_cast< schar > ( float  v)
inline
template<>
schar cv::saturate_cast< schar > ( double  v)
inline
template<>
schar cv::saturate_cast< schar > ( int64  v)
inline
template<>
schar cv::saturate_cast< schar > ( uint64  v)
inline
template<>
short cv::saturate_cast< short > ( ushort  v)
inline
template<>
short cv::saturate_cast< short > ( int  v)
inline
template<>
short cv::saturate_cast< short > ( unsigned  v)
inline
template<>
short cv::saturate_cast< short > ( float  v)
inline
template<>
short cv::saturate_cast< short > ( double  v)
inline
template<>
short cv::saturate_cast< short > ( int64  v)
inline
template<>
short cv::saturate_cast< short > ( uint64  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( schar  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( ushort  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( int  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( short  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( unsigned  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( float  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( double  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( int64  v)
inline
template<>
uchar cv::saturate_cast< uchar > ( uint64  v)
inline
template<>
unsigned cv::saturate_cast< unsigned > ( float  v)
inline
template<>
unsigned cv::saturate_cast< unsigned > ( double  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( schar  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( short  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( int  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( unsigned  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( float  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( double  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( int64  v)
inline
template<>
ushort cv::saturate_cast< ushort > ( uint64  v)
inline