44#ifndef OPENCV_CORE_TYPES_HPP
45#define OPENCV_CORE_TYPES_HPP
48# error types.hpp header must be compiled as C++
56#include "opencv2/core/cvdef.h"
57#include "opencv2/core/cvstd.hpp"
58#include "opencv2/core/matx.hpp"
62#pragma warning(disable: 4459)
105 enum { generic_type = 0,
108#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
118template<
typename _Tp>
120template<
typename _Tp>
170#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
173#elif OPENCV_ABI_COMPATIBILITY < 500
180#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
183#elif OPENCV_ABI_COMPATIBILITY < 500
218 enum { generic_type = 0,
221#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
231template<
typename _Tp>
233template<
typename _Tp>
262#if OPENCV_ABI_COMPATIBILITY < 500
269#if OPENCV_ABI_COMPATIBILITY < 500
300 enum { generic_type = 0,
303#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
313template<
typename _Tp>
315template<
typename _Tp>
342#if OPENCV_ABI_COMPATIBILITY < 500
348#if OPENCV_ABI_COMPATIBILITY < 500
379 enum { generic_type = 0,
382#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
392template<
typename _Tp>
394template<
typename _Tp>
450 Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);
451#if OPENCV_ABI_COMPATIBILITY < 500
458#if OPENCV_ABI_COMPATIBILITY < 500
498 enum { generic_type = 0,
501#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
511template<
typename _Tp>
513template<
typename _Tp>
577 enum { generic_type = 0,
580#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
641 enum { generic_type = 0,
644#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
683 template<
typename _Tp2,
int cn>
711 enum { generic_type = 0,
714#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
724template<
typename _Tp>
726template<
typename _Tp>
793 float size=1,
float response=1,
int octave=0,
int class_id=-1);
814#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
819 typedef float work_type;
820 typedef float channel_type;
822 enum { generic_type = 0,
824 channels = (int)(
sizeof(value_type)/
sizeof(channel_type)),
829 typedef Vec<channel_type, channels> vec_type;
858#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
862 typedef DMatch value_type;
863 typedef int work_type;
864 typedef int channel_type;
866 enum { generic_type = 0,
868 channels = (int)(
sizeof(value_type)/
sizeof(channel_type)),
873 typedef Vec<channel_type, channels> vec_type;
909 const bool isCount = (
type & COUNT) && maxCount > 0;
910 const bool isEps = (
type & EPS) && !
cvIsNaN(epsilon);
911 return isCount || isEps;
965 Moments(
double m00,
double m10,
double m01,
double m20,
double m11,
966 double m02,
double m30,
double m21,
double m12,
double m03 );
995 enum { generic_type = 0,
998#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
1024template<
typename _Tp>
inline
1028template<
typename _Tp>
inline
1030 : re(_re), im(_im) {}
1032template<
typename _Tp>
template<
typename T2>
inline
1033Complex<_Tp>::operator Complex<T2>()
const
1035 return Complex<T2>(saturate_cast<T2>(re), saturate_cast<T2>(im));
1038template<
typename _Tp>
inline
1041 return Complex<_Tp>(re, -im);
1045template<
typename _Tp>
static inline
1046bool operator == (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1048 return a.re == b.re && a.im == b.im;
1051template<
typename _Tp>
static inline
1052bool operator != (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1054 return a.re != b.re || a.im != b.im;
1057template<
typename _Tp>
static inline
1058Complex<_Tp>
operator + (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1060 return Complex<_Tp>( a.re + b.re, a.im + b.im );
1063template<
typename _Tp>
static inline
1064Complex<_Tp>&
operator += (Complex<_Tp>& a,
const Complex<_Tp>& b)
1066 a.re += b.re; a.im += b.im;
1070template<
typename _Tp>
static inline
1071Complex<_Tp>
operator - (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1073 return Complex<_Tp>( a.re - b.re, a.im - b.im );
1076template<
typename _Tp>
static inline
1077Complex<_Tp>&
operator -= (Complex<_Tp>& a,
const Complex<_Tp>& b)
1079 a.re -= b.re; a.im -= b.im;
1083template<
typename _Tp>
static inline
1084Complex<_Tp>
operator - (
const Complex<_Tp>& a)
1086 return Complex<_Tp>(-a.re, -a.im);
1089template<
typename _Tp>
static inline
1090Complex<_Tp>
operator * (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1092 return Complex<_Tp>( a.re*b.re - a.im*b.im, a.re*b.im + a.im*b.re );
1095template<
typename _Tp>
static inline
1096Complex<_Tp>
operator * (
const Complex<_Tp>& a, _Tp b)
1098 return Complex<_Tp>( a.re*b, a.im*b );
1101template<
typename _Tp>
static inline
1102Complex<_Tp>
operator * (_Tp b,
const Complex<_Tp>& a)
1104 return Complex<_Tp>( a.re*b, a.im*b );
1107template<
typename _Tp>
static inline
1108Complex<_Tp>
operator + (
const Complex<_Tp>& a, _Tp b)
1110 return Complex<_Tp>( a.re + b, a.im );
1113template<
typename _Tp>
static inline
1114Complex<_Tp>
operator - (
const Complex<_Tp>& a, _Tp b)
1115{
return Complex<_Tp>( a.re - b, a.im ); }
1117template<
typename _Tp>
static inline
1118Complex<_Tp>
operator + (_Tp b,
const Complex<_Tp>& a)
1120 return Complex<_Tp>( a.re + b, a.im );
1123template<
typename _Tp>
static inline
1124Complex<_Tp>
operator - (_Tp b,
const Complex<_Tp>& a)
1126 return Complex<_Tp>( b - a.re, -a.im );
1129template<
typename _Tp>
static inline
1132 a.re += b;
return a;
1135template<
typename _Tp>
static inline
1138 a.re -= b;
return a;
1141template<
typename _Tp>
static inline
1144 a.re *= b; a.im *= b;
return a;
1147template<
typename _Tp>
static inline
1148double abs(
const Complex<_Tp>& a)
1150 return std::sqrt( (
double)a.re*a.re + (
double)a.im*a.im);
1153template<
typename _Tp>
static inline
1154Complex<_Tp>
operator / (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1156 double t = 1./((double)b.re*b.re + (
double)b.im*b.im);
1157 return Complex<_Tp>( (_Tp)((a.re*b.re + a.im*b.im)*t),
1158 (_Tp)((-a.re*b.im + a.im*b.re)*t) );
1161template<
typename _Tp>
static inline
1162Complex<_Tp>&
operator /= (Complex<_Tp>& a,
const Complex<_Tp>& b)
1168template<
typename _Tp>
static inline
1169Complex<_Tp>
operator / (
const Complex<_Tp>& a, _Tp b)
1172 return Complex<_Tp>( a.re*t, a.im*t );
1175template<
typename _Tp>
static inline
1176Complex<_Tp>
operator / (_Tp b,
const Complex<_Tp>& a)
1178 return Complex<_Tp>(b)/a;
1181template<
typename _Tp>
static inline
1182Complex<_Tp>
operator /= (
const Complex<_Tp>& a, _Tp b)
1185 a.re *= t; a.im *= t;
return a;
1192template<
typename _Tp>
inline
1196template<
typename _Tp>
inline
1200#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
1201template<
typename _Tp>
inline
1206template<
typename _Tp>
inline
1208 :
x(sz.width),
y(sz.height) {}
1210template<
typename _Tp>
inline
1212 :
x(v[0]),
y(v[1]) {}
1214#if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
1215template<
typename _Tp>
inline
1223template<
typename _Tp>
template<
typename _Tp2>
inline
1224Point_<_Tp>::operator Point_<_Tp2>()
const
1226 return Point_<_Tp2>(saturate_cast<_Tp2>(
x), saturate_cast<_Tp2>(
y));
1229template<
typename _Tp>
inline
1230Point_<_Tp>::operator Vec<_Tp, 2>()
const
1232 return Vec<_Tp, 2>(
x,
y);
1235template<
typename _Tp>
inline
1238 return saturate_cast<_Tp>(
x*
pt.
x +
y*
pt.
y);
1241template<
typename _Tp>
inline
1244 return (
double)
x*(double)(
pt.
x) + (double)
y*(
double)(
pt.
y);
1247template<
typename _Tp>
inline
1250 return (
double)
x*
pt.
y - (double)
y*
pt.
x;
1253template<
typename _Tp>
inline bool
1256 return r.contains(*
this);
1260template<
typename _Tp>
static inline
1261Point_<_Tp>&
operator += (Point_<_Tp>& a,
const Point_<_Tp>& b)
1268template<
typename _Tp>
static inline
1269Point_<_Tp>&
operator -= (Point_<_Tp>& a,
const Point_<_Tp>& b)
1276template<
typename _Tp>
static inline
1279 a.x = saturate_cast<_Tp>(a.x * b);
1280 a.y = saturate_cast<_Tp>(a.y * b);
1284template<
typename _Tp>
static inline
1287 a.x = saturate_cast<_Tp>(a.x * b);
1288 a.y = saturate_cast<_Tp>(a.y * b);
1292template<
typename _Tp>
static inline
1293Point_<_Tp>&
operator *= (Point_<_Tp>& a,
double b)
1295 a.x = saturate_cast<_Tp>(a.x * b);
1296 a.y = saturate_cast<_Tp>(a.y * b);
1300template<
typename _Tp>
static inline
1303 a.x = saturate_cast<_Tp>(a.x / b);
1304 a.y = saturate_cast<_Tp>(a.y / b);
1308template<
typename _Tp>
static inline
1311 a.x = saturate_cast<_Tp>(a.x / b);
1312 a.y = saturate_cast<_Tp>(a.y / b);
1316template<
typename _Tp>
static inline
1317Point_<_Tp>&
operator /= (Point_<_Tp>& a,
double b)
1319 a.x = saturate_cast<_Tp>(a.x / b);
1320 a.y = saturate_cast<_Tp>(a.y / b);
1324template<
typename _Tp>
static inline
1325double norm(
const Point_<_Tp>&
pt)
1330template<
typename _Tp>
static inline
1331bool operator == (
const Point_<_Tp>& a,
const Point_<_Tp>& b)
1333 return a.x == b.x && a.y == b.y;
1336template<
typename _Tp>
static inline
1337bool operator != (
const Point_<_Tp>& a,
const Point_<_Tp>& b)
1339 return a.x != b.x || a.y != b.y;
1342template<
typename _Tp>
static inline
1343Point_<_Tp>
operator + (
const Point_<_Tp>& a,
const Point_<_Tp>& b)
1345 return Point_<_Tp>( saturate_cast<_Tp>(a.x + b.x), saturate_cast<_Tp>(a.y + b.y) );
1348template<
typename _Tp>
static inline
1349Point_<_Tp>
operator - (
const Point_<_Tp>& a,
const Point_<_Tp>& b)
1351 return Point_<_Tp>( saturate_cast<_Tp>(a.x - b.x), saturate_cast<_Tp>(a.y - b.y) );
1354template<
typename _Tp>
static inline
1357 return Point_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y) );
1360template<
typename _Tp>
static inline
1361Point_<_Tp>
operator * (
const Point_<_Tp>& a,
int b)
1363 return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );
1366template<
typename _Tp>
static inline
1367Point_<_Tp>
operator * (
int a,
const Point_<_Tp>& b)
1369 return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );
1372template<
typename _Tp>
static inline
1373Point_<_Tp>
operator * (
const Point_<_Tp>& a,
float b)
1375 return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );
1378template<
typename _Tp>
static inline
1379Point_<_Tp>
operator * (
float a,
const Point_<_Tp>& b)
1381 return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );
1384template<
typename _Tp>
static inline
1385Point_<_Tp>
operator * (
const Point_<_Tp>& a,
double b)
1387 return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );
1390template<
typename _Tp>
static inline
1391Point_<_Tp>
operator * (
double a,
const Point_<_Tp>& b)
1393 return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );
1396template<
typename _Tp>
static inline
1397Point_<_Tp>
operator * (
const Matx<_Tp, 2, 2>& a,
const Point_<_Tp>& b)
1399 Matx<_Tp, 2, 1> tmp = a * Vec<_Tp,2>(b.x, b.y);
1400 return Point_<_Tp>(tmp.val[0], tmp.val[1]);
1403template<
typename _Tp>
static inline
1404Point3_<_Tp>
operator * (
const Matx<_Tp, 3, 3>& a,
const Point_<_Tp>& b)
1406 Matx<_Tp, 3, 1> tmp = a * Vec<_Tp,3>(b.x, b.y, 1);
1407 return Point3_<_Tp>(tmp.val[0], tmp.val[1], tmp.val[2]);
1410template<
typename _Tp>
static inline
1411Point_<_Tp>
operator / (
const Point_<_Tp>& a,
int b)
1418template<
typename _Tp>
static inline
1419Point_<_Tp>
operator / (
const Point_<_Tp>& a,
float b)
1426template<
typename _Tp>
static inline
1427Point_<_Tp>
operator / (
const Point_<_Tp>& a,
double b)
1435template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<int>&
pt);
1436template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<int64>&
pt);
1437template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<float>&
pt);
1438template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<double>&
pt);
1440template<>
inline int normL2Sqr<int>(
const Point_<int>&
pt) {
return pt.dot(
pt); }
1441template<>
inline int64 normL2Sqr<int64>(
const Point_<int64>&
pt) {
return pt.dot(
pt); }
1442template<>
inline float normL2Sqr<float>(
const Point_<float>&
pt) {
return pt.dot(
pt); }
1443template<>
inline double normL2Sqr<double>(
const Point_<int>&
pt) {
return pt.dot(
pt); }
1445template<>
inline double normL2Sqr<double>(
const Point_<float>&
pt) {
return pt.ddot(
pt); }
1446template<>
inline double normL2Sqr<double>(
const Point_<double>&
pt) {
return pt.ddot(
pt); }
1452template<
typename _Tp>
inline
1454 :
x(0),
y(0), z(0) {}
1456template<
typename _Tp>
inline
1458 :
x(_x),
y(_y), z(_z) {}
1460template<
typename _Tp>
inline
1464template<
typename _Tp>
inline
1466 :
x(v[0]),
y(v[1]), z(v[2]) {}
1468template<
typename _Tp>
template<
typename _Tp2>
inline
1469Point3_<_Tp>::operator Point3_<_Tp2>()
const
1471 return Point3_<_Tp2>(saturate_cast<_Tp2>(
x), saturate_cast<_Tp2>(
y), saturate_cast<_Tp2>(z));
1474template<
typename _Tp>
inline
1475Point3_<_Tp>::operator Vec<_Tp, 3>()
const
1477 return Vec<_Tp, 3>(
x,
y, z);
1480template<
typename _Tp>
inline
1483 return saturate_cast<_Tp>(
x*
pt.
x +
y*
pt.
y + z*
pt.z);
1486template<
typename _Tp>
inline
1489 return (
double)
x*
pt.
x + (double)
y*
pt.
y + (
double)z*
pt.z;
1492template<
typename _Tp>
inline
1499template<
typename _Tp>
static inline
1500Point3_<_Tp>&
operator += (Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1508template<
typename _Tp>
static inline
1509Point3_<_Tp>&
operator -= (Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1517template<
typename _Tp>
static inline
1520 a.x = saturate_cast<_Tp>(a.x * b);
1521 a.y = saturate_cast<_Tp>(a.y * b);
1522 a.z = saturate_cast<_Tp>(a.z * b);
1526template<
typename _Tp>
static inline
1527Point3_<_Tp>&
operator *= (Point3_<_Tp>& a,
float b)
1529 a.x = saturate_cast<_Tp>(a.x * b);
1530 a.y = saturate_cast<_Tp>(a.y * b);
1531 a.z = saturate_cast<_Tp>(a.z * b);
1535template<
typename _Tp>
static inline
1536Point3_<_Tp>&
operator *= (Point3_<_Tp>& a,
double b)
1538 a.x = saturate_cast<_Tp>(a.x * b);
1539 a.y = saturate_cast<_Tp>(a.y * b);
1540 a.z = saturate_cast<_Tp>(a.z * b);
1544template<
typename _Tp>
static inline
1547 a.x = saturate_cast<_Tp>(a.x / b);
1548 a.y = saturate_cast<_Tp>(a.y / b);
1549 a.z = saturate_cast<_Tp>(a.z / b);
1553template<
typename _Tp>
static inline
1554Point3_<_Tp>&
operator /= (Point3_<_Tp>& a,
float b)
1556 a.x = saturate_cast<_Tp>(a.x / b);
1557 a.y = saturate_cast<_Tp>(a.y / b);
1558 a.z = saturate_cast<_Tp>(a.z / b);
1562template<
typename _Tp>
static inline
1563Point3_<_Tp>&
operator /= (Point3_<_Tp>& a,
double b)
1565 a.x = saturate_cast<_Tp>(a.x / b);
1566 a.y = saturate_cast<_Tp>(a.y / b);
1567 a.z = saturate_cast<_Tp>(a.z / b);
1571template<
typename _Tp>
static inline
1572double norm(
const Point3_<_Tp>&
pt)
1577template<
typename _Tp>
static inline
1578bool operator == (
const Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1580 return a.x == b.x && a.y == b.y && a.z == b.z;
1583template<
typename _Tp>
static inline
1584bool operator != (
const Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1586 return a.x != b.x || a.y != b.y || a.z != b.z;
1589template<
typename _Tp>
static inline
1590Point3_<_Tp>
operator + (
const Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1592 return Point3_<_Tp>( saturate_cast<_Tp>(a.x + b.x), saturate_cast<_Tp>(a.y + b.y), saturate_cast<_Tp>(a.z + b.z));
1595template<
typename _Tp>
static inline
1596Point3_<_Tp>
operator - (
const Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1598 return Point3_<_Tp>( saturate_cast<_Tp>(a.x - b.x), saturate_cast<_Tp>(a.y - b.y), saturate_cast<_Tp>(a.z - b.z));
1601template<
typename _Tp>
static inline
1602Point3_<_Tp>
operator - (
const Point3_<_Tp>& a)
1604 return Point3_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y), saturate_cast<_Tp>(-a.z) );
1607template<
typename _Tp>
static inline
1608Point3_<_Tp>
operator * (
const Point3_<_Tp>& a,
int b)
1610 return Point3_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b), saturate_cast<_Tp>(a.z*b) );
1613template<
typename _Tp>
static inline
1614Point3_<_Tp>
operator * (
int a,
const Point3_<_Tp>& b)
1616 return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) );
1619template<
typename _Tp>
static inline
1620Point3_<_Tp>
operator * (
const Point3_<_Tp>& a,
float b)
1622 return Point3_<_Tp>( saturate_cast<_Tp>(a.x * b), saturate_cast<_Tp>(a.y * b), saturate_cast<_Tp>(a.z * b) );
1625template<
typename _Tp>
static inline
1626Point3_<_Tp>
operator * (
float a,
const Point3_<_Tp>& b)
1628 return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) );
1631template<
typename _Tp>
static inline
1632Point3_<_Tp>
operator * (
const Point3_<_Tp>& a,
double b)
1634 return Point3_<_Tp>( saturate_cast<_Tp>(a.x * b), saturate_cast<_Tp>(a.y * b), saturate_cast<_Tp>(a.z * b) );
1637template<
typename _Tp>
static inline
1638Point3_<_Tp>
operator * (
double a,
const Point3_<_Tp>& b)
1640 return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) );
1643template<
typename _Tp>
static inline
1644Point3_<_Tp>
operator * (
const Matx<_Tp, 3, 3>& a,
const Point3_<_Tp>& b)
1646 Matx<_Tp, 3, 1> tmp = a * Vec<_Tp,3>(b.x, b.y, b.z);
1647 return Point3_<_Tp>(tmp.val[0], tmp.val[1], tmp.val[2]);
1650template<
typename _Tp>
static inline
1651Matx<_Tp, 4, 1>
operator * (
const Matx<_Tp, 4, 4>& a,
const Point3_<_Tp>& b)
1653 return a * Matx<_Tp, 4, 1>(b.x, b.y, b.z, 1);
1656template<
typename _Tp>
static inline
1657Point3_<_Tp>
operator / (
const Point3_<_Tp>& a,
int b)
1659 Point3_<_Tp> tmp(a);
1664template<
typename _Tp>
static inline
1665Point3_<_Tp>
operator / (
const Point3_<_Tp>& a,
float b)
1667 Point3_<_Tp> tmp(a);
1672template<
typename _Tp>
static inline
1673Point3_<_Tp>
operator / (
const Point3_<_Tp>& a,
double b)
1675 Point3_<_Tp> tmp(a);
1684template<
typename _Tp>
inline
1686 : width(0), height(0) {}
1688template<
typename _Tp>
inline
1690 : width(_width), height(_height) {}
1692template<
typename _Tp>
inline
1694 : width(
pt.
x), height(
pt.
y) {}
1696template<
typename _Tp>
template<
typename _Tp2>
inline
1697Size_<_Tp>::operator Size_<_Tp2>()
const
1699 return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height));
1702template<
typename _Tp>
inline
1705 const _Tp
result = width * height;
1707 || width == 0 ||
result / width == height);
1711template<
typename _Tp>
inline
1714 return width /
static_cast<double>(height);
1717template<
typename _Tp>
inline
1720 return width <= 0 || height <= 0;
1724template<
typename _Tp>
static inline
1732template<
typename _Tp>
static inline
1733Size_<_Tp>
operator * (
const Size_<_Tp>& a, _Tp b)
1740template<
typename _Tp>
static inline
1748template<
typename _Tp>
static inline
1749Size_<_Tp>
operator / (
const Size_<_Tp>& a, _Tp b)
1756template<
typename _Tp>
static inline
1757Size_<_Tp>&
operator += (Size_<_Tp>& a,
const Size_<_Tp>& b)
1760 a.height += b.height;
1764template<
typename _Tp>
static inline
1765Size_<_Tp>
operator + (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1772template<
typename _Tp>
static inline
1773Size_<_Tp>&
operator -= (Size_<_Tp>& a,
const Size_<_Tp>& b)
1776 a.height -= b.height;
1780template<
typename _Tp>
static inline
1781Size_<_Tp>
operator - (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1788template<
typename _Tp>
static inline
1789bool operator == (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1791 return a.width == b.width && a.height == b.height;
1794template<
typename _Tp>
static inline
1795bool operator != (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1804template<
typename _Tp>
inline
1806 :
x(0),
y(0), width(0), height(0) {}
1808template<
typename _Tp>
inline
1810 :
x(_x),
y(_y), width(_width), height(_height) {}
1812template<
typename _Tp>
inline
1814 :
x(
org.
x),
y(
org.
y), width(sz.width), height(sz.height) {}
1816template<
typename _Tp>
inline
1825template<
typename _Tp>
inline
1828 return Point_<_Tp>(
x,
y);
1831template<
typename _Tp>
inline
1834 return Point_<_Tp>(
x + width,
y + height);
1837template<
typename _Tp>
inline
1840 return Size_<_Tp>(width, height);
1843template<
typename _Tp>
inline
1846 const _Tp
result = width * height;
1848 || width == 0 ||
result / width == height);
1852template<
typename _Tp>
inline
1855 return width <= 0 || height <= 0;
1858template<
typename _Tp>
template<
typename _Tp2>
inline
1859Rect_<_Tp>::operator Rect_<_Tp2>()
const
1861 return Rect_<_Tp2>(saturate_cast<_Tp2>(
x), saturate_cast<_Tp2>(
y), saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height));
1864template<
typename _Tp>
inline
1871template<
typename _Tp>
static inline
1872Rect_<_Tp>&
operator += ( Rect_<_Tp>& a,
const Point_<_Tp>& b )
1879template<
typename _Tp>
static inline
1880Rect_<_Tp>&
operator -= ( Rect_<_Tp>& a,
const Point_<_Tp>& b )
1887template<
typename _Tp>
static inline
1888Rect_<_Tp>&
operator += ( Rect_<_Tp>& a,
const Size_<_Tp>& b )
1891 a.height += b.height;
1895template<
typename _Tp>
static inline
1896Rect_<_Tp>&
operator -= ( Rect_<_Tp>& a,
const Size_<_Tp>& b )
1898 const _Tp width = a.width - b.width;
1899 const _Tp height = a.height - b.height;
1906template<
typename _Tp>
static inline
1907Rect_<_Tp>&
operator &= ( Rect_<_Tp>& a,
const Rect_<_Tp>& b )
1909 if (a.empty() || b.empty()) {
1913 const Rect_<_Tp>& Rx_min = (a.x < b.x) ? a : b;
1914 const Rect_<_Tp>& Rx_max = (a.x < b.x) ? b : a;
1915 const Rect_<_Tp>& Ry_min = (a.y < b.y) ? a : b;
1916 const Rect_<_Tp>& Ry_max = (a.y < b.y) ? b : a;
1922 if ((Rx_min.x < 0 && Rx_min.x + Rx_min.width < Rx_max.x) ||
1923 (Ry_min.y < 0 && Ry_min.y + Ry_min.height < Ry_max.y)) {
1931 a.width =
std::min(Rx_min.width - (Rx_max.x - Rx_min.x), Rx_max.width);
1932 a.height =
std::min(Ry_min.height - (Ry_max.y - Ry_min.y), Ry_max.height);
1940template<
typename _Tp>
static inline
1941Rect_<_Tp>&
operator |= ( Rect_<_Tp>& a,
const Rect_<_Tp>& b )
1946 else if (!b.empty()) {
1949 a.width =
std::max(a.x + a.width, b.x + b.width) - x1;
1950 a.height =
std::max(a.y + a.height, b.y + b.height) - y1;
1957template<
typename _Tp>
static inline
1958bool operator == (
const Rect_<_Tp>& a,
const Rect_<_Tp>& b)
1960 return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
1963template<
typename _Tp>
static inline
1964bool operator != (
const Rect_<_Tp>& a,
const Rect_<_Tp>& b)
1966 return a.x != b.x || a.y != b.y || a.width != b.width || a.height != b.height;
1969template<
typename _Tp>
static inline
1970Rect_<_Tp>
operator + (
const Rect_<_Tp>& a,
const Point_<_Tp>& b)
1972 return Rect_<_Tp>( a.x + b.x, a.y + b.y, a.width, a.height );
1975template<
typename _Tp>
static inline
1976Rect_<_Tp>
operator - (
const Rect_<_Tp>& a,
const Point_<_Tp>& b)
1978 return Rect_<_Tp>( a.x - b.x, a.y - b.y, a.width, a.height );
1981template<
typename _Tp>
static inline
1982Rect_<_Tp>
operator + (
const Rect_<_Tp>& a,
const Size_<_Tp>& b)
1984 return Rect_<_Tp>( a.x, a.y, a.width + b.width, a.height + b.height );
1987template<
typename _Tp>
static inline
1988Rect_<_Tp>
operator - (
const Rect_<_Tp>& a,
const Size_<_Tp>& b)
1990 const _Tp width = a.width - b.width;
1991 const _Tp height = a.height - b.height;
1993 return Rect_<_Tp>( a.x, a.y, width, height );
1996template<
typename _Tp>
static inline
1997Rect_<_Tp>
operator & (
const Rect_<_Tp>& a,
const Rect_<_Tp>& b)
2003template<
typename _Tp>
static inline
2004Rect_<_Tp>
operator | (
const Rect_<_Tp>& a,
const Rect_<_Tp>& b)
2016template<
typename _Tp>
static inline
2017double jaccardDistance(
const Rect_<_Tp>& a,
const Rect_<_Tp>& b) {
2026 double Aab = (a & b).area();
2028 return 1.0 - Aab / (Aa + Ab - Aab);
2075 return Range(INT_MIN, INT_MAX);
2080bool operator == (
const Range& r1,
const Range& r2)
2082 return r1.start == r2.start && r1.end == r2.end;
2086bool operator != (
const Range& r1,
const Range& r2)
2092bool operator !(
const Range&
r)
2094 return r.start ==
r.end;
2098Range
operator & (
const Range& r1,
const Range& r2)
2115 return Range(r1.start +
delta, r1.end +
delta);
2121 return Range(r1.start +
delta, r1.end +
delta);
2127 return r1 + (-
delta);
2134template<
typename _Tp>
inline
2137 this->val[0] = this->val[1] = this->val[2] = this->val[3] = 0;
2140template<
typename _Tp>
inline
2149template<
typename _Tp>
inline
2153template<
typename _Tp>
inline
2161template<
typename _Tp>
inline
2163 this->val[0] = s.
val[0];
2164 this->val[1] = s.val[1];
2165 this->val[2] = s.val[2];
2166 this->val[3] = s.val[3];
2170template<
typename _Tp>
inline
2179template<
typename _Tp>
template<
typename _Tp2,
int cn>
inline
2183 for( i = 0; i < (cn < 4 ? cn : 4); i++ )
2184 this->val[i] = cv::saturate_cast<_Tp>(v.val[i]);
2189template<
typename _Tp>
inline
2193 this->val[1] = this->val[2] = this->val[3] = 0;
2196template<
typename _Tp>
inline
2199 return Scalar_<_Tp>(v0, v0, v0, v0);
2203template<
typename _Tp>
inline
2206 return Scalar_<_Tp>(saturate_cast<_Tp>(this->val[0] * a.val[0] *
scale),
2207 saturate_cast<_Tp>(this->val[1] * a.val[1] *
scale),
2208 saturate_cast<_Tp>(this->val[2] * a.val[2] *
scale),
2209 saturate_cast<_Tp>(this->val[3] * a.val[3] *
scale));
2212template<
typename _Tp>
inline
2215 return Scalar_<_Tp>(saturate_cast<_Tp>( this->val[0]),
2216 saturate_cast<_Tp>(-this->val[1]),
2217 saturate_cast<_Tp>(-this->val[2]),
2218 saturate_cast<_Tp>(-this->val[3]));
2221template<
typename _Tp>
inline
2224 return this->val[1] == 0 && this->val[2] == 0 && this->val[3] == 0;
2228template<
typename _Tp>
template<
typename T2>
inline
2229Scalar_<_Tp>::operator Scalar_<T2>()
const
2231 return Scalar_<T2>(saturate_cast<T2>(this->val[0]),
2232 saturate_cast<T2>(this->val[1]),
2233 saturate_cast<T2>(this->val[2]),
2234 saturate_cast<T2>(this->val[3]));
2238template<
typename _Tp>
static inline
2239Scalar_<_Tp>&
operator += (Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2241 a.val[0] += b.val[0];
2242 a.val[1] += b.val[1];
2243 a.val[2] += b.val[2];
2244 a.val[3] += b.val[3];
2248template<
typename _Tp>
static inline
2249Scalar_<_Tp>&
operator -= (Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2251 a.val[0] -= b.val[0];
2252 a.val[1] -= b.val[1];
2253 a.val[2] -= b.val[2];
2254 a.val[3] -= b.val[3];
2258template<
typename _Tp>
static inline
2259Scalar_<_Tp>&
operator *= ( Scalar_<_Tp>& a, _Tp v )
2268template<
typename _Tp>
static inline
2269bool operator == (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b )
2271 return a.val[0] == b.val[0] && a.val[1] == b.val[1] &&
2272 a.val[2] == b.val[2] && a.val[3] == b.val[3];
2275template<
typename _Tp>
static inline
2276bool operator != (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b )
2278 return a.val[0] != b.val[0] || a.val[1] != b.val[1] ||
2279 a.val[2] != b.val[2] || a.val[3] != b.val[3];
2282template<
typename _Tp>
static inline
2283Scalar_<_Tp>
operator + (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2285 return Scalar_<_Tp>(a.val[0] + b.val[0],
2286 a.val[1] + b.val[1],
2287 a.val[2] + b.val[2],
2288 a.val[3] + b.val[3]);
2291template<
typename _Tp>
static inline
2292Scalar_<_Tp>
operator - (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2294 return Scalar_<_Tp>(saturate_cast<_Tp>(a.val[0] - b.val[0]),
2295 saturate_cast<_Tp>(a.val[1] - b.val[1]),
2296 saturate_cast<_Tp>(a.val[2] - b.val[2]),
2297 saturate_cast<_Tp>(a.val[3] - b.val[3]));
2300template<
typename _Tp>
static inline
2303 return Scalar_<_Tp>(a.val[0] *
alpha,
2309template<
typename _Tp>
static inline
2315template<
typename _Tp>
static inline
2316Scalar_<_Tp>
operator - (
const Scalar_<_Tp>& a)
2318 return Scalar_<_Tp>(saturate_cast<_Tp>(-a.val[0]),
2319 saturate_cast<_Tp>(-a.val[1]),
2320 saturate_cast<_Tp>(-a.val[2]),
2321 saturate_cast<_Tp>(-a.val[3]));
2325template<
typename _Tp>
static inline
2326Scalar_<_Tp>
operator * (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2328 return Scalar_<_Tp>(saturate_cast<_Tp>(a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]),
2329 saturate_cast<_Tp>(a[0]*b[1] + a[1]*b[0] + a[2]*b[3] - a[3]*b[2]),
2330 saturate_cast<_Tp>(a[0]*b[2] - a[1]*b[3] + a[2]*b[0] + a[3]*b[1]),
2331 saturate_cast<_Tp>(a[0]*b[3] + a[1]*b[2] - a[2]*b[1] + a[3]*b[0]));
2334template<
typename _Tp>
static inline
2335Scalar_<_Tp>&
operator *= (Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2341template<
typename _Tp>
static inline
2344 return Scalar_<_Tp>(a.val[0] /
alpha,
2350template<
typename _Tp>
static inline
2353 float s = 1 /
alpha;
2354 return Scalar_<float>(a.val[0] * s, a.val[1] * s, a.val[2] * s, a.val[3] * s);
2357template<
typename _Tp>
static inline
2360 double s = 1 /
alpha;
2361 return Scalar_<double>(a.val[0] * s, a.val[1] * s, a.val[2] * s, a.val[3] * s);
2364template<
typename _Tp>
static inline
2371template<
typename _Tp>
static inline
2372Scalar_<_Tp>
operator / (_Tp a,
const Scalar_<_Tp>& b)
2374 _Tp s = a / (b[0]*b[0] + b[1]*b[1] + b[2]*b[2] + b[3]*b[3]);
2375 return b.conj() * s;
2378template<
typename _Tp>
static inline
2379Scalar_<_Tp>
operator / (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2381 return a * ((_Tp)1 / b);
2384template<
typename _Tp>
static inline
2385Scalar_<_Tp>&
operator /= (Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2391template<
typename _Tp>
static inline
2394 Matx<double, 4, 1> c((Matx<double, 4, 4>)a, b, Matx_MatMulOp());
2395 return reinterpret_cast<const Scalar&
>(c);
2401 Matx<double, 4, 1> c(a, b, Matx_MatMulOp());
2402 return reinterpret_cast<const Scalar&
>(c);
2411 :
pt(0,0),
size(0),
angle(-1), response(0), octave(0), class_id(-1) {}
2415 :
pt(_pt),
size(_size),
angle(_angle), response(_response), octave(_octave), class_id(_class_id) {}
2418KeyPoint::KeyPoint(
float x,
float y,
float _size,
float _angle,
float _response,
int _octave,
int _class_id)
2419 :
pt(
x,
y),
size(_size),
angle(_angle), response(_response), octave(_octave), class_id(_class_id) {}
2427 : queryIdx(-1), trainIdx(-1), imgIdx(-1),
distance(FLT_MAX) {}
2431 : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(-1),
distance(_distance) {}
2434DMatch::DMatch(
int _queryIdx,
int _trainIdx,
int _imgIdx,
float _distance)
2435 : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(_imgIdx),
distance(_distance) {}
2449 :
type(0), maxCount(0), epsilon(0) {}
2453 :
type(_type), maxCount(_maxCount), epsilon(_epsilon) {}
A complex number class.
Definition types.hpp:80
Complex conj() const
conjugation
_Tp im
the real and the imaginary parts
Definition types.hpp:92
_Tp re
Definition types.hpp:92
Complex(_Tp _re, _Tp _im=0)
Complex()
default constructor
Class for matching keypoint descriptors.
Definition types.hpp:842
CV_WRAP DMatch(int _queryIdx, int _trainIdx, float _distance)
CV_PROP_RW int queryIdx
query descriptor index
Definition types.hpp:848
bool operator<(const DMatch &m) const
CV_PROP_RW float distance
Definition types.hpp:852
CV_PROP_RW int imgIdx
train image index
Definition types.hpp:850
CV_WRAP DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance)
CV_PROP_RW int trainIdx
train descriptor index
Definition types.hpp:849
value_type work_type
Definition types.hpp:102
_Tp channel_type
Definition types.hpp:103
Vec< channel_type, channels > vec_type
Definition types.hpp:114
Complex< _Tp > value_type
Definition types.hpp:101
Vec< channel_type, channels > vec_type
Definition types.hpp:1004
double channel_type
Definition types.hpp:993
double work_type
Definition types.hpp:992
Moments value_type
Definition types.hpp:991
Point3_< typename DataType< _Tp >::work_type > work_type
Definition types.hpp:297
Point3_< _Tp > value_type
Definition types.hpp:296
_Tp channel_type
Definition types.hpp:298
Vec< channel_type, channels > vec_type
Definition types.hpp:309
Point_< _Tp > value_type
Definition types.hpp:214
Point_< typename DataType< _Tp >::work_type > work_type
Definition types.hpp:215
_Tp channel_type
Definition types.hpp:216
Vec< channel_type, channels > vec_type
Definition types.hpp:227
Vec< channel_type, channels > vec_type
Definition types.hpp:650
value_type work_type
Definition types.hpp:638
Range value_type
Definition types.hpp:637
int channel_type
Definition types.hpp:639
Vec< channel_type, channels > vec_type
Definition types.hpp:507
Rect_< typename DataType< _Tp >::work_type > work_type
Definition types.hpp:495
Rect_< _Tp > value_type
Definition types.hpp:494
_Tp channel_type
Definition types.hpp:496
RotatedRect value_type
Definition types.hpp:573
float channel_type
Definition types.hpp:575
Vec< channel_type, channels > vec_type
Definition types.hpp:586
value_type work_type
Definition types.hpp:574
_Tp channel_type
Definition types.hpp:709
Scalar_< _Tp > value_type
Definition types.hpp:707
Scalar_< typename DataType< _Tp >::work_type > work_type
Definition types.hpp:708
Vec< channel_type, channels > vec_type
Definition types.hpp:720
Size_< _Tp > value_type
Definition types.hpp:375
_Tp channel_type
Definition types.hpp:377
Size_< typename DataType< _Tp >::work_type > work_type
Definition types.hpp:376
Vec< channel_type, channels > vec_type
Definition types.hpp:388
Template "trait" class for OpenCV primitive data types.
Definition traits.hpp:113
Data structure for salient point detectors.
Definition types.hpp:745
CV_WRAP KeyPoint()
the default constructor
static CV_WRAP float overlap(const KeyPoint &kp1, const KeyPoint &kp2)
static CV_WRAP void convert(const std::vector< Point2f > &points2f, CV_OUT std::vector< KeyPoint > &keypoints, float size=1, float response=1, int octave=0, int class_id=-1)
CV_PROP_RW float angle
Definition types.hpp:806
KeyPoint(Point2f pt, float size, float angle=-1, float response=0, int octave=0, int class_id=-1)
CV_PROP_RW Point2f pt
coordinates of the keypoints
Definition types.hpp:804
CV_PROP_RW int octave
octave (pyramid layer) from which the keypoint has been extracted
Definition types.hpp:810
CV_PROP_RW float response
the response by which the most strong keypoints have been selected. Can be used for the further sorti...
Definition types.hpp:809
static CV_WRAP void convert(const std::vector< KeyPoint > &keypoints, CV_OUT std::vector< Point2f > &points2f, const std::vector< int > &keypointIndexes=std::vector< int >())
CV_PROP_RW int class_id
object class (if the keypoints need to be clustered by an object they belong to)
Definition types.hpp:811
CV_PROP_RW float size
diameter of the meaningful keypoint neighborhood
Definition types.hpp:805
CV_WRAP KeyPoint(float x, float y, float size, float angle=-1, float response=0, int octave=0, int class_id=-1)
_Tp val[m *n]
matrix elements
Definition matx.hpp:218
struct returned by cv::moments
Definition types.hpp:960
Moments()
the default constructor
CV_PROP_RW double nu02
Definition types.hpp:984
CV_PROP_RW double m00
Definition types.hpp:974
CV_PROP_RW double mu02
Definition types.hpp:979
Moments(double m00, double m10, double m01, double m20, double m11, double m02, double m30, double m21, double m12, double m03)
the full constructor
Template class for 3D points specified by its coordinates x, y and z.
Definition types.hpp:255
_Tp value_type
Definition types.hpp:257
_Tp z
z coordinate of the 3D point
Definition types.hpp:286
_Tp dot(const Point3_ &pt) const
dot product
_Tp x
x coordinate of the 3D point
Definition types.hpp:284
Point3_(const Point_< _Tp > &pt)
Point3_(_Tp _x, _Tp _y, _Tp _z)
Point3_(const Point3_ &pt)=default
Point3_(const Vec< _Tp, 3 > &v)
Point3_ cross(const Point3_ &pt) const
cross product of the 2 3D points
double ddot(const Point3_ &pt) const
dot product computed in double-precision arithmetics
Point3_ & operator=(const Point3_ &pt)=default
Point3_()
default constructor
_Tp y
y coordinate of the 3D point
Definition types.hpp:285
Point3_(Point3_ &&pt) CV_NOEXCEPT=default
Template class for 2D points specified by its coordinates x and y.
Definition types.hpp:163
_Tp y
y coordinate of the point
Definition types.hpp:202
Point_(const Size_< _Tp > &sz)
Point_()
default constructor
_Tp dot(const Point_ &pt) const
dot product
bool inside(const Rect_< _Tp > &r) const
checks whether the point is inside the specified rectangle
_Tp x
x coordinate of the point
Definition types.hpp:201
Point_(const Vec< _Tp, 2 > &v)
Point_ & operator=(const Point_ &pt)=default
double ddot(const Point_ &pt) const
dot product computed in double-precision arithmetics
double cross(const Point_ &pt) const
cross-product
Point_(const Point_ &pt)=default
Point_(Point_ &&pt) CV_NOEXCEPT=default
_Tp value_type
Definition types.hpp:165
Template class specifying a continuous subsequence (slice) of a sequence.
Definition types.hpp:623
int end
Definition types.hpp:631
Range(int _start, int _end)
Template class for 2D rectangles.
Definition types.hpp:444
_Tp area() const
area (width*height) of the rectangle
Point_< _Tp > tl() const
the top-left corner
Rect_(Rect_ &&r) CV_NOEXCEPT=default
Rect_ & operator=(const Rect_ &r)=default
_Tp x
x coordinate of the top-left corner
Definition types.hpp:480
bool contains(const Point_< _Tp > &pt) const
checks whether the rectangle contains the point
Rect_(const Point_< _Tp > &pt1, const Point_< _Tp > &pt2)
_Tp value_type
Definition types.hpp:446
Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height)
_Tp y
y coordinate of the top-left corner
Definition types.hpp:481
bool empty() const
true if empty
_Tp width
width of the rectangle
Definition types.hpp:482
_Tp height
height of the rectangle
Definition types.hpp:483
Rect_(const Rect_ &r)=default
Point_< _Tp > br() const
the bottom-right corner
Size_< _Tp > size() const
size (width, height) of the rectangle
Rect_(const Point_< _Tp > &org, const Size_< _Tp > &sz)
Rect_()
default constructor
The class represents rotated (i.e. not up-right) rectangles on a plane.
Definition types.hpp:531
CV_WRAP RotatedRect()
default constructor
CV_PROP_RW float angle
returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right...
Definition types.hpp:567
CV_PROP_RW Size2f size
returns width and height of the rectangle
Definition types.hpp:565
CV_WRAP void points(CV_OUT std::vector< Point2f > &pts) const
CV_WRAP RotatedRect(const Point2f ¢er, const Size2f &size, float angle)
void points(Point2f pts[]) const
CV_PROP_RW Point2f center
returns the rectangle mass center
Definition types.hpp:563
CV_WRAP RotatedRect(const Point2f &point1, const Point2f &point2, const Point2f &point3)
CV_WRAP Rect2f boundingRect2f() const
returns the minimal (exact) floating point rectangle containing the rotated rectangle,...
CV_WRAP Rect boundingRect() const
returns the minimal up-right integer rectangle containing the rotated rectangle
Template class for a 4-element vector derived from Vec.
Definition types.hpp:670
Scalar_(const Scalar_ &s)
Scalar_(Scalar_ &&s) CV_NOEXCEPT
Scalar_ & operator=(Scalar_ &&s) CV_NOEXCEPT
Scalar_ & operator=(const Scalar_ &s)
Scalar_< _Tp > mul(const Scalar_< _Tp > &a, double scale=1) const
per-element product
Scalar_(const Vec< _Tp2, cn > &v)
static Scalar_< _Tp > all(_Tp v0)
returns a scalar with all elements set to v0
Scalar_()
default constructor
bool isReal() const
returns true iff v1 == v2 == v3 == 0
Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0)
Scalar_< _Tp > conj() const
returns (v0, -v1, -v2, -v3)
Template class for specifying the size of an image or rectangle.
Definition types.hpp:335
bool empty() const
true if empty
Size_(Size_ &&sz) CV_NOEXCEPT=default
_Tp height
the height
Definition types.hpp:363
double aspectRatio() const
aspect ratio (width/height)
Size_(const Point_< _Tp > &pt)
Size_(const Size_ &sz)=default
Size_(_Tp _width, _Tp _height)
_Tp value_type
Definition types.hpp:337
_Tp area() const
the area (width*height)
_Tp width
the width
Definition types.hpp:362
Size_ & operator=(const Size_ &sz)=default
Size_()
default constructor
The class defining termination criteria for iterative algorithms.
Definition types.hpp:886
int type
the type of termination criteria: COUNT, EPS or COUNT + EPS
Definition types.hpp:914
int maxCount
the maximum number of iterations/elements
Definition types.hpp:915
Type
Definition types.hpp:892
bool isValid() const
Definition types.hpp:907
TermCriteria(int type, int maxCount, double epsilon)
double epsilon
the desired accuracy
Definition types.hpp:916
TermCriteria()
default constructor
Template class for short numerical vectors, a partial case of Matx.
Definition matx.hpp:369
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
Calculates the absolute norm of an array.
Point_< int > Point2i
Definition types.hpp:205
Rect2i Rect
Definition types.hpp:489
Size_< int64 > Size2l
Definition types.hpp:367
Point3_< double > Point3d
Definition types.hpp:291
Point2i Point
Definition types.hpp:209
Rect_< float > Rect2f
Definition types.hpp:487
Point_< int64 > Point2l
Definition types.hpp:206
Point_< double > Point2d
Definition types.hpp:208
Size2i Size
Definition types.hpp:370
Complex< double > Complexd
Definition types.hpp:96
Point3_< float > Point3f
Definition types.hpp:290
static bool operator!=(const Matx< _Tp, m, n > &a, const Matx< _Tp, m, n > &b)
Scalar_< double > Scalar
Definition types.hpp:702
static bool operator==(const Matx< _Tp, m, n > &a, const Matx< _Tp, m, n > &b)
Size_< int > Size2i
Definition types.hpp:366
Point_< float > Point2f
Definition types.hpp:207
Rect_< double > Rect2d
Definition types.hpp:488
Rect_< int > Rect2i
Definition types.hpp:486
Complex< float > Complexf
Definition types.hpp:95
Size_< float > Size2f
Definition types.hpp:368
Point3_< int > Point3i
Definition types.hpp:289
Size_< double > Size2d
Definition types.hpp:369
int int channels
Definition core_c.h:100
double double end
Definition core_c.h:1381
double start
Definition core_c.h:1381
CvScalar scale
Definition core_c.h:1088
const CvArr * angle
Definition core_c.h:1194
CvSize size
Definition core_c.h:112
int int type
Definition core_c.h:221
int depth
Definition core_c.h:100
const CvArr CvArr * x
Definition core_c.h:1195
double alpha
Definition core_c.h:1093
const CvArr const CvArr CvArr * result
Definition core_c.h:1423
const CvArr * y
Definition core_c.h:1187
int64_t int64
Definition interface.h:61
#define CV_MAKETYPE(depth, cn)
Definition interface.h:85
CV_INLINE v_reg< _Tp, n > operator|(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Bitwise OR.
CV_INLINE v_reg< _Tp, n > operator&(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Bitwise AND.
CV_INLINE v_reg< _Tp, n > & operator|=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator/=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > operator/(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Divide values.
CV_INLINE v_reg< _Tp, n > & operator&=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator-=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator+=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
CV_INLINE v_reg< _Tp, n > & operator*=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
softfloat abs(softfloat a)
Absolute value.
Definition softfloat.hpp:444
CV_INLINE int cvIsNaN(double value)
Determines if the argument is Not A Number.
Definition fast_math.hpp:284
#define CV_EXPORTS_W_SIMPLE
Definition cvdef.h:473
#define CV_EXPORTS
Definition cvdef.h:435
#define CV_OUT
Definition cvdef.h:478
#define CV_EXPORTS_W
Definition cvdef.h:472
#define CV_NOEXCEPT
Definition cvdef.h:800
#define CV_PROP_RW
Definition cvdef.h:480
#define CV_WRAP
Definition cvdef.h:481
static _AccTp normL2Sqr(const _Tp *a, int n)
Definition base.hpp:404
#define CV_DbgAssert(expr)
Definition base.hpp:375
#define CV_EXPORTS_W_MAP
Definition cvdef.h:475
CvPoint2D32f pt[4]
Definition imgproc_c.h:571
CvPoint pt1
Definition imgproc_c.h:357
CvRect r
Definition imgproc_c.h:984
CvSize int int int CvPoint int delta
Definition imgproc_c.h:1168
const char CvPoint org
Definition imgproc_c.h:1143
CvPoint CvPoint pt2
Definition imgproc_c.h:357
const CvPoint * pts
Definition imgproc_c.h:1026
CvArr CvPoint2D32f center
Definition imgproc_c.h:270
"black box" representation of the file storage associated with a file on disk.
Definition calib3d.hpp:441
DualQuat< T > operator-(const DualQuat< T > &q, const T a)
Definition dualquaternion.inl.hpp:255
DualQuat< T > operator+(const T a, const DualQuat< T > &q)
Definition dualquaternion.inl.hpp:243
DualQuat< T > operator*(const T a, const DualQuat< T > &q)
Definition dualquaternion.inl.hpp:274
float x
Definition types_c.h:978
float y
Definition types_c.h:979
int y
Definition types_c.h:937
int x
Definition types_c.h:936
int x
Definition types_c.h:833
Definition traits.hpp:382
@ value
Definition traits.hpp:382
Definition traits.hpp:402
Definition traits.hpp:386
@ value
Definition traits.hpp:386