45#ifndef OPENCV_CORE_HPP
46#define OPENCV_CORE_HPP
49# error core.hpp header must be compiled as C++
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"
129 Exception(
int _code,
const String& _err,
const String& _func,
const String& _file,
int _line);
135 virtual const
char *what() const throw() CV_OVERRIDE;
136 void formatMessage();
321 int top,
int bottom,
int left,
int right,
361 InputArray mask = noArray(),
int dtype = -1);
401 InputArray mask = noArray(),
int dtype = -1);
425CV_EXPORTS_W
void multiply(InputArray src1, InputArray src2,
426 OutputArray dst,
double scale = 1,
int dtype = -1);
454 double scale = 1,
int dtype = -1);
457CV_EXPORTS_W
void divide(
double scale, InputArray src2,
506CV_EXPORTS_W
void addWeighted(InputArray src1,
double alpha, InputArray src2,
507 double beta,
double gamma,
OutputArray dst,
int dtype = -1);
535 double alpha = 1,
double beta = 0);
622CV_EXPORTS_W
Scalar mean(InputArray src, InputArray mask = noArray());
645 InputArray mask=noArray());
683CV_EXPORTS_W
double norm(InputArray src1,
int normType =
NORM_L2, InputArray mask = noArray());
696CV_EXPORTS_W
double norm(InputArray src1, InputArray src2,
697 int normType =
NORM_L2, InputArray mask = noArray());
723CV_EXPORTS_W
double PSNR(InputArray src1, InputArray src2,
double R=255.);
732 int normType =
NORM_L2,
int K = 0,
733 InputArray mask = noArray(),
int update = 0,
734 bool crosscheck =
false);
795 int norm_type =
NORM_L2,
int dtype = -1, InputArray mask = noArray());
824CV_EXPORTS_W
void minMaxLoc(InputArray src, CV_OUT
double* minVal,
825 CV_OUT
double* maxVal = 0, CV_OUT
Point* minLoc = 0,
826 CV_OUT
Point* maxLoc = 0, InputArray mask = noArray());
852CV_EXPORTS
void minMaxIdx(InputArray src,
double* minVal,
double* maxVal = 0,
853 int* minIdx = 0,
int* maxIdx = 0, InputArray mask = noArray());
865 double* maxVal,
int* minIdx = 0,
int* maxIdx = 0);
987 const int* fromTo,
size_t npairs);
1004 const int* fromTo,
size_t npairs);
1020 const std::vector<int>& fromTo);
1339 InputArray mask = noArray());
1396CV_EXPORTS_W
void inRange(InputArray src, InputArray lowerb,
1577 bool angleInDegrees =
false);
1596 bool angleInDegrees =
false);
1627 double minVal = -DBL_MAX,
double maxVal = DBL_MAX);
1663CV_EXPORTS_W
void gemm(InputArray src1, InputArray src2,
double alpha,
1664 InputArray src3,
double beta,
OutputArray dst,
int flags = 0);
1695 InputArray delta = noArray(),
1696 double scale = 1,
int dtype = -1 );
1868CV_EXPORTS_W
bool solve(InputArray src1, InputArray src2,
1984 int flags,
int ctype = CV_64F);
2004 int maxComponents = 0);
2008 OutputArray eigenvectors,
double retainedVariance);
2013 double retainedVariance);
2027CV_EXPORTS_W
void SVBackSubst( InputArray w, InputArray u, InputArray vt,
2040CV_EXPORTS_W
double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar);
2174CV_EXPORTS_W
void dft(InputArray src,
OutputArray dst,
int flags = 0,
int nonzeroRows = 0);
2188CV_EXPORTS_W
void idft(InputArray src,
OutputArray dst,
int flags = 0,
int nonzeroRows = 0);
2259 int flags,
bool conjB =
false);
2430 PCA(InputArray data, InputArray mean,
int flags,
int maxComponents = 0);
2442 PCA(InputArray data, InputArray mean,
int flags,
double retainedVariance);
2464 PCA&
operator()(InputArray data, InputArray mean,
int flags,
int maxComponents = 0);
2477 PCA&
operator()(InputArray data, InputArray mean,
int flags,
double retainedVariance);
2568 explicit LDA(
int num_components = 0);
2575 LDA(InputArrayOfArrays src, InputArray labels,
int num_components = 0);
2579 void save(
const String& filename)
const;
2599 void compute(InputArrayOfArrays src, InputArray labels);
2619 static Mat subspaceProject(InputArray W, InputArray mean, InputArray src);
2620 static Mat subspaceReconstruct(InputArray W, InputArray mean, InputArray src);
2623 int _num_components;
2626 void lda(InputArrayOfArrays src, InputArray labels);
2670 SVD( InputArray src,
int flags = 0 );
2683 SVD& operator ()( InputArray src,
int flags = 0 );
2716 InputArray vt, InputArray rhs,
2756 template<
typename _Tp,
int m,
int n,
int nm>
static
2757 void compute(
const Matx<_Tp, m, n>& a,
Matx<_Tp, nm, 1>& w,
Matx<_Tp, m, nm>& u,
Matx<_Tp, n, nm>& vt );
2760 template<
typename _Tp,
int m,
int n,
int nm>
static
2764 template<
typename _Tp,
int m,
int n,
int nm,
int nb>
static
2765 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 );
2820 operator unsigned();
2835 unsigned operator ()();
2839 unsigned operator ()(
unsigned N);
2931 bool operator ==(
const RNG& other)
const;
2944 void seed(
unsigned s);
2949 operator unsigned();
2953 unsigned operator ()(
unsigned N);
2954 unsigned operator ()();
2964 enum PeriodParameters {N = 624, M = 397};
3026 virtual const char* next() = 0;
3027 virtual void reset() = 0;
3048 virtual void set16fPrecision(
int p = 4) = 0;
3049 virtual void set32fPrecision(
int p = 8) = 0;
3050 virtual void set64fPrecision(
int p = 16) = 0;
3051 virtual void setMultiline(
bool ml =
true) = 0;
3053 static Ptr<Formatter> get(Formatter::FormatType fmt = FMT_DEFAULT);
3061 for(
const char* str = fmtd->next(); str; str = fmtd->next())
3062 out += cv::String(str);
3067String& operator << (String& out,
const Mat& mtx)
3069 return out << Formatter::get()->format(mtx);
3074class CV_EXPORTS Algorithm;
3076template<
typename _Tp,
typename _EnumTp =
void>
struct ParamType {};
3098 CV_WRAP
virtual void clear() {}
3111 CV_WRAP
virtual void read(
const FileNode& fn) { CV_UNUSED(fn); }
3115 CV_WRAP
virtual bool empty()
const {
return false; }
3132 return !obj->empty() ? obj :
Ptr<_Tp>();
3147 template<
typename _Tp>
static Ptr<_Tp> load(
const String& filename,
const String& objname=String())
3155 return !obj->empty() ? obj :
Ptr<_Tp>();
3174 return !obj->empty() ? obj :
Ptr<_Tp>();
3179 CV_WRAP
virtual void save(
const String& filename)
const;
3183 CV_WRAP
virtual String getDefaultName()
const;
3190 INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7,
3191 UNSIGNED_INT=8, UINT64=9, UCHAR=11, SCALAR=12
3198 typedef bool const_param_type;
3199 typedef bool member_type;
3201 static const Param type = Param::BOOLEAN;
3206 typedef int const_param_type;
3207 typedef int member_type;
3209 static const Param type = Param::INT;
3214 typedef double const_param_type;
3215 typedef double member_type;
3217 static const Param type = Param::REAL;
3222 typedef const String& const_param_type;
3223 typedef String member_type;
3225 static const Param type = Param::STRING;
3233 static const Param type = Param::MAT;
3238 typedef const std::vector<Mat>& const_param_type;
3239 typedef std::vector<Mat> member_type;
3241 static const Param type = Param::MAT_VECTOR;
3249 static const Param type = Param::ALGORITHM;
3254 typedef float const_param_type;
3255 typedef float member_type;
3257 static const Param type = Param::FLOAT;
3262 typedef unsigned const_param_type;
3263 typedef unsigned member_type;
3265 static const Param type = Param::UNSIGNED_INT;
3270 typedef uint64 const_param_type;
3271 typedef uint64 member_type;
3273 static const Param type = Param::UINT64;
3278 typedef uchar const_param_type;
3279 typedef uchar member_type;
3281 static const Param type = Param::UCHAR;
3289 static const Param type = Param::SCALAR;
3292template<
typename _Tp>
3293struct ParamType<_Tp, typename std::enable_if< std::is_enum<_Tp>::value >::type>
3295 typedef typename std::underlying_type<_Tp>::type const_param_type;
3296 typedef typename std::underlying_type<_Tp>::type member_type;
3298 static const Param type = Param::INT;
3305#include "opencv2/core/operations.hpp"
3306#include "opencv2/core/cvstd.inl.hpp"
3307#include "opencv2/core/utility.hpp"
3308#include "opencv2/core/optim.hpp"
3309#include "opencv2/core/ovx.hpp"
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
virtual void write(FileStorage &fs) const
Stores algorithm parameters in a file storage
Definition: core.hpp:3102
static Ptr< _Tp > load(const String &filename, const String &objname=String())
Loads algorithm from the file
Definition: core.hpp:3147
static Ptr< _Tp > read(const FileNode &fn)
Reads algorithm from the file node
Definition: core.hpp:3128
static Ptr< _Tp > loadFromString(const String &strModel, const String &objname=String())
Loads algorithm from a String
Definition: core.hpp:3168
Class passed to an error.
Definition: core.hpp:119
Exception(int _code, const String &_err, const String &_func, const String &_file, int _line)
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.
@ READ
value, open the file for reading
Definition: persistence.hpp:309
@ MEMORY
returned by FileStorage::release)
Definition: persistence.hpp:312
virtual CV_WRAP bool isOpened() const
Checks whether the file is opened.
Linear Discriminant Analysis
Definition: core.hpp:2563
Mat eigenvalues() const
Definition: core.hpp:2617
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)
LDA(int num_components=0)
constructor Initializes a LDA with num_components (default 0).
Mat eigenvectors() const
Definition: core.hpp:2613
void load(const String &filename)
Mat project(InputArray src)
void load(const FileStorage &node)
n-dimensional dense array class
Definition: mat.hpp:802
Template class for small matrices whose type and size are known at compilation time
Definition: matx.hpp:100
Principal Component Analysis
Definition: core.hpp:2407
void project(InputArray vec, OutputArray result) const
Mat mean
mean value subtracted before the projection and added after the back projection
Definition: core.hpp:2547
Mat eigenvalues
eigenvalues of the covariation matrix
Definition: core.hpp:2546
void backProject(InputArray vec, OutputArray result) const
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:2545
void read(const FileNode &fn)
load PCA objects
Flags
Definition: core.hpp:2409
PCA(InputArray data, InputArray mean, int flags, double retainedVariance)
Mersenne Twister random number generator
Definition: core.hpp:2940
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,...
Random Number Generator
Definition: core.hpp:2783
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
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.
Singular Value Decomposition
Definition: core.hpp:2644
SVD()
the default constructor
Flags
Definition: core.hpp:2646
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
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:2704
The class defining termination criteria for iterative algorithms.
Definition: core/types.hpp:853
CV_EXPORTS_AS(calibrateCameraExtended) double calibrateCamera(InputArrayOfArrays objectPoints
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
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:230
CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar)
Calculates the Mahalanobis distance between two vectors.
CV_EXPORTS_W void transform(InputArray src, OutputArray dst, InputArray m)
Performs the matrix transformation of every array element.
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 void max(InputArray src1, InputArray src2, OutputArray dst)
Calculates per-element maximum of two arrays or an array and a scalar.
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 sqrt(InputArray src, OutputArray dst)
Calculates a square root of array elements.
CV_EXPORTS void merge(const Mat *mv, size_t count, OutputArray dst)
Creates one multi-channel array out of several single-channel ones.
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 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 exp(InputArray src, OutputArray dst)
Calculates the exponent of every array element.
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 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:1072
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 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 rotate(InputArray src, OutputArray dst, int rotateCode)
Rotates a 2D array in multiples of 90 degrees. The function cv::rotate rotates the array in one of th...
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 magnitude(InputArray x, InputArray y, OutputArray magnitude)
Calculates the magnitude of 2D vectors.
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 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 void pow(InputArray src, double power, OutputArray dst)
Raises every array element to a power.
CV_EXPORTS_W Scalar trace(InputArray mtx)
Returns the trace of a matrix.
CV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags)
Sorts each row or each column of a matrix.
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 min(InputArray src1, InputArray src2, OutputArray dst)
Calculates per-element minimum of two arrays or an array and a scalar.
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 log(InputArray src, OutputArray dst)
Calculates the natural logarithm of every array element.
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)
converts NaNs to the 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:230
@ REDUCE_MIN
the output is the minimum (column/row-wise) of all rows/columns of the matrix.
Definition: core.hpp:233
@ REDUCE_AVG
the output is the mean vector of all rows/columns of the matrix.
Definition: core.hpp:231
@ REDUCE_MAX
the output is the maximum (column/row-wise) of all rows/columns of the matrix.
Definition: core.hpp:232
@ ROTATE_90_CLOCKWISE
Rotate 90 degrees clockwise
Definition: core.hpp:1073
@ ROTATE_90_COUNTERCLOCKWISE
Rotate 270 degrees clockwise
Definition: core.hpp:1075
@ ROTATE_180
Rotate 180 degrees clockwise
Definition: core.hpp:1074
@ DECOMP_LU
Definition: base.hpp:135
@ NORM_L2
Definition: base.hpp:185
KmeansFlags
k-Means flags
Definition: core.hpp:213
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:222
@ KMEANS_PP_CENTERS
Definition: core.hpp:217
@ KMEANS_RANDOM_CENTERS
Definition: core.hpp:215
SortFlags
Definition: core.hpp:157
CV_EXPORTS CV_NORETURN void error(const Exception &exc)
Signals an error and raises the exception.
#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:158
@ SORT_ASCENDING
Definition: core.hpp:161
@ SORT_EVERY_ROW
each matrix row is sorted independently
Definition: core.hpp:157
@ SORT_DESCENDING
Definition: core.hpp:163
CovarFlags
Covariation flags
Definition: core.hpp:174
CV_EXPORTS void swap(Mat &a, Mat &b)
Swaps two matrices
@ COVAR_USE_AVG
Definition: core.hpp:193
@ COVAR_NORMAL
Definition: core.hpp:187
@ COVAR_SCRAMBLED
Definition: core.hpp:182
@ COVAR_COLS
Definition: core.hpp:206
@ COVAR_SCALE
Definition: core.hpp:198
@ COVAR_ROWS
Definition: core.hpp:202
CV_EXPORTS_W void line(InputOutputArray img, Point pt1, Point pt2, const Scalar &color, int thickness=1, int lineType=LINE_8, int shift=0)
Draws a line segment connecting two points.
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
DualQuat< T > power(const DualQuat< T > &dq, const T t, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)
Definition: dualquaternion.inl.hpp:358
Definition: core.hpp:3076
Definition: cvstd_wrapper.hpp:74