OpenCV  3.4.20
Open Source Computer Vision
Classes | Namespaces | Enumerations | Functions
core.hpp File Reference
#include "opencv2/core/cvdef.h"
#include "opencv2/core/base.hpp"
#include "opencv2/core/cvstd.hpp"
#include "opencv2/core/traits.hpp"
#include "opencv2/core/matx.hpp"
#include "opencv2/core/types.hpp"
#include "opencv2/core/mat.hpp"
#include "opencv2/core/persistence.hpp"
#include "opencv2/core/operations.hpp"
#include "opencv2/core/cvstd.inl.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/optim.hpp"
#include "opencv2/core/ovx.hpp"

Classes

class  cv::Algorithm
 This is a base class for all more or less complex algorithms in OpenCV. More...
 
class  cv::Exception
 Class passed to an error. More...
 
class  cv::Formatted
 
class  cv::Formatter
 
class  cv::LDA
 Linear Discriminant Analysis. More...
 
struct  cv::Param
 
struct  cv::ParamType< _Tp >
 
struct  cv::ParamType< Algorithm >
 
struct  cv::ParamType< bool >
 
struct  cv::ParamType< double >
 
struct  cv::ParamType< float >
 
struct  cv::ParamType< Mat >
 
struct  cv::ParamType< Scalar >
 
struct  cv::ParamType< std::vector< Mat > >
 
struct  cv::ParamType< String >
 
struct  cv::ParamType< uchar >
 
struct  cv::ParamType< uint64 >
 
struct  cv::ParamType< unsigned >
 
class  cv::PCA
 Principal Component Analysis. More...
 
class  cv::RNG
 Random Number Generator. More...
 
class  cv::RNG_MT19937
 Mersenne Twister random number generator. More...
 
class  cv::SVD
 Singular Value Decomposition. More...
 

Namespaces

 cv
 

Enumerations

enum  cv::CovarFlags {
  cv::COVAR_SCRAMBLED = 0,
  cv::COVAR_NORMAL = 1,
  cv::COVAR_USE_AVG = 2,
  cv::COVAR_SCALE = 4,
  cv::COVAR_ROWS = 8,
  cv::COVAR_COLS = 16
}
 Covariation flags. More...
 
enum  cv::HersheyFonts {
  cv::FONT_HERSHEY_SIMPLEX = 0,
  cv::FONT_HERSHEY_PLAIN = 1,
  cv::FONT_HERSHEY_DUPLEX = 2,
  cv::FONT_HERSHEY_COMPLEX = 3,
  cv::FONT_HERSHEY_TRIPLEX = 4,
  cv::FONT_HERSHEY_COMPLEX_SMALL = 5,
  cv::FONT_HERSHEY_SCRIPT_SIMPLEX = 6,
  cv::FONT_HERSHEY_SCRIPT_COMPLEX = 7,
  cv::FONT_ITALIC = 16
}
 Only a subset of Hershey fonts https://en.wikipedia.org/wiki/Hershey_fonts are supported. More...
 
enum  cv::KmeansFlags {
  cv::KMEANS_RANDOM_CENTERS = 0,
  cv::KMEANS_PP_CENTERS = 2,
  cv::KMEANS_USE_INITIAL_LABELS = 1
}
 k-Means flags More...
 
enum  cv::LineTypes {
  cv::FILLED = -1,
  cv::LINE_4 = 4,
  cv::LINE_8 = 8,
  cv::LINE_AA = 16
}
 type of line More...
 
enum  cv::ReduceTypes {
  cv::REDUCE_SUM = 0,
  cv::REDUCE_AVG = 1,
  cv::REDUCE_MAX = 2,
  cv::REDUCE_MIN = 3
}
 
enum  cv::RotateFlags {
  cv::ROTATE_90_CLOCKWISE = 0,
  cv::ROTATE_180 = 1,
  cv::ROTATE_90_COUNTERCLOCKWISE = 2
}
 
enum  cv::SortFlags {
  cv::SORT_EVERY_ROW = 0,
  cv::SORT_EVERY_COLUMN = 1,
  cv::SORT_ASCENDING = 0,
  cv::SORT_DESCENDING = 16
}
 

Functions

void cv::absdiff (InputArray src1, InputArray src2, OutputArray dst)
 Calculates the per-element absolute difference between two arrays or between an array and a scalar. More...
 
void cv::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. More...
 
void cv::addWeighted (InputArray src1, double alpha, InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1)
 Calculates the weighted sum of two arrays. More...
 
void cv::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 More...
 
void cv::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-wise conjunction of two arrays or an array and a scalar. More...
 
void cv::bitwise_not (InputArray src, OutputArray dst, InputArray mask=noArray())
 Inverts every bit of an array. More...
 
void cv::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. More...
 
void cv::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. More...
 
int cv::borderInterpolate (int p, int len, int borderType)
 Computes the source location of an extrapolated pixel. More...
 
void cv::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. More...
 
void cv::calcCovarMatrix (InputArray samples, OutputArray covar, InputOutputArray mean, int flags, int ctype=CV_64F)
 
void cv::cartToPolar (InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees=false)
 Calculates the magnitude and angle of 2D vectors. More...
 
bool cv::checkRange (InputArray a, bool quiet=true, Point *pos=0, double minVal=-DBL_MAX, double maxVal=DBL_MAX)
 Checks every element of an input array for invalid values. More...
 
void cv::compare (InputArray src1, InputArray src2, OutputArray dst, int cmpop)
 Performs the per-element comparison of two arrays or an array and scalar value. More...
 
void cv::completeSymm (InputOutputArray m, bool lowerToUpper=false)
 Copies the lower or the upper half of a square matrix to its another half. More...
 
void cv::convertFp16 (InputArray src, OutputArray dst)
 Converts an array to half precision floating number. More...
 
void cv::convertScaleAbs (InputArray src, OutputArray dst, double alpha=1, double beta=0)
 Scales, calculates absolute values, and converts the result to 8-bit. More...
 
void cv::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. More...
 
int cv::countNonZero (InputArray src)
 Counts non-zero array elements. More...
 
void cv::dct (InputArray src, OutputArray dst, int flags=0)
 Performs a forward or inverse discrete Cosine transform of 1D or 2D array. More...
 
double cv::determinant (InputArray mtx)
 Returns the determinant of a square floating-point matrix. More...
 
void cv::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. More...
 
void cv::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. More...
 
void cv::divide (double scale, InputArray src2, OutputArray dst, int dtype=-1)
 
bool cv::eigen (InputArray src, OutputArray eigenvalues, OutputArray eigenvectors=noArray())
 Calculates eigenvalues and eigenvectors of a symmetric matrix. More...
 
void cv::eigenNonSymmetric (InputArray src, OutputArray eigenvalues, OutputArray eigenvectors)
 Calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only). More...
 
void cv::error (const Exception &exc)
 Signals an error and raises the exception. More...
 
void cv::exp (InputArray src, OutputArray dst)
 Calculates the exponent of every array element. More...
 
void cv::extractChannel (InputArray src, OutputArray dst, int coi)
 Extracts a single channel from src (coi is 0-based index) More...
 
void cv::findNonZero (InputArray src, OutputArray idx)
 Returns the list of locations of non-zero pixels. More...
 
void cv::flip (InputArray src, OutputArray dst, int flipCode)
 Flips a 2D array around vertical, horizontal, or both axes. More...
 
void cv::gemm (InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags=0)
 Performs generalized matrix multiplication. More...
 
int cv::getOptimalDFTSize (int vecsize)
 Returns the optimal DFT size for a given vector size. More...
 
void cv::hconcat (const Mat *src, size_t nsrc, OutputArray dst)
 Applies horizontal concatenation to given matrices. More...
 
void cv::hconcat (InputArray src1, InputArray src2, OutputArray dst)
 
void cv::hconcat (InputArrayOfArrays src, OutputArray dst)
 
void cv::idct (InputArray src, OutputArray dst, int flags=0)
 Calculates the inverse Discrete Cosine Transform of a 1D or 2D array. More...
 
void cv::idft (InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0)
 Calculates the inverse Discrete Fourier Transform of a 1D or 2D array. More...
 
void cv::inRange (InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst)
 Checks if array elements lie between the elements of two other arrays. More...
 
void cv::insertChannel (InputArray src, InputOutputArray dst, int coi)
 Inserts a single channel to dst (coi is 0-based index) More...
 
double cv::invert (InputArray src, OutputArray dst, int flags=DECOMP_LU)
 Finds the inverse or pseudo-inverse of a matrix. More...
 
double cv::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. More...
 
void cv::log (InputArray src, OutputArray dst)
 Calculates the natural logarithm of every array element. More...
 
void cv::LUT (InputArray src, InputArray lut, OutputArray dst)
 Performs a look-up table transform of an array. More...
 
void cv::magnitude (InputArray x, InputArray y, OutputArray magnitude)
 Calculates the magnitude of 2D vectors. More...
 
double cv::Mahalanobis (InputArray v1, InputArray v2, InputArray icovar)
 Calculates the Mahalanobis distance between two vectors. More...
 
void cv::max (InputArray src1, InputArray src2, OutputArray dst)
 Calculates per-element maximum of two arrays or an array and a scalar. More...
 
void cv::max (const Mat &src1, const Mat &src2, Mat &dst)
 
void cv::max (const UMat &src1, const UMat &src2, UMat &dst)
 
Scalar cv::mean (InputArray src, InputArray mask=noArray())
 Calculates an average (mean) of array elements. More...
 
void cv::meanStdDev (InputArray src, OutputArray mean, OutputArray stddev, InputArray mask=noArray())
 
void cv::merge (const Mat *mv, size_t count, OutputArray dst)
 Creates one multi-channel array out of several single-channel ones. More...
 
void cv::merge (InputArrayOfArrays mv, OutputArray dst)
 
void cv::min (InputArray src1, InputArray src2, OutputArray dst)
 Calculates per-element minimum of two arrays or an array and a scalar. More...
 
void cv::min (const Mat &src1, const Mat &src2, Mat &dst)
 
void cv::min (const UMat &src1, const UMat &src2, UMat &dst)
 
void cv::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. More...
 
void cv::minMaxLoc (InputArray src, double *minVal, double *maxVal=0, Point *minLoc=0, Point *maxLoc=0, InputArray mask=noArray())
 Finds the global minimum and maximum in an array. More...
 
void cv::minMaxLoc (const SparseMat &a, double *minVal, double *maxVal, int *minIdx=0, int *maxIdx=0)
 
void cv::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. More...
 
void cv::mixChannels (InputArrayOfArrays src, InputOutputArrayOfArrays dst, const int *fromTo, size_t npairs)
 
void cv::mixChannels (InputArrayOfArrays src, InputOutputArrayOfArrays dst, const std::vector< int > &fromTo)
 
void cv::mulSpectrums (InputArray a, InputArray b, OutputArray c, int flags, bool conjB=false)
 Performs the per-element multiplication of two Fourier spectrums. More...
 
void cv::multiply (InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
 Calculates the per-element scaled product of two arrays. More...
 
void cv::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. More...
 
double cv::norm (InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
 Calculates the absolute norm of an array. More...
 
double cv::norm (InputArray src1, InputArray src2, int normType=NORM_L2, InputArray mask=noArray())
 Calculates an absolute difference norm or a relative difference norm. More...
 
double cv::norm (const SparseMat &src, int normType)
 
void cv::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. More...
 
void cv::normalize (const SparseMat &src, SparseMat &dst, double alpha, int normType)
 
static String & cv::operator<< (String &out, Ptr< Formatted > fmtd)
 
static String & cv::operator<< (String &out, const Mat &mtx)
 
void cv::patchNaNs (InputOutputArray a, double val=0)
 converts NaNs to the given number More...
 
void cv::PCABackProject (InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, int maxComponents=0)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, OutputArray eigenvalues, int maxComponents=0)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, double retainedVariance)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, OutputArray eigenvalues, double retainedVariance)
 
void cv::PCAProject (InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
 
void cv::perspectiveTransform (InputArray src, OutputArray dst, InputArray m)
 Performs the perspective matrix transformation of vectors. More...
 
void cv::phase (InputArray x, InputArray y, OutputArray angle, bool angleInDegrees=false)
 Calculates the rotation angle of 2D vectors. More...
 
void cv::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. More...
 
void cv::pow (InputArray src, double power, OutputArray dst)
 Raises every array element to a power. More...
 
double cv::PSNR (InputArray src1, InputArray src2)
 Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric. More...
 
void cv::randn (InputOutputArray dst, InputArray mean, InputArray stddev)
 Fills the array with normally distributed random numbers. More...
 
void cv::randShuffle (InputOutputArray dst, double iterFactor=1., RNG *rng=0)
 Shuffles the array elements randomly. More...
 
void cv::randu (InputOutputArray dst, InputArray low, InputArray high)
 Generates a single uniformly-distributed random number or an array of random numbers. More...
 
void cv::reduce (InputArray src, OutputArray dst, int dim, int rtype, int dtype=-1)
 Reduces a matrix to a vector. More...
 
void cv::repeat (InputArray src, int ny, int nx, OutputArray dst)
 Fills the output array with repeated copies of the input array. More...
 
Mat cv::repeat (const Mat &src, int ny, int nx)
 
void cv::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 three different ways: Rotate by 90 degrees clockwise (rotateCode = ROTATE_90_CLOCKWISE). Rotate by 180 degrees clockwise (rotateCode = ROTATE_180). Rotate by 270 degrees clockwise (rotateCode = ROTATE_90_COUNTERCLOCKWISE). More...
 
void cv::scaleAdd (InputArray src1, double alpha, InputArray src2, OutputArray dst)
 Calculates the sum of a scaled array and another array. More...
 
void cv::setIdentity (InputOutputArray mtx, const Scalar &s=Scalar(1))
 Initializes a scaled identity matrix. More...
 
void cv::setRNGSeed (int seed)
 Sets state of default random number generator. More...
 
bool cv::solve (InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
 Solves one or more linear systems or least-squares problems. More...
 
int cv::solveCubic (InputArray coeffs, OutputArray roots)
 Finds the real roots of a cubic equation. More...
 
double cv::solvePoly (InputArray coeffs, OutputArray roots, int maxIters=300)
 Finds the real or complex roots of a polynomial equation. More...
 
void cv::sort (InputArray src, OutputArray dst, int flags)
 Sorts each row or each column of a matrix. More...
 
void cv::sortIdx (InputArray src, OutputArray dst, int flags)
 Sorts each row or each column of a matrix. More...
 
void cv::split (const Mat &src, Mat *mvbegin)
 Divides a multi-channel array into several single-channel arrays. More...
 
void cv::split (InputArray m, OutputArrayOfArrays mv)
 
void cv::sqrt (InputArray src, OutputArray dst)
 Calculates a square root of array elements. More...
 
void cv::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. More...
 
Scalar cv::sum (InputArray src)
 Calculates the sum of array elements. More...
 
void cv::SVBackSubst (InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst)
 
void cv::SVDecomp (InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags=0)
 
void cv::swap (Mat &a, Mat &b)
 Swaps two matrices. More...
 
void cv::swap (UMat &a, UMat &b)
 
RNG & cv::theRNG ()
 Returns the default random number generator. More...
 
Scalar cv::trace (InputArray mtx)
 Returns the trace of a matrix. More...
 
void cv::transform (InputArray src, OutputArray dst, InputArray m)
 Performs the matrix transformation of every array element. More...
 
void cv::transpose (InputArray src, OutputArray dst)
 Transposes a matrix. More...
 
void cv::vconcat (const Mat *src, size_t nsrc, OutputArray dst)
 Applies vertical concatenation to given matrices. More...
 
void cv::vconcat (InputArray src1, InputArray src2, OutputArray dst)
 
void cv::vconcat (InputArrayOfArrays src, OutputArray dst)