core.hpp
Go to the documentation of this file.
1 
4 /*M///////////////////////////////////////////////////////////////////////////////////////
5 //
6 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
7 //
8 // By downloading, copying, installing or using the software you agree to this license.
9 // If you do not agree to this license, do not download, install,
10 // copy or use the software.
11 //
12 //
13 // License Agreement
14 // For Open Source Computer Vision Library
15 //
16 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
17 // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
18 // Third party copyrights are property of their respective owners.
19 //
20 // Redistribution and use in source and binary forms, with or without modification,
21 // are permitted provided that the following conditions are met:
22 //
23 // * Redistribution's of source code must retain the above copyright notice,
24 // this list of conditions and the following disclaimer.
25 //
26 // * Redistribution's in binary form must reproduce the above copyright notice,
27 // this list of conditions and the following disclaimer in the documentation
28 // and/or other materials provided with the distribution.
29 //
30 // * The name of the copyright holders may not be used to endorse or promote products
31 // derived from this software without specific prior written permission.
32 //
33 // This software is provided by the copyright holders and contributors "as is" and
34 // any express or implied warranties, including, but not limited to, the implied
35 // warranties of merchantability and fitness for a particular purpose are disclaimed.
36 // In no event shall the Intel Corporation or contributors be liable for any direct,
37 // indirect, incidental, special, exemplary, or consequential damages
38 // (including, but not limited to, procurement of substitute goods or services;
39 // loss of use, data, or profits; or business interruption) however caused
40 // and on any theory of liability, whether in contract, strict liability,
41 // or tort (including negligence or otherwise) arising in any way out of
42 // the use of this software, even if advised of the possibility of such damage.
43 //
44 //M*/
45 
46 #ifndef __OPENCV_CORE_HPP__
47 #define __OPENCV_CORE_HPP__
48 
49 #include "opencv2/core/types_c.h"
50 #include "opencv2/core/version.hpp"
51 
52 #ifdef __cplusplus
53 
54 #ifndef SKIP_INCLUDES
55 #include <limits.h>
56 #include <algorithm>
57 #include <cmath>
58 #include <cstddef>
59 #include <complex>
60 #include <map>
61 #include <new>
62 #include <string>
63 #include <vector>
64 #include <sstream>
65 #endif // SKIP_INCLUDES
66 
70 namespace cv {
71 
72 #undef abs
73 #undef min
74 #undef max
75 #undef Complex
76 
77 using std::vector;
78 using std::string;
79 using std::ptrdiff_t;
80 
81 template<typename _Tp> class Size_;
82 template<typename _Tp> class Point_;
83 template<typename _Tp> class Rect_;
84 template<typename _Tp, int cn> class Vec;
85 template<typename _Tp, int m, int n> class Matx;
86 
87 typedef std::string String;
88 
89 class Mat;
90 class SparseMat;
91 typedef Mat MatND;
92 
93 namespace ogl {
94  class Buffer;
95  class Texture2D;
96  class Arrays;
97 }
98 
99 // < Deprecated
100 class GlBuffer;
101 class GlTexture;
102 class GlArrays;
103 class GlCamera;
104 // >
105 
106 namespace gpu {
107  class GpuMat;
108 }
109 
110 class CV_EXPORTS MatExpr;
111 class CV_EXPORTS MatOp_Base;
112 class CV_EXPORTS MatArg;
113 class CV_EXPORTS MatConstIterator;
114 
115 template<typename _Tp> class Mat_;
116 template<typename _Tp> class MatIterator_;
117 template<typename _Tp> class MatConstIterator_;
118 template<typename _Tp> class MatCommaInitializer_;
119 
120 #if !defined(ANDROID) || (defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_WCHAR_T)
121 typedef std::basic_string<wchar_t> WString;
122 
123 CV_EXPORTS string fromUtf16(const WString& str);
124 CV_EXPORTS WString toUtf16(const string& str);
125 #endif
126 
127 CV_EXPORTS string format( const char* fmt, ... );
128 CV_EXPORTS string tempfile( const char* suffix CV_DEFAULT(0));
129 
130 // matrix decomposition types
133 enum { CMP_EQ=0, CMP_GT=1, CMP_GE=2, CMP_LT=3, CMP_LE=4, CMP_NE=5 };
134 enum { GEMM_1_T=1, GEMM_2_T=2, GEMM_3_T=4 };
137 
138 
143 class CV_EXPORTS Exception : public std::exception
144 {
145 public:
149  Exception();
154  Exception(int _code, const string& _err, const string& _func, const string& _file, int _line);
155  virtual ~Exception() throw();
156 
160  virtual const char *what() const throw();
161  void formatMessage();
162 
163  string msg;
164 
165  int code;
166  string err;
167  string func;
168  string file;
169  int line;
170 };
171 
172 
174 
182 CV_EXPORTS void error( const Exception& exc );
183 
185 
192 CV_EXPORTS bool setBreakOnError(bool flag);
193 
194 typedef int (CV_CDECL *ErrorCallback)( int status, const char* func_name,
195  const char* err_msg, const char* file_name,
196  int line, void* userdata );
197 
199 
209 CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback,
210  void* userdata=0, void** prevUserdata=0);
211 
212 
213 #if defined __GNUC__
214 #define CV_Func __func__
215 #elif defined _MSC_VER
216 #define CV_Func __FUNCTION__
217 #else
218 #define CV_Func ""
219 #endif
220 
221 #define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, CV_Func, __FILE__, __LINE__) )
222 #define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, CV_Func, __FILE__, __LINE__) )
223 #define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, CV_Func, __FILE__, __LINE__) )
224 
225 #ifdef _DEBUG
226 #define CV_DbgAssert(expr) CV_Assert(expr)
227 #else
228 #define CV_DbgAssert(expr)
229 #endif
230 
231 CV_EXPORTS void glob(String pattern, std::vector<String>& result, bool recursive = false);
232 
233 CV_EXPORTS void setNumThreads(int nthreads);
234 CV_EXPORTS int getNumThreads();
235 CV_EXPORTS int getThreadNum();
236 
237 CV_EXPORTS_W const string& getBuildInformation();
238 
240 
247 CV_EXPORTS_W int64 getTickCount();
248 
261 CV_EXPORTS_W double getTickFrequency();
262 
271 CV_EXPORTS_W int64 getCPUTickCount();
272 
292 CV_EXPORTS_W bool checkHardwareSupport(int feature);
293 
295 CV_EXPORTS_W int getNumberOfCPUs();
296 
307 CV_EXPORTS void* fastMalloc(size_t bufSize);
308 
315 CV_EXPORTS void fastFree(void* ptr);
316 
317 template<typename _Tp> static inline _Tp* allocate(size_t n)
318 {
319  return new _Tp[n];
320 }
321 
322 template<typename _Tp> static inline void deallocate(_Tp* ptr, size_t)
323 {
324  delete[] ptr;
325 }
326 
333 template<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))
334 {
335  return (_Tp*)(((size_t)ptr + n-1) & -n);
336 }
337 
343 static inline size_t alignSize(size_t sz, int n)
344 {
345  assert((n & (n - 1)) == 0); // n is a power of 2
346  return (sz + n-1) & -n;
347 }
348 
358 CV_EXPORTS_W void setUseOptimized(bool onoff);
359 
365 CV_EXPORTS_W bool useOptimized();
366 
370 template<typename _Tp> class Allocator
371 {
372 public:
373  typedef _Tp value_type;
374  typedef value_type* pointer;
375  typedef const value_type* const_pointer;
377  typedef const value_type& const_reference;
378  typedef size_t size_type;
379  typedef ptrdiff_t difference_type;
380  template<typename U> class rebind { typedef Allocator<U> other; };
381 
382  explicit Allocator() {}
384  explicit Allocator(Allocator const&) {}
385  template<typename U>
386  explicit Allocator(Allocator<U> const&) {}
387 
388  // address
389  pointer address(reference r) { return &r; }
391 
392  pointer allocate(size_type count, const void* =0)
393  { return reinterpret_cast<pointer>(fastMalloc(count * sizeof (_Tp))); }
394 
396 
398  { return max(static_cast<_Tp>(-1)/sizeof(_Tp), 1); }
399 
400  void construct(pointer p, const _Tp& v) { new(static_cast<void*>(p)) _Tp(v); }
401  void destroy(pointer p) { p->~_Tp(); }
402 };
403 
405 
412 template<typename _Tp> class DataDepth {};
413 
414 template<> class DataDepth<bool> { public: enum { value = CV_8U, fmt=(int)'u' }; };
415 template<> class DataDepth<uchar> { public: enum { value = CV_8U, fmt=(int)'u' }; };
416 template<> class DataDepth<schar> { public: enum { value = CV_8S, fmt=(int)'c' }; };
417 template<> class DataDepth<char> { public: enum { value = CV_8S, fmt=(int)'c' }; };
418 template<> class DataDepth<ushort> { public: enum { value = CV_16U, fmt=(int)'w' }; };
419 template<> class DataDepth<short> { public: enum { value = CV_16S, fmt=(int)'s' }; };
420 template<> class DataDepth<int> { public: enum { value = CV_32S, fmt=(int)'i' }; };
421 // this is temporary solution to support 32-bit unsigned integers
422 template<> class DataDepth<unsigned> { public: enum { value = CV_32S, fmt=(int)'i' }; };
423 template<> class DataDepth<float> { public: enum { value = CV_32F, fmt=(int)'f' }; };
424 template<> class DataDepth<double> { public: enum { value = CV_64F, fmt=(int)'d' }; };
425 template<typename _Tp> class DataDepth<_Tp*> { public: enum { value = CV_USRTYPE1, fmt=(int)'r' }; };
426 
427 
429 
446 struct CV_EXPORTS Matx_AddOp {};
447 struct CV_EXPORTS Matx_SubOp {};
448 struct CV_EXPORTS Matx_ScaleOp {};
449 struct CV_EXPORTS Matx_MulOp {};
450 struct CV_EXPORTS Matx_MatMulOp {};
451 struct CV_EXPORTS Matx_TOp {};
452 
453 template<typename _Tp, int m, int n> class Matx
454 {
455 public:
456  typedef _Tp value_type;
460  type = CV_MAKETYPE(depth, channels) };
461 
463  Matx();
464 
465  Matx(_Tp v0);
466  Matx(_Tp v0, _Tp v1);
467  Matx(_Tp v0, _Tp v1, _Tp v2);
468  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3);
469  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4);
470  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5);
471  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6);
472  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7);
473  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8);
474  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9);
475  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
476  _Tp v4, _Tp v5, _Tp v6, _Tp v7,
477  _Tp v8, _Tp v9, _Tp v10, _Tp v11);
478  Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
479  _Tp v4, _Tp v5, _Tp v6, _Tp v7,
480  _Tp v8, _Tp v9, _Tp v10, _Tp v11,
481  _Tp v12, _Tp v13, _Tp v14, _Tp v15);
482  explicit Matx(const _Tp* vals);
483 
484  static Matx all(_Tp alpha);
485  static Matx zeros();
486  static Matx ones();
487  static Matx eye();
488  static Matx diag(const diag_type& d);
489  static Matx randu(_Tp a, _Tp b);
490  static Matx randn(_Tp a, _Tp b);
491 
493  _Tp dot(const Matx<_Tp, m, n>& v) const;
494 
496  double ddot(const Matx<_Tp, m, n>& v) const;
497 
499  template<typename T2> operator Matx<T2, m, n>() const;
500 
502  template<int m1, int n1> Matx<_Tp, m1, n1> reshape() const;
503 
505  template<int m1, int n1> Matx<_Tp, m1, n1> get_minor(int i, int j) const;
506 
508  Matx<_Tp, 1, n> row(int i) const;
509 
511  Matx<_Tp, m, 1> col(int i) const;
512 
514  diag_type diag() const;
515 
517  Matx<_Tp, n, m> t() const;
518 
520  Matx<_Tp, n, m> inv(int method=DECOMP_LU) const;
521 
523  template<int l> Matx<_Tp, n, l> solve(const Matx<_Tp, m, l>& rhs, int flags=DECOMP_LU) const;
524  Vec<_Tp, n> solve(const Vec<_Tp, m>& rhs, int method) const;
525 
527  Matx<_Tp, m, n> mul(const Matx<_Tp, m, n>& a) const;
528 
530  const _Tp& operator ()(int i, int j) const;
531  _Tp& operator ()(int i, int j);
532 
534  const _Tp& operator ()(int i) const;
535  _Tp& operator ()(int i);
536 
539  template<typename _T2> Matx(const Matx<_Tp, m, n>& a, _T2 alpha, Matx_ScaleOp);
541  template<int l> Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp);
542  Matx(const Matx<_Tp, n, m>& a, Matx_TOp);
543 
544  _Tp val[m*n]; //< matrix elements
545 };
546 
547 
556 
565 
572 
575 
580 
585 
586 
602 template<typename _Tp, int cn> class Vec : public Matx<_Tp, cn, 1>
603 {
604 public:
605  typedef _Tp value_type;
606  enum { depth = DataDepth<_Tp>::value, channels = cn, type = CV_MAKETYPE(depth, channels) };
607 
609  Vec();
610 
611  Vec(_Tp v0);
612  Vec(_Tp v0, _Tp v1);
613  Vec(_Tp v0, _Tp v1, _Tp v2);
614  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3);
615  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4);
616  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5);
617  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6);
618  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7);
619  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8);
620  Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9);
621  explicit Vec(const _Tp* values);
622 
623  Vec(const Vec<_Tp, cn>& v);
624 
625  static Vec all(_Tp alpha);
626 
628  Vec mul(const Vec<_Tp, cn>& v) const;
629 
631  Vec conj() const;
632 
638  Vec cross(const Vec& v) const;
640  template<typename T2> operator Vec<T2, cn>() const;
642  operator CvScalar() const;
643 
645  const _Tp& operator [](int i) const;
646  _Tp& operator[](int i);
647  const _Tp& operator ()(int i) const;
648  _Tp& operator ()(int i);
649 
652  template<typename _T2> Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp);
653 };
654 
655 
656 /* \typedef
657 
658  Shorter aliases for the most popular specializations of Vec<T,n>
659 */
663 
667 
671 
677 
682 
687 
688 
690 
698 template<typename _Tp> class Complex
699 {
700 public:
701 
703  Complex();
704  Complex( _Tp _re, _Tp _im=0 );
705  Complex( const std::complex<_Tp>& c );
706 
708  template<typename T2> operator Complex<T2>() const;
710  Complex conj() const;
712  operator std::complex<_Tp>() const;
713 
714  _Tp re, im; //< the real and the imaginary parts
715 };
716 
717 
723 
724 
726 
734 template<typename _Tp> class Point_
735 {
736 public:
737  typedef _Tp value_type;
738 
739  // various constructors
740  Point_();
741  Point_(_Tp _x, _Tp _y);
742  Point_(const Point_& pt);
743  Point_(const CvPoint& pt);
744  Point_(const CvPoint2D32f& pt);
745  Point_(const Size_<_Tp>& sz);
746  Point_(const Vec<_Tp, 2>& v);
747 
748  Point_& operator = (const Point_& pt);
750  template<typename _Tp2> operator Point_<_Tp2>() const;
751 
753  operator CvPoint() const;
754  operator CvPoint2D32f() const;
755  operator Vec<_Tp, 2>() const;
756 
758  _Tp dot(const Point_& pt) const;
760  double ddot(const Point_& pt) const;
762  double cross(const Point_& pt) const;
764  bool inside(const Rect_<_Tp>& r) const;
765 
766  _Tp x, y; //< the point coordinates
767 };
768 
777 template<typename _Tp> class Point3_
778 {
779 public:
780  typedef _Tp value_type;
781 
782  // various constructors
783  Point3_();
784  Point3_(_Tp _x, _Tp _y, _Tp _z);
785  Point3_(const Point3_& pt);
786  explicit Point3_(const Point_<_Tp>& pt);
787  Point3_(const CvPoint3D32f& pt);
788  Point3_(const Vec<_Tp, 3>& v);
789 
790  Point3_& operator = (const Point3_& pt);
792  template<typename _Tp2> operator Point3_<_Tp2>() const;
794  operator CvPoint3D32f() const;
796  operator Vec<_Tp, 3>() const;
797 
799  _Tp dot(const Point3_& pt) const;
801  double ddot(const Point3_& pt) const;
803  Point3_ cross(const Point3_& pt) const;
804 
805  _Tp x, y, z; //< the point coordinates
806 };
807 
809 
816 template<typename _Tp> class Size_
817 {
818 public:
819  typedef _Tp value_type;
820 
822  Size_();
823  Size_(_Tp _width, _Tp _height);
824  Size_(const Size_& sz);
825  Size_(const CvSize& sz);
826  Size_(const CvSize2D32f& sz);
827  Size_(const Point_<_Tp>& pt);
828 
829  Size_& operator = (const Size_& sz);
831  _Tp area() const;
832 
834  template<typename _Tp2> operator Size_<_Tp2>() const;
835 
837  operator CvSize() const;
838  operator CvSize2D32f() const;
839 
840  _Tp width, height; // the width and the height
841 };
842 
844 
851 template<typename _Tp> class Rect_
852 {
853 public:
854  typedef _Tp value_type;
855 
857  Rect_();
858  Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);
859  Rect_(const Rect_& r);
860  Rect_(const CvRect& r);
861  Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz);
862  Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2);
863 
864  Rect_& operator = ( const Rect_& r );
866  Point_<_Tp> tl() const;
868  Point_<_Tp> br() const;
869 
871  Size_<_Tp> size() const;
873  _Tp area() const;
874 
876  template<typename _Tp2> operator Rect_<_Tp2>() const;
878  operator CvRect() const;
879 
881  bool contains(const Point_<_Tp>& pt) const;
882 
883  _Tp x, y, width, height; //< the top-left corner, as well as width and height of the rectangle
884 };
885 
886 
893 typedef Point2i Point;
896 typedef Size2i Size;
897 typedef Rect_<int> Rect;
904 
905 
913 class CV_EXPORTS RotatedRect
914 {
915 public:
917  RotatedRect();
918  RotatedRect(const Point2f& center, const Size2f& size, float angle);
919  RotatedRect(const CvBox2D& box);
920 
922  void points(Point2f pts[]) const;
924  Rect boundingRect() const;
926  operator CvBox2D() const;
927 
928  Point2f center; //< the rectangle mass center
929  Size2f size; //< width and height of the rectangle
930  float angle; //< the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
931 };
932 
934 
941 template<typename _Tp> class Scalar_ : public Vec<_Tp, 4>
942 {
943 public:
945  Scalar_();
946  Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);
947  Scalar_(const CvScalar& s);
948  Scalar_(_Tp v0);
949 
951  static Scalar_<_Tp> all(_Tp v0);
953  operator CvScalar() const;
954 
956  template<typename T2> operator Scalar_<T2>() const;
957 
959  Scalar_<_Tp> mul(const Scalar_<_Tp>& t, double scale=1 ) const;
960 
961  // returns (v0, -v1, -v2, -v3)
962  Scalar_<_Tp> conj() const;
963 
964  // returns true iff v1 == v2 == v3 == 0
965  bool isReal() const;
966 };
967 
969 
970 CV_EXPORTS void scalarToRawData(const Scalar& s, void* buf, int type, int unroll_to=0);
971 
973 
979 class CV_EXPORTS Range
980 {
981 public:
982  Range();
983  Range(int _start, int _end);
984  Range(const CvSlice& slice);
985  int size() const;
986  bool empty() const;
987  static Range all();
988  operator CvSlice() const;
989 
990  int start, end;
991 };
992 
994 
1006 template<typename _Tp> class DataType
1007 {
1008 public:
1009  typedef _Tp value_type;
1013  enum { generic_type = 1, depth = -1, channels = 1, fmt=0,
1014  type = CV_MAKETYPE(depth, channels) };
1015 };
1016 
1017 template<> class DataType<bool>
1018 {
1019 public:
1020  typedef bool value_type;
1021  typedef int work_type;
1024  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1026  type = CV_MAKETYPE(depth, channels) };
1027 };
1028 
1029 template<> class DataType<uchar>
1030 {
1031 public:
1033  typedef int work_type;
1036  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1038  type = CV_MAKETYPE(depth, channels) };
1039 };
1040 
1041 template<> class DataType<schar>
1042 {
1043 public:
1045  typedef int work_type;
1048  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1050  type = CV_MAKETYPE(depth, channels) };
1051 };
1052 
1053 template<> class DataType<char>
1054 {
1055 public:
1057  typedef int work_type;
1060  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1062  type = CV_MAKETYPE(depth, channels) };
1063 };
1064 
1065 template<> class DataType<ushort>
1066 {
1067 public:
1069  typedef int work_type;
1072  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1074  type = CV_MAKETYPE(depth, channels) };
1075 };
1076 
1077 template<> class DataType<short>
1078 {
1079 public:
1080  typedef short value_type;
1081  typedef int work_type;
1084  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1086  type = CV_MAKETYPE(depth, channels) };
1087 };
1088 
1089 template<> class DataType<int>
1090 {
1091 public:
1092  typedef int value_type;
1096  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1098  type = CV_MAKETYPE(depth, channels) };
1099 };
1100 
1101 template<> class DataType<float>
1102 {
1103 public:
1104  typedef float value_type;
1108  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1110  type = CV_MAKETYPE(depth, channels) };
1111 };
1112 
1113 template<> class DataType<double>
1114 {
1115 public:
1116  typedef double value_type;
1120  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 1,
1122  type = CV_MAKETYPE(depth, channels) };
1123 };
1124 
1125 template<typename _Tp, int m, int n> class DataType<Matx<_Tp, m, n> >
1126 {
1127 public:
1130  typedef _Tp channel_type;
1132  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = m*n,
1133  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1134  type = CV_MAKETYPE(depth, channels) };
1135 };
1136 
1137 template<typename _Tp, int cn> class DataType<Vec<_Tp, cn> >
1138 {
1139 public:
1142  typedef _Tp channel_type;
1144  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = cn,
1145  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1146  type = CV_MAKETYPE(depth, channels) };
1147 };
1148 
1149 template<typename _Tp> class DataType<std::complex<_Tp> >
1150 {
1151 public:
1152  typedef std::complex<_Tp> value_type;
1154  typedef _Tp channel_type;
1155  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 2,
1156  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1157  type = CV_MAKETYPE(depth, channels) };
1159 };
1160 
1161 template<typename _Tp> class DataType<Complex<_Tp> >
1162 {
1163 public:
1166  typedef _Tp channel_type;
1167  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 2,
1168  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1169  type = CV_MAKETYPE(depth, channels) };
1171 };
1172 
1173 template<typename _Tp> class DataType<Point_<_Tp> >
1174 {
1175 public:
1178  typedef _Tp channel_type;
1179  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 2,
1180  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1181  type = CV_MAKETYPE(depth, channels) };
1183 };
1184 
1185 template<typename _Tp> class DataType<Point3_<_Tp> >
1186 {
1187 public:
1190  typedef _Tp channel_type;
1191  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 3,
1192  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1193  type = CV_MAKETYPE(depth, channels) };
1195 };
1196 
1197 template<typename _Tp> class DataType<Size_<_Tp> >
1198 {
1199 public:
1202  typedef _Tp channel_type;
1203  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 2,
1204  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1205  type = CV_MAKETYPE(depth, channels) };
1207 };
1208 
1209 template<typename _Tp> class DataType<Rect_<_Tp> >
1210 {
1211 public:
1214  typedef _Tp channel_type;
1215  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 4,
1216  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1217  type = CV_MAKETYPE(depth, channels) };
1219 };
1220 
1221 template<typename _Tp> class DataType<Scalar_<_Tp> >
1222 {
1223 public:
1226  typedef _Tp channel_type;
1227  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 4,
1228  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1229  type = CV_MAKETYPE(depth, channels) };
1231 };
1232 
1233 template<> class DataType<Range>
1234 {
1235 public:
1238  typedef int channel_type;
1239  enum { generic_type = 0, depth = DataDepth<channel_type>::value, channels = 2,
1240  fmt = ((channels-1)<<8) + DataDepth<channel_type>::fmt,
1241  type = CV_MAKETYPE(depth, channels) };
1243 };
1244 
1246 
1268 template<typename _Tp> class Ptr
1269 {
1270 public:
1272  Ptr();
1274  Ptr(_Tp* _obj);
1276  ~Ptr();
1278  Ptr(const Ptr& ptr);
1279  template<typename _Tp2> Ptr(const Ptr<_Tp2>& ptr);
1281  Ptr& operator = (const Ptr& ptr);
1283  void addref();
1285  void release();
1287  void delete_obj();
1289  bool empty() const;
1290 
1292  template<typename _Tp2> Ptr<_Tp2> ptr();
1293  template<typename _Tp2> const Ptr<_Tp2> ptr() const;
1294 
1296  _Tp* operator -> ();
1297  const _Tp* operator -> () const;
1298 
1299  operator _Tp* ();
1300  operator const _Tp*() const;
1301 
1302  _Tp* obj; //< the object pointer.
1303  int* refcount; //< the associated reference counter
1304 };
1305 
1306 
1308 
1312 class CV_EXPORTS _InputArray
1313 {
1314 public:
1315  enum {
1316  KIND_SHIFT = 16,
1317  FIXED_TYPE = 0x8000 << KIND_SHIFT,
1318  FIXED_SIZE = 0x4000 << KIND_SHIFT,
1319  KIND_MASK = ~(FIXED_TYPE|FIXED_SIZE) - (1 << KIND_SHIFT) + 1,
1320 
1321  NONE = 0 << KIND_SHIFT,
1322  MAT = 1 << KIND_SHIFT,
1323  MATX = 2 << KIND_SHIFT,
1324  STD_VECTOR = 3 << KIND_SHIFT,
1325  STD_VECTOR_VECTOR = 4 << KIND_SHIFT,
1326  STD_VECTOR_MAT = 5 << KIND_SHIFT,
1327  EXPR = 6 << KIND_SHIFT,
1328  OPENGL_BUFFER = 7 << KIND_SHIFT,
1329  OPENGL_TEXTURE = 8 << KIND_SHIFT,
1330  GPU_MAT = 9 << KIND_SHIFT,
1331  OCL_MAT =10 << KIND_SHIFT
1332  };
1333  _InputArray();
1334 
1335  _InputArray(const Mat& m);
1336  _InputArray(const MatExpr& expr);
1337  template<typename _Tp> _InputArray(const _Tp* vec, int n);
1338  template<typename _Tp> _InputArray(const vector<_Tp>& vec);
1339  template<typename _Tp> _InputArray(const vector<vector<_Tp> >& vec);
1340  _InputArray(const vector<Mat>& vec);
1341  template<typename _Tp> _InputArray(const vector<Mat_<_Tp> >& vec);
1342  template<typename _Tp> _InputArray(const Mat_<_Tp>& m);
1343  template<typename _Tp, int m, int n> _InputArray(const Matx<_Tp, m, n>& matx);
1344  _InputArray(const Scalar& s);
1345  _InputArray(const double& val);
1346  // < Deprecated
1347  _InputArray(const GlBuffer& buf);
1348  _InputArray(const GlTexture& tex);
1349  // >
1350  _InputArray(const gpu::GpuMat& d_mat);
1351  _InputArray(const ogl::Buffer& buf);
1352  _InputArray(const ogl::Texture2D& tex);
1353 
1354  virtual Mat getMat(int i=-1) const;
1355  virtual void getMatVector(vector<Mat>& mv) const;
1356  // < Deprecated
1357  virtual GlBuffer getGlBuffer() const;
1358  virtual GlTexture getGlTexture() const;
1359  // >
1360  virtual gpu::GpuMat getGpuMat() const;
1361  /*virtual*/ ogl::Buffer getOGlBuffer() const;
1362  /*virtual*/ ogl::Texture2D getOGlTexture2D() const;
1363 
1364  virtual int kind() const;
1365  virtual Size size(int i=-1) const;
1366  virtual size_t total(int i=-1) const;
1367  virtual int type(int i=-1) const;
1368  virtual int depth(int i=-1) const;
1369  virtual int channels(int i=-1) const;
1370  virtual bool empty() const;
1371 
1372 #ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
1373  virtual ~_InputArray();
1374 #endif
1375 
1376  int flags;
1377  void* obj;
1378  Size sz;
1379 };
1380 
1381 
1382 enum
1383 {
1384  DEPTH_MASK_8U = 1 << CV_8U,
1385  DEPTH_MASK_8S = 1 << CV_8S,
1386  DEPTH_MASK_16U = 1 << CV_16U,
1387  DEPTH_MASK_16S = 1 << CV_16S,
1388  DEPTH_MASK_32S = 1 << CV_32S,
1389  DEPTH_MASK_32F = 1 << CV_32F,
1390  DEPTH_MASK_64F = 1 << CV_64F,
1394 };
1395 
1396 
1400 class CV_EXPORTS _OutputArray : public _InputArray
1401 {
1402 public:
1403  _OutputArray();
1404 
1405  _OutputArray(Mat& m);
1406  template<typename _Tp> _OutputArray(vector<_Tp>& vec);
1407  template<typename _Tp> _OutputArray(vector<vector<_Tp> >& vec);
1408  _OutputArray(vector<Mat>& vec);
1409  template<typename _Tp> _OutputArray(vector<Mat_<_Tp> >& vec);
1410  template<typename _Tp> _OutputArray(Mat_<_Tp>& m);
1411  template<typename _Tp, int m, int n> _OutputArray(Matx<_Tp, m, n>& matx);
1412  template<typename _Tp> _OutputArray(_Tp* vec, int n);
1413  _OutputArray(gpu::GpuMat& d_mat);
1414  _OutputArray(ogl::Buffer& buf);
1415  _OutputArray(ogl::Texture2D& tex);
1416 
1417  _OutputArray(const Mat& m);
1418  template<typename _Tp> _OutputArray(const vector<_Tp>& vec);
1419  template<typename _Tp> _OutputArray(const vector<vector<_Tp> >& vec);
1420  _OutputArray(const vector<Mat>& vec);
1421  template<typename _Tp> _OutputArray(const vector<Mat_<_Tp> >& vec);
1422  template<typename _Tp> _OutputArray(const Mat_<_Tp>& m);
1423  template<typename _Tp, int m, int n> _OutputArray(const Matx<_Tp, m, n>& matx);
1424  template<typename _Tp> _OutputArray(const _Tp* vec, int n);
1425  _OutputArray(const gpu::GpuMat& d_mat);
1426  _OutputArray(const ogl::Buffer& buf);
1427  _OutputArray(const ogl::Texture2D& tex);
1428 
1429  virtual bool fixedSize() const;
1430  virtual bool fixedType() const;
1431  virtual bool needed() const;
1432  virtual Mat& getMatRef(int i=-1) const;
1433  /*virtual*/ gpu::GpuMat& getGpuMatRef() const;
1434  /*virtual*/ ogl::Buffer& getOGlBufferRef() const;
1435  /*virtual*/ ogl::Texture2D& getOGlTexture2DRef() const;
1436  virtual void create(Size sz, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
1437  virtual void create(int rows, int cols, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
1438  virtual void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
1439  virtual void release() const;
1440  virtual void clear() const;
1441 
1442 #ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
1443  virtual ~_OutputArray();
1444 #endif
1445 };
1446 
1447 typedef const _InputArray& InputArray;
1448 typedef InputArray InputArrayOfArrays;
1449 typedef const _OutputArray& OutputArray;
1450 typedef OutputArray OutputArrayOfArrays;
1451 typedef OutputArray InputOutputArray;
1452 typedef OutputArray InputOutputArrayOfArrays;
1453 
1454 CV_EXPORTS OutputArray noArray();
1455 
1457 
1458 enum { MAGIC_MASK=0xFFFF0000, TYPE_MASK=0x00000FFF, DEPTH_MASK=7 };
1459 
1460 static inline size_t getElemSize(int type) { return CV_ELEM_SIZE(type); }
1461 
1466 class CV_EXPORTS MatAllocator
1467 {
1468 public:
1470  virtual ~MatAllocator() {}
1471  virtual void allocate(int dims, const int* sizes, int type, int*& refcount,
1472  uchar*& datastart, uchar*& data, size_t* step) = 0;
1473  virtual void deallocate(int* refcount, uchar* datastart, uchar* data) = 0;
1474 };
1475 
1688 class CV_EXPORTS Mat
1689 {
1690 public:
1692  Mat();
1694  // (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)
1695  Mat(int rows, int cols, int type);
1696  Mat(Size size, int type);
1698  Mat(int rows, int cols, int type, const Scalar& s);
1699  Mat(Size size, int type, const Scalar& s);
1700 
1702  Mat(int ndims, const int* sizes, int type);
1703  Mat(int ndims, const int* sizes, int type, const Scalar& s);
1704 
1706  Mat(const Mat& m);
1708  Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP);
1709  Mat(Size size, int type, void* data, size_t step=AUTO_STEP);
1710  Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0);
1711 
1713  Mat(const Mat& m, const Range& rowRange, const Range& colRange=Range::all());
1714  Mat(const Mat& m, const Rect& roi);
1715  Mat(const Mat& m, const Range* ranges);
1717  Mat(const CvMat* m, bool copyData=false);
1719  Mat(const CvMatND* m, bool copyData=false);
1721  Mat(const IplImage* img, bool copyData=false);
1723  template<typename _Tp> explicit Mat(const vector<_Tp>& vec, bool copyData=false);
1725  template<typename _Tp, int n> explicit Mat(const Vec<_Tp, n>& vec, bool copyData=true);
1727  template<typename _Tp, int m, int n> explicit Mat(const Matx<_Tp, m, n>& mtx, bool copyData=true);
1729  template<typename _Tp> explicit Mat(const Point_<_Tp>& pt, bool copyData=true);
1731  template<typename _Tp> explicit Mat(const Point3_<_Tp>& pt, bool copyData=true);
1733  template<typename _Tp> explicit Mat(const MatCommaInitializer_<_Tp>& commaInitializer);
1734 
1736  explicit Mat(const gpu::GpuMat& m);
1737 
1739  ~Mat();
1741  Mat& operator = (const Mat& m);
1742  Mat& operator = (const MatExpr& expr);
1743 
1745  Mat row(int y) const;
1747  Mat col(int x) const;
1749  Mat rowRange(int startrow, int endrow) const;
1750  Mat rowRange(const Range& r) const;
1752  Mat colRange(int startcol, int endcol) const;
1753  Mat colRange(const Range& r) const;
1755  // (d=0 - the main diagonal,
1756  // >0 - a diagonal from the lower half,
1757  // <0 - a diagonal from the upper half)
1758  Mat diag(int d=0) const;
1760  static Mat diag(const Mat& d);
1761 
1763  Mat clone() const;
1765  // It calls m.create(this->size(), this->type()).
1766  void copyTo( OutputArray m ) const;
1768  void copyTo( OutputArray m, InputArray mask ) const;
1770  void convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const;
1771 
1772  void assignTo( Mat& m, int type=-1 ) const;
1773 
1775  Mat& operator = (const Scalar& s);
1777  Mat& setTo(InputArray value, InputArray mask=noArray());
1779  // number of channels and/or different number of rows. see cvReshape.
1780  Mat reshape(int cn, int rows=0) const;
1781  Mat reshape(int cn, int newndims, const int* newsz) const;
1782 
1784  MatExpr t() const;
1786  MatExpr inv(int method=DECOMP_LU) const;
1788  MatExpr mul(InputArray m, double scale=1) const;
1789 
1791  Mat cross(InputArray m) const;
1793  double dot(InputArray m) const;
1794 
1796  static MatExpr zeros(int rows, int cols, int type);
1797  static MatExpr zeros(Size size, int type);
1798  static MatExpr zeros(int ndims, const int* sz, int type);
1799  static MatExpr ones(int rows, int cols, int type);
1800  static MatExpr ones(Size size, int type);
1801  static MatExpr ones(int ndims, const int* sz, int type);
1802  static MatExpr eye(int rows, int cols, int type);
1803  static MatExpr eye(Size size, int type);
1804 
1806  // previous data is unreferenced if needed.
1807  void create(int rows, int cols, int type);
1808  void create(Size size, int type);
1809  void create(int ndims, const int* sizes, int type);
1810 
1812  void addref();
1814  // deallocates the data when reference counter reaches 0.
1815  void release();
1816 
1818  void deallocate();
1820  void copySize(const Mat& m);
1821 
1823  void reserve(size_t sz);
1825  void resize(size_t sz);
1827  void resize(size_t sz, const Scalar& s);
1829  void push_back_(const void* elem);
1831  template<typename _Tp> void push_back(const _Tp& elem);
1832  template<typename _Tp> void push_back(const Mat_<_Tp>& elem);
1833  void push_back(const Mat& m);
1835  void pop_back(size_t nelems=1);
1836 
1838  void locateROI( Size& wholeSize, Point& ofs ) const;
1840  Mat& adjustROI( int dtop, int dbottom, int dleft, int dright );
1842  // (this is a generalized form of row, rowRange etc.)
1843  Mat operator()( Range rowRange, Range colRange ) const;
1844  Mat operator()( const Rect& roi ) const;
1845  Mat operator()( const Range* ranges ) const;
1846 
1848  operator CvMat() const;
1850  operator CvMatND() const;
1852  operator IplImage() const;
1853 
1854  template<typename _Tp> operator vector<_Tp>() const;
1855  template<typename _Tp, int n> operator Vec<_Tp, n>() const;
1856  template<typename _Tp, int m, int n> operator Matx<_Tp, m, n>() const;
1857 
1859  // (i.e. when there are no gaps between successive rows).
1860  // similar to CV_IS_MAT_CONT(cvmat->type)
1861  bool isContinuous() const;
1862 
1864  bool isSubmatrix() const;
1865 
1867  // similar to CV_ELEM_SIZE(cvmat->type)
1868  size_t elemSize() const;
1870  size_t elemSize1() const;
1872  int type() const;
1874  int depth() const;
1876  int channels() const;
1878  size_t step1(int i=0) const;
1880  bool empty() const;
1882  size_t total() const;
1883 
1885  int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const;
1886 
1888  uchar* ptr(int i0=0);
1889  const uchar* ptr(int i0=0) const;
1890 
1892  uchar* ptr(int i0, int i1);
1893  const uchar* ptr(int i0, int i1) const;
1894 
1896  uchar* ptr(int i0, int i1, int i2);
1897  const uchar* ptr(int i0, int i1, int i2) const;
1898 
1900  uchar* ptr(const int* idx);
1902  const uchar* ptr(const int* idx) const;
1903 
1904  template<int n> uchar* ptr(const Vec<int, n>& idx);
1905  template<int n> const uchar* ptr(const Vec<int, n>& idx) const;
1906 
1908  template<typename _Tp> _Tp* ptr(int i0=0);
1909  template<typename _Tp> const _Tp* ptr(int i0=0) const;
1910 
1911  template<typename _Tp> _Tp* ptr(int i0, int i1);
1912  template<typename _Tp> const _Tp* ptr(int i0, int i1) const;
1913 
1914  template<typename _Tp> _Tp* ptr(int i0, int i1, int i2);
1915  template<typename _Tp> const _Tp* ptr(int i0, int i1, int i2) const;
1916 
1917  template<typename _Tp> _Tp* ptr(const int* idx);
1918  template<typename _Tp> const _Tp* ptr(const int* idx) const;
1919 
1920  template<typename _Tp, int n> _Tp* ptr(const Vec<int, n>& idx);
1921  template<typename _Tp, int n> const _Tp* ptr(const Vec<int, n>& idx) const;
1922 
1924  template<typename _Tp> _Tp& at(int i0=0);
1925  template<typename _Tp> const _Tp& at(int i0=0) const;
1926 
1927  template<typename _Tp> _Tp& at(int i0, int i1);
1928  template<typename _Tp> const _Tp& at(int i0, int i1) const;
1929 
1930  template<typename _Tp> _Tp& at(int i0, int i1, int i2);
1931  template<typename _Tp> const _Tp& at(int i0, int i1, int i2) const;
1932 
1933  template<typename _Tp> _Tp& at(const int* idx);
1934  template<typename _Tp> const _Tp& at(const int* idx) const;
1935 
1936  template<typename _Tp, int n> _Tp& at(const Vec<int, n>& idx);
1937  template<typename _Tp, int n> const _Tp& at(const Vec<int, n>& idx) const;
1938 
1940  template<typename _Tp> _Tp& at(Point pt);
1941  template<typename _Tp> const _Tp& at(Point pt) const;
1942 
1944  // the iterators take care of skipping gaps in the end of rows (if any)
1945  template<typename _Tp> MatIterator_<_Tp> begin();
1946  template<typename _Tp> MatIterator_<_Tp> end();
1947  template<typename _Tp> MatConstIterator_<_Tp> begin() const;
1948  template<typename _Tp> MatConstIterator_<_Tp> end() const;
1949 
1950  enum { MAGIC_VAL=0x42FF0000, AUTO_STEP=0, CONTINUOUS_FLAG=CV_MAT_CONT_FLAG, SUBMATRIX_FLAG=CV_SUBMAT_FLAG };
1951 
1958  int flags;
1960  int dims;
1962  int rows, cols;
1965 
1967  // when matrix points to user-allocated data, the pointer is NULL
1968  int* refcount;
1969 
1974 
1977 
1978  struct CV_EXPORTS MSize
1979  {
1980  MSize(int* _p);
1981  Size operator()() const;
1982  const int& operator[](int i) const;
1983  int& operator[](int i);
1984  operator const int*() const;
1985  bool operator == (const MSize& sz) const;
1986  bool operator != (const MSize& sz) const;
1987 
1988  int* p;
1989  };
1990 
1991  struct CV_EXPORTS MStep
1992  {
1993  MStep();
1994  MStep(size_t s);
1995  const size_t& operator[](int i) const;
1996  size_t& operator[](int i);
1997  operator size_t() const;
1998  MStep& operator = (size_t s);
1999 
2000  size_t* p;
2001  size_t buf[2];
2002  protected:
2003  MStep& operator = (const MStep&);
2004  };
2005 
2008 
2009 protected:
2010  void initEmpty();
2011 };
2012 
2013 
2019 class CV_EXPORTS RNG
2020 {
2021 public:
2022  enum { UNIFORM=0, NORMAL=1 };
2023 
2024  RNG();
2025  RNG(uint64 state);
2027  unsigned next();
2028 
2029  operator uchar();
2030  operator schar();
2031  operator ushort();
2032  operator short();
2033  operator unsigned();
2035  unsigned operator ()(unsigned N);
2036  unsigned operator ()();
2037  operator int();
2038  operator float();
2039  operator double();
2041  int uniform(int a, int b);
2043  float uniform(float a, float b);
2045  double uniform(double a, double b);
2046  void fill( InputOutputArray mat, int distType, InputArray a, InputArray b, bool saturateRange=false );
2048  double gaussian(double sigma);
2049 
2051 };
2052 
2058 class CV_EXPORTS RNG_MT19937
2059 {
2060 public:
2061  RNG_MT19937();
2062  RNG_MT19937(unsigned s);
2063  void seed(unsigned s);
2064 
2065  unsigned next();
2066 
2067  operator int();
2068  operator unsigned();
2069  operator float();
2070  operator double();
2071 
2072  unsigned operator ()(unsigned N);
2073  unsigned operator ()();
2074 
2076  int uniform(int a, int b);
2078  float uniform(float a, float b);
2080  double uniform(double a, double b);
2081 
2082 private:
2083  enum PeriodParameters {N = 624, M = 397};
2084  unsigned state[N];
2085  int mti;
2086 };
2087 
2091 class CV_EXPORTS TermCriteria
2092 {
2093 public:
2094  enum
2095  {
2096  COUNT=1,
2097  MAX_ITER=COUNT,
2098  EPS=2
2099  };
2100 
2102  TermCriteria();
2104  TermCriteria(int type, int maxCount, double epsilon);
2108  operator CvTermCriteria() const;
2109 
2110  int type;
2111  int maxCount; // the maximum number of iterations/elements
2112  double epsilon; // the desired accuracy
2113 };
2114 
2115 
2116 typedef void (*BinaryFunc)(const uchar* src1, size_t step1,
2117  const uchar* src2, size_t step2,
2118  uchar* dst, size_t step, Size sz,
2119  void*);
2120 
2121 CV_EXPORTS BinaryFunc getConvertFunc(int sdepth, int ddepth);
2122 CV_EXPORTS BinaryFunc getConvertScaleFunc(int sdepth, int ddepth);
2123 CV_EXPORTS BinaryFunc getCopyMaskFunc(size_t esz);
2124 
2126 CV_EXPORTS void swap(Mat& a, Mat& b);
2127 
2129 CV_EXPORTS Mat cvarrToMat(const CvArr* arr, bool copyData=false,
2130  bool allowND=true, int coiMode=0);
2132 CV_EXPORTS void extractImageCOI(const CvArr* arr, OutputArray coiimg, int coi=-1);
2134 CV_EXPORTS void insertImageCOI(InputArray coiimg, CvArr* arr, int coi=-1);
2135 
2137 CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst,
2138  InputArray mask=noArray(), int dtype=-1);
2140 CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst,
2141  InputArray mask=noArray(), int dtype=-1);
2142 
2144 CV_EXPORTS_W void multiply(InputArray src1, InputArray src2,
2145  OutputArray dst, double scale=1, int dtype=-1);
2146 
2148 CV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst,
2149  double scale=1, int dtype=-1);
2150 
2152 CV_EXPORTS_W void divide(double scale, InputArray src2,
2153  OutputArray dst, int dtype=-1);
2154 
2156 CV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst);
2157 
2159 CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2,
2160  double beta, double gamma, OutputArray dst, int dtype=-1);
2161 
2163 CV_EXPORTS_W void convertScaleAbs(InputArray src, OutputArray dst,
2164  double alpha=1, double beta=0);
2166 CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst,
2167  int interpolation=0);
2168 
2170 CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);
2172 CV_EXPORTS_W int countNonZero( InputArray src );
2174 CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );
2175 
2177 CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask=noArray());
2179 CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev,
2180  InputArray mask=noArray());
2182 CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray());
2184 CV_EXPORTS_W double norm(InputArray src1, InputArray src2,
2185  int normType=NORM_L2, InputArray mask=noArray());
2186 
2188 CV_EXPORTS_W void batchDistance(InputArray src1, InputArray src2,
2189  OutputArray dist, int dtype, OutputArray nidx,
2190  int normType=NORM_L2, int K=0,
2191  InputArray mask=noArray(), int update=0,
2192  bool crosscheck=false);
2193 
2195 CV_EXPORTS_W void normalize( InputArray src, OutputArray dst, double alpha=1, double beta=0,
2196  int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray());
2197 
2199 CV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double* minVal,
2200  CV_OUT double* maxVal=0, CV_OUT Point* minLoc=0,
2201  CV_OUT Point* maxLoc=0, InputArray mask=noArray());
2202 CV_EXPORTS void minMaxIdx(InputArray src, double* minVal, double* maxVal,
2203  int* minIdx=0, int* maxIdx=0, InputArray mask=noArray());
2204 
2206 CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype=-1);
2207 
2209 CV_EXPORTS void merge(const Mat* mv, size_t count, OutputArray dst);
2210 CV_EXPORTS void merge(const vector<Mat>& mv, OutputArray dst );
2211 
2213 CV_EXPORTS_W void merge(InputArrayOfArrays mv, OutputArray dst);
2214 
2216 CV_EXPORTS void split(const Mat& src, Mat* mvbegin);
2217 CV_EXPORTS void split(const Mat& m, vector<Mat>& mv );
2218 
2220 CV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv);
2221 
2223 CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,
2224  const int* fromTo, size_t npairs);
2225 CV_EXPORTS void mixChannels(const vector<Mat>& src, vector<Mat>& dst,
2226  const int* fromTo, size_t npairs);
2227 CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputArrayOfArrays dst,
2228  const vector<int>& fromTo);
2229 
2231 CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi);
2232 
2234 CV_EXPORTS_W void insertChannel(InputArray src, InputOutputArray dst, int coi);
2235 
2237 CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode);
2238 
2240 CV_EXPORTS_W void repeat(InputArray src, int ny, int nx, OutputArray dst);
2241 CV_EXPORTS Mat repeat(const Mat& src, int ny, int nx);
2242 
2243 CV_EXPORTS void hconcat(const Mat* src, size_t nsrc, OutputArray dst);
2244 CV_EXPORTS void hconcat(InputArray src1, InputArray src2, OutputArray dst);
2245 CV_EXPORTS_W void hconcat(InputArrayOfArrays src, OutputArray dst);
2246 
2247 CV_EXPORTS void vconcat(const Mat* src, size_t nsrc, OutputArray dst);
2248 CV_EXPORTS void vconcat(InputArray src1, InputArray src2, OutputArray dst);
2249 CV_EXPORTS_W void vconcat(InputArrayOfArrays src, OutputArray dst);
2250 
2252 CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2,
2253  OutputArray dst, InputArray mask=noArray());
2255 CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2,
2256  OutputArray dst, InputArray mask=noArray());
2258 CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2,
2259  OutputArray dst, InputArray mask=noArray());
2261 CV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst,
2262  InputArray mask=noArray());
2264 CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst);
2266 CV_EXPORTS_W void inRange(InputArray src, InputArray lowerb,
2267  InputArray upperb, OutputArray dst);
2269 CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop);
2271 CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst);
2273 CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst);
2274 
2276 CV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst);
2278 CV_EXPORTS void min(const Mat& src1, double src2, Mat& dst);
2280 CV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst);
2282 CV_EXPORTS void max(const Mat& src1, double src2, Mat& dst);
2283 
2285 CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst);
2287 CV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst);
2289 CV_EXPORTS_W void exp(InputArray src, OutputArray dst);
2291 CV_EXPORTS_W void log(InputArray src, OutputArray dst);
2293 CV_EXPORTS_W float cubeRoot(float val);
2295 CV_EXPORTS_W float fastAtan2(float y, float x);
2296 
2297 CV_EXPORTS void exp(const float* src, float* dst, int n);
2298 CV_EXPORTS void log(const float* src, float* dst, int n);
2299 CV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees);
2300 CV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n);
2301 
2303 CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle,
2304  OutputArray x, OutputArray y, bool angleInDegrees=false);
2306 CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y,
2307  OutputArray magnitude, OutputArray angle,
2308  bool angleInDegrees=false);
2310 CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle,
2311  bool angleInDegrees=false);
2313 CV_EXPORTS_W void magnitude(InputArray x, InputArray y, OutputArray magnitude);
2315 CV_EXPORTS_W bool checkRange(InputArray a, bool quiet=true, CV_OUT Point* pos=0,
2316  double minVal=-DBL_MAX, double maxVal=DBL_MAX);
2318 CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val=0);
2319 
2321 CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
2322  InputArray src3, double gamma, OutputArray dst, int flags=0);
2324 CV_EXPORTS_W void mulTransposed( InputArray src, OutputArray dst, bool aTa,
2325  InputArray delta=noArray(),
2326  double scale=1, int dtype=-1 );
2328 CV_EXPORTS_W void transpose(InputArray src, OutputArray dst);
2330 CV_EXPORTS_W void transform(InputArray src, OutputArray dst, InputArray m );
2332 CV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArray m );
2333 
2335 CV_EXPORTS_W void completeSymm(InputOutputArray mtx, bool lowerToUpper=false);
2337 CV_EXPORTS_W void setIdentity(InputOutputArray mtx, const Scalar& s=Scalar(1));
2339 CV_EXPORTS_W double determinant(InputArray mtx);
2341 CV_EXPORTS_W Scalar trace(InputArray mtx);
2343 CV_EXPORTS_W double invert(InputArray src, OutputArray dst, int flags=DECOMP_LU);
2345 CV_EXPORTS_W bool solve(InputArray src1, InputArray src2,
2346  OutputArray dst, int flags=DECOMP_LU);
2347 
2348 enum
2349 {
2354 };
2355 
2357 CV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags);
2359 CV_EXPORTS_W void sortIdx(InputArray src, OutputArray dst, int flags);
2361 CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots);
2363 CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters=300);
2365 CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues, int lowindex=-1,
2366  int highindex=-1);
2368 CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues,
2369  OutputArray eigenvectors,
2370  int lowindex=-1, int highindex=-1);
2371 CV_EXPORTS_W bool eigen(InputArray src, bool computeEigenvectors,
2372  OutputArray eigenvalues, OutputArray eigenvectors);
2373 
2374 enum
2375 {
2382 };
2383 
2385 CV_EXPORTS void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean,
2386  int flags, int ctype=CV_64F);
2388 CV_EXPORTS_W void calcCovarMatrix( InputArray samples, OutputArray covar,
2389  OutputArray mean, int flags, int ctype=CV_64F);
2390 
2445 class CV_EXPORTS PCA
2446 {
2447 public:
2449  PCA();
2451  PCA(InputArray data, InputArray mean, int flags, int maxComponents=0);
2452  PCA(InputArray data, InputArray mean, int flags, double retainedVariance);
2454  PCA& operator()(InputArray data, InputArray mean, int flags, int maxComponents=0);
2455  PCA& computeVar(InputArray data, InputArray mean, int flags, double retainedVariance);
2457  Mat project(InputArray vec) const;
2459  void project(InputArray vec, OutputArray result) const;
2461  Mat backProject(InputArray vec) const;
2463  void backProject(InputArray vec, OutputArray result) const;
2464 
2468 };
2469 
2470 CV_EXPORTS_W void PCACompute(InputArray data, CV_OUT InputOutputArray mean,
2471  OutputArray eigenvectors, int maxComponents=0);
2472 
2473 CV_EXPORTS_W void PCAComputeVar(InputArray data, CV_OUT InputOutputArray mean,
2474  OutputArray eigenvectors, double retainedVariance);
2475 
2476 CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean,
2477  InputArray eigenvectors, OutputArray result);
2478 
2479 CV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean,
2480  InputArray eigenvectors, OutputArray result);
2481 
2482 
2496 class CV_EXPORTS SVD
2497 {
2498 public:
2499  enum { MODIFY_A=1, NO_UV=2, FULL_UV=4 };
2501  SVD();
2503  SVD( InputArray src, int flags=0 );
2505  SVD& operator ()( InputArray src, int flags=0 );
2506 
2508  static void compute( InputArray src, OutputArray w,
2509  OutputArray u, OutputArray vt, int flags=0 );
2511  static void compute( InputArray src, OutputArray w, int flags=0 );
2513  static void backSubst( InputArray w, InputArray u,
2514  InputArray vt, InputArray rhs,
2515  OutputArray dst );
2516 
2517  template<typename _Tp, int m, int n, int nm> static void compute( const Matx<_Tp, m, n>& a,
2519  template<typename _Tp, int m, int n, int nm> static void compute( const Matx<_Tp, m, n>& a,
2520  Matx<_Tp, nm, 1>& w );
2521  template<typename _Tp, int m, int n, int nm, int nb> static void backSubst( const Matx<_Tp, nm, 1>& w,
2522  const Matx<_Tp, m, nm>& u, const Matx<_Tp, n, nm>& vt, const Matx<_Tp, m, nb>& rhs, Matx<_Tp, n, nb>& dst );
2523 
2525  static void solveZ( InputArray src, OutputArray dst );
2527  void backSubst( InputArray rhs, OutputArray dst ) const;
2528 
2529  Mat u, w, vt;
2530 };
2531 
2533 CV_EXPORTS_W void SVDecomp( InputArray src, CV_OUT OutputArray w,
2534  CV_OUT OutputArray u, CV_OUT OutputArray vt, int flags=0 );
2535 
2537 CV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt,
2538  InputArray rhs, CV_OUT OutputArray dst );
2539 
2541 CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar);
2543 CV_EXPORTS double Mahalonobis(InputArray v1, InputArray v2, InputArray icovar);
2544 
2546 CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0);
2548 CV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0);
2550 CV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags=0);
2552 CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags=0);
2554 CV_EXPORTS_W void mulSpectrums(InputArray a, InputArray b, OutputArray c,
2555  int flags, bool conjB=false);
2557 CV_EXPORTS_W int getOptimalDFTSize(int vecsize);
2558 
2562 enum
2563 {
2564  KMEANS_RANDOM_CENTERS=0, // Chooses random centers for k-Means initialization
2565  KMEANS_PP_CENTERS=2, // Uses k-Means++ algorithm for initialization
2566  KMEANS_USE_INITIAL_LABELS=1 // Uses the user-provided labels for K-Means initialization
2567 };
2569 CV_EXPORTS_W double kmeans( InputArray data, int K, CV_OUT InputOutputArray bestLabels,
2570  TermCriteria criteria, int attempts,
2571  int flags, OutputArray centers=noArray() );
2572 
2574 CV_EXPORTS RNG& theRNG();
2575 
2577 template<typename _Tp> static inline _Tp randu() { return (_Tp)theRNG(); }
2578 
2580 CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high);
2581 
2583 CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev);
2584 
2586 CV_EXPORTS void randShuffle(InputOutputArray dst, double iterFactor=1., RNG* rng=0);
2587 CV_EXPORTS_AS(randShuffle) void randShuffle_(InputOutputArray dst, double iterFactor=1.);
2588 
2590 CV_EXPORTS_W void line(CV_IN_OUT Mat& img, Point pt1, Point pt2, const Scalar& color,
2591  int thickness=1, int lineType=8, int shift=0);
2592 
2594 CV_EXPORTS_W void rectangle(CV_IN_OUT Mat& img, Point pt1, Point pt2,
2595  const Scalar& color, int thickness=1,
2596  int lineType=8, int shift=0);
2597 
2599 CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec,
2600  const Scalar& color, int thickness=1,
2601  int lineType=8, int shift=0);
2602 
2604 CV_EXPORTS_W void circle(CV_IN_OUT Mat& img, Point center, int radius,
2605  const Scalar& color, int thickness=1,
2606  int lineType=8, int shift=0);
2607 
2609 CV_EXPORTS_W void ellipse(CV_IN_OUT Mat& img, Point center, Size axes,
2610  double angle, double startAngle, double endAngle,
2611  const Scalar& color, int thickness=1,
2612  int lineType=8, int shift=0);
2613 
2615 CV_EXPORTS_W void ellipse(CV_IN_OUT Mat& img, const RotatedRect& box, const Scalar& color,
2616  int thickness=1, int lineType=8);
2617 
2619 CV_EXPORTS void fillConvexPoly(Mat& img, const Point* pts, int npts,
2620  const Scalar& color, int lineType=8,
2621  int shift=0);
2622 CV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points,
2623  const Scalar& color, int lineType=8,
2624  int shift=0);
2625 
2627 CV_EXPORTS void fillPoly(Mat& img, const Point** pts,
2628  const int* npts, int ncontours,
2629  const Scalar& color, int lineType=8, int shift=0,
2630  Point offset=Point() );
2631 
2632 CV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts,
2633  const Scalar& color, int lineType=8, int shift=0,
2634  Point offset=Point() );
2635 
2637 CV_EXPORTS void polylines(Mat& img, const Point** pts, const int* npts,
2638  int ncontours, bool isClosed, const Scalar& color,
2639  int thickness=1, int lineType=8, int shift=0 );
2640 
2641 CV_EXPORTS_W void polylines(InputOutputArray img, InputArrayOfArrays pts,
2642  bool isClosed, const Scalar& color,
2643  int thickness=1, int lineType=8, int shift=0 );
2644 
2646 CV_EXPORTS bool clipLine(Size imgSize, CV_IN_OUT Point& pt1, CV_IN_OUT Point& pt2);
2647 
2649 CV_EXPORTS_W bool clipLine(Rect imgRect, CV_OUT CV_IN_OUT Point& pt1, CV_OUT CV_IN_OUT Point& pt2);
2650 
2657 class CV_EXPORTS LineIterator
2658 {
2659 public:
2661  LineIterator( const Mat& img, Point pt1, Point pt2,
2662  int connectivity=8, bool leftToRight=false );
2664  uchar* operator *();
2666  LineIterator& operator ++();
2668  LineIterator operator ++(int);
2670  Point pos() const;
2671 
2673  const uchar* ptr0;
2674  int step, elemSize;
2675  int err, count;
2676  int minusDelta, plusDelta;
2677  int minusStep, plusStep;
2678 };
2679 
2681 CV_EXPORTS_W void ellipse2Poly( Point center, Size axes, int angle,
2682  int arcStart, int arcEnd, int delta,
2683  CV_OUT vector<Point>& pts );
2684 
2685 enum
2686 {
2696 };
2697 
2699 CV_EXPORTS_W void putText( Mat& img, const string& text, Point org,
2700  int fontFace, double fontScale, Scalar color,
2701  int thickness=1, int lineType=8,
2702  bool bottomLeftOrigin=false );
2703 
2705 CV_EXPORTS_W Size getTextSize(const string& text, int fontFace,
2706  double fontScale, int thickness,
2707  CV_OUT int* baseLine);
2708 
2710 
2756 template<typename _Tp> class Mat_ : public Mat
2757 {
2758 public:
2759  typedef _Tp value_type;
2763 
2765  Mat_();
2767  Mat_(int _rows, int _cols);
2769  Mat_(int _rows, int _cols, const _Tp& value);
2771  explicit Mat_(Size _size);
2773  Mat_(Size _size, const _Tp& value);
2775  Mat_(int _ndims, const int* _sizes);
2777  Mat_(int _ndims, const int* _sizes, const _Tp& value);
2779  Mat_(const Mat& m);
2781  Mat_(const Mat_& m);
2783  Mat_(int _rows, int _cols, _Tp* _data, size_t _step=AUTO_STEP);
2785  Mat_(int _ndims, const int* _sizes, _Tp* _data, const size_t* _steps=0);
2787  Mat_(const Mat_& m, const Range& rowRange, const Range& colRange=Range::all());
2789  Mat_(const Mat_& m, const Rect& roi);
2791  Mat_(const Mat_& m, const Range* ranges);
2793  explicit Mat_(const MatExpr& e);
2795  explicit Mat_(const vector<_Tp>& vec, bool copyData=false);
2796  template<int n> explicit Mat_(const Vec<typename DataType<_Tp>::channel_type, n>& vec, bool copyData=true);
2797  template<int m, int n> explicit Mat_(const Matx<typename DataType<_Tp>::channel_type, m, n>& mtx, bool copyData=true);
2798  explicit Mat_(const Point_<typename DataType<_Tp>::channel_type>& pt, bool copyData=true);
2799  explicit Mat_(const Point3_<typename DataType<_Tp>::channel_type>& pt, bool copyData=true);
2800  explicit Mat_(const MatCommaInitializer_<_Tp>& commaInitializer);
2801 
2802  Mat_& operator = (const Mat& m);
2803  Mat_& operator = (const Mat_& m);
2805  Mat_& operator = (const _Tp& s);
2807  Mat_& operator = (const MatExpr& e);
2808 
2810  iterator begin();
2811  iterator end();
2812  const_iterator begin() const;
2813  const_iterator end() const;
2814 
2816  void create(int _rows, int _cols);
2818  void create(Size _size);
2820  void create(int _ndims, const int* _sizes);
2822  Mat_ cross(const Mat_& m) const;
2824  template<typename T2> operator Mat_<T2>() const;
2826  Mat_ row(int y) const;
2827  Mat_ col(int x) const;
2828  Mat_ diag(int d=0) const;
2829  Mat_ clone() const;
2830 
2832  size_t elemSize() const;
2833  size_t elemSize1() const;
2834  int type() const;
2835  int depth() const;
2836  int channels() const;
2837  size_t step1(int i=0) const;
2839  size_t stepT(int i=0) const;
2840 
2842  static MatExpr zeros(int rows, int cols);
2843  static MatExpr zeros(Size size);
2844  static MatExpr zeros(int _ndims, const int* _sizes);
2845  static MatExpr ones(int rows, int cols);
2846  static MatExpr ones(Size size);
2847  static MatExpr ones(int _ndims, const int* _sizes);
2848  static MatExpr eye(int rows, int cols);
2849  static MatExpr eye(Size size);
2850 
2852  Mat_& adjustROI( int dtop, int dbottom, int dleft, int dright );
2853  Mat_ operator()( const Range& rowRange, const Range& colRange ) const;
2854  Mat_ operator()( const Rect& roi ) const;
2855  Mat_ operator()( const Range* ranges ) const;
2856 
2858  _Tp* operator [](int y);
2859  const _Tp* operator [](int y) const;
2860 
2862  _Tp& operator ()(const int* idx);
2864  const _Tp& operator ()(const int* idx) const;
2865 
2867  template<int n> _Tp& operator ()(const Vec<int, n>& idx);
2869  template<int n> const _Tp& operator ()(const Vec<int, n>& idx) const;
2870 
2872  _Tp& operator ()(int idx0);
2874  const _Tp& operator ()(int idx0) const;
2876  _Tp& operator ()(int idx0, int idx1);
2878  const _Tp& operator ()(int idx0, int idx1) const;
2880  _Tp& operator ()(int idx0, int idx1, int idx2);
2882  const _Tp& operator ()(int idx0, int idx1, int idx2) const;
2883 
2884  _Tp& operator ()(Point pt);
2885  const _Tp& operator ()(Point pt) const;
2886 
2888  operator vector<_Tp>() const;
2890  template<int n> operator Vec<typename DataType<_Tp>::channel_type, n>() const;
2892  template<int m, int n> operator Matx<typename DataType<_Tp>::channel_type, m, n>() const;
2893 };
2894 
2899 
2904 
2909 
2914 
2919 
2924 
2926 
2927 class CV_EXPORTS MatConstIterator
2928 {
2929 public:
2930  typedef uchar* value_type;
2931  typedef ptrdiff_t difference_type;
2932  typedef const uchar** pointer;
2933  typedef uchar* reference;
2934  typedef std::random_access_iterator_tag iterator_category;
2935 
2937  MatConstIterator();
2939  MatConstIterator(const Mat* _m);
2941  MatConstIterator(const Mat* _m, int _row, int _col=0);
2943  MatConstIterator(const Mat* _m, Point _pt);
2945  MatConstIterator(const Mat* _m, const int* _idx);
2948 
2950  MatConstIterator& operator = (const MatConstIterator& it);
2952  uchar* operator *() const;
2954  uchar* operator [](ptrdiff_t i) const;
2955 
2957  MatConstIterator& operator += (ptrdiff_t ofs);
2959  MatConstIterator& operator -= (ptrdiff_t ofs);
2961  MatConstIterator& operator --();
2963  MatConstIterator operator --(int);
2965  MatConstIterator& operator ++();
2967  MatConstIterator operator ++(int);
2969  Point pos() const;
2971  void pos(int* _idx) const;
2972  ptrdiff_t lpos() const;
2973  void seek(ptrdiff_t ofs, bool relative=false);
2974  void seek(const int* _idx, bool relative=false);
2975 
2976  const Mat* m;
2977  size_t elemSize;
2981 };
2982 
2987 template<typename _Tp>
2988 class MatConstIterator_ : public MatConstIterator
2989 {
2990 public:
2991  typedef _Tp value_type;
2992  typedef ptrdiff_t difference_type;
2993  typedef const _Tp* pointer;
2994  typedef const _Tp& reference;
2995  typedef std::random_access_iterator_tag iterator_category;
2996 
3000  MatConstIterator_(const Mat_<_Tp>* _m);
3002  MatConstIterator_(const Mat_<_Tp>* _m, int _row, int _col=0);
3004  MatConstIterator_(const Mat_<_Tp>* _m, Point _pt);
3006  MatConstIterator_(const Mat_<_Tp>* _m, const int* _idx);
3009 
3011  MatConstIterator_& operator = (const MatConstIterator_& it);
3013  _Tp operator *() const;
3015  _Tp operator [](ptrdiff_t i) const;
3016 
3018  MatConstIterator_& operator += (ptrdiff_t ofs);
3020  MatConstIterator_& operator -= (ptrdiff_t ofs);
3022  MatConstIterator_& operator --();
3024  MatConstIterator_ operator --(int);
3026  MatConstIterator_& operator ++();
3028  MatConstIterator_ operator ++(int);
3030  Point pos() const;
3031 };
3032 
3033 
3038 template<typename _Tp>
3039 class MatIterator_ : public MatConstIterator_<_Tp>
3040 {
3041 public:
3042  typedef _Tp* pointer;
3043  typedef _Tp& reference;
3044  typedef std::random_access_iterator_tag iterator_category;
3045 
3047  MatIterator_();
3049  MatIterator_(Mat_<_Tp>* _m);
3051  MatIterator_(Mat_<_Tp>* _m, int _row, int _col=0);
3053  MatIterator_(const Mat_<_Tp>* _m, Point _pt);
3055  MatIterator_(const Mat_<_Tp>* _m, const int* _idx);
3057  MatIterator_(const MatIterator_& it);
3059  MatIterator_& operator = (const MatIterator_<_Tp>& it );
3060 
3062  _Tp& operator *() const;
3064  _Tp& operator [](ptrdiff_t i) const;
3065 
3067  MatIterator_& operator += (ptrdiff_t ofs);
3069  MatIterator_& operator -= (ptrdiff_t ofs);
3071  MatIterator_& operator --();
3073  MatIterator_ operator --(int);
3075  MatIterator_& operator ++();
3077  MatIterator_ operator ++(int);
3078 };
3079 
3080 template<typename _Tp> class MatOp_Iter_;
3081 
3095 template<typename _Tp> class MatCommaInitializer_
3096 {
3097 public:
3101  template<typename T2> MatCommaInitializer_<_Tp>& operator , (T2 v);
3103  Mat_<_Tp> operator *() const;
3104  operator Mat_<_Tp>() const;
3105 protected:
3107 };
3108 
3109 
3110 template<typename _Tp, int m, int n> class MatxCommaInitializer
3111 {
3112 public:
3114  template<typename T2> MatxCommaInitializer<_Tp, m, n>& operator , (T2 val);
3115  Matx<_Tp, m, n> operator *() const;
3116 
3118  int idx;
3119 };
3120 
3121 template<typename _Tp, int m> class VecCommaInitializer : public MatxCommaInitializer<_Tp, m, 1>
3122 {
3123 public:
3125  template<typename T2> VecCommaInitializer<_Tp, m>& operator , (T2 val);
3126  Vec<_Tp, m> operator *() const;
3127 };
3128 
3156 template<typename _Tp, size_t fixed_size=4096/sizeof(_Tp)+8> class AutoBuffer
3157 {
3158 public:
3159  typedef _Tp value_type;
3160  enum { buffer_padding = (int)((16 + sizeof(_Tp) - 1)/sizeof(_Tp)) };
3161 
3163  AutoBuffer();
3165  AutoBuffer(size_t _size);
3167  ~AutoBuffer();
3168 
3170  void allocate(size_t _size);
3172  void deallocate();
3174  operator _Tp* ();
3176  operator const _Tp* () const;
3177 
3178 protected:
3180  _Tp* ptr;
3182  size_t size;
3184  _Tp buf[fixed_size+buffer_padding];
3185 };
3186 
3188 
3239 class CV_EXPORTS NAryMatIterator
3240 {
3241 public:
3243  NAryMatIterator();
3245  NAryMatIterator(const Mat** arrays, uchar** ptrs, int narrays=-1);
3247  NAryMatIterator(const Mat** arrays, Mat* planes, int narrays=-1);
3249  void init(const Mat** arrays, Mat* planes, uchar** ptrs, int narrays=-1);
3250 
3252  NAryMatIterator& operator ++();
3254  NAryMatIterator operator ++(int);
3255 
3257  const Mat** arrays;
3263  int narrays;
3265  size_t nplanes;
3267  size_t size;
3268 protected:
3270  size_t idx;
3271 };
3272 
3273 //typedef NAryMatIterator NAryMatNDIterator;
3274 
3275 typedef void (*ConvertData)(const void* from, void* to, int cn);
3276 typedef void (*ConvertScaleData)(const void* from, void* to, int cn, double alpha, double beta);
3277 
3279 CV_EXPORTS ConvertData getConvertElem(int fromType, int toType);
3281 CV_EXPORTS ConvertScaleData getConvertScaleElem(int fromType, int toType);
3282 
3283 
3285 
3286 class SparseMatIterator;
3288 template<typename _Tp> class SparseMatIterator_;
3289 template<typename _Tp> class SparseMatConstIterator_;
3290 
3376 class CV_EXPORTS SparseMat
3377 {
3378 public:
3381 
3383  struct CV_EXPORTS Hdr
3384  {
3385  Hdr(int _dims, const int* _sizes, int _type);
3386  void clear();
3388  int dims;
3390  size_t nodeSize;
3391  size_t nodeCount;
3392  size_t freeList;
3393  vector<uchar> pool;
3394  vector<size_t> hashtab;
3395  int size[CV_MAX_DIM];
3396  };
3397 
3399  struct CV_EXPORTS Node
3400  {
3402  size_t hashval;
3404  size_t next;
3406  int idx[CV_MAX_DIM];
3407  };
3408 
3410  SparseMat();
3412  SparseMat(int dims, const int* _sizes, int _type);
3414  SparseMat(const SparseMat& m);
3416 
3419  explicit SparseMat(const Mat& m);
3421  SparseMat(const CvSparseMat* m);
3423  ~SparseMat();
3424 
3426  SparseMat& operator = (const SparseMat& m);
3428  SparseMat& operator = (const Mat& m);
3429 
3431  SparseMat clone() const;
3432 
3434  void copyTo( SparseMat& m ) const;
3436  void copyTo( Mat& m ) const;
3438  void convertTo( SparseMat& m, int rtype, double alpha=1 ) const;
3440 
3445  void convertTo( Mat& m, int rtype, double alpha=1, double beta=0 ) const;
3446 
3447  // not used now
3448  void assignTo( SparseMat& m, int type=-1 ) const;
3449 
3451 
3456  void create(int dims, const int* _sizes, int _type);
3458  void clear();
3460  void addref();
3461  // decrements the header reference counter. When the counter reaches 0, the header and all the underlying data are deallocated.
3462  void release();
3463 
3465  operator CvSparseMat*() const;
3467  size_t elemSize() const;
3469  size_t elemSize1() const;
3470 
3472  int type() const;
3474  int depth() const;
3476  int channels() const;
3477 
3479  const int* size() const;
3481  int size(int i) const;
3483  int dims() const;
3485  size_t nzcount() const;
3486 
3488  size_t hash(int i0) const;
3490  size_t hash(int i0, int i1) const;
3492  size_t hash(int i0, int i1, int i2) const;
3494  size_t hash(const int* idx) const;
3495 
3497 
3510  uchar* ptr(int i0, bool createMissing, size_t* hashval=0);
3513  uchar* ptr(int i0, int i1, bool createMissing, size_t* hashval=0);
3515  uchar* ptr(int i0, int i1, int i2, bool createMissing, size_t* hashval=0);
3517  uchar* ptr(const int* idx, bool createMissing, size_t* hashval=0);
3519 
3521 
3528  template<typename _Tp> _Tp& ref(int i0, size_t* hashval=0);
3531  template<typename _Tp> _Tp& ref(int i0, int i1, size_t* hashval=0);
3533  template<typename _Tp> _Tp& ref(int i0, int i1, int i2, size_t* hashval=0);
3535  template<typename _Tp> _Tp& ref(const int* idx, size_t* hashval=0);
3537 
3539 
3550  template<typename _Tp> _Tp value(int i0, size_t* hashval=0) const;
3553  template<typename _Tp> _Tp value(int i0, int i1, size_t* hashval=0) const;
3555  template<typename _Tp> _Tp value(int i0, int i1, int i2, size_t* hashval=0) const;
3557  template<typename _Tp> _Tp value(const int* idx, size_t* hashval=0) const;
3559 
3561 
3568  template<typename _Tp> const _Tp* find(int i0, size_t* hashval=0) const;
3571  template<typename _Tp> const _Tp* find(int i0, int i1, size_t* hashval=0) const;
3573  template<typename _Tp> const _Tp* find(int i0, int i1, int i2, size_t* hashval=0) const;
3575  template<typename _Tp> const _Tp* find(const int* idx, size_t* hashval=0) const;
3576 
3578  void erase(int i0, int i1, size_t* hashval=0);
3580  void erase(int i0, int i1, int i2, size_t* hashval=0);
3582  void erase(const int* idx, size_t* hashval=0);
3583 
3585 
3591  template<typename _Tp> SparseMatIterator_<_Tp> begin();
3593  SparseMatConstIterator begin() const;
3595  template<typename _Tp> SparseMatConstIterator_<_Tp> begin() const;
3597 
3603  SparseMatConstIterator end() const;
3605  template<typename _Tp> SparseMatIterator_<_Tp> end();
3607  template<typename _Tp> SparseMatConstIterator_<_Tp> end() const;
3608 
3610  template<typename _Tp> _Tp& value(Node* n);
3612  template<typename _Tp> const _Tp& value(const Node* n) const;
3613 
3615  Node* node(size_t nidx);
3616  const Node* node(size_t nidx) const;
3617 
3618  uchar* newNode(const int* idx, size_t hashval);
3619  void removeNode(size_t hidx, size_t nidx, size_t previdx);
3620  void resizeHashTab(size_t newsize);
3621 
3622  enum { MAGIC_VAL=0x42FD0000, MAX_DIM=CV_MAX_DIM, HASH_SCALE=0x5bd1e995, HASH_BIT=0x80000000 };
3623 
3624  int flags;
3626 };
3627 
3629 CV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal,
3630  double* maxVal, int* minIdx=0, int* maxIdx=0);
3632 CV_EXPORTS double norm( const SparseMat& src, int normType );
3634 CV_EXPORTS void normalize( const SparseMat& src, SparseMat& dst, double alpha, int normType );
3635 
3648 class CV_EXPORTS SparseMatConstIterator
3649 {
3650 public:
3654  SparseMatConstIterator(const SparseMat* _m);
3657 
3659  SparseMatConstIterator& operator = (const SparseMatConstIterator& it);
3660 
3662  template<typename _Tp> const _Tp& value() const;
3664  const SparseMat::Node* node() const;
3665 
3667  SparseMatConstIterator& operator --();
3669  SparseMatConstIterator operator --(int);
3671  SparseMatConstIterator& operator ++();
3673  SparseMatConstIterator operator ++(int);
3674 
3676  void seekEnd();
3677 
3678  const SparseMat* m;
3679  size_t hashidx;
3681 };
3682 
3690 {
3691 public:
3697  SparseMatIterator(SparseMat* _m, const int* idx);
3700 
3702  SparseMatIterator& operator = (const SparseMatIterator& it);
3704  template<typename _Tp> _Tp& value() const;
3706  SparseMat::Node* node() const;
3707 
3709  SparseMatIterator& operator ++();
3711  SparseMatIterator operator ++(int);
3712 };
3713 
3727 template<typename _Tp> class SparseMat_ : public SparseMat
3728 {
3729 public:
3732 
3734  SparseMat_();
3736  SparseMat_(int dims, const int* _sizes);
3738  SparseMat_(const SparseMat& m);
3740  SparseMat_(const SparseMat_& m);
3742  SparseMat_(const Mat& m);
3744  SparseMat_(const CvSparseMat* m);
3746  SparseMat_& operator = (const SparseMat& m);
3748  SparseMat_& operator = (const SparseMat_& m);
3750  SparseMat_& operator = (const Mat& m);
3751 
3753  SparseMat_ clone() const;
3755  void create(int dims, const int* _sizes);
3757  operator CvSparseMat*() const;
3758 
3760  int type() const;
3762  int depth() const;
3764  int channels() const;
3765 
3767  _Tp& ref(int i0, size_t* hashval=0);
3769  _Tp& ref(int i0, int i1, size_t* hashval=0);
3771  _Tp& ref(int i0, int i1, int i2, size_t* hashval=0);
3773  _Tp& ref(const int* idx, size_t* hashval=0);
3774 
3776  _Tp operator()(int i0, size_t* hashval=0) const;
3778  _Tp operator()(int i0, int i1, size_t* hashval=0) const;
3780  _Tp operator()(int i0, int i1, int i2, size_t* hashval=0) const;
3782  _Tp operator()(const int* idx, size_t* hashval=0) const;
3783 
3792 };
3793 
3794 
3801 template<typename _Tp> class SparseMatConstIterator_ : public SparseMatConstIterator
3802 {
3803 public:
3804  typedef std::forward_iterator_tag iterator_category;
3805 
3813 
3815  SparseMatConstIterator_& operator = (const SparseMatConstIterator_& it);
3817  const _Tp& operator *() const;
3818 
3820  SparseMatConstIterator_& operator ++();
3822  SparseMatConstIterator_ operator ++(int);
3823 };
3824 
3831 template<typename _Tp> class SparseMatIterator_ : public SparseMatConstIterator_<_Tp>
3832 {
3833 public:
3834  typedef std::forward_iterator_tag iterator_category;
3835 
3843 
3845  SparseMatIterator_& operator = (const SparseMatIterator_& it);
3847  _Tp& operator *() const;
3848 
3850  SparseMatIterator_& operator ++();
3852  SparseMatIterator_ operator ++(int);
3853 };
3854 
3856 
3881 class CV_EXPORTS_W KDTree
3882 {
3883 public:
3887  struct Node
3888  {
3889  Node() : idx(-1), left(-1), right(-1), boundary(0.f) {}
3890  Node(int _idx, int _left, int _right, float _boundary)
3891  : idx(_idx), left(_left), right(_right), boundary(_boundary) {}
3893  int idx;
3895  int left, right;
3897  float boundary;
3898  };
3899 
3901  CV_WRAP KDTree();
3903  CV_WRAP KDTree(InputArray points, bool copyAndReorderPoints=false);
3905  CV_WRAP KDTree(InputArray points, InputArray _labels,
3906  bool copyAndReorderPoints=false);
3908  CV_WRAP void build(InputArray points, bool copyAndReorderPoints=false);
3910  CV_WRAP void build(InputArray points, InputArray labels,
3911  bool copyAndReorderPoints=false);
3913  CV_WRAP int findNearest(InputArray vec, int K, int Emax,
3914  OutputArray neighborsIdx,
3915  OutputArray neighbors=noArray(),
3916  OutputArray dist=noArray(),
3917  OutputArray labels=noArray()) const;
3919  CV_WRAP void findOrthoRange(InputArray minBounds,
3920  InputArray maxBounds,
3921  OutputArray neighborsIdx,
3922  OutputArray neighbors=noArray(),
3923  OutputArray labels=noArray()) const;
3925  CV_WRAP void getPoints(InputArray idx, OutputArray pts,
3926  OutputArray labels=noArray()) const;
3928  const float* getPoint(int ptidx, int* label=0) const;
3930  CV_WRAP int dims() const;
3931 
3932  vector<Node> nodes;
3933  CV_PROP Mat points;
3934  CV_PROP vector<int> labels;
3935  CV_PROP int maxDepth;
3936  CV_PROP_RW int normType;
3937 };
3938 
3940 
3941 class CV_EXPORTS FileNode;
3942 
4040 class CV_EXPORTS_W FileStorage
4041 {
4042 public:
4044  enum
4045  {
4046  READ=0,
4047  WRITE=1,
4048  APPEND=2,
4049  MEMORY=4,
4050  FORMAT_MASK=(7<<3),
4051  FORMAT_AUTO=0,
4052  FORMAT_XML=(1<<3),
4053  FORMAT_YAML=(2<<3)
4054  };
4055  enum
4056  {
4057  UNDEFINED=0,
4058  VALUE_EXPECTED=1,
4059  NAME_EXPECTED=2,
4060  INSIDE_MAP=4
4061  };
4063  CV_WRAP FileStorage();
4065  CV_WRAP FileStorage(const string& source, int flags, const string& encoding=string());
4069  virtual ~FileStorage();
4070 
4072  CV_WRAP virtual bool open(const string& filename, int flags, const string& encoding=string());
4074  CV_WRAP virtual bool isOpened() const;
4076  CV_WRAP virtual void release();
4078  CV_WRAP string releaseAndGetString();
4079 
4081  CV_WRAP FileNode getFirstTopLevelNode() const;
4083  CV_WRAP FileNode root(int streamidx=0) const;
4085  FileNode operator[](const string& nodename) const;
4087  CV_WRAP FileNode operator[](const char* nodename) const;
4088 
4090  CvFileStorage* operator *() { return fs; }
4092  const CvFileStorage* operator *() const { return fs; }
4094  void writeRaw( const string& fmt, const uchar* vec, size_t len );
4096  void writeObj( const string& name, const void* obj );
4097 
4099  static string getDefaultObjectName(const string& filename);
4100 
4102  string elname;
4103  vector<char> structs;
4104  int state;
4105 };
4106 
4107 class CV_EXPORTS FileNodeIterator;
4108 
4119 class CV_EXPORTS_W_SIMPLE FileNode
4120 {
4121 public:
4123  enum
4124  {
4125  NONE=0,
4126  INT=1,
4127  REAL=2,
4128  FLOAT=REAL,
4129  STR=3,
4130  STRING=STR,
4131  REF=4,
4132  SEQ=5,
4133  MAP=6,
4135  FLOW=8,
4136  USER=16,
4137  EMPTY=32,
4138  NAMED=64
4139  };
4141  CV_WRAP FileNode();
4143  FileNode(const CvFileStorage* fs, const CvFileNode* node);
4145  FileNode(const FileNode& node);
4147  FileNode operator[](const string& nodename) const;
4149  CV_WRAP FileNode operator[](const char* nodename) const;
4151  CV_WRAP FileNode operator[](int i) const;
4153  CV_WRAP int type() const;
4154 
4156  CV_WRAP bool empty() const;
4158  CV_WRAP bool isNone() const;
4160  CV_WRAP bool isSeq() const;
4162  CV_WRAP bool isMap() const;
4164  CV_WRAP bool isInt() const;
4166  CV_WRAP bool isReal() const;
4168  CV_WRAP bool isString() const;
4170  CV_WRAP bool isNamed() const;
4172  CV_WRAP string name() const;
4174  CV_WRAP size_t size() const;
4176  operator int() const;
4178  operator float() const;
4180  operator double() const;
4182  operator string() const;
4183 
4185  CvFileNode* operator *();
4187  const CvFileNode* operator* () const;
4188 
4190  FileNodeIterator begin() const;
4192  FileNodeIterator end() const;
4193 
4195  void readRaw( const string& fmt, uchar* vec, size_t len ) const;
4197  void* readObj() const;
4198 
4199  // do not use wrapper pointer classes for better efficiency
4202 };
4203 
4204 
4210 class CV_EXPORTS FileNodeIterator
4211 {
4212 public:
4214  FileNodeIterator();
4216  FileNodeIterator(const CvFileStorage* fs, const CvFileNode* node, size_t ofs=0);
4218  FileNodeIterator(const FileNodeIterator& it);
4220  FileNode operator *() const;
4222  FileNode operator ->() const;
4223 
4225  FileNodeIterator& operator ++ ();
4227  FileNodeIterator operator ++ (int);
4229  FileNodeIterator& operator -- ();
4231  FileNodeIterator operator -- (int);
4233  FileNodeIterator& operator += (int ofs);
4235  FileNodeIterator& operator -= (int ofs);
4236 
4238  FileNodeIterator& readRaw( const string& fmt, uchar* vec,
4239  size_t maxCount=(size_t)INT_MAX );
4240 
4244  size_t remaining;
4245 };
4246 
4248 
4249 template<typename _Tp> class SeqIterator;
4250 
4252 
4263 template<typename _Tp> class Seq
4264 {
4265 public:
4268 
4270  Seq();
4272  Seq(const CvSeq* seq);
4274  Seq(MemStorage& storage, int headerSize = sizeof(CvSeq));
4276  _Tp& operator [](int idx);
4278  const _Tp& operator[](int idx) const;
4280  SeqIterator<_Tp> begin() const;
4282  SeqIterator<_Tp> end() const;
4284  size_t size() const;
4286  int type() const;
4288  int depth() const;
4290  int channels() const;
4292  size_t elemSize() const;
4294  size_t index(const _Tp& elem) const;
4296  void push_back(const _Tp& elem);
4298  void push_front(const _Tp& elem);
4300  void push_back(const _Tp* elems, size_t count);
4302  void push_front(const _Tp* elems, size_t count);
4304  void insert(int idx, const _Tp& elem);
4306  void insert(int idx, const _Tp* elems, size_t count);
4308  void remove(int idx);
4310  void remove(const Range& r);
4311 
4313  _Tp& front();
4315  const _Tp& front() const;
4317  _Tp& back();
4319  const _Tp& back() const;
4321  bool empty() const;
4322 
4324  void clear();
4326  void pop_front();
4328  void pop_back();
4330  void pop_front(_Tp* elems, size_t count);
4332  void pop_back(_Tp* elems, size_t count);
4333 
4335  void copyTo(vector<_Tp>& vec, const Range& range=Range::all()) const;
4337  operator vector<_Tp>() const;
4338 
4340 };
4341 
4342 
4346 template<typename _Tp> class SeqIterator : public CvSeqReader
4347 {
4348 public:
4350  SeqIterator();
4352  SeqIterator(const Seq<_Tp>& seq, bool seekEnd=false);
4354  void seek(size_t pos);
4356  size_t tell() const;
4358  _Tp& operator *();
4360  const _Tp& operator *() const;
4362  SeqIterator& operator ++();
4364  SeqIterator operator ++(int) const;
4366  SeqIterator& operator --();
4368  SeqIterator operator --(int) const;
4369 
4371  SeqIterator& operator +=(int);
4373  SeqIterator& operator -=(int);
4374 
4375  // this is index of the current element module seq->total*2
4376  // (to distinguish between 0 and seq->total)
4377  int index;
4378 };
4379 
4380 
4381 class CV_EXPORTS Algorithm;
4382 class CV_EXPORTS AlgorithmInfo;
4383 struct CV_EXPORTS AlgorithmInfoData;
4384 
4385 template<typename _Tp> struct ParamType {};
4386 
4390 class CV_EXPORTS_W Algorithm
4391 {
4392 public:
4393  Algorithm();
4394  virtual ~Algorithm();
4395  string name() const;
4396 
4397  template<typename _Tp> typename ParamType<_Tp>::member_type get(const string& name) const;
4398  template<typename _Tp> typename ParamType<_Tp>::member_type get(const char* name) const;
4399 
4400  CV_WRAP int getInt(const string& name) const;
4401  CV_WRAP double getDouble(const string& name) const;
4402  CV_WRAP bool getBool(const string& name) const;
4403  CV_WRAP string getString(const string& name) const;
4404  CV_WRAP Mat getMat(const string& name) const;
4405  CV_WRAP vector<Mat> getMatVector(const string& name) const;
4406  CV_WRAP Ptr<Algorithm> getAlgorithm(const string& name) const;
4407 
4408  void set(const string& name, int value);
4409  void set(const string& name, double value);
4410  void set(const string& name, bool value);
4411  void set(const string& name, const string& value);
4412  void set(const string& name, const Mat& value);
4413  void set(const string& name, const vector<Mat>& value);
4414  void set(const string& name, const Ptr<Algorithm>& value);
4415  template<typename _Tp> void set(const string& name, const Ptr<_Tp>& value);
4416 
4417  CV_WRAP void setInt(const string& name, int value);
4418  CV_WRAP void setDouble(const string& name, double value);
4419  CV_WRAP void setBool(const string& name, bool value);
4420  CV_WRAP void setString(const string& name, const string& value);
4421  CV_WRAP void setMat(const string& name, const Mat& value);
4422  CV_WRAP void setMatVector(const string& name, const vector<Mat>& value);
4423  CV_WRAP void setAlgorithm(const string& name, const Ptr<Algorithm>& value);
4424  template<typename _Tp> void setAlgorithm(const string& name, const Ptr<_Tp>& value);
4425 
4426  void set(const char* name, int value);
4427  void set(const char* name, double value);
4428  void set(const char* name, bool value);
4429  void set(const char* name, const string& value);
4430  void set(const char* name, const Mat& value);
4431  void set(const char* name, const vector<Mat>& value);
4432  void set(const char* name, const Ptr<Algorithm>& value);
4433  template<typename _Tp> void set(const char* name, const Ptr<_Tp>& value);
4434 
4435  void setInt(const char* name, int value);
4436  void setDouble(const char* name, double value);
4437  void setBool(const char* name, bool value);
4438  void setString(const char* name, const string& value);
4439  void setMat(const char* name, const Mat& value);
4440  void setMatVector(const char* name, const vector<Mat>& value);
4441  void setAlgorithm(const char* name, const Ptr<Algorithm>& value);
4442  template<typename _Tp> void setAlgorithm(const char* name, const Ptr<_Tp>& value);
4443 
4444  CV_WRAP string paramHelp(const string& name) const;
4445  int paramType(const char* name) const;
4446  CV_WRAP int paramType(const string& name) const;
4447  CV_WRAP void getParams(CV_OUT vector<string>& names) const;
4448 
4449 
4450  virtual void write(FileStorage& fs) const;
4451  virtual void read(const FileNode& fn);
4452 
4453  typedef Algorithm* (*Constructor)(void);
4454  typedef int (Algorithm::*Getter)() const;
4455  typedef void (Algorithm::*Setter)(int);
4456 
4457  CV_WRAP static void getList(CV_OUT vector<string>& algorithms);
4458  CV_WRAP static Ptr<Algorithm> _create(const string& name);
4459  template<typename _Tp> static Ptr<_Tp> create(const string& name);
4460 
4461  virtual AlgorithmInfo* info() const /* TODO: make it = 0;*/ { return 0; }
4462 };
4463 
4464 
4465 class CV_EXPORTS AlgorithmInfo
4466 {
4467 public:
4468  friend class Algorithm;
4469  AlgorithmInfo(const string& name, Algorithm::Constructor create);
4470  ~AlgorithmInfo();
4471  void get(const Algorithm* algo, const char* name, int argType, void* value) const;
4472  void addParam_(Algorithm& algo, const char* name, int argType,
4473  void* value, bool readOnly,
4474  Algorithm::Getter getter, Algorithm::Setter setter,
4475  const string& help=string());
4476  string paramHelp(const char* name) const;
4477  int paramType(const char* name) const;
4478  void getParams(vector<string>& names) const;
4479 
4480  void write(const Algorithm* algo, FileStorage& fs) const;
4481  void read(Algorithm* algo, const FileNode& fn) const;
4482  string name() const;
4483 
4484  void addParam(Algorithm& algo, const char* name,
4485  int& value, bool readOnly=false,
4486  int (Algorithm::*getter)()=0,
4487  void (Algorithm::*setter)(int)=0,
4488  const string& help=string());
4489  void addParam(Algorithm& algo, const char* name,
4490  short& value, bool readOnly=false,
4491  int (Algorithm::*getter)()=0,
4492  void (Algorithm::*setter)(int)=0,
4493  const string& help=string());
4494  void addParam(Algorithm& algo, const char* name,
4495  bool& value, bool readOnly=false,
4496  int (Algorithm::*getter)()=0,
4497  void (Algorithm::*setter)(int)=0,
4498  const string& help=string());
4499  void addParam(Algorithm& algo, const char* name,
4500  double& value, bool readOnly=false,
4501  double (Algorithm::*getter)()=0,
4502  void (Algorithm::*setter)(double)=0,
4503  const string& help=string());
4504  void addParam(Algorithm& algo, const char* name,
4505  string& value, bool readOnly=false,
4506  string (Algorithm::*getter)()=0,
4507  void (Algorithm::*setter)(const string&)=0,
4508  const string& help=string());
4509  void addParam(Algorithm& algo, const char* name,
4510  Mat& value, bool readOnly=false,
4511  Mat (Algorithm::*getter)()=0,
4512  void (Algorithm::*setter)(const Mat&)=0,
4513  const string& help=string());
4514  void addParam(Algorithm& algo, const char* name,
4515  vector<Mat>& value, bool readOnly=false,
4516  vector<Mat> (Algorithm::*getter)()=0,
4517  void (Algorithm::*setter)(const vector<Mat>&)=0,
4518  const string& help=string());
4519  void addParam(Algorithm& algo, const char* name,
4520  Ptr<Algorithm>& value, bool readOnly=false,
4521  Ptr<Algorithm> (Algorithm::*getter)()=0,
4522  void (Algorithm::*setter)(const Ptr<Algorithm>&)=0,
4523  const string& help=string());
4524  void addParam(Algorithm& algo, const char* name,
4525  float& value, bool readOnly=false,
4526  float (Algorithm::*getter)()=0,
4527  void (Algorithm::*setter)(float)=0,
4528  const string& help=string());
4529  void addParam(Algorithm& algo, const char* name,
4530  unsigned int& value, bool readOnly=false,
4531  unsigned int (Algorithm::*getter)()=0,
4532  void (Algorithm::*setter)(unsigned int)=0,
4533  const string& help=string());
4534  void addParam(Algorithm& algo, const char* name,
4535  uint64& value, bool readOnly=false,
4536  uint64 (Algorithm::*getter)()=0,
4537  void (Algorithm::*setter)(uint64)=0,
4538  const string& help=string());
4539  void addParam(Algorithm& algo, const char* name,
4540  uchar& value, bool readOnly=false,
4541  uchar (Algorithm::*getter)()=0,
4542  void (Algorithm::*setter)(uchar)=0,
4543  const string& help=string());
4544  template<typename _Tp, typename _Base> void addParam(Algorithm& algo, const char* name,
4545  Ptr<_Tp>& value, bool readOnly=false,
4546  Ptr<_Tp> (Algorithm::*getter)()=0,
4547  void (Algorithm::*setter)(const Ptr<_Tp>&)=0,
4548  const string& help=string());
4549  template<typename _Tp> void addParam(Algorithm& algo, const char* name,
4550  Ptr<_Tp>& value, bool readOnly=false,
4551  Ptr<_Tp> (Algorithm::*getter)()=0,
4552  void (Algorithm::*setter)(const Ptr<_Tp>&)=0,
4553  const string& help=string());
4554 protected:
4555  AlgorithmInfoData* data;
4556  void set(Algorithm* algo, const char* name, int argType,
4557  const void* value, bool force=false) const;
4558 };
4559 
4560 
4561 struct CV_EXPORTS Param
4562 {
4563  enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9, SHORT=10, UCHAR=11 };
4564 
4565  Param();
4566  Param(int _type, bool _readonly, int _offset,
4567  Algorithm::Getter _getter=0,
4568  Algorithm::Setter _setter=0,
4569  const string& _help=string());
4570  int type;
4571  int offset;
4572  bool readonly;
4575  string help;
4576 };
4577 
4578 template<> struct ParamType<bool>
4579 {
4580  typedef bool const_param_type;
4581  typedef bool member_type;
4582 
4583  enum { type = Param::BOOLEAN };
4584 };
4585 
4586 template<> struct ParamType<int>
4587 {
4588  typedef int const_param_type;
4589  typedef int member_type;
4590 
4591  enum { type = Param::INT };
4592 };
4593 
4594 template<> struct ParamType<short>
4595 {
4596  typedef int const_param_type;
4597  typedef int member_type;
4598 
4599  enum { type = Param::SHORT };
4600 };
4601 
4602 template<> struct ParamType<double>
4603 {
4604  typedef double const_param_type;
4605  typedef double member_type;
4606 
4607  enum { type = Param::REAL };
4608 };
4609 
4610 template<> struct ParamType<string>
4611 {
4612  typedef const string& const_param_type;
4613  typedef string member_type;
4614 
4615  enum { type = Param::STRING };
4616 };
4617 
4618 template<> struct ParamType<Mat>
4619 {
4620  typedef const Mat& const_param_type;
4621  typedef Mat member_type;
4622 
4623  enum { type = Param::MAT };
4624 };
4625 
4626 template<> struct ParamType<vector<Mat> >
4627 {
4628  typedef const vector<Mat>& const_param_type;
4629  typedef vector<Mat> member_type;
4630 
4632 };
4633 
4634 template<> struct ParamType<Algorithm>
4635 {
4638 
4640 };
4641 
4642 template<> struct ParamType<float>
4643 {
4644  typedef float const_param_type;
4645  typedef float member_type;
4646 
4647  enum { type = Param::FLOAT };
4648 };
4649 
4650 template<> struct ParamType<unsigned>
4651 {
4652  typedef unsigned const_param_type;
4653  typedef unsigned member_type;
4654 
4656 };
4657 
4658 template<> struct ParamType<uint64>
4659 {
4662 
4663  enum { type = Param::UINT64 };
4664 };
4665 
4666 template<> struct ParamType<uchar>
4667 {
4670 
4671  enum { type = Param::UCHAR };
4672 };
4673 
4715 class CV_EXPORTS CommandLineParser
4716 {
4717  public:
4718 
4720  CommandLineParser(int argc, const char* const argv[], const char* key_map);
4721 
4723  template<typename _Tp>
4724  _Tp get(const std::string& name, bool space_delete=true)
4725  {
4726  if (!has(name))
4727  {
4728  return _Tp();
4729  }
4730  std::string str = getString(name);
4731  return analyzeValue<_Tp>(str, space_delete);
4732  }
4733 
4735  void printParams();
4736 
4737  protected:
4738  std::map<std::string, std::vector<std::string> > data;
4739  std::string getString(const std::string& name);
4740 
4741  bool has(const std::string& keys);
4742 
4743  template<typename _Tp>
4744  _Tp analyzeValue(const std::string& str, bool space_delete=false);
4745 
4746  template<typename _Tp>
4747  static _Tp getData(const std::string& str)
4748  {
4749  _Tp res = _Tp();
4750  std::stringstream s1(str);
4751  s1 >> res;
4752  return res;
4753  }
4754 
4755  template<typename _Tp>
4756  _Tp fromStringNumber(const std::string& str);//the default conversion function for numbers
4757 
4758  };
4759 
4760 template<> CV_EXPORTS
4761 bool CommandLineParser::get<bool>(const std::string& name, bool space_delete);
4762 
4763 template<> CV_EXPORTS
4764 std::string CommandLineParser::analyzeValue<std::string>(const std::string& str, bool space_delete);
4765 
4766 template<> CV_EXPORTS
4767 int CommandLineParser::analyzeValue<int>(const std::string& str, bool space_delete);
4768 
4769 template<> CV_EXPORTS
4770 unsigned int CommandLineParser::analyzeValue<unsigned int>(const std::string& str, bool space_delete);
4771 
4772 template<> CV_EXPORTS
4773 uint64 CommandLineParser::analyzeValue<uint64>(const std::string& str, bool space_delete);
4774 
4775 template<> CV_EXPORTS
4776 float CommandLineParser::analyzeValue<float>(const std::string& str, bool space_delete);
4777 
4778 template<> CV_EXPORTS
4779 double CommandLineParser::analyzeValue<double>(const std::string& str, bool space_delete);
4780 
4781 
4783 
4784 // a base body class
4785 class CV_EXPORTS ParallelLoopBody
4786 {
4787 public:
4788  virtual ~ParallelLoopBody();
4789  virtual void operator() (const Range& range) const = 0;
4790 };
4791 
4792 CV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.);
4793 
4795 
4796 class CV_EXPORTS Mutex
4797 {
4798 public:
4799  Mutex();
4800  ~Mutex();
4801  Mutex(const Mutex& m);
4802  Mutex& operator = (const Mutex& m);
4803 
4804  void lock();
4805  bool trylock();
4806  void unlock();
4807 
4808  struct Impl;
4809 protected:
4810  Impl* impl;
4811 };
4812 
4813 class CV_EXPORTS AutoLock
4814 {
4815 public:
4816  AutoLock(Mutex& m) : mutex(&m) { mutex->lock(); }
4817  ~AutoLock() { mutex->unlock(); }
4818 protected:
4820 private:
4821  AutoLock(const AutoLock&);
4822  AutoLock& operator = (const AutoLock&);
4823 };
4824 
4826 {
4827 private:
4828  int key_;
4829 protected:
4830  CV_EXPORTS TLSDataContainer();
4831  CV_EXPORTS ~TLSDataContainer(); // virtual is not required
4832 public:
4833  virtual void* createDataInstance() const = 0;
4834  virtual void deleteDataInstance(void* data) const = 0;
4835 
4836  CV_EXPORTS void* getData() const;
4837 };
4838 
4839 template <typename T>
4840 class TLSData : protected TLSDataContainer
4841 {
4842 public:
4843  inline TLSData() {}
4844  inline ~TLSData() {}
4845  inline T* get() const { return (T*)getData(); }
4846 private:
4847  virtual void* createDataInstance() const { return new T; }
4848  virtual void deleteDataInstance(void* data) const { delete (T*)data; }
4849 };
4850 
4851 }
4852 
4853 #endif // __cplusplus
4854 
4855 #include "opencv2/core/operations.hpp"
4856 #include "opencv2/core/mat.hpp"
4857 
4858 #endif /*__OPENCV_CORE_HPP__*/
int dims
Definition: core_c.h:218
struct CvTermCriteria CvTermCriteria
value_type work_type
Definition: core.hpp:1153
CvArr CvPoint2D32f double M
Definition: imgproc_c.h:186
CvSeqReader reader
Definition: core.hpp:4243
bool member_type
Definition: core.hpp:4581
void(* ConvertData)(const void *from, void *to, int cn)
Definition: core.hpp:3275
Point_< _Tp > value_type
Definition: core.hpp:1176
short value_type
Definition: core.hpp:1080
bool readonly
Definition: core.hpp:4572
Point3_< _Tp > value_type
Definition: core.hpp:1188
Definition: core.hpp:4385
CV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double *minVal, CV_OUT double *maxVal=0, CV_OUT Point *minLoc=0, CV_OUT Point *maxLoc=0, InputArray mask=noArray())
finds global minimum and maximum array elements and returns their values and their locations ...
GLdouble GLdouble GLdouble r
MatAllocator * allocator
custom allocator
Definition: core.hpp:1976
_Tp value_type
Definition: core.hpp:605
string func
function name. Available only when the compiler supports getting it
Definition: core.hpp:167
CV_EXPORTS void merge(const Mat *mv, size_t count, OutputArray dst)
makes multi-channel array out of several single-channel arrays
Definition: core.hpp:4563
GLenum GLint ref
short float uchar uchar uchar uchar uchar ushort int uchar ushort int float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float int int int float int int int float int CV_CUDEV_IMPLEMENT_VEC_BINARY_OP char CV_CUDEV_IMPLEMENT_VEC_BINARY_OP ushort CV_CUDEV_IMPLEMENT_VEC_BINARY_OP short CV_CUDEV_IMPLEMENT_VEC_BINARY_OP int CV_CUDEV_IMPLEMENT_VEC_BINARY_OP uint CV_CUDEV_IMPLEMENT_VEC_BINARY_OP float CV_CUDEV_IMPLEMENT_VEC_BINARY_OP double char
Definition: vec_math.hpp:426
void * obj
Definition: core.hpp:1377
Point2i Point
Definition: core.hpp:893
const CvArr CvArr CvArr const CvPoint2D32f CvPoint2D32f int CvSize int char * status
Definition: tracking.hpp:73
Matx< double, 1, 4 > Matx14d
Definition: core.hpp:553
Mat_< ushort > Mat1w
Definition: core.hpp:2905
CV_EXPORTS_W void sortIdx(InputArray src, OutputArray dst, int flags)
sorts independently each matrix row or each matrix column
string err
error description
Definition: core.hpp:166
GLsizei GLsizei GLchar * source
Definition: core.hpp:1384
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
computes norm of the selected array part
OutputArray OutputArray int sdepth
Definition: imgproc.hpp:621
Vec< channel_type, channels > vec_type
Definition: core.hpp:1242
CV_EXPORTS string fromUtf16(const WString &str)
CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst)
computes square root of each matrix element (dst = src**0.5)
int rows
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions ...
Definition: core.hpp:1962
ptrdiff_t difference_type
Definition: core.hpp:379
CvPoint2D32f pt[4]
Definition: imgproc_c.h:410
Vec< ushort, 2 > Vec2w
Definition: core.hpp:668
CV_EXPORTS void extractImageCOI(const CvArr *arr, OutputArray coiimg, int coi=-1)
extracts Channel of Interest from CvMat or IplImage and makes cv::Mat out of it.
int * p
Definition: core.hpp:1988
GLenum GLint GLint y
Definition: core_c.h:613
Definition: core.hpp:4563
string msg
the formatted error message
Definition: core.hpp:163
const _OutputArray & OutputArray
Definition: core.hpp:1449
int const_param_type
Definition: core.hpp:4596
CvFileNode * node
Definition: core_c.h:1638
Random Number Generator.
Definition: core.hpp:2019
const char * text
Definition: core_c.h:1407
Definition: core.hpp:451
std::random_access_iterator_tag iterator_category
Definition: core.hpp:2934
const int * sizes
Definition: core_c.h:212
void(* BinaryFunc)(const uchar *src1, size_t step1, const uchar *src2, size_t step2, uchar *dst, size_t step, Size sz, void *)
Definition: core.hpp:2116
Definition: types_c.h:816
CvSeq * seq
Definition: core.hpp:4339
Definition: core.hpp:133
IplImage CvRect * roi
Definition: legacy.hpp:234
Definition: types_c.h:1021
signed char schar
Definition: types_c.h:174
Termination criteria in iterative algorithms.
Definition: core.hpp:2091
value_type work_type
Definition: core.hpp:1010
value_type * pointer
Definition: core.hpp:374
value_type channel_type
Definition: core.hpp:1011
_Tp value_type
Definition: core.hpp:2991
value_type vec_type
Definition: core.hpp:1119
float angle
Definition: core.hpp:930
CvArr const CvArr * lut
Definition: core_c.h:1439
Mat_< Vec4i > Mat4i
Definition: core.hpp:2913
Vec< float, 6 > Vec6f
Definition: core.hpp:681
int CvScalar value
Definition: core_c.h:340
A short numerical vector.
Definition: core.hpp:84
const char const char ** filename
Definition: core_c.h:1750
DataType< _Tp >::channel_type channel_type
Definition: core.hpp:2760
Matx< _Tp, m, n > mat_type
Definition: core.hpp:458
size_t nplanes
the number of hyper-planes that the iterator steps through
Definition: core.hpp:3265
CV_EXPORTS_W void batchDistance(InputArray src1, InputArray src2, OutputArray dist, int dtype, OutputArray nidx, int normType=NORM_L2, int K=0, InputArray mask=noArray(), int update=0, bool crosscheck=false)
naive nearest neighbor finder
Fast Nearest Neighbor Search Class.
Definition: core.hpp:3881
Read-write Sparse Matrix Iterator.
Definition: core.hpp:3689
CV_EXPORTS void calcCovarMatrix(const Mat *samples, int nsamples, Mat &covar, Mat &mean, int flags, int ctype=CV_64F)
computes covariation matrix of a set of samples
CV_EXPORTS MatExpr operator!=(const Mat &a, const Mat &b)
Vec< double, 6 > Vec6d
Definition: core.hpp:686
int depth
Definition: core_c.h:73
Size_< double > Size2d
Definition: core.hpp:895
const void * elem
Definition: core_c.h:1075
value_type work_type
Definition: core.hpp:1165
Definition: core.hpp:4563
int idx
Definition: core.hpp:3118
CV_EXPORTS_W void findNonZero(InputArray src, OutputArray idx)
returns the list of locations of non-zero pixels
CvPoint CvPoint pt2
Definition: core_c.h:1270
CV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags)
sorts independently each matrix row or each matrix column
CV_EXPORTS void fillPoly(Mat &img, const Point **pts, const int *npts, int ncontours, const Scalar &color, int lineType=8, int shift=0, Point offset=Point())
fills an area bounded by one or more polygons
OutputArray InputOutputArrayOfArrays
Definition: core.hpp:1452
Matx< double, 2, 1 > Matx21d
Definition: core.hpp:558
int start
Definition: core.hpp:990
Size_< typename DataType< _Tp >::work_type > work_type
Definition: core.hpp:1201
Matrix read-write iterator.
Definition: core.hpp:116
Matx< double, 4, 3 > Matx43d
Definition: core.hpp:579
Matx< _Tp, m, n > * dst
Definition: core.hpp:3117
~AutoLock()
Definition: core.hpp:4817
Matx< double, 3, 4 > Matx34d
Definition: core.hpp:577
_Tp z
Definition: core.hpp:805
Definition: core.hpp:1386
Definition: core.hpp:4618
CV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags=0)
performs forward or inverse 1D or 2D Discrete Cosine Transformation
CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
computes bitwise conjunction of the two arrays (dst = src1 & src2)
CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev)
fills array with normally-distributed random numbers with the specified mean and the standard deviati...
int int void int total
Definition: core_c.h:1048
string member_type
Definition: core.hpp:4613
GLsizei const GLchar ** string
const CvMat CvMat int method CV_DEFAULT(CV_FM_RANSAC)
_Tp value_type
Definition: core.hpp:3159
AutoLock(Mutex &m)
Definition: core.hpp:4816
CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters=300)
finds real and complex roots of a polynomial
CV_EXPORTS_W void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, CV_OUT vector< Point > &pts)
converts elliptic arc to a polygonal curve
Vec< int, 6 > Vec6i
Definition: core.hpp:675
Mat eigenvectors
eigenvectors of the covariation matrix
Definition: core.hpp:2465
Mat_< Vec4b > Mat4b
Definition: core.hpp:2898
Definition: core.hpp:133
Size2i Size
Definition: core.hpp:896
int work_type
Definition: core.hpp:1069
int(CV_CDECL * ErrorCallback)(int status, const char *func_name, const char *err_msg, const char *file_name, int line, void *userdata)
Definition: core.hpp:194
~TLSData()
Definition: core.hpp:4844
Definition: core.hpp:2693
CV_EXPORTS_W void inRange(InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst)
set mask elements for those array elements which are within the element-specific bounding box (dst = ...
void(Algorithm::* Setter)(int)
Definition: core.hpp:4455
int member_type
Definition: core.hpp:4597
class CV_EXPORTS FileNodeIterator
Definition: core.hpp:4107
Definition: core.hpp:3080
CV_EXPORTS void polylines(Mat &img, const Point **pts, const int *npts, int ncontours, bool isClosed, const Scalar &color, int thickness=1, int lineType=8, int shift=0)
draws one or more polygonal curves
Vec< double, 2 > Vec2d
Definition: core.hpp:683
uchar * datalimit
Definition: core.hpp:1973
CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype=-1)
transforms 2D matrix to 1D row or column vector by taking sum, minimum, maximum or mean value over al...
Definition: core.hpp:132
Mat_< Vec2f > Mat2f
Definition: core.hpp:2916
CvSize CvPoint2D32f int count
Definition: calib3d.hpp:221
class CV_EXPORTS MatConstIterator
Definition: core.hpp:113
Definition: types_c.h:951
Algorithm::Getter getter
Definition: core.hpp:4573
Definition: types_c.h:1138
uchar * data
pointer to the data
Definition: core.hpp:1964
Definition: core.hpp:3110
CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask=noArray())
computes mean value of selected array elements
const CvSeq * seq
Definition: core_c.h:908
friend class Algorithm
Definition: core.hpp:4468
Matx< float, 1, 2 > Matx12f
Definition: core.hpp:548
Vec< channel_type, channels > vec_type
Definition: core.hpp:1218
struct CvSlice CvSlice
CV_EXPORTS_W bool useOptimized()
Returns the current optimization status.
Definition: core.hpp:4578
Allocator()
Definition: core.hpp:382
int type
Definition: core.hpp:4570
SeqIterator< _Tp > iterator
Definition: core.hpp:4266
value_type channel_type
Definition: core.hpp:1070
const int * idx
Definition: core_c.h:323
value_type vec_type
Definition: core.hpp:1095
Smart pointer for OpenGL 2D texture memory with reference counting.
Definition: opengl_interop.hpp:144
size_t next
index of the next node in the same hash table entry
Definition: core.hpp:3404
static Range all()
Definition: operations.hpp:2219
CV_EXPORTS BinaryFunc getConvertScaleFunc(int sdepth, int ddepth)
const CvArr * src1
Definition: core_c.h:436
Template Sequence Class derived from CvSeq.
Definition: core.hpp:4263
Definition: core.hpp:4563
_Tp value_type
Definition: core.hpp:780
Mat_< Vec2w > Mat2w
Definition: core.hpp:2906
InputArray InputArrayOfArrays
Definition: core.hpp:1448
CvSize size
Definition: calib3d.hpp:212
Definition: core.hpp:1389
The 2D range class.
Definition: core.hpp:979
Vec< double, 4 > Vec4d
Definition: core.hpp:685
int idx
split dimension; >=0 for nodes (dim), < 0 for leaves (index of the point)
Definition: core.hpp:3893
std::forward_iterator_tag iterator_category
Definition: core.hpp:3804
CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle, OutputArray x, OutputArray y, bool angleInDegrees=false)
converts polar coordinates to Cartesian
Allocator(Allocator< U > const &)
Definition: core.hpp:386
Definition: core.hpp:131
Definition: core.hpp:450
Mat_< Vec4w > Mat4w
Definition: core.hpp:2908
CV_EXPORTS_W bool checkHardwareSupport(int feature)
Returns SSE etc.
CV_PROP_RW int normType
type of the distance (cv::NORM_L1 or cv::NORM_L2) used for search.
Definition: core.hpp:3936
Node(int _idx, int _left, int _right, float _boundary)
Definition: core.hpp:3890
GLsizei GLsizei GLuint * obj
SparseMatConstIterator_< _Tp > const_iterator
Definition: core.hpp:3731
Vec< channel_type, channels > vec_type
Definition: core.hpp:1182
OpenGL Arrays.
Definition: opengl_interop.hpp:207
_Tp * obj
Definition: core.hpp:1302
GLuint src
Definition: core_c.h:1650
Definition: core.hpp:136
Mat_< Vec3d > Mat3d
Definition: core.hpp:2922
const Mat ** arrays
the iterated arrays
Definition: core.hpp:3257
CV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
computes element-wise weighted quotient of the two arrays (dst = scale*src1/src2) ...
SparseMatIterator_< _Tp > iterator
Definition: core.hpp:3730
const CvFileStorage * fs
Definition: core.hpp:4200
int int int flags
Definition: highgui_c.h:186
CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val=0)
converts NaN's to the given number
vector< Node > nodes
all the tree nodes
Definition: core.hpp:3932
Automatically Allocated Buffer Class.
Definition: core.hpp:3156
CV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst, InputArray mask=noArray())
inverts each bit of array (dst = ~src)
GLfloat ny
CV_EXPORTS_W void SVDecomp(InputArray src, CV_OUT OutputArray w, CV_OUT OutputArray u, CV_OUT OutputArray vt, int flags=0)
computes SVD of src
Matx< double, 6, 6 > Matx66d
Definition: core.hpp:584
vector< Mat > member_type
Definition: core.hpp:4629
Definition: core.hpp:4563
CV_EXPORTS_W int getNumberOfCPUs()
returns the number of CPUs (including hyper-threading)
Matx< float, 3, 1 > Matx31f
Definition: core.hpp:559
_Tp channel_type
Definition: core.hpp:1178
CV_EXPORTS ConvertData getConvertElem(int fromType, int toType)
returns the function for converting pixels from one data type to another
Definition: core.hpp:132
Definition: core.hpp:85
unsigned const_param_type
Definition: core.hpp:4652
_Tp * ptr
pointer to the real buffer, can point to buf if the buffer is small enough
Definition: core.hpp:3180
CV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
performs inverse 1D or 2D Discrete Fourier Transformation
Vec< channel_type, channels > vec_type
Definition: core.hpp:1170
Definition: core.hpp:380
CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
computes bitwise disjunction of the two arrays (dst = src1 | src2)
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: core_c.h:403
Definition: types_c.h:858
Point3_< float > Point3f
Definition: core.hpp:902
int d
Definition: legacy.hpp:3064
Matx< double, 2, 2 > Matx22d
Definition: core.hpp:567
_Tp & reference
Definition: core.hpp:3043
const Mat & const_param_type
Definition: core.hpp:4620
Point3_< typename DataType< _Tp >::work_type > work_type
Definition: core.hpp:1189
Complex< _Tp > value_type
Definition: core.hpp:1164
CV_EXPORTS_W bool checkRange(InputArray a, bool quiet=true, CV_OUT Point *pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX)
checks that each matrix element is within the specified range.
CvRect r
Definition: core_c.h:1282
const CvMat const CvMat const CvMat CvMat CvMat CvMat CvMat CvSize CvMat CvMat * T
Definition: calib3d.hpp:270
GLfloat angle
Definition: core_c.h:1297
Definition: core.hpp:2378
CvPoint center
Definition: core_c.h:1290
Definition: core.hpp:2351
const Ptr< Algorithm > & const_param_type
Definition: core.hpp:4636
SparseMatIterator iterator
Definition: core.hpp:3379
int int int idx2
Definition: core_c.h:316
CvPoint * points
Definition: legacy.hpp:798
Mat_< Vec2d > Mat2d
Definition: core.hpp:2921
Definition: core.hpp:4563
void deallocate(pointer p, size_type)
Definition: core.hpp:395
const_pointer address(const_reference r)
Definition: core.hpp:390
_Tp value_type
Definition: core.hpp:2759
Definition: core.hpp:132
Mat mean
mean value subtracted before the projection and added after the back projection
Definition: core.hpp:2467
size_t freeList
Definition: core.hpp:3392
struct CvSize2D32f CvSize2D32f
CV_EXPORTS_W void PCACompute(InputArray data, CV_OUT InputOutputArray mean, OutputArray eigenvectors, int maxComponents=0)
CV_EXPORTS_W double kmeans(InputArray data, int K, CV_OUT InputOutputArray bestLabels, TermCriteria criteria, int attempts, int flags, OutputArray centers=noArray())
clusters the input data using k-Means algorithm
CvRNG * rng
Definition: core_c.h:652
Hdr * hdr
Definition: core.hpp:3625
Definition: core.hpp:2379
Definition: core.hpp:4825
int state
the writer state
Definition: core.hpp:4104
Matx< float, 2, 2 > Matx22f
Definition: core.hpp:566
_Tp channel_type
Definition: core.hpp:1154
Definition: core.hpp:133
CV_EXPORTS void randShuffle(InputOutputArray dst, double iterFactor=1., RNG *rng=0)
shuffles the input array elements
GLXDrawable GLXDrawable read
CV_EXPORTS RNG & theRNG()
returns the thread-local Random number generator
Mat_< uchar > Mat1b
Definition: core.hpp:2895
value_type vec_type
Definition: core.hpp:1143
int * refcount
pointer to the reference counter;
Definition: core.hpp:1968
_Tp re
Definition: core.hpp:714
Definition: types_c.h:1155
OutputArray sum
Definition: imgproc.hpp:620
internal::ParamGenerator< T > Range(T start, T end, IncrementT step)
Definition: ts_gtest.h:15869
uchar * sliceStart
Definition: core.hpp:2979
GLuint res
struct CvRect CvRect
int member_type
Definition: core.hpp:4589
_Tp value_type
Definition: core.hpp:456
CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
solves linear system or a least-square problem
_Tp channel_type
Definition: core.hpp:1130
The template scalar class.
Definition: core.hpp:941
const _Tp * pointer
Definition: core.hpp:2993
CV_EXPORTS void setNumThreads(int nthreads)
int work_type
Definition: core.hpp:1057
Definition: core.hpp:2691
uint64 state
Definition: core.hpp:2050
CV_EXPORTS_W void resize(InputArray src, OutputArray dst, Size dsize, double fx=0, double fy=0, int interpolation=INTER_LINEAR)
resizes the image
void int step
Definition: core_c.h:403
The STL-compilant memory Allocator based on cv::fastMalloc() and cv::fastFree()
Definition: core.hpp:370
const CvArr CvArr int method
Definition: imgproc_c.h:281
uint64 const_param_type
Definition: core.hpp:4660
class CV_EXPORTS MatOp_Base
Definition: core.hpp:111
Mat eigenvalues
eigenvalues of the covariation matrix
Definition: core.hpp:2466
const uchar * ptr0
Definition: core.hpp:2673
CV_EXPORTS_W void write(FileStorage &fs, const string &name, int value)
ptrdiff_t difference_type
Definition: core.hpp:2992
Proxy datatype for passing Mat's and vector<>'s as input parameters.
Definition: core.hpp:1312
uchar * datastart
helper fields used in locateROI and adjustROI
Definition: core.hpp:1971
Rect_< _Tp > value_type
Definition: core.hpp:1212
value_type channel_type
Definition: core.hpp:1022
const char const char const char * file_name
Definition: core_c.h:1743
void clear(const ColorA &color=ColorA::black(), bool clearDepthBuffer=true)
CV_EXPORTS string format(const char *fmt,...)
Definition: core.hpp:2380
Definition: types_c.h:1202
ptrdiff_t difference_type
Definition: core.hpp:2931
Matx< _Tp, m, n > value_type
Definition: core.hpp:1128
int void int void IplImage float * coeffs
Definition: legacy.hpp:93
Mat MatND
Definition: core.hpp:90
Vec< short, 3 > Vec3s
Definition: core.hpp:665
GLfloat GLfloat v1
CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst, int interpolation=0)
transforms array of numbers using a lookup table: dst(i)=lut(src(i))
Size_< float > Size2f
Definition: core.hpp:900
Vec< uchar, 4 > Vec4b
Definition: core.hpp:662
The 2D size class.
Definition: core.hpp:81
_Tp channel_type
Definition: core.hpp:1142
const char const char * str
Definition: core_c.h:1552
_Tp channel_type
Definition: core.hpp:1166
const CvArr const CvArr CvArr * result
Definition: core_c.h:805
Ptr< CvFileStorage > fs
the underlying C FileStorage structure
Definition: core.hpp:4101
typedef void(CV_CDECL *CvMouseCallback)(int event
const vector< Mat > & const_param_type
Definition: core.hpp:4628
OpenGL Arrays.
Definition: opengl_interop_deprecated.hpp:166
Matx< float, 4, 1 > Matx41f
Definition: core.hpp:561
ushort value_type
Definition: core.hpp:1068
struct CvPoint CvPoint
Definition: mat.hpp:1213
CV_EXPORTS void set(Mat &dst, const Scalar &gamma, const Mat &mask=Mat())
TLSData()
Definition: core.hpp:4843
CV_EXPORTS void parallel_for_(const Range &range, const ParallelLoopBody &body, double nstripes=-1.)
Matx< float, 2, 1 > Matx21f
Definition: core.hpp:557
int err
Definition: core.hpp:2675
Definition: core.hpp:4563
Definition: core.hpp:132
virtual ~MatAllocator()
Definition: core.hpp:1470
CvPoint2D32f double CvTermCriteria criteria
Definition: calib3d.hpp:65
Matx< float, 3, 4 > Matx34f
Definition: core.hpp:576
CV_EXPORTS void * fastMalloc(size_t bufSize)
Allocates memory buffer.
std::random_access_iterator_tag iterator_category
Definition: core.hpp:2995
Vec< ushort, 4 > Vec4w
Definition: core.hpp:670
AlgorithmInfoData * data
Definition: core.hpp:4555
size_type max_size() const
Definition: core.hpp:397
CV_EXPORTS_W double getTickFrequency()
Returns the number of ticks per seconds.
const char * name
Definition: core_c.h:1538
const value_type & const_reference
Definition: core.hpp:377
size_t elemSize
Definition: core.hpp:2977
uchar * ptr
Definition: core.hpp:2978
int int idx1
Definition: core_c.h:315
CV_EXPORTS_W void setIdentity(InputOutputArray mtx, const Scalar &s=Scalar(1))
initializes scaled identity matrix
GLint GLvoid * img
Definition: legacy.hpp:1150
CV_EXPORTS BinaryFunc getCopyMaskFunc(size_t esz)
CV_EXPORTS_W int countNonZero(InputArray src)
computes the number of nonzero array elements
CvMemStoragePos * pos
Definition: core_c.h:933
value_type vec_type
Definition: core.hpp:1107
struct CvMatND CvMatND
CV_EXPORTS_W int64 getCPUTickCount()
Returns the number of CPU ticks.
GLenum GLenum GLvoid * row
void destroy(pointer p)
Definition: core.hpp:401
Smart pointer for OpenGL buffer memory with reference counting.
Definition: opengl_interop_deprecated.hpp:53
uchar * reference
Definition: core.hpp:2933
std::basic_string< wchar_t > WString
Definition: core.hpp:118
value_type channel_type
Definition: core.hpp:1106
struct CvMat CvMat
Ptr< CvMemStorage > MemStorage
Definition: core.hpp:4249
CV_EXPORTS ConvertScaleData getConvertScaleElem(int fromType, int toType)
returns the function for converting pixels from one data type to another with the optional scaling ...
Mat_< Vec3w > Mat3w
Definition: core.hpp:2907
Matx< float, 4, 3 > Matx43f
Definition: core.hpp:578
STL-style Sequence Iterator inherited from the CvSeqReader structure.
Definition: core.hpp:4249
OpenGL camera.
Definition: opengl_interop_deprecated.hpp:274
GLuint GLfloat * val
uchar * sliceEnd
Definition: core.hpp:2980
Definition: core.hpp:2564
int refcount
Definition: core.hpp:3387
const CvArr const CvArr const CvArr * src3
Definition: core_c.h:436
int width
Definition: highgui_c.h:130
const _InputArray & InputArray
Definition: core.hpp:1447
CV_EXPORTS_W void insertChannel(InputArray src, InputOutputArray dst, int coi)
inserts a single channel to dst (coi is 0-based index)
uchar ** ptrs
data pointers
Definition: core.hpp:3261
SeqIterator< _Tp > const_iterator
Definition: core.hpp:4267
CV_EXPORTS ErrorCallback redirectError(ErrorCallback errCallback, void *userdata=0, void **prevUserdata=0)
Sets the new error handler and the optional user data.
CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
const CvFileNode * container
Definition: core.hpp:4242
uchar * getData(IplImage *image)
Definition: legacy.hpp:2096
Vec< double, 3 > Vec3d
Definition: core.hpp:684
CV_EXPORTS void minMaxIdx(InputArray src, double *minVal, double *maxVal, int *minIdx=0, int *maxIdx=0, InputArray mask=noArray())
Definition: core.hpp:2377
CV_EXPORTS BinaryFunc getConvertFunc(int sdepth, int ddepth)
CV_EXPORTS_W void putText(Mat &img, const string &text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false)
renders text string in the image
Size_< int > Size2i
Definition: core.hpp:894
std::complex< _Tp > value_type
Definition: core.hpp:1152
template 3D point class.
Definition: core.hpp:777
Size sz
Definition: core.hpp:1378
Point_< typename DataType< _Tp >::work_type > work_type
Definition: core.hpp:1177
CV_EXPORTS double Mahalonobis(InputArray v1, InputArray v2, InputArray icovar)
a synonym for Mahalanobis
int dims
Definition: core.hpp:3388
CvArr const CvMat * mat
Definition: core_c.h:700
CV_EXPORTS void split(const Mat &src, Mat *mvbegin)
copies each plane of a multi-channel array to a dedicated array
Vec< _Tp, cn > value_type
Definition: core.hpp:1140
value_type work_type
Definition: core.hpp:1093
_Tp y
Definition: core.hpp:883
Definition: core.hpp:132
MatConstIterator_< _Tp > const_iterator
Definition: core.hpp:2762
Point3_< int > Point3i
Definition: core.hpp:901
A complex number class.
Definition: core.hpp:698
CV_EXPORTS_W void exp(InputArray src, OutputArray dst)
computes exponent of each matrix element (dst = e**src)
~Allocator()
Definition: core.hpp:383
CV_EXPORTS MatExpr operator==(const Mat &a, const Mat &b)
Vec< short, 4 > Vec4s
Definition: core.hpp:666
std::string String
Definition: core.hpp:85
GLclampf GLclampf GLclampf alpha
Definition: core_c.h:687
int flags
includes several bit-fields:
Definition: core.hpp:1958
uchar * ptr
Definition: core.hpp:2672
const CvPoint * pts
Definition: core_c.h:1315
GLuint GLenum GLenum transform
Mat_< Vec3f > Mat3f
Definition: core.hpp:2917
Ptr< Algorithm > member_type
Definition: core.hpp:4637
Definition: core.hpp:136
Definition: core.hpp:131
Definition: core.hpp:134
int value_type
Definition: core.hpp:1092
Definition: core.hpp:135
struct _IplImage IplImage
Vec< int, 2 > Vec2i
Definition: core.hpp:672
int coi
Definition: core_c.h:94
CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst)
computes per-element minimum of two arrays (dst = min(src1, src2))
CV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
Smart pointer for OpenGL 2d texture memory with reference counting.
Definition: opengl_interop_deprecated.hpp:119
int index
Definition: core_c.h:309
CvSize int int int CvPoint int delta
Definition: core_c.h:1427
Vec< channel_type, channels > vec_type
Definition: core.hpp:1158
OutputArray dst
Definition: imgproc.hpp:823
Impl * impl
Definition: core.hpp:4808
_Tp value_type
Definition: core.hpp:854
sparse matrix node - element of a hash table
Definition: core.hpp:3399
CV_EXPORTS int getNumThreads()
Definition: core.hpp:4602
Definition: core.hpp:4563
int offset
Definition: core.hpp:4571
uchar * value_type
Definition: core.hpp:2930
value_type channel_type
Definition: core.hpp:1118
Definition: core.hpp:1458
size_t size_t CvMemStorage * storage
Definition: core_c.h:946
unsigned member_type
Definition: core.hpp:4653
Sparse matrix class.
Definition: core.hpp:3376
Definition: core.hpp:4840
MatAllocator()
Definition: core.hpp:1469
GLfloat GLfloat GLfloat v2
Definition: core.hpp:1991
CvPoint CvSize axes
Definition: core_c.h:1297
Smart pointer for OpenGL buffer memory with reference counting.
Definition: opengl_interop.hpp:56
_Tp channel_type
Definition: core.hpp:1190
Smart pointer for GPU memory with reference counting. Its interface is mostly similar with cv::Mat...
Definition: gpumat.hpp:154
GLenum GLint x
Definition: core_c.h:632
CV_EXPORTS_W int64 getTickCount()
Returns the number of ticks.
std::random_access_iterator_tag iterator_category
Definition: core.hpp:3044
Matx< double, 6, 1 > Matx61d
Definition: core.hpp:564
schar value_type
Definition: core.hpp:1044
GLsizei range
A short numerical vector.
Definition: core.hpp:446
Definition: core.hpp:131
GLintptr offset
void CvArr
Definition: types_c.h:196
GLuint GLuint GLsizei count
Definition: core_c.h:973
Custom array allocator.
Definition: core.hpp:1466
Definition: core.hpp:2694
void mul(const float *array, float scalar, float *result, size_t length)
Comma-separated Matrix Initializer.
Definition: core.hpp:118
_Tp channel_type
Definition: core.hpp:1226
GLenum GLsizei n
CV_EXPORTS_W void repeat(InputArray src, int ny, int nx, OutputArray dst)
replicates the input matrix the specified number of times in the horizontal and/or vertical direction...
Matx< double, 1, 2 > Matx12d
Definition: core.hpp:549
CV_EXPORTS_W void setUseOptimized(bool onoff)
Turns on/off available optimization.
const char * func_name
Definition: core_c.h:1743
struct CvFileStorage CvFileStorage
Definition: types_c.h:1740
int narrays
the number of arrays
Definition: core.hpp:3263
CvSlice slice
Definition: core_c.h:1053
GLuint GLsizei bufSize
value_type channel_type
Definition: core.hpp:1094
Definition: core.hpp:447
Definition: core.hpp:1391
Definition: core.hpp:2381
vector< size_t > hashtab
Definition: core.hpp:3394
const Mat * m
Definition: core.hpp:2976
GLdouble left
Matx< double, 4, 1 > Matx41d
Definition: core.hpp:562
int plusDelta
Definition: core.hpp:2676
Definition: types_c.h:1828
_Tp channel_type
Definition: core.hpp:1202
Informative template class for OpenCV "scalars".
Definition: core.hpp:1006
Mat_< Vec3i > Mat3i
Definition: core.hpp:2912
Vec< ushort, 3 > Vec3w
Definition: core.hpp:669
std::forward_iterator_tag iterator_category
Definition: core.hpp:3834
_Tp value_type
Definition: core.hpp:373
CV_EXPORTS void fillConvexPoly(Mat &img, const Point *pts, int npts, const Scalar &color, int lineType=8, int shift=0)
draws a filled convex polygon in the image
GLfloat GLfloat GLfloat GLfloat nx
Mat_< int > Mat1i
Definition: core.hpp:2910
Matx< double, 1, 3 > Matx13d
Definition: core.hpp:551
uchar * ptr
Definition: core.hpp:3680
int CvSeq float CvSize2D32f int flag
Definition: legacy.hpp:237
float const_param_type
Definition: core.hpp:4644
uint64 member_type
Definition: core.hpp:4661
int right
Definition: core.hpp:3895
Mat_< Vec3b > Mat3b
Definition: core.hpp:2897
schar value_type
Definition: core.hpp:1056
CV_EXPORTS WString toUtf16(const string &str)
Definition: core.hpp:2689
Definition: core.hpp:135
const _Tp & reference
Definition: core.hpp:2994
#define MAP(b, scale, offset)
float member_type
Definition: core.hpp:4645
Principal Component Analysis.
Definition: core.hpp:2445
value_type vec_type
Definition: core.hpp:1083
size_t size
the size of each segment (in elements)
Definition: core.hpp:3267
const char CvPoint org
Definition: core_c.h:1407
Definition: core.hpp:2688
CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues, int lowindex=-1, int highindex=-1)
finds eigenvalues of a symmetric matrix
CvMat * roots
Definition: core_c.h:665
OutputArray OutputArrayOfArrays
Definition: core.hpp:1450
const SparseMat * m
Definition: core.hpp:3678
Definition: core.hpp:2690
int(Algorithm::* Getter)() const
Definition: core.hpp:4454
Template Read-Only Sparse Matrix Iterator Class.
Definition: core.hpp:3289
Matx< double, 3, 3 > Matx33d
Definition: core.hpp:574
CV_EXPORTS void insertImageCOI(InputArray coiimg, CvArr *arr, int coi=-1)
inserts single-channel cv::Mat into a multi-channel CvMat or IplImage
Definition: core.hpp:135
Definition: core.hpp:2376
Definition: types_c.h:645
Vec< float, 4 > Vec4f
Definition: core.hpp:680
const GLdouble * v
CV_EXPORTS void error(const Exception &exc)
Signals an error and raises the exception.
Definition: core.hpp:4610
GLsizei GLboolean transpose
XML/YAML File Storage Class.
Definition: core.hpp:4040
Vec< uchar, 2 > Vec2b
Definition: core.hpp:660
double member_type
Definition: core.hpp:4605
double const CvArr double beta
Definition: core_c.h:523
GLdouble GLdouble right
Definition: core.hpp:2687
Definition: core.hpp:1388
int idx0
Definition: core_c.h:314
double iterFactor
Definition: core.hpp:2587
CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar)
computes Mahalanobis distance between two vectors: sqrt((v1-v2)'icovar(v1-v2)), where icovar is the i...
Definition: core.hpp:132
Matx< double, 4, 4 > Matx44d
Definition: core.hpp:582
GLboolean GLboolean GLboolean b
Definition: legacy.hpp:633
CV_EXPORTS_W void ellipse(CV_IN_OUT Mat &img, Point center, Size axes, double angle, double startAngle, double endAngle, const Scalar &color, int thickness=1, int lineType=8, int shift=0)
draws an elliptic arc, ellipse sector or a rotated ellipse in the image
Range value_type
Definition: core.hpp:1236
The n-dimensional matrix class.
Definition: core.hpp:1688
void fill(float value, float *array, size_t length)
CV_PROP int maxDepth
maximum depth of the search tree.
Definition: core.hpp:3935
Singular Value Decomposition class.
Definition: core.hpp:2496
int rows
Definition: core_c.h:114
bool value_type
Definition: core.hpp:1020
struct CvPoint2D32f CvPoint2D32f
Matx< double, 2, 3 > Matx23d
Definition: core.hpp:569
Allocator(Allocator const &)
Definition: core.hpp:384
Matx< typename DataType< _Tp >::work_type, m, n > work_type
Definition: core.hpp:1129
int iterdepth
Definition: core.hpp:3269
Definition: types_c.h:465
CV_EXPORTS_W Scalar trace(InputArray mtx)
computes trace of a matrix
Definition: core.hpp:132
Template matrix class derived from Mat.
Definition: core.hpp:115
pointer allocate(size_type count, const void *=0)
Definition: core.hpp:392
Definition: types_c.h:997
OutputArray InputOutputArray
Definition: core.hpp:1451
Definition: core.hpp:2927
CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
subtracts one matrix from another (dst = src1 - src2)
CV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArray m)
performs perspective transformation of each element of multi-channel input matrix ...
CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double gamma, OutputArray dst, int flags=0)
implements generalized matrix product algorithm GEMM from BLAS
int int y
Definition: highgui_c.h:186
struct CvScalar CvScalar
Definition: core.hpp:3121
Vec< uchar, 3 > Vec3b
Definition: core.hpp:661
Node()
Definition: core.hpp:3889
CV_EXPORTS_W const string & getBuildInformation()
GLsizei const GLfloat * value
Definition: core_c.h:341
Definition: core.hpp:1458
Point_< int > Point2i
Definition: core.hpp:892
Definition: core.hpp:135
size_t size_type
Definition: core.hpp:378
void begin(GLenum mode)
OutputArray OutputArray labels
Definition: imgproc.hpp:823
int plusStep
Definition: core.hpp:2677
int maxCount
Definition: core.hpp:2111
CV_EXPORTS bool clipLine(Size imgSize, CV_IN_OUT Point &pt1, CV_IN_OUT Point &pt2)
clips the line segment by the rectangle Rect(0, 0, imgSize.width, imgSize.height) ...
Mat_< Vec2b > Mat2b
Definition: core.hpp:2896
Definition: core.hpp:2566
CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
computes bitwise exclusive-or of the two arrays (dst = src1 ^ src2)
Algorithm::Setter setter
Definition: core.hpp:4574
int cols
Definition: core_c.h:109
Definition: core.hpp:4563
value_type work_type
Definition: core.hpp:1237
Matx< double, 1, 6 > Matx16d
Definition: core.hpp:555
CV_EXPORTS_W void rectangle(CV_IN_OUT Mat &img, Point pt1, Point pt2, const Scalar &color, int thickness=1, int lineType=8, int shift=0)
draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image ...
The Template Sparse Matrix class derived from cv::SparseMat.
Definition: core.hpp:3727
Mat_< Vec2i > Mat2i
Definition: core.hpp:2911
Definition: core.hpp:4586
GLfloat GLfloat p
GLuint GLuint GLsizei GLenum type
Definition: core_c.h:114
Definition: core.hpp:2565
Definition: core.hpp:134
CV_EXPORTS_W int getOptimalDFTSize(int vecsize)
computes the minimal vector size vecsize1 >= vecsize so that the dft() of the vector of length vecsiz...
Matx< _Tp,(m< n?m:n), 1 > diag_type
Definition: core.hpp:457
__int64 int64
Definition: types_c.h:158
GLsizei samples
Vec< channel_type, channels > vec_type
Definition: core.hpp:1206
Vec< channel_type, channels > vec_type
Definition: core.hpp:1230
const GLubyte * c
Definition: legacy.hpp:633
double epsilon
Definition: core.hpp:2112
CvPoint pt1
Definition: core_c.h:1270
value_type channel_type
Definition: core.hpp:1034
int int type
Definition: core_c.h:109
int work_type
Definition: core.hpp:1081
int maxIters
Definition: legacy.hpp:3114
CV_EXPORTS_W void mulTransposed(InputArray src, OutputArray dst, bool aTa, InputArray delta=noArray(), double scale=1, int dtype=-1)
multiplies matrix by its transposition from the left or from the right
float ** ranges
Definition: imgproc_c.h:435
size_t remaining
Definition: core.hpp:4244
GLuint const GLchar * name
Definition: core_c.h:1546
Definition: core.hpp:4813
size_t hashidx
Definition: core.hpp:3679
CV_EXPORTS void magnitude(const float *x, const float *y, float *dst, int n)
int int channels
Definition: core_c.h:73
Definition: types_c.h:1173
CV_EXPORTS void scalarToRawData(const Scalar &s, void *buf, int type, int unroll_to=0)
CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode)
reverses the order of the rows, columns or both in a matrix
unsigned short ushort
Definition: types_c.h:171
const string & const_param_type
Definition: core.hpp:4612
int work_type
Definition: core.hpp:1033
void construct(pointer p, const _Tp &v)
Definition: core.hpp:400
vector< char > structs
the stack of written structures
Definition: core.hpp:4103
Scalar_< typename DataType< _Tp >::work_type > work_type
Definition: core.hpp:1225
The rotated 2D rectangle.
Definition: core.hpp:913
CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src)
computes sum of array elements
template 2D point class.
Definition: core.hpp:82
value_type vec_type
Definition: core.hpp:1071
int work_type
Definition: core.hpp:1045
CV_EXPORTS_W void log(InputArray src, OutputArray dst)
computes natural logarithm of absolute value of each matrix element: dst = log(abs(src)) ...
string help
Definition: core.hpp:4575
CvPoint2D32f CvPoint2D32f CvPoint2D32f CvPoint2D32f * cross
Definition: legacy.hpp:577
Size_< _Tp > value_type
Definition: core.hpp:1200
CV_EXPORTS_W void SVBackSubst(InputArray w, InputArray u, InputArray vt, InputArray rhs, CV_OUT OutputArray dst)
performs back substitution for the previously computed SVD
CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst)
computes element-wise absolute difference of two arrays (dst = abs(src1 - src2))
_Tp width
Definition: core.hpp:840
Mat_< float > Mat1f
Definition: core.hpp:2915
Mat_< Vec4d > Mat4d
Definition: core.hpp:2923
CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots)
finds real roots of a cubic polynomial
Read-Only Sparse Matrix Iterator.
Definition: core.hpp:3648
CV_EXPORTS_W void completeSymm(InputOutputArray mtx, bool lowerToUpper=false)
extends the symmetrical matrix from the lower half or from the upper half
Complex< float > Complexf
Definition: core.hpp:721
CV_EXPORTS bool setBreakOnError(bool flag)
Sets/resets the break-on-error mode.
Definition: types_c.h:1223
const char * ptr
Definition: core_c.h:942
CV_EXPORTS cv::Mat getMat(cv::InputArray arr)
struct CvSize CvSize
int work_type
Definition: core.hpp:1021
GLboolean GLboolean GLboolean GLboolean a
Definition: legacy.hpp:633
"\nThe CommandLineParser class is designed for command line arguments parsing\n" "Keys map: \n" "Befo...
Definition: core.hpp:4715
virtual AlgorithmInfo * info() const
Definition: core.hpp:4461
Definition: core.hpp:131
CV_EXPORTS void fastFree(void *ptr)
Frees the memory allocated with cv::fastMalloc.
Rect_< typename DataType< _Tp >::work_type > work_type
Definition: core.hpp:1213
char int argc
Definition: highgui_c.h:81
double value_type
Definition: core.hpp:1116
Definition: core.hpp:2353
Definition: core.hpp:1392
value_type vec_type
Definition: core.hpp:1047
CV_EXPORTS_W void PCAComputeVar(InputArray data, CV_OUT InputOutputArray mean, OutputArray eigenvectors, double retainedVariance)
CV_EXPORTS_W void circle(CV_IN_OUT Mat &img, Point center, int radius, const Scalar &color, int thickness=1, int lineType=8, int shift=0)
draws the circle outline or a solid circle in the image
size_t size
size of the real buffer
Definition: core.hpp:3182
class CV_EXPORTS Algorithm
Definition: core.hpp:4381
Size2f size
Definition: core.hpp:929
char * argv[]
Definition: highgui_c.h:81
Definition: core.hpp:2350
Complex< double > Complexd
Definition: core.hpp:722
CV_EXPORTS_W void convertScaleAbs(InputArray src, OutputArray dst, double alpha=1, double beta=0)
scales array elements, computes absolute values and converts the results to 8-bit unsigned integers: ...
Definition: core.hpp:1393
_Tp value_type
Definition: core.hpp:737
int channel_type
Definition: core.hpp:1238
Mat * planes
the current planes
Definition: core.hpp:3259
Definition: core.hpp:1387
Vec< float, 2 > Vec2f
Definition: core.hpp:678
The 2D up-right rectangle class.
Definition: core.hpp:83
Definition: core.hpp:4563
int n
Definition: legacy.hpp:3070
const CvPoint int npts
Definition: core_c.h:1315
uchar member_type
Definition: core.hpp:4669
CvArr * arr
Definition: core_c.h:649
CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
performs forward or inverse 1D or 2D Discrete Fourier Transformation
_Tp y
Definition: core.hpp:766
CV_EXPORTS void glob(String pattern, std::vector< String > &result, bool recursive=false)
unsigned char uchar
Definition: types_c.h:170
string elname
the currently written element
Definition: core.hpp:4102
GLfloat v0
Definition: types_c.h:1333
Definition: core.hpp:135
Mat_< Vec2s > Mat2s
Definition: core.hpp:2901
double const CvArr double double gamma
Definition: core_c.h:523
Vec< int, 8 > Vec8i
Definition: core.hpp:676
CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags=0)
performs inverse 1D or 2D Discrete Cosine Transformation
Point3_< double > Point3d
Definition: core.hpp:903
CV_EXPORTS string tempfile(const char *suffix CV_DEFAULT(0))
Cv_iplAllocateImageData Cv_iplDeallocate deallocate
Definition: core_c.h:1512
_Tp value_type
Definition: core.hpp:1009
Definition: core.hpp:133
int int height
Definition: highgui_c.h:130
const CvFileNode * node
Definition: core.hpp:4201
class CV_EXPORTS AlgorithmInfo
Definition: core.hpp:4382
Matx< float, 1, 6 > Matx16f
Definition: core.hpp:554
static _Tp getData(const std::string &str)
Definition: core.hpp:4747
int flags
Definition: core.hpp:3624
The standard OpenCV exception class.
Definition: core.hpp:143
Mat w
Definition: core.hpp:2529
Matx< float, 1, 4 > Matx14f
Definition: core.hpp:552
::max::max::max float
Definition: functional.hpp:326
value_type work_type
Definition: core.hpp:1105
Vec< int, 4 > Vec4i
Definition: core.hpp:674
struct CvBox2D CvBox2D
Matx< float, 2, 3 > Matx23f
Definition: core.hpp:568
Random Number Generator - MT.
Definition: core.hpp:2058
Definition: core.hpp:132
GLenum GLsizei len
uchar const_param_type
Definition: core.hpp:4668
Line iterator class.
Definition: core.hpp:2657
value_type channel_type
Definition: core.hpp:1058
const GLuint * arrays
false
Definition: color.hpp:230
Definition: core.hpp:134
Definition: core.hpp:4796
value_type channel_type
Definition: core.hpp:1046
value_type vec_type
Definition: core.hpp:1023
Matx< double, 3, 2 > Matx32d
Definition: core.hpp:571
::max::max int
Definition: functional.hpp:324
int index
Definition: core.hpp:4377
Mat_< short > Mat1s
Definition: core.hpp:2900
Definition: core.hpp:1390
n-Dimensional Dense Matrix Iterator Class.
Definition: core.hpp:3239
int const_param_type
Definition: core.hpp:4588
true
Definition: color.hpp:221
int * refcount
Definition: core.hpp:1303
size_t nodeSize
Definition: core.hpp:3390
GLsizei const GLfloat * points
int flags
Definition: core.hpp:1376
Definition: core.hpp:4563
Definition: core.hpp:2692
CV_EXPORTS void vconcat(const Mat *src, size_t nsrc, OutputArray dst)
_Tp value_type
Definition: core.hpp:819
Definition: types_c.h:1620
CV_EXPORTS void hconcat(const Mat *src, size_t nsrc, OutputArray dst)
Point2f center
Definition: core.hpp:928
CV_EXPORTS_W double determinant(InputArray mtx)
computes determinant of a square matrix
GLubyte GLubyte GLubyte GLubyte w
value_type work_type
Definition: core.hpp:1117
Definition: types_c.h:1075
size_t nodeCount
Definition: core.hpp:3391
The node of the search tree.
Definition: core.hpp:3887
int x
Definition: highgui_c.h:186
Smart pointer to dynamically allocated objects.
Definition: core.hpp:1268
Definition: core.hpp:4594
const CvFileStorage * fs
Definition: core.hpp:4241
CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
adds one matrix to another (dst = src1 + src2)
GLboolean GLenum GLenum GLvoid * values
const CvArr CvArr CvStereoBMState * state
Definition: calib3d.hpp:353
double double end
Definition: core_c.h:774
CV_EXPORTS_W Rect boundingRect(InputArray points)
computes the bounding rectangle for a contour
GLboolean invert
Definition: core.hpp:4563
CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle, bool angleInDegrees=false)
computes angle (angle(i)) of each (x(i), y(i)) vector
Mat member_type
Definition: core.hpp:4621
CV_EXPORTS void swap(Mat &a, Mat &b)
swaps two matrices
const char const char * err_msg
Definition: core_c.h:1743
Definition: core.hpp:1385
short
Definition: vec_math.hpp:153
int code
error code
Definition: core.hpp:165
value_type vec_type
Definition: core.hpp:1035
Vec< int, 3 > Vec3i
Definition: core.hpp:673
Algorithm *(* Constructor)(void)
Definition: core.hpp:4453
A helper class for cv::DataType.
Definition: core.hpp:412
int valueOffset
Definition: core.hpp:3389
value_type & reference
Definition: core.hpp:376
const GLfloat * m
CV_EXPORTS_W Size getTextSize(const string &text, int fontFace, double fontScale, int thickness, CV_OUT int *baseLine)
returns bounding box of the text string
Vec< typename DataType< _Tp >::work_type, cn > work_type
Definition: core.hpp:1141
size_t * p
Definition: core.hpp:2000
CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1)
computes weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma)
int step
Definition: core.hpp:2674
CV_EXPORTS_W void mulSpectrums(InputArray a, InputArray b, OutputArray c, int flags, bool conjB=false)
computes element-wise product of the two Fourier spectrums. The second spectrum can optionally be con...
class CV_EXPORTS FileNode
Definition: core.hpp:3941
CvMemStorage CvSeq CvCmpFunc void * userdata
Definition: core_c.h:1083
Definition: core.hpp:133
CV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst)
adds scaled array to another one (dst = alpha*src1 + src2)
MSize size
Definition: core.hpp:2006
GLint GLint GLsizei GLsizei GLsizei depth
Definition: core_c.h:76
unsigned __int64 uint64
Definition: types_c.h:159
Definition: types_c.h:1040
Template Read-Write Sparse Matrix Iterator Class.
Definition: core.hpp:3288
CV_EXPORTS OutputArray noArray()
CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees=false)
converts Cartesian coordinates to polar
Definition: core.hpp:131
float value_type
Definition: core.hpp:1104
Vec< channel_type, channels > vec_type
Definition: core.hpp:1194
GLenum GLenum GLenum GLenum GLenum scale
GLdouble GLdouble t
the sparse matrix header
Definition: core.hpp:3383
CvArr double power
Definition: core_c.h:618
float boundary
go to the left if query_vec[node.idx]<=node.boundary, otherwise go to the right
Definition: core.hpp:3897
class CV_EXPORTS MatArg
Definition: core.hpp:112
value_type vec_type
Definition: core.hpp:1059
int line
line number in the source file where the error has occured
Definition: core.hpp:169
GLdouble s
Definition: core.hpp:1458
CV_PROP Mat points
all the points.
Definition: core.hpp:3933
const CvMat CvSize double alpha
Definition: calib3d.hpp:126
const CvArr const CvArr * src2
Definition: core_c.h:436
Definition: core.hpp:1978
void(* ConvertScaleData)(const void *from, void *to, int cn, double alpha, double beta)
Definition: core.hpp:3276
CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev, InputArray mask=noArray())
computes mean value and standard deviation of all or selected array elements
value_type vec_type
Definition: core.hpp:1012
Point_< float > Point2f
Definition: core.hpp:898
CV_EXPORTS_W float cubeRoot(float val)
computes cube root of the argument
Matx< float, 6, 6 > Matx66f
Definition: core.hpp:583
Mutex * mutex
Definition: core.hpp:4819
bool const_param_type
Definition: core.hpp:4580
Definition: core.hpp:133
GLenum GLint GLuint mask
Definition: tracking.hpp:132
Definition: core.hpp:2695
const uchar ** pointer
Definition: core.hpp:2932
CV_EXPORTS_W void multiply(InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
computes element-wise weighted product of the two arrays (dst = scale*src1*src2)
DataType< _Tp >::work_type dot(const Vector< _Tp > &v1, const Vector< _Tp > &v2)
Definition: operations.hpp:2465
Definition: core.hpp:449
CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi)
extracts a single channel from src (coi is 0-based index)
CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop)
compares elements of two arrays (dst = src1 src2)
struct CV_EXPORTS AlgorithmInfoData
Definition: core.hpp:4383
GLclampf f
GLsizei maxCount
CvPoint int radius
Definition: core_c.h:1290
Matx< float, 1, 3 > Matx13f
Definition: core.hpp:550
value_type channel_type
Definition: core.hpp:1082
Definition: core.hpp:448
Mat_< Vec4f > Mat4f
Definition: core.hpp:2918
size_t idx
Definition: core.hpp:3270
MatIterator_< _Tp > iterator
Definition: core.hpp:2761
pointer address(reference r)
Definition: core.hpp:389
MatIterator_< _Tp > it
Definition: core.hpp:3106
Definition: core.hpp:2352
value_type vec_type
Definition: core.hpp:1131
CV_PROP vector< int > labels
the parallel array of labels.
Definition: core.hpp:3934
int dims
the matrix dimensionality, >= 2
Definition: core.hpp:1960
Matx< double, 3, 1 > Matx31d
Definition: core.hpp:560
Matrix read-only iterator.
Definition: core.hpp:117
CV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst)
raises the input matrix elements to the specified power (b = a**power)
Point_< double > Point2d
Definition: core.hpp:899
Matx< float, 4, 4 > Matx44f
Definition: core.hpp:581
GLsizeiptr size
Definition: core_c.h:939
CV_EXPORTS int getThreadNum()
Definition: core.hpp:4561
CV_EXPORTS Mat cvarrToMat(const CvArr *arr, bool copyData=false, bool allowND=true, int coiMode=0)
converts array (CvMat or IplImage) to cv::Mat
Scalar_< _Tp > value_type
Definition: core.hpp:1224
_Tp * pointer
Definition: core.hpp:3042
Scalar_< double > Scalar
Definition: core.hpp:968
std::map< std::string, std::vector< std::string > > data
Definition: core.hpp:4738
CvPoint3D64f double * dist
Definition: legacy.hpp:556
CV_EXPORTS void mixChannels(const Mat *src, size_t nsrcs, Mat *dst, size_t ndsts, const int *fromTo, size_t npairs)
copies selected channels from the input arrays to the selected channels of the output arrays ...
Proxy datatype for passing Mat's and vector<>'s as input parameters.
Definition: core.hpp:1400
Matx< float, 3, 3 > Matx33f
Definition: core.hpp:573
double const_param_type
Definition: core.hpp:4604
Mat_< Vec3s > Mat3s
Definition: core.hpp:2902
MStep step
Definition: core.hpp:2007
Mat_< double > Mat1d
Definition: core.hpp:2920
vector< uchar > pool
Definition: core.hpp:3393
int type
the type of termination criteria: COUNT, EPS or COUNT + EPS
Definition: core.hpp:2110
Rect_< int > Rect
Definition: core.hpp:897
CV_EXPORTS_W float fastAtan2(float y, float x)
computes the angle in degrees (0..360) of the vector (x,y)
uchar value_type
Definition: core.hpp:1032
const CvArr * next
Definition: tracking.hpp:102
const value_type * const_pointer
Definition: core.hpp:375
_Tp channel_type
Definition: core.hpp:1214
Vec< float, 3 > Vec3f
Definition: core.hpp:679
size_t hashval
hash value
Definition: core.hpp:3402
SparseMatConstIterator const_iterator
Definition: core.hpp:3380
CV_EXPORTS_W void normalize(InputArray src, OutputArray dst, double alpha=1, double beta=0, int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray())
scales and shifts array elements so that either the specified norm (alpha) or the minimum (alpha) and...
short float uchar uchar uchar uchar uchar ushort int uchar ushort int float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float float int int int float int int int float int CV_CUDEV_IMPLEMENT_VEC_BINARY_OP char CV_CUDEV_IMPLEMENT_VEC_BINARY_OP ushort CV_CUDEV_IMPLEMENT_VEC_BINARY_OP short CV_CUDEV_IMPLEMENT_VEC_BINARY_OP int CV_CUDEV_IMPLEMENT_VEC_BINARY_OP uint CV_CUDEV_IMPLEMENT_VEC_BINARY_OP float CV_CUDEV_IMPLEMENT_VEC_BINARY_OP double int int uint double
Definition: vec_math.hpp:432
Definition: core.hpp:4785
struct CvPoint3D32f CvPoint3D32f
CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst)
computes per-element maximum of two arrays (dst = max(src1, src2))
Matx< float, 3, 2 > Matx32f
Definition: core.hpp:570
uchar * dataend
Definition: core.hpp:1972
Definition: core.hpp:131
CV_EXPORTS void insert(const Mat &plane, Mat &a, int coi)
Matx< float, 6, 1 > Matx61f
Definition: core.hpp:563
Definition: core.hpp:132
GLfloat GLfloat GLfloat GLfloat v3
CV_EXPORTS_W void line(CV_IN_OUT Mat &img, Point pt1, Point pt2, const Scalar &color, int thickness=1, int lineType=8, int shift=0)
draws the line segment (pt1, pt2) in the image
Vec< short, 2 > Vec2s
Definition: core.hpp:664
Mat_< Vec4s > Mat4s
Definition: core.hpp:2903
GLuint color
Definition: core_c.h:1276
string file
source file name where the error has occured
Definition: core.hpp:168