EstervQrCode 2.0.0
Library for qr code manipulation
Loading...
Searching...
No Matches
core.hpp
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2015, Intel Corporation, all rights reserved.
14// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
15// Copyright (C) 2015, OpenCV Foundation, all rights reserved.
16// Copyright (C) 2015, Itseez Inc., all rights reserved.
17// Third party copyrights are property of their respective owners.
18//
19// Redistribution and use in source and binary forms, with or without modification,
20// are permitted provided that the following conditions are met:
21//
22// * Redistribution's of source code must retain the above copyright notice,
23// this list of conditions and the following disclaimer.
24//
25// * Redistribution's in binary form must reproduce the above copyright notice,
26// this list of conditions and the following disclaimer in the documentation
27// and/or other materials provided with the distribution.
28//
29// * The name of the copyright holders may not be used to endorse or promote products
30// derived from this software without specific prior written permission.
31//
32// This software is provided by the copyright holders and contributors "as is" and
33// any express or implied warranties, including, but not limited to, the implied
34// warranties of merchantability and fitness for a particular purpose are disclaimed.
35// In no event shall the Intel Corporation or contributors be liable for any direct,
36// indirect, incidental, special, exemplary, or consequential damages
37// (including, but not limited to, procurement of substitute goods or services;
38// loss of use, data, or profits; or business interruption) however caused
39// and on any theory of liability, whether in contract, strict liability,
40// or tort (including negligence or otherwise) arising in any way out of
41// the use of this software, even if advised of the possibility of such damage.
42//
43//M*/
44
45#ifndef OPENCV_CORE_HPP
46#define OPENCV_CORE_HPP
47
48#ifndef __cplusplus
49# error core.hpp header must be compiled as C++
50#endif
51
52#include "opencv2/core/cvdef.h"
53#include "opencv2/core/base.hpp"
54#include "opencv2/core/cvstd.hpp"
55#include "opencv2/core/traits.hpp"
56#include "opencv2/core/matx.hpp"
57#include "opencv2/core/types.hpp"
58#include "opencv2/core/mat.hpp"
59#include "opencv2/core/persistence.hpp"
60
102namespace cv {
103
106
115{
116public:
125 Exception(int _code, const String& _err, const String& _func, const String& _file, int _line);
126 virtual ~Exception() throw();
127
131 virtual const char *what() const throw() CV_OVERRIDE;
132 void formatMessage();
133
134 String msg;
135
136 int code;
137 String err;
139 String file;
140 int line;
141};
142
151CV_EXPORTS CV_NORETURN void error(const Exception& exc);
152
157 SORT_ASCENDING = 0,
159 SORT_DESCENDING = 16
162 };
163
165
168
204
207
220
222
225
230 REDUCE_SUM2 = 4
231 };
232
234
237CV_EXPORTS void swap(Mat& a, Mat& b);
239CV_EXPORTS void swap( UMat& a, UMat& b );
240
242
245
267CV_EXPORTS_W int borderInterpolate(int p, int len, int borderType);
268
318 int top, int bottom, int left, int right,
319 int borderType, const Scalar& value = Scalar() );
320
360CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst,
361 InputArray mask = noArray(), int dtype = -1);
362
403CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst,
404 InputArray mask = noArray(), int dtype = -1);
405
406
431CV_EXPORTS_W void multiply(InputArray src1, InputArray src2,
432 OutputArray dst, double scale = 1, int dtype = -1);
433
462CV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst,
463 double scale = 1, int dtype = -1);
464
466CV_EXPORTS_W void divide(double scale, InputArray src2,
467 OutputArray dst, int dtype = -1);
468
487CV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst);
488
515CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2,
516 double beta, double gamma, OutputArray dst, int dtype = -1);
517
544 double alpha = 1, double beta = 0);
545
559
574CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst);
575
583CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);
584
601CV_EXPORTS_W bool hasNonZero( InputArray src );
602
620CV_EXPORTS_W int countNonZero( InputArray src );
621
658CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );
659
671CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask = noArray());
672
694 InputArray mask=noArray());
695
732CV_EXPORTS_W double norm(InputArray src1, int normType = NORM_L2, InputArray mask = noArray());
733
745CV_EXPORTS_W double norm(InputArray src1, InputArray src2,
746 int normType = NORM_L2, InputArray mask = noArray());
751CV_EXPORTS double norm( const SparseMat& src, int normType );
752
772CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2, double R=255.);
773
779CV_EXPORTS_W void batchDistance(InputArray src1, InputArray src2,
780 OutputArray dist, int dtype, OutputArray nidx,
781 int normType = NORM_L2, int K = 0,
782 InputArray mask = noArray(), int update = 0,
783 bool crosscheck = false);
784
843CV_EXPORTS_W void normalize( InputArray src, InputOutputArray dst, double alpha = 1, double beta = 0,
844 int norm_type = NORM_L2, int dtype = -1, InputArray mask = noArray());
845
853CV_EXPORTS void normalize( const SparseMat& src, SparseMat& dst, double alpha, int normType );
854
873CV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double* minVal,
874 CV_OUT double* maxVal = 0, CV_OUT Point* minLoc = 0,
875 CV_OUT Point* maxLoc = 0, InputArray mask = noArray());
876
892CV_EXPORTS_W void reduceArgMin(InputArray src, OutputArray dst, int axis, bool lastIndex = false);
893
909CV_EXPORTS_W void reduceArgMax(InputArray src, OutputArray dst, int axis, bool lastIndex = false);
910
931CV_EXPORTS void minMaxIdx(InputArray src, double* minVal, double* maxVal = 0,
932 int* minIdx = 0, int* maxIdx = 0, InputArray mask = noArray());
933
943CV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal,
944 double* maxVal, int* minIdx = 0, int* maxIdx = 0);
945
970CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype = -1);
971
991CV_EXPORTS void merge(const Mat* mv, size_t count, OutputArray dst);
992
1000
1016CV_EXPORTS void split(const Mat& src, Mat* mvbegin);
1017
1023
1065CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,
1066 const int* fromTo, size_t npairs);
1067
1083 const int* fromTo, size_t npairs);
1084
1099 const std::vector<int>& fromTo);
1100
1107CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi);
1108
1116
1149CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode);
1150
1156CV_EXPORTS_W void flipND(InputArray src, OutputArray dst, int axis);
1157
1163CV_EXPORTS_W void broadcast(InputArray src, InputArray shape, OutputArray dst);
1164
1181CV_EXPORTS_W void rotate(InputArray src, OutputArray dst, int rotateCode);
1182
1196CV_EXPORTS_W void repeat(InputArray src, int ny, int nx, OutputArray dst);
1197
1205CV_EXPORTS Mat repeat(const Mat& src, int ny, int nx);
1206
1228CV_EXPORTS void hconcat(const Mat* src, size_t nsrc, OutputArray dst);
1249CV_EXPORTS void hconcat(InputArray src1, InputArray src2, OutputArray dst);
1269
1290CV_EXPORTS void vconcat(const Mat* src, size_t nsrc, OutputArray dst);
1314CV_EXPORTS void vconcat(InputArray src1, InputArray src2, OutputArray dst);
1333
1359CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2,
1360 OutputArray dst, InputArray mask = noArray());
1361
1386CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2,
1387 OutputArray dst, InputArray mask = noArray());
1388
1414CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2,
1415 OutputArray dst, InputArray mask = noArray());
1416
1432 InputArray mask = noArray());
1433
1460CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst);
1461
1472void CV_EXPORTS_W copyTo(InputArray src, OutputArray dst, InputArray mask);
1492CV_EXPORTS_W void inRange(InputArray src, InputArray lowerb,
1493 InputArray upperb, OutputArray dst);
1494
1521CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop);
1522
1534CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst);
1538CV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst);
1542CV_EXPORTS void min(const UMat& src1, const UMat& src2, UMat& dst);
1543
1555CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst);
1559CV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst);
1563CV_EXPORTS void max(const UMat& src1, const UMat& src2, UMat& dst);
1564
1574CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst);
1575
1599CV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst);
1600
1615CV_EXPORTS_W void exp(InputArray src, OutputArray dst);
1616
1628CV_EXPORTS_W void log(InputArray src, OutputArray dst);
1629
1650CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle,
1651 OutputArray x, OutputArray y, bool angleInDegrees = false);
1652
1671CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y,
1673 bool angleInDegrees = false);
1674
1691CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle,
1692 bool angleInDegrees = false);
1693
1705CV_EXPORTS_W void magnitude(InputArray x, InputArray y, OutputArray magnitude);
1706
1722CV_EXPORTS_W bool checkRange(InputArray a, bool quiet = true, CV_OUT Point* pos = 0,
1723 double minVal = -DBL_MAX, double maxVal = DBL_MAX);
1724
1730
1759CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha,
1760 InputArray src3, double beta, OutputArray dst, int flags = 0);
1761
1790CV_EXPORTS_W void mulTransposed( InputArray src, OutputArray dst, bool aTa,
1791 InputArray delta = noArray(),
1792 double scale = 1, int dtype = -1 );
1793
1804
1814
1839CV_EXPORTS_W void transform(InputArray src, OutputArray dst, InputArray m );
1840
1866CV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArray m );
1867
1882CV_EXPORTS_W void completeSymm(InputOutputArray m, bool lowerToUpper = false);
1883
1900
1914CV_EXPORTS_W double determinant(InputArray mtx);
1915
1923CV_EXPORTS_W Scalar trace(InputArray mtx);
1924
1950CV_EXPORTS_W double invert(InputArray src, OutputArray dst, int flags = DECOMP_LU);
1951
1974CV_EXPORTS_W bool solve(InputArray src1, InputArray src2,
1975 OutputArray dst, int flags = DECOMP_LU);
1976
1990CV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags);
1991
2010CV_EXPORTS_W void sortIdx(InputArray src, OutputArray dst, int flags);
2011
2026
2035CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters = 300);
2036
2056CV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues,
2057 OutputArray eigenvectors = noArray());
2058
2073CV_EXPORTS_W void eigenNonSymmetric(InputArray src, OutputArray eigenvalues,
2074 OutputArray eigenvectors);
2075
2089CV_EXPORTS void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean,
2090 int flags, int ctype = CV_64F);
2091
2100CV_EXPORTS_W void calcCovarMatrix( InputArray samples, OutputArray covar,
2101 InputOutputArray mean, int flags, int ctype = CV_64F);
2102
2105 OutputArray eigenvectors, int maxComponents = 0);
2106
2108CV_EXPORTS_AS(PCACompute2) void PCACompute(InputArray data, InputOutputArray mean,
2109 OutputArray eigenvectors, OutputArray eigenvalues,
2110 int maxComponents = 0);
2111
2114 OutputArray eigenvectors, double retainedVariance);
2115
2117CV_EXPORTS_AS(PCACompute2) void PCACompute(InputArray data, InputOutputArray mean,
2118 OutputArray eigenvectors, OutputArray eigenvalues,
2119 double retainedVariance);
2120
2122CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean,
2123 InputArray eigenvectors, OutputArray result);
2124
2126CV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean,
2127 InputArray eigenvectors, OutputArray result);
2128
2130CV_EXPORTS_W void SVDecomp( InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags = 0 );
2131
2133CV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt,
2134 InputArray rhs, OutputArray dst );
2135
2146CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar);
2147
2280CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0);
2281
2294CV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0);
2295
2335CV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags = 0);
2336
2345CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags = 0);
2346
2364CV_EXPORTS_W void mulSpectrums(InputArray a, InputArray b, OutputArray c,
2365 int flags, bool conjB = false);
2366
2389
2400
2408
2419CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high);
2420
2432CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev);
2433
2445CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);
2446
2513{
2514public:
2515 enum Flags { DATA_AS_ROW = 0,
2516 DATA_AS_COL = 1,
2517 USE_AVG = 2
2519
2526
2536 PCA(InputArray data, InputArray mean, int flags, int maxComponents = 0);
2537
2548 PCA(InputArray data, InputArray mean, int flags, double retainedVariance);
2549
2570 PCA& operator()(InputArray data, InputArray mean, int flags, int maxComponents = 0);
2571
2583 PCA& operator()(InputArray data, InputArray mean, int flags, double retainedVariance);
2584
2599 Mat project(InputArray vec) const;
2600
2613 void project(InputArray vec, OutputArray result) const;
2614
2628 Mat backProject(InputArray vec) const;
2629
2637 void backProject(InputArray vec, OutputArray result) const;
2638
2643 void write(FileStorage& fs) const;
2644
2649 void read(const FileNode& fn);
2650
2654};
2655
2669{
2670public:
2674 explicit LDA(int num_components = 0);
2675
2681 LDA(InputArrayOfArrays src, InputArray labels, int num_components = 0);
2682
2685 void save(const String& filename) const;
2686
2689 void load(const String& filename);
2690
2693 void save(FileStorage& fs) const;
2694
2697 void load(const FileStorage& node);
2698
2702
2705 void compute(InputArrayOfArrays src, InputArray labels);
2706
2710 Mat project(InputArray src);
2711
2715 Mat reconstruct(InputArray src);
2716
2719 Mat eigenvectors() const { return _eigenvectors; }
2720
2723 Mat eigenvalues() const { return _eigenvalues; }
2724
2725 static Mat subspaceProject(InputArray W, InputArray mean, InputArray src);
2726 static Mat subspaceReconstruct(InputArray W, InputArray mean, InputArray src);
2727
2728protected:
2732 void lda(InputArrayOfArrays src, InputArray labels);
2733};
2734
2750{
2751public:
2752 enum Flags {
2755 MODIFY_A = 1,
2758 NO_UV = 2,
2762 FULL_UV = 4
2764
2770
2776 SVD( InputArray src, int flags = 0 );
2777
2789 SVD& operator ()( InputArray src, int flags = 0 );
2790
2808 static void compute( InputArray src, OutputArray w,
2809 OutputArray u, OutputArray vt, int flags = 0 );
2810
2817 static void compute( InputArray src, OutputArray w, int flags = 0 );
2818
2821 static void backSubst( InputArray w, InputArray u,
2822 InputArray vt, InputArray rhs,
2823 OutputArray dst );
2824
2835 static void solveZ( InputArray src, OutputArray dst );
2836
2859 void backSubst( InputArray rhs, OutputArray dst ) const;
2860
2862 template<typename _Tp, int m, int n, int nm> static
2864
2866 template<typename _Tp, int m, int n, int nm> static
2868
2870 template<typename _Tp, int m, int n, int nm, int nb> static
2872
2873 Mat u, w, vt;
2874};
2875
2889{
2890public:
2891 enum { UNIFORM = 0,
2892 NORMAL = 1
2894
2907 RNG(uint64 state);
2910 unsigned next();
2911
2918 operator uchar();
2920 operator schar();
2922 operator ushort();
2924 operator short();
2926 operator unsigned();
2928 operator int();
2930 operator float();
2932 operator double();
2933
2941 unsigned operator ()();
2945 unsigned operator ()(unsigned N);
2946
2983 int uniform(int a, int b);
2985 float uniform(float a, float b);
2987 double uniform(double a, double b);
2988
3023 void fill( InputOutputArray mat, int distType, InputArray a, InputArray b, bool saturateRange = false );
3024
3033 double gaussian(double sigma);
3034
3036
3037 bool operator ==(const RNG& other) const;
3038};
3039
3046{
3047public:
3049 RNG_MT19937(unsigned s);
3050 void seed(unsigned s);
3051
3052 unsigned next();
3053
3054 operator int();
3055 operator unsigned();
3056 operator float();
3057 operator double();
3058
3059 unsigned operator ()(unsigned N);
3060 unsigned operator ()();
3061
3063 int uniform(int a, int b);
3065 float uniform(float a, float b);
3067 double uniform(double a, double b);
3068
3069private:
3070 enum PeriodParameters {N = 624, M = 397};
3071 unsigned state[N];
3072 int mti;
3073};
3074
3076
3079
3117CV_EXPORTS_W double kmeans( InputArray data, int K, InputOutputArray bestLabels,
3118 TermCriteria criteria, int attempts,
3119 int flags, OutputArray centers = noArray() );
3120
3122
3125
3127
3130{
3131public:
3132 virtual const char* next() = 0;
3133 virtual void reset() = 0;
3134 virtual ~Formatted();
3135};
3136
3139{
3140public:
3142 FMT_DEFAULT = 0,
3143 FMT_MATLAB = 1,
3144 FMT_CSV = 2,
3145 FMT_PYTHON = 3,
3146 FMT_NUMPY = 4,
3147 FMT_C = 5
3149
3150 virtual ~Formatter();
3151
3152 virtual Ptr<Formatted> format(const Mat& mtx) const = 0;
3153
3154 virtual void set16fPrecision(int p = 4) = 0;
3155 virtual void set32fPrecision(int p = 8) = 0;
3156 virtual void set64fPrecision(int p = 16) = 0;
3157 virtual void setMultiline(bool ml = true) = 0;
3158
3159 static Ptr<Formatter> get(Formatter::FormatType fmt = FMT_DEFAULT);
3160
3161};
3162
3163static inline
3164String& operator << (String& out, Ptr<Formatted> fmtd)
3165{
3166 fmtd->reset();
3167 for(const char* str = fmtd->next(); str; str = fmtd->next())
3168 out += cv::String(str);
3169 return out;
3170}
3171
3172static inline
3173String& operator << (String& out, const Mat& mtx)
3174{
3175 return out << Formatter::get()->format(mtx);
3176}
3177
3179
3181
3182template<typename _Tp, typename _EnumTp = void> struct ParamType {};
3183
3184
3197{
3198public:
3200 virtual ~Algorithm();
3201
3204 CV_WRAP virtual void clear() {}
3205
3208 CV_WRAP virtual void write(FileStorage& fs) const { CV_UNUSED(fs); }
3209
3213 CV_WRAP void write(FileStorage& fs, const String& name) const;
3214#if CV_VERSION_MAJOR < 5
3216 void write(const Ptr<FileStorage>& fs, const String& name = String()) const;
3217#endif
3218
3221 CV_WRAP virtual void read(const FileNode& fn) { CV_UNUSED(fn); }
3222
3225 CV_WRAP virtual bool empty() const { return false; }
3226
3238 template<typename _Tp> static Ptr<_Tp> read(const FileNode& fn)
3239 {
3240 Ptr<_Tp> obj = _Tp::create();
3241 obj->read(fn);
3242 return !obj->empty() ? obj : Ptr<_Tp>();
3243 }
3244
3257 template<typename _Tp> static Ptr<_Tp> load(const String& filename, const String& objname=String())
3258 {
3259 FileStorage fs(filename, FileStorage::READ);
3260 CV_Assert(fs.isOpened());
3261 FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
3262 if (fn.empty()) return Ptr<_Tp>();
3263 Ptr<_Tp> obj = _Tp::create();
3264 obj->read(fn);
3265 return !obj->empty() ? obj : Ptr<_Tp>();
3266 }
3267
3278 template<typename _Tp> static Ptr<_Tp> loadFromString(const String& strModel, const String& objname=String())
3279 {
3280 FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY);
3281 FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
3282 Ptr<_Tp> obj = _Tp::create();
3283 obj->read(fn);
3284 return !obj->empty() ? obj : Ptr<_Tp>();
3285 }
3286
3289 CV_WRAP virtual void save(const String& filename) const;
3290
3294
3295protected:
3296 void writeFormat(FileStorage& fs) const;
3297};
3298
3299enum struct Param {
3300 INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7,
3301 UNSIGNED_INT=8, UINT64=9, UCHAR=11, SCALAR=12
3302};
3303
3304
3305
3306template<> struct ParamType<bool>
3307{
3308 typedef bool const_param_type;
3309 typedef bool member_type;
3310
3311 static const Param type = Param::BOOLEAN;
3312};
3313
3314template<> struct ParamType<int>
3315{
3316 typedef int const_param_type;
3317 typedef int member_type;
3318
3319 static const Param type = Param::INT;
3320};
3321
3322template<> struct ParamType<double>
3323{
3324 typedef double const_param_type;
3325 typedef double member_type;
3326
3327 static const Param type = Param::REAL;
3328};
3329
3330template<> struct ParamType<String>
3331{
3332 typedef const String& const_param_type;
3334
3335 static const Param type = Param::STRING;
3336};
3337
3338template<> struct ParamType<Mat>
3339{
3340 typedef const Mat& const_param_type;
3342
3343 static const Param type = Param::MAT;
3344};
3345
3346template<> struct ParamType<std::vector<Mat> >
3347{
3350
3351 static const Param type = Param::MAT_VECTOR;
3352};
3353
3354template<> struct ParamType<Algorithm>
3355{
3358
3359 static const Param type = Param::ALGORITHM;
3360};
3361
3362template<> struct ParamType<float>
3363{
3364 typedef float const_param_type;
3365 typedef float member_type;
3366
3367 static const Param type = Param::FLOAT;
3368};
3369
3370template<> struct ParamType<unsigned>
3371{
3372 typedef unsigned const_param_type;
3373 typedef unsigned member_type;
3374
3375 static const Param type = Param::UNSIGNED_INT;
3376};
3377
3378template<> struct ParamType<uint64>
3379{
3382
3383 static const Param type = Param::UINT64;
3384};
3385
3386template<> struct ParamType<uchar>
3387{
3390
3391 static const Param type = Param::UCHAR;
3392};
3393
3394template<> struct ParamType<Scalar>
3395{
3396 typedef const Scalar& const_param_type;
3398
3399 static const Param type = Param::SCALAR;
3400};
3401
3402template<typename _Tp>
3403struct ParamType<_Tp, typename std::enable_if< std::is_enum<_Tp>::value >::type>
3404{
3407
3408 static const Param type = Param::INT;
3409};
3410
3412
3413} //namespace cv
3414
3415#include "opencv2/core/operations.hpp"
3416#include "opencv2/core/cvstd.inl.hpp"
3417#include "opencv2/core/utility.hpp"
3418#include "opencv2/core/optim.hpp"
3419#include "opencv2/core/ovx.hpp"
3420
3421#endif /*OPENCV_CORE_HPP*/
This is a base class for all more or less complex algorithms in OpenCV.
Definition core.hpp:3197
virtual CV_WRAP void clear()
Clears the algorithm state.
Definition core.hpp:3204
virtual CV_WRAP void write(FileStorage &fs) const
Stores algorithm parameters in a file storage.
Definition core.hpp:3208
void writeFormat(FileStorage &fs) const
virtual CV_WRAP String getDefaultName() const
void write(const Ptr< FileStorage > &fs, const String &name=String()) const
static Ptr< _Tp > load(const String &filename, const String &objname=String())
Loads algorithm from the file.
Definition core.hpp:3257
virtual ~Algorithm()
virtual CV_WRAP void read(const FileNode &fn)
Reads algorithm parameters from a file storage.
Definition core.hpp:3221
CV_WRAP void write(FileStorage &fs, const String &name) const
static Ptr< _Tp > read(const FileNode &fn)
Reads algorithm from the file node.
Definition core.hpp:3238
static Ptr< _Tp > loadFromString(const String &strModel, const String &objname=String())
Loads algorithm from a String.
Definition core.hpp:3278
virtual CV_WRAP bool empty() const
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
Definition core.hpp:3225
virtual CV_WRAP void save(const String &filename) const
Class passed to an error.
Definition core.hpp:115
Exception(int _code, const String &_err, const String &_func, const String &_file, int _line)
virtual ~Exception()
File Storage Node class.
Definition persistence.hpp:482
CV_WRAP bool empty() const
returns true if the node is empty
XML/YAML/JSON file storage class that encapsulates all the information necessary for writing or readi...
Definition persistence.hpp:304
CV_WRAP FileNode getFirstTopLevelNode() const
Returns the first element of the top-level mapping.
virtual CV_WRAP bool isOpened() const
Checks whether the file is opened.
Definition core.hpp:3130
virtual void reset()=0
virtual const char * next()=0
virtual ~Formatted()
Definition core.hpp:3139
static Ptr< Formatter > get(Formatter::FormatType fmt=FMT_DEFAULT)
virtual ~Formatter()
virtual void set16fPrecision(int p=4)=0
virtual void setMultiline(bool ml=true)=0
FormatType
Definition core.hpp:3141
virtual Ptr< Formatted > format(const Mat &mtx) const =0
virtual void set64fPrecision(int p=16)=0
virtual void set32fPrecision(int p=8)=0
Linear Discriminant Analysis.
Definition core.hpp:2669
Mat eigenvalues() const
Definition core.hpp:2723
void lda(InputArrayOfArrays src, InputArray labels)
void save(FileStorage &fs) const
LDA(InputArrayOfArrays src, InputArray labels, int num_components=0)
Mat reconstruct(InputArray src)
void save(const String &filename) const
void compute(InputArrayOfArrays src, InputArray labels)
static Mat subspaceProject(InputArray W, InputArray mean, InputArray src)
LDA(int num_components=0)
constructor Initializes a LDA with num_components (default 0).
Mat eigenvectors() const
Definition core.hpp:2719
Mat _eigenvectors
Definition core.hpp:2730
void load(const String &filename)
Mat _eigenvalues
Definition core.hpp:2731
Mat project(InputArray src)
static Mat subspaceReconstruct(InputArray W, InputArray mean, InputArray src)
void load(const FileStorage &node)
int _num_components
Definition core.hpp:2729
n-dimensional dense array class
Definition mat.hpp:812
Template class for small matrices whose type and size are known at compilation time.
Definition matx.hpp:100
Principal Component Analysis.
Definition core.hpp:2513
void project(InputArray vec, OutputArray result) const
Mat mean
mean value subtracted before the projection and added after the back projection
Definition core.hpp:2653
Mat eigenvalues
eigenvalues of the covariation matrix
Definition core.hpp:2652
void backProject(InputArray vec, OutputArray result) const
PCA()
default constructor
PCA(InputArray data, InputArray mean, int flags, int maxComponents=0)
Mat backProject(InputArray vec) const
Reconstructs vectors from their PC projections.
PCA & operator()(InputArray data, InputArray mean, int flags, int maxComponents=0)
performs PCA
PCA & operator()(InputArray data, InputArray mean, int flags, double retainedVariance)
Mat project(InputArray vec) const
Projects vector(s) to the principal component subspace.
void write(FileStorage &fs) const
write PCA objects
Mat eigenvectors
eigenvectors of the covariation matrix
Definition core.hpp:2651
void read(const FileNode &fn)
load PCA objects
Flags
Definition core.hpp:2515
PCA(InputArray data, InputArray mean, int flags, double retainedVariance)
Template class for 2D points specified by its coordinates x and y.
Definition types.hpp:163
Mersenne Twister random number generator.
Definition core.hpp:3046
void seed(unsigned s)
int uniform(int a, int b)
returns uniformly distributed integer random number from [a,b) range
float uniform(float a, float b)
returns uniformly distributed floating-point random number from [a,b) range
double uniform(double a, double b)
returns uniformly distributed double-precision floating-point random number from [a,...
RNG_MT19937(unsigned s)
unsigned next()
Random Number Generator.
Definition core.hpp:2889
RNG()
constructor
RNG(uint64 state)
float uniform(float a, float b)
double uniform(double a, double b)
double gaussian(double sigma)
Returns the next random number sampled from the Gaussian distribution.
uint64 state
Definition core.hpp:3035
int uniform(int a, int b)
returns uniformly distributed integer random number from [a,b) range
void fill(InputOutputArray mat, int distType, InputArray a, InputArray b, bool saturateRange=false)
Fills arrays with random numbers.
unsigned next()
Singular Value Decomposition.
Definition core.hpp:2750
SVD()
the default constructor
Flags
Definition core.hpp:2752
SVD(InputArray src, int flags=0)
static void compute(const Matx< _Tp, m, n > &a, Matx< _Tp, nm, 1 > &w)
static void compute(const Matx< _Tp, m, n > &a, Matx< _Tp, nm, 1 > &w, Matx< _Tp, m, nm > &u, Matx< _Tp, n, nm > &vt)
static void compute(InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags=0)
decomposes matrix and stores the results to user-provided matrices
static void backSubst(InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst)
performs back substitution
void backSubst(InputArray rhs, OutputArray dst) const
performs a singular value back substitution.
static void compute(InputArray src, OutputArray w, int flags=0)
static void solveZ(InputArray src, OutputArray dst)
solves an under-determined singular linear system
Mat u
Definition core.hpp:2873
static void backSubst(const Matx< _Tp, nm, 1 > &w, const Matx< _Tp, m, nm > &u, const Matx< _Tp, n, nm > &vt, const Matx< _Tp, m, nb > &rhs, Matx< _Tp, n, nb > &dst)
The class SparseMat represents multi-dimensional sparse numerical arrays.
Definition mat.hpp:2735
The class defining termination criteria for iterative algorithms.
Definition types.hpp:886
Definition mat.hpp:2433
Definition mat.hpp:387
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition mat.hpp:296
CV_EXPORTS_W void insertChannel(InputArray src, InputOutputArray dst, int coi)
Inserts a single channel to dst (coi is 0-based index)
CV_EXPORTS_W int borderInterpolate(int p, int len, int borderType)
Computes the source location of an extrapolated pixel.
CV_EXPORTS void minMaxIdx(InputArray src, double *minVal, double *maxVal=0, int *minIdx=0, int *maxIdx=0, InputArray mask=noArray())
Finds the global minimum and maximum in an array.
CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
Calculates the per-element bit-wise "exclusive or" operation on two arrays or an array and a scalar.
CV_EXPORTS_W void convertScaleAbs(InputArray src, OutputArray dst, double alpha=1, double beta=0)
Scales, calculates absolute values, and converts the result to 8-bit.
CV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean, OutputArray eigenvectors, int maxComponents=0)
CV_EXPORTS_W void SVDecomp(InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags=0)
CV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues, OutputArray eigenvectors=noArray())
Calculates eigenvalues and eigenvectors of a symmetric matrix.
void CV_EXPORTS_W copyTo(InputArray src, OutputArray dst, InputArray mask)
This is an overloaded member function, provided for convenience (python) Copies the matrix to another...
CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags=0)
Performs generalized matrix multiplication.
CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype=-1)
Reduces a matrix to a vector.
ReduceTypes
Definition core.hpp:226
CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar)
Calculates the Mahalanobis distance between two vectors.
CV_EXPORTS void split(const Mat &src, Mat *mvbegin)
Divides a multi-channel array into several single-channel arrays.
CV_EXPORTS_W void mulSpectrums(InputArray a, InputArray b, OutputArray c, int flags, bool conjB=false)
Performs the per-element multiplication of two Fourier spectrums.
CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle, OutputArray x, OutputArray y, bool angleInDegrees=false)
Calculates x and y coordinates of 2D vectors from their magnitude and angle.
CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots)
Finds the real roots of a cubic equation.
CV_EXPORTS_W void sortIdx(InputArray src, OutputArray dst, int flags)
Sorts each row or each column of a matrix.
CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees=false)
Calculates the magnitude and angle of 2D vectors.
CV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags=0)
Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
CV_EXPORTS_W void flipND(InputArray src, OutputArray dst, int axis)
Flips a n-dimensional at given axis.
CV_EXPORTS_W void reduceArgMin(InputArray src, OutputArray dst, int axis, bool lastIndex=false)
Finds indices of min elements along provided axis.
CV_EXPORTS_W void completeSymm(InputOutputArray m, bool lowerToUpper=false)
Copies the lower or the upper half of a square matrix to its another half.
CV_EXPORTS_W void SVBackSubst(InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst)
CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst)
Performs a look-up table transform of an array.
CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags=0)
Calculates the inverse Discrete Cosine Transform of a 1D or 2D array.
CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle, bool angleInDegrees=false)
Calculates the rotation angle of 2D vectors.
CV_EXPORTS_W void reduceArgMax(InputArray src, OutputArray dst, int axis, bool lastIndex=false)
Finds indices of max elements along provided axis.
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 the global minimum and maximum in an array.
CV_EXPORTS void vconcat(const Mat *src, size_t nsrc, OutputArray dst)
Applies vertical concatenation to given matrices.
CV_EXPORTS_W void eigenNonSymmetric(InputArray src, OutputArray eigenvalues, OutputArray eigenvectors)
Calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).
CV_EXPORTS_W int getOptimalDFTSize(int vecsize)
Returns the optimal DFT size for a given vector size.
CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev, InputArray mask=noArray())
CV_EXPORTS_W void copyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar &value=Scalar())
Forms a border around an image.
CV_EXPORTS RNG & theRNG()
Returns the default random number generator.
RotateFlags
Definition core.hpp:1165
CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop)
Performs the per-element comparison of two arrays or an array and scalar value.
CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
Calculates the per-element bit-wise disjunction of two arrays or an array and a scalar.
CV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
Calculates the inverse Discrete Fourier Transform of a 1D or 2D array.
CV_EXPORTS_W int countNonZero(InputArray src)
Counts non-zero array elements.
CV_EXPORTS void hconcat(const Mat *src, size_t nsrc, OutputArray dst)
Applies horizontal concatenation to given matrices.
CV_EXPORTS_W void broadcast(InputArray src, InputArray shape, OutputArray dst)
Broadcast the given Mat to the given shape.
CV_EXPORTS_W double norm(InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
Calculates the absolute norm of an array.
CV_EXPORTS void mixChannels(const Mat *src, size_t nsrcs, Mat *dst, size_t ndsts, const int *fromTo, size_t npairs)
Copies specified channels from input arrays to the specified channels of output arrays.
CV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst)
Calculates the sum of a scaled array and another array.
CV_EXPORTS_W void repeat(InputArray src, int ny, int nx, OutputArray dst)
Fills the output array with repeated copies of the input array.
CV_EXPORTS_W double invert(InputArray src, OutputArray dst, int flags=DECOMP_LU)
Finds the inverse or pseudo-inverse of a matrix.
CV_EXPORTS_W void mulTransposed(InputArray src, OutputArray dst, bool aTa, InputArray delta=noArray(), double scale=1, int dtype=-1)
Calculates the product of a matrix and its transposition.
CV_EXPORTS_W bool hasNonZero(InputArray src)
Checks for the presence of at least one non-zero array element.
CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
Solves one or more linear systems or least-squares problems.
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 bitwise_not(InputArray src, OutputArray dst, InputArray mask=noArray())
Inverts every bit of an array.
CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2, double R=255.)
Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.
CV_EXPORTS_W Scalar trace(InputArray mtx)
Returns the trace of a matrix.
CV_EXPORTS_W void transposeND(InputArray src, const std::vector< int > &order, OutputArray dst)
Transpose for n-dimensional matrices.
CV_EXPORTS_W bool checkRange(InputArray a, bool quiet=true, CV_OUT Point *pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX)
Checks every element of an input array for invalid values.
CV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
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
CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode)
Flips a 2D array around vertical, horizontal, or both axes.
CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst)
Calculates the per-element absolute difference between two arrays or between an array and a scalar.
CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high)
Generates a single uniformly-distributed random number or an array of random numbers.
CV_EXPORTS_W void transpose(InputArray src, OutputArray dst)
Transposes a matrix.
CV_EXPORTS_W void setIdentity(InputOutputArray mtx, const Scalar &s=Scalar(1))
Initializes a scaled identity matrix.
CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
Calculates the per-element sum of two arrays or an array and a scalar.
CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor=1., RNG *rng=0)
Shuffles the array elements randomly.
CV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
Performs per-element division of two arrays or a scalar by an array.
CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters=300)
Finds the real or complex roots of a polynomial equation.
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) Calculates the per-element bit-wis...
CV_EXPORTS_W void convertFp16(InputArray src, OutputArray dst)
Converts an array to half precision floating number.
CV_EXPORTS_W void inRange(InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst)
Checks if array elements lie between the elements of two other arrays.
CV_EXPORTS_W void findNonZero(InputArray src, OutputArray idx)
Returns the list of locations of non-zero pixels.
CV_EXPORTS_W double determinant(InputArray mtx)
Returns the determinant of a square floating-point matrix.
CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev)
Fills the array with normally distributed random numbers.
CV_EXPORTS_W void multiply(InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
Calculates the per-element scaled product of two arrays.
CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
Calculates the per-element difference between two arrays or array and a scalar.
CV_EXPORTS_W void normalize(InputArray src, InputOutputArray dst, double alpha=1, double beta=0, int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray())
Normalizes the norm or value range of an array.
CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val=0)
Replaces NaNs by given number.
CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
CV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArray m)
Performs the perspective matrix transformation of vectors.
CV_EXPORTS void calcCovarMatrix(const Mat *samples, int nsamples, Mat &covar, Mat &mean, int flags, int ctype=CV_64F)
Calculates the covariance matrix of a set of vectors.
CV_EXPORTS_W void setRNGSeed(int seed)
Sets state of default random number generator.
CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array.
CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1)
Calculates the weighted sum of two arrays.
@ REDUCE_SUM
the output is the sum of all rows/columns of the matrix.
Definition core.hpp:226
@ REDUCE_MIN
the output is the minimum (column/row-wise) of all rows/columns of the matrix.
Definition core.hpp:229
@ REDUCE_AVG
the output is the mean vector of all rows/columns of the matrix.
Definition core.hpp:227
@ REDUCE_MAX
the output is the maximum (column/row-wise) of all rows/columns of the matrix.
Definition core.hpp:228
@ REDUCE_SUM2
the output is the sum of all squared rows/columns of the matrix.
Definition core.hpp:230
@ ROTATE_90_CLOCKWISE
Rotate 90 degrees clockwise.
Definition core.hpp:1166
@ ROTATE_90_COUNTERCLOCKWISE
Rotate 270 degrees clockwise.
Definition core.hpp:1168
@ ROTATE_180
Rotate 180 degrees clockwise.
Definition core.hpp:1167
CV_EXPORTS InputOutputArray noArray()
InputArray InputArrayOfArrays
Definition mat.hpp:443
Param
Definition core.hpp:3299
CvMat * roots
Definition core_c.h:1263
CvCmpFunc func
Definition core_c.h:1712
CvArr int order
Definition core_c.h:1311
CvMemStorage CvSeq ** labels
Definition core_c.h:1724
int CvScalar value
Definition core_c.h:720
const CvArr const CvArr const CvArr CvArr int flags
Definition core_c.h:1342
const CvArr const CvArr const CvArr * src3
Definition core_c.h:994
CvArr * dst
Definition core_c.h:875
CvArr * W
Definition core_c.h:1335
double const CvArr double beta
Definition core_c.h:1094
const int * idx
Definition core_c.h:668
const char const char const char int line
Definition core_c.h:2623
CvArr const CvMat * mat
Definition core_c.h:1308
CvMemStoragePos * pos
Definition core_c.h:1573
CvScalar scale
Definition core_c.h:1088
const CvArr const CvArr * src2
Definition core_c.h:994
int coi
Definition core_c.h:172
const CvArr * angle
Definition core_c.h:1194
const CvArr * src1
Definition core_c.h:993
int int type
Definition core_c.h:221
CvRNG * rng
Definition core_c.h:1250
int count
Definition core_c.h:1413
CvArr double power
Definition core_c.h:1199
CvArr const CvArr * mask
Definition core_c.h:589
CvArr const CvArr * lut
Definition core_c.h:1893
const char const char ** filename
Definition core_c.h:2630
void * data
Definition core_c.h:427
CvArr * mean
Definition core_c.h:1419
const CvArr CvArr * x
Definition core_c.h:1195
double const CvArr double double gamma
Definition core_c.h:1095
double alpha
Definition core_c.h:1093
const CvArr const CvArr CvArr * result
Definition core_c.h:1423
const CvArr CvArr * magnitude
Definition core_c.h:1188
const CvArr * y
Definition core_c.h:1187
KmeansFlags
k-Means flags
Definition core.hpp:209
CV_EXPORTS_W double kmeans(InputArray data, int K, InputOutputArray bestLabels, TermCriteria criteria, int attempts, int flags, OutputArray centers=noArray())
Finds centers of clusters and groups input samples around the clusters.
@ KMEANS_USE_INITIAL_LABELS
Definition core.hpp:218
@ KMEANS_PP_CENTERS
Definition core.hpp:213
@ KMEANS_RANDOM_CENTERS
Definition core.hpp:211
signed char schar
Definition interface.h:48
#define CV_64F
Definition interface.h:79
unsigned char uchar
Definition interface.h:51
unsigned short ushort
Definition interface.h:52
uint64_t uint64
Definition interface.h:62
#define CV_EXPORTS
Definition cvdef.h:435
#define CV_EXPORTS_AS(synonym)
Definition cvdef.h:474
#define CV_OVERRIDE
Definition cvdef.h:792
#define CV_OUT
Definition cvdef.h:478
#define CV_EXPORTS_W
Definition cvdef.h:472
#define CV_NORETURN
Definition cvdef.h:735
SortFlags
Definition core.hpp:153
#define CV_WRAP
Definition cvdef.h:481
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails.
Definition base.hpp:342
@ SORT_EVERY_COLUMN
Definition core.hpp:154
@ SORT_ASCENDING
Definition core.hpp:157
@ SORT_EVERY_ROW
each matrix row is sorted independently
Definition core.hpp:153
@ SORT_DESCENDING
Definition core.hpp:159
CovarFlags
Covariation flags.
Definition core.hpp:170
@ COVAR_USE_AVG
Definition core.hpp:189
@ COVAR_NORMAL
Definition core.hpp:183
@ COVAR_SCRAMBLED
Definition core.hpp:178
@ COVAR_COLS
Definition core.hpp:202
@ COVAR_SCALE
Definition core.hpp:194
@ COVAR_ROWS
Definition core.hpp:198
CvArr CvPoint2D32f double M
Definition imgproc_c.h:270
CvSize int int int CvPoint int delta
Definition imgproc_c.h:1168
CvArr * sum
Definition imgproc_c.h:61
int int int int shape
Definition imgproc_c.h:301
CvArr int code
Definition imgproc_c.h:203
CvPoint2D32f int CvSize CvSize CvTermCriteria criteria
Definition imgproc_c.h:900
"black box" representation of the file storage associated with a file on disk.
Definition calib3d.hpp:441
Ptr< Algorithm > member_type
Definition core.hpp:3357
const Ptr< Algorithm > & const_param_type
Definition core.hpp:3356
Mat member_type
Definition core.hpp:3341
const Mat & const_param_type
Definition core.hpp:3340
Scalar member_type
Definition core.hpp:3397
const Scalar & const_param_type
Definition core.hpp:3396
const String & const_param_type
Definition core.hpp:3332
String member_type
Definition core.hpp:3333
std::underlying_type< _Tp >::type const_param_type
Definition core.hpp:3405
std::underlying_type< _Tp >::type member_type
Definition core.hpp:3406
bool const_param_type
Definition core.hpp:3308
bool member_type
Definition core.hpp:3309
double member_type
Definition core.hpp:3325
double const_param_type
Definition core.hpp:3324
float const_param_type
Definition core.hpp:3364
float member_type
Definition core.hpp:3365
int member_type
Definition core.hpp:3317
int const_param_type
Definition core.hpp:3316
std::vector< Mat > member_type
Definition core.hpp:3349
const std::vector< Mat > & const_param_type
Definition core.hpp:3348
uchar member_type
Definition core.hpp:3389
uchar const_param_type
Definition core.hpp:3388
uint64 member_type
Definition core.hpp:3381
uint64 const_param_type
Definition core.hpp:3380
unsigned member_type
Definition core.hpp:3373
unsigned const_param_type
Definition core.hpp:3372
Definition core.hpp:3182
Definition cvstd_wrapper.hpp:74
void reset(const std::true_type &, Y *ptr)
Definition cvstd_wrapper.hpp:107
bool empty() const
Definition cvstd_wrapper.hpp:130