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
118 template<
typename _Tp>
120 template<
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
231 template<
typename _Tp>
233 template<
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
313 template<
typename _Tp>
315 template<
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
392 template<
typename _Tp>
394 template<
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
511 template<
typename _Tp>
513 template<
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
724 template<
typename _Tp>
726 template<
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
1024 template<
typename _Tp>
inline
1028 template<
typename _Tp>
inline
1030 : re(_re), im(_im) {}
1032 template<
typename _Tp>
template<
typename T2>
inline
1033 Complex<_Tp>::operator Complex<T2>()
const
1035 return Complex<T2>(saturate_cast<T2>(re), saturate_cast<T2>(im));
1038 template<
typename _Tp>
inline
1041 return Complex<_Tp>(re, -im);
1045 template<
typename _Tp>
static inline
1046 bool operator == (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1048 return a.re == b.re && a.im == b.im;
1051 template<
typename _Tp>
static inline
1052 bool operator != (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1054 return a.re != b.re || a.im != b.im;
1057 template<
typename _Tp>
static inline
1058 Complex<_Tp>
operator + (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1060 return Complex<_Tp>( a.re + b.re, a.im + b.im );
1063 template<
typename _Tp>
static inline
1064 Complex<_Tp>&
operator += (Complex<_Tp>& a,
const Complex<_Tp>& b)
1066 a.re += b.re; a.im += b.im;
1070 template<
typename _Tp>
static inline
1071 Complex<_Tp>
operator - (
const Complex<_Tp>& a,
const Complex<_Tp>& b)
1073 return Complex<_Tp>( a.re - b.re, a.im - b.im );
1076 template<
typename _Tp>
static inline
1077 Complex<_Tp>&
operator -= (Complex<_Tp>& a,
const Complex<_Tp>& b)
1079 a.re -= b.re; a.im -= b.im;
1083 template<
typename _Tp>
static inline
1084 Complex<_Tp>
operator - (
const Complex<_Tp>& a)
1086 return Complex<_Tp>(-a.re, -a.im);
1089 template<
typename _Tp>
static inline
1090 Complex<_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 );
1095 template<
typename _Tp>
static inline
1096 Complex<_Tp>
operator * (
const Complex<_Tp>& a, _Tp b)
1098 return Complex<_Tp>( a.re*b, a.im*b );
1101 template<
typename _Tp>
static inline
1102 Complex<_Tp>
operator * (_Tp b,
const Complex<_Tp>& a)
1104 return Complex<_Tp>( a.re*b, a.im*b );
1107 template<
typename _Tp>
static inline
1108 Complex<_Tp>
operator + (
const Complex<_Tp>& a, _Tp b)
1110 return Complex<_Tp>( a.re + b, a.im );
1113 template<
typename _Tp>
static inline
1114 Complex<_Tp>
operator - (
const Complex<_Tp>& a, _Tp b)
1115 {
return Complex<_Tp>( a.re - b, a.im ); }
1117 template<
typename _Tp>
static inline
1118 Complex<_Tp>
operator + (_Tp b,
const Complex<_Tp>& a)
1120 return Complex<_Tp>( a.re + b, a.im );
1123 template<
typename _Tp>
static inline
1124 Complex<_Tp>
operator - (_Tp b,
const Complex<_Tp>& a)
1126 return Complex<_Tp>( b - a.re, -a.im );
1129 template<
typename _Tp>
static inline
1130 Complex<_Tp>&
operator += (Complex<_Tp>& a, _Tp b)
1132 a.re += b;
return a;
1135 template<
typename _Tp>
static inline
1136 Complex<_Tp>&
operator -= (Complex<_Tp>& a, _Tp b)
1138 a.re -= b;
return a;
1141 template<
typename _Tp>
static inline
1142 Complex<_Tp>&
operator *= (Complex<_Tp>& a, _Tp b)
1144 a.re *= b; a.im *= b;
return a;
1147 template<
typename _Tp>
static inline
1148 double abs(
const Complex<_Tp>& a)
1150 return std::sqrt( (
double)a.re*a.re + (
double)a.im*a.im);
1153 template<
typename _Tp>
static inline
1154 Complex<_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) );
1161 template<
typename _Tp>
static inline
1162 Complex<_Tp>&
operator /= (Complex<_Tp>& a,
const Complex<_Tp>& b)
1168 template<
typename _Tp>
static inline
1169 Complex<_Tp>
operator / (
const Complex<_Tp>& a, _Tp b)
1172 return Complex<_Tp>( a.re*t, a.im*t );
1175 template<
typename _Tp>
static inline
1176 Complex<_Tp>
operator / (_Tp b,
const Complex<_Tp>& a)
1178 return Complex<_Tp>(b)/a;
1181 template<
typename _Tp>
static inline
1182 Complex<_Tp>
operator /= (
const Complex<_Tp>& a, _Tp b)
1185 a.re *= t; a.im *= t;
return a;
1192 template<
typename _Tp>
inline
1196 template<
typename _Tp>
inline
1200 #if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
1201 template<
typename _Tp>
inline
1206 template<
typename _Tp>
inline
1208 :
x(sz.width),
y(sz.height) {}
1210 template<
typename _Tp>
inline
1212 :
x(v[0]),
y(v[1]) {}
1214 #if (defined(__GNUC__) && __GNUC__ < 5) && !defined(__clang__)
1215 template<
typename _Tp>
inline
1223 template<
typename _Tp>
template<
typename _Tp2>
inline
1224 Point_<_Tp>::operator Point_<_Tp2>()
const
1226 return Point_<_Tp2>(saturate_cast<_Tp2>(
x), saturate_cast<_Tp2>(
y));
1229 template<
typename _Tp>
inline
1230 Point_<_Tp>::operator Vec<_Tp, 2>()
const
1232 return Vec<_Tp, 2>(
x,
y);
1235 template<
typename _Tp>
inline
1238 return saturate_cast<_Tp>(
x*
pt.
x +
y*
pt.
y);
1241 template<
typename _Tp>
inline
1244 return (
double)
x*(double)(
pt.
x) + (double)
y*(
double)(
pt.
y);
1247 template<
typename _Tp>
inline
1250 return (
double)
x*
pt.
y - (double)
y*
pt.
x;
1253 template<
typename _Tp>
inline bool
1256 return r.contains(*
this);
1260 template<
typename _Tp>
static inline
1261 Point_<_Tp>&
operator += (Point_<_Tp>& a,
const Point_<_Tp>& b)
1268 template<
typename _Tp>
static inline
1269 Point_<_Tp>&
operator -= (Point_<_Tp>& a,
const Point_<_Tp>& b)
1276 template<
typename _Tp>
static inline
1279 a.x = saturate_cast<_Tp>(a.x * b);
1280 a.y = saturate_cast<_Tp>(a.y * b);
1284 template<
typename _Tp>
static inline
1285 Point_<_Tp>&
operator *= (Point_<_Tp>& a,
float b)
1287 a.x = saturate_cast<_Tp>(a.x * b);
1288 a.y = saturate_cast<_Tp>(a.y * b);
1292 template<
typename _Tp>
static inline
1293 Point_<_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);
1300 template<
typename _Tp>
static inline
1303 a.x = saturate_cast<_Tp>(a.x / b);
1304 a.y = saturate_cast<_Tp>(a.y / b);
1308 template<
typename _Tp>
static inline
1309 Point_<_Tp>&
operator /= (Point_<_Tp>& a,
float b)
1311 a.x = saturate_cast<_Tp>(a.x / b);
1312 a.y = saturate_cast<_Tp>(a.y / b);
1316 template<
typename _Tp>
static inline
1317 Point_<_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);
1324 template<
typename _Tp>
static inline
1325 double norm(
const Point_<_Tp>&
pt)
1330 template<
typename _Tp>
static inline
1331 bool operator == (
const Point_<_Tp>& a,
const Point_<_Tp>& b)
1333 return a.x == b.x && a.y == b.y;
1336 template<
typename _Tp>
static inline
1337 bool operator != (
const Point_<_Tp>& a,
const Point_<_Tp>& b)
1339 return a.x != b.x || a.y != b.y;
1342 template<
typename _Tp>
static inline
1343 Point_<_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) );
1348 template<
typename _Tp>
static inline
1349 Point_<_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) );
1354 template<
typename _Tp>
static inline
1355 Point_<_Tp>
operator - (
const Point_<_Tp>& a)
1357 return Point_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y) );
1360 template<
typename _Tp>
static inline
1361 Point_<_Tp>
operator * (
const Point_<_Tp>& a,
int b)
1363 return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );
1366 template<
typename _Tp>
static inline
1367 Point_<_Tp>
operator * (
int a,
const Point_<_Tp>& b)
1369 return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );
1372 template<
typename _Tp>
static inline
1373 Point_<_Tp>
operator * (
const Point_<_Tp>& a,
float b)
1375 return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );
1378 template<
typename _Tp>
static inline
1379 Point_<_Tp>
operator * (
float a,
const Point_<_Tp>& b)
1381 return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );
1384 template<
typename _Tp>
static inline
1385 Point_<_Tp>
operator * (
const Point_<_Tp>& a,
double b)
1387 return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) );
1390 template<
typename _Tp>
static inline
1391 Point_<_Tp>
operator * (
double a,
const Point_<_Tp>& b)
1393 return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) );
1396 template<
typename _Tp>
static inline
1397 Point_<_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]);
1403 template<
typename _Tp>
static inline
1404 Point3_<_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]);
1410 template<
typename _Tp>
static inline
1411 Point_<_Tp>
operator / (
const Point_<_Tp>& a,
int b)
1418 template<
typename _Tp>
static inline
1419 Point_<_Tp>
operator / (
const Point_<_Tp>& a,
float b)
1426 template<
typename _Tp>
static inline
1427 Point_<_Tp>
operator / (
const Point_<_Tp>& a,
double b)
1435 template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<int>&
pt);
1436 template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<int64>&
pt);
1437 template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<float>&
pt);
1438 template<
typename _AccTp>
static inline _AccTp
normL2Sqr(
const Point_<double>&
pt);
1440 template<>
inline int normL2Sqr<int>(
const Point_<int>&
pt) {
return pt.dot(
pt); }
1441 template<>
inline int64 normL2Sqr<int64>(
const Point_<int64>&
pt) {
return pt.dot(
pt); }
1442 template<>
inline float normL2Sqr<float>(
const Point_<float>&
pt) {
return pt.dot(
pt); }
1443 template<>
inline double normL2Sqr<double>(
const Point_<int>&
pt) {
return pt.dot(
pt); }
1445 template<>
inline double normL2Sqr<double>(
const Point_<float>&
pt) {
return pt.ddot(
pt); }
1446 template<>
inline double normL2Sqr<double>(
const Point_<double>&
pt) {
return pt.ddot(
pt); }
1452 template<
typename _Tp>
inline
1454 :
x(0),
y(0), z(0) {}
1456 template<
typename _Tp>
inline
1458 :
x(_x),
y(_y), z(_z) {}
1460 template<
typename _Tp>
inline
1464 template<
typename _Tp>
inline
1466 :
x(v[0]),
y(v[1]), z(v[2]) {}
1468 template<
typename _Tp>
template<
typename _Tp2>
inline
1469 Point3_<_Tp>::operator Point3_<_Tp2>()
const
1471 return Point3_<_Tp2>(saturate_cast<_Tp2>(
x), saturate_cast<_Tp2>(
y), saturate_cast<_Tp2>(z));
1474 template<
typename _Tp>
inline
1475 Point3_<_Tp>::operator Vec<_Tp, 3>()
const
1477 return Vec<_Tp, 3>(
x,
y, z);
1480 template<
typename _Tp>
inline
1483 return saturate_cast<_Tp>(
x*
pt.
x +
y*
pt.
y + z*
pt.z);
1486 template<
typename _Tp>
inline
1489 return (
double)
x*
pt.
x + (double)
y*
pt.
y + (
double)z*
pt.z;
1492 template<
typename _Tp>
inline
1499 template<
typename _Tp>
static inline
1500 Point3_<_Tp>&
operator += (Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1508 template<
typename _Tp>
static inline
1509 Point3_<_Tp>&
operator -= (Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1517 template<
typename _Tp>
static inline
1518 Point3_<_Tp>&
operator *= (Point3_<_Tp>& a,
int b)
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);
1526 template<
typename _Tp>
static inline
1527 Point3_<_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);
1535 template<
typename _Tp>
static inline
1536 Point3_<_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);
1544 template<
typename _Tp>
static inline
1545 Point3_<_Tp>&
operator /= (Point3_<_Tp>& a,
int b)
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);
1553 template<
typename _Tp>
static inline
1554 Point3_<_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);
1562 template<
typename _Tp>
static inline
1563 Point3_<_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);
1571 template<
typename _Tp>
static inline
1572 double norm(
const Point3_<_Tp>&
pt)
1577 template<
typename _Tp>
static inline
1578 bool operator == (
const Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1580 return a.x == b.x && a.y == b.y && a.z == b.z;
1583 template<
typename _Tp>
static inline
1584 bool operator != (
const Point3_<_Tp>& a,
const Point3_<_Tp>& b)
1586 return a.x != b.x || a.y != b.y || a.z != b.z;
1589 template<
typename _Tp>
static inline
1590 Point3_<_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));
1595 template<
typename _Tp>
static inline
1596 Point3_<_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));
1601 template<
typename _Tp>
static inline
1602 Point3_<_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) );
1607 template<
typename _Tp>
static inline
1608 Point3_<_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) );
1613 template<
typename _Tp>
static inline
1614 Point3_<_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) );
1619 template<
typename _Tp>
static inline
1620 Point3_<_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) );
1625 template<
typename _Tp>
static inline
1626 Point3_<_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) );
1631 template<
typename _Tp>
static inline
1632 Point3_<_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) );
1637 template<
typename _Tp>
static inline
1638 Point3_<_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) );
1643 template<
typename _Tp>
static inline
1644 Point3_<_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]);
1650 template<
typename _Tp>
static inline
1651 Matx<_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);
1656 template<
typename _Tp>
static inline
1657 Point3_<_Tp>
operator / (
const Point3_<_Tp>& a,
int b)
1659 Point3_<_Tp> tmp(a);
1664 template<
typename _Tp>
static inline
1665 Point3_<_Tp>
operator / (
const Point3_<_Tp>& a,
float b)
1667 Point3_<_Tp> tmp(a);
1672 template<
typename _Tp>
static inline
1673 Point3_<_Tp>
operator / (
const Point3_<_Tp>& a,
double b)
1675 Point3_<_Tp> tmp(a);
1684 template<
typename _Tp>
inline
1686 : width(0), height(0) {}
1688 template<
typename _Tp>
inline
1690 : width(_width), height(_height) {}
1692 template<
typename _Tp>
inline
1694 : width(
pt.
x), height(
pt.
y) {}
1696 template<
typename _Tp>
template<
typename _Tp2>
inline
1697 Size_<_Tp>::operator Size_<_Tp2>()
const
1699 return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height));
1702 template<
typename _Tp>
inline
1705 const _Tp
result = width * height;
1707 || width == 0 ||
result / width == height);
1711 template<
typename _Tp>
inline
1714 return width /
static_cast<double>(height);
1717 template<
typename _Tp>
inline
1720 return width <= 0 || height <= 0;
1724 template<
typename _Tp>
static inline
1732 template<
typename _Tp>
static inline
1733 Size_<_Tp>
operator * (
const Size_<_Tp>& a, _Tp b)
1740 template<
typename _Tp>
static inline
1748 template<
typename _Tp>
static inline
1749 Size_<_Tp>
operator / (
const Size_<_Tp>& a, _Tp b)
1756 template<
typename _Tp>
static inline
1757 Size_<_Tp>&
operator += (Size_<_Tp>& a,
const Size_<_Tp>& b)
1760 a.height += b.height;
1764 template<
typename _Tp>
static inline
1765 Size_<_Tp>
operator + (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1772 template<
typename _Tp>
static inline
1773 Size_<_Tp>&
operator -= (Size_<_Tp>& a,
const Size_<_Tp>& b)
1776 a.height -= b.height;
1780 template<
typename _Tp>
static inline
1781 Size_<_Tp>
operator - (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1788 template<
typename _Tp>
static inline
1789 bool operator == (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1791 return a.width == b.width && a.height == b.height;
1794 template<
typename _Tp>
static inline
1795 bool operator != (
const Size_<_Tp>& a,
const Size_<_Tp>& b)
1804 template<
typename _Tp>
inline
1806 :
x(0),
y(0), width(0), height(0) {}
1808 template<
typename _Tp>
inline
1810 :
x(_x),
y(_y), width(_width), height(_height) {}
1812 template<
typename _Tp>
inline
1814 :
x(
org.
x),
y(
org.
y), width(sz.width), height(sz.height) {}
1816 template<
typename _Tp>
inline
1825 template<
typename _Tp>
inline
1828 return Point_<_Tp>(
x,
y);
1831 template<
typename _Tp>
inline
1834 return Point_<_Tp>(
x + width,
y + height);
1837 template<
typename _Tp>
inline
1840 return Size_<_Tp>(width, height);
1843 template<
typename _Tp>
inline
1846 const _Tp
result = width * height;
1848 || width == 0 ||
result / width == height);
1852 template<
typename _Tp>
inline
1855 return width <= 0 || height <= 0;
1858 template<
typename _Tp>
template<
typename _Tp2>
inline
1859 Rect_<_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));
1864 template<
typename _Tp>
inline
1871 template<
typename _Tp>
static inline
1872 Rect_<_Tp>&
operator += ( Rect_<_Tp>& a,
const Point_<_Tp>& b )
1879 template<
typename _Tp>
static inline
1880 Rect_<_Tp>&
operator -= ( Rect_<_Tp>& a,
const Point_<_Tp>& b )
1887 template<
typename _Tp>
static inline
1888 Rect_<_Tp>&
operator += ( Rect_<_Tp>& a,
const Size_<_Tp>& b )
1891 a.height += b.height;
1895 template<
typename _Tp>
static inline
1896 Rect_<_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;
1906 template<
typename _Tp>
static inline
1907 Rect_<_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);
1940 template<
typename _Tp>
static inline
1941 Rect_<_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;
1957 template<
typename _Tp>
static inline
1958 bool 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;
1963 template<
typename _Tp>
static inline
1964 bool 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;
1969 template<
typename _Tp>
static inline
1970 Rect_<_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 );
1975 template<
typename _Tp>
static inline
1976 Rect_<_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 );
1981 template<
typename _Tp>
static inline
1982 Rect_<_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 );
1987 template<
typename _Tp>
static inline
1988 Rect_<_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 );
1996 template<
typename _Tp>
static inline
1997 Rect_<_Tp>
operator & (
const Rect_<_Tp>& a,
const Rect_<_Tp>& b)
2003 template<
typename _Tp>
static inline
2004 Rect_<_Tp>
operator | (
const Rect_<_Tp>& a,
const Rect_<_Tp>& b)
2016 template<
typename _Tp>
static inline
2017 double 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);
2080 bool operator == (
const Range& r1,
const Range& r2)
2082 return r1.start == r2.start && r1.end == r2.end;
2086 bool operator != (
const Range& r1,
const Range& r2)
2092 bool operator !(
const Range&
r)
2094 return r.start ==
r.end;
2098 Range
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);
2134 template<
typename _Tp>
inline
2137 this->val[0] = this->val[1] = this->val[2] = this->val[3] = 0;
2140 template<
typename _Tp>
inline
2149 template<
typename _Tp>
inline
2153 template<
typename _Tp>
inline
2161 template<
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];
2170 template<
typename _Tp>
inline
2179 template<
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]);
2189 template<
typename _Tp>
inline
2193 this->val[1] = this->val[2] = this->val[3] = 0;
2196 template<
typename _Tp>
inline
2199 return Scalar_<_Tp>(v0, v0, v0, v0);
2203 template<
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));
2212 template<
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]));
2221 template<
typename _Tp>
inline
2224 return this->val[1] == 0 && this->val[2] == 0 && this->val[3] == 0;
2228 template<
typename _Tp>
template<
typename T2>
inline
2229 Scalar_<_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]));
2238 template<
typename _Tp>
static inline
2239 Scalar_<_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];
2248 template<
typename _Tp>
static inline
2249 Scalar_<_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];
2258 template<
typename _Tp>
static inline
2259 Scalar_<_Tp>&
operator *= ( Scalar_<_Tp>& a, _Tp v )
2268 template<
typename _Tp>
static inline
2269 bool 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];
2275 template<
typename _Tp>
static inline
2276 bool 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];
2282 template<
typename _Tp>
static inline
2283 Scalar_<_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]);
2291 template<
typename _Tp>
static inline
2292 Scalar_<_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]));
2300 template<
typename _Tp>
static inline
2303 return Scalar_<_Tp>(a.val[0] *
alpha,
2309 template<
typename _Tp>
static inline
2315 template<
typename _Tp>
static inline
2316 Scalar_<_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]));
2325 template<
typename _Tp>
static inline
2326 Scalar_<_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]));
2334 template<
typename _Tp>
static inline
2335 Scalar_<_Tp>&
operator *= (Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2341 template<
typename _Tp>
static inline
2344 return Scalar_<_Tp>(a.val[0] /
alpha,
2350 template<
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);
2357 template<
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);
2364 template<
typename _Tp>
static inline
2371 template<
typename _Tp>
static inline
2372 Scalar_<_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;
2378 template<
typename _Tp>
static inline
2379 Scalar_<_Tp>
operator / (
const Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2381 return a * ((_Tp)1 / b);
2384 template<
typename _Tp>
static inline
2385 Scalar_<_Tp>&
operator /= (Scalar_<_Tp>& a,
const Scalar_<_Tp>& b)
2391 template<
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) {}
2418 KeyPoint::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) {}
2434 DMatch::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) {}
2460 #pragma warning(pop)
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
Point3_ & operator=(const Point3_ &pt)=default
double ddot(const Point3_ &pt) const
dot product computed in double-precision arithmetics
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)
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
Point_ & operator=(const Point_ &pt)=default
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
Rect_(Rect_ &&r) CV_NOEXCEPT=default
Point_< _Tp > tl() const
the top-left corner
_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
Point_< _Tp > br() const
the bottom-right corner
Rect_(const Rect_ &r)=default
Size_< _Tp > size() const
size (width, height) of the rectangle
Rect_(const Point_< _Tp > &org, const Size_< _Tp > &sz)
Rect_ & operator=(const Rect_ &r)=default
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_< _Tp > mul(const Scalar_< _Tp > &a, double scale=1) const
per-element product
Scalar_(Scalar_ &&s) CV_NOEXCEPT
Scalar_(const Vec< _Tp2, cn > &v)
Scalar_< _Tp > conj() const
returns (v0, -v1, -v2, -v3)
Scalar_ & operator=(Scalar_ &&s) CV_NOEXCEPT
static Scalar_< _Tp > all(_Tp v0)
returns a scalar with all elements set to v0
Scalar_ & operator=(const Scalar_ &s)
Scalar_()
default constructor
bool isReal() const
returns true iff v1 == v2 == v3 == 0
Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0)
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
Size_ & operator=(const Size_ &sz)=default
_Tp area() const
the area (width*height)
_Tp width
the width
Definition: types.hpp:362
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
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)
static double norm(const Matx< _Tp, m, n > &M)
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
const CvArr * angle
Definition: core_c.h:1194
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
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-=(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/(const v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
Divide values.
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+=(v_reg< _Tp, n > &a, const v_reg< _Tp, n > &b)
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 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
DualQuat< T > operator-(const DualQuat< T > &q, const T a)
Definition: dualquaternion.inl.hpp:255
static uchar abs(uchar a)
Definition: cvstd.hpp:66
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
Definition: traits.hpp:382
@ value
Definition: traits.hpp:382
Definition: traits.hpp:402
Definition: traits.hpp:386
@ value
Definition: traits.hpp:386