OpenCV 4.10.0-dev
Open Source Computer Vision
Loading...
Searching...
No Matches
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"
Include dependency graph for core.hpp:
This graph shows which files directly or indirectly include this file:

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::ParamType< _Tp, _EnumTp >
 
struct  cv::ParamType< _Tp, typename std::enable_if< std::is_enum< _Tp >::value >::type >
 
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

namespace  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::KmeansFlags {
  cv::KMEANS_RANDOM_CENTERS = 0 ,
  cv::KMEANS_PP_CENTERS = 2 ,
  cv::KMEANS_USE_INITIAL_LABELS = 1
}
 k-means flags More...
 
enum struct  cv::Param {
  cv::Param::INT =0 ,
  cv::Param::BOOLEAN =1 ,
  cv::Param::REAL =2 ,
  cv::Param::STRING =3 ,
  cv::Param::MAT =4 ,
  cv::Param::MAT_VECTOR =5 ,
  cv::Param::ALGORITHM =6 ,
  cv::Param::FLOAT =7 ,
  cv::Param::UNSIGNED_INT =8 ,
  cv::Param::UINT64 =9 ,
  cv::Param::UCHAR =11 ,
  cv::Param::SCALAR =12
}
 
enum  cv::ReduceTypes {
  cv::REDUCE_SUM = 0 ,
  cv::REDUCE_AVG = 1 ,
  cv::REDUCE_MAX = 2 ,
  cv::REDUCE_MIN = 3 ,
  cv::REDUCE_SUM2 = 4
}
 
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.
 
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.
 
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.
 
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
 
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.
 
void cv::bitwise_not (InputArray src, OutputArray dst, InputArray mask=noArray())
 Inverts every bit of an array.
 
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.
 
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.
 
int cv::borderInterpolate (int p, int len, int borderType)
 Computes the source location of an extrapolated pixel.
 
void cv::broadcast (InputArray src, InputArray shape, OutputArray dst)
 Broadcast the given Mat to the given shape.
 
void cv::calcCovarMatrix (const Mat *samples, int nsamples, Mat &covar, Mat &mean, int flags, int ctype=6)
 Calculates the covariance matrix of a set of vectors.
 
void cv::calcCovarMatrix (InputArray samples, OutputArray covar, InputOutputArray mean, int flags, int ctype=6)
 
void cv::cartToPolar (InputArray x, InputArray y, OutputArray magnitude, OutputArray angle, bool angleInDegrees=false)
 Calculates the magnitude and angle of 2D vectors.
 
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.
 
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.
 
void cv::completeSymm (InputOutputArray m, bool lowerToUpper=false)
 Copies the lower or the upper half of a square matrix to its another half.
 
void cv::convertFp16 (InputArray src, OutputArray dst)
 Converts an array to half precision floating number.
 
void cv::convertScaleAbs (InputArray src, OutputArray dst, double alpha=1, double beta=0)
 Scales, calculates absolute values, and converts the result to 8-bit.
 
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.
 
void cv::copyTo (InputArray src, OutputArray dst, InputArray mask)
 This is an overloaded member function, provided for convenience (python) Copies the matrix to another one. When the operation mask is specified, if the Mat::create call shown above reallocates the matrix, the newly allocated matrix is initialized with all zeros before copying the data.
 
int cv::countNonZero (InputArray src)
 Counts non-zero array elements.
 
void cv::dct (InputArray src, OutputArray dst, int flags=0)
 Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
 
double cv::determinant (InputArray mtx)
 Returns the determinant of a square floating-point matrix.
 
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.
 
void cv::divide (double scale, InputArray src2, OutputArray dst, int dtype=-1)
 
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.
 
bool cv::eigen (InputArray src, OutputArray eigenvalues, OutputArray eigenvectors=noArray())
 Calculates eigenvalues and eigenvectors of a symmetric matrix.
 
void cv::eigenNonSymmetric (InputArray src, OutputArray eigenvalues, OutputArray eigenvectors)
 Calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).
 
void cv::error (const Exception &exc)
 Signals an error and raises the exception.
 
void cv::exp (InputArray src, OutputArray dst)
 Calculates the exponent of every array element.
 
void cv::extractChannel (InputArray src, OutputArray dst, int coi)
 Extracts a single channel from src (coi is 0-based index)
 
void cv::findNonZero (InputArray src, OutputArray idx)
 Returns the list of locations of non-zero pixels.
 
void cv::flip (InputArray src, OutputArray dst, int flipCode)
 Flips a 2D array around vertical, horizontal, or both axes.
 
void cv::flipND (InputArray src, OutputArray dst, int axis)
 Flips a n-dimensional at given axis.
 
void cv::gemm (InputArray src1, InputArray src2, double alpha, InputArray src3, double beta, OutputArray dst, int flags=0)
 Performs generalized matrix multiplication.
 
int cv::getOptimalDFTSize (int vecsize)
 Returns the optimal DFT size for a given vector size.
 
bool cv::hasNonZero (InputArray src)
 Checks for the presence of at least one non-zero array element.
 
void cv::hconcat (const Mat *src, size_t nsrc, OutputArray dst)
 Applies horizontal concatenation to given matrices.
 
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.
 
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.
 
void cv::inRange (InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst)
 Checks if array elements lie between the elements of two other arrays.
 
void cv::insertChannel (InputArray src, InputOutputArray dst, int coi)
 Inserts a single channel to dst (coi is 0-based index)
 
double cv::invert (InputArray src, OutputArray dst, int flags=DECOMP_LU)
 Finds the inverse or pseudo-inverse of a matrix.
 
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.
 
void cv::log (InputArray src, OutputArray dst)
 Calculates the natural logarithm of every array element.
 
void cv::LUT (InputArray src, InputArray lut, OutputArray dst)
 Performs a look-up table transform of an array.
 
void cv::magnitude (InputArray x, InputArray y, OutputArray magnitude)
 Calculates the magnitude of 2D vectors.
 
double cv::Mahalanobis (InputArray v1, InputArray v2, InputArray icovar)
 Calculates the Mahalanobis distance between two vectors.
 
void cv::max (const Mat &src1, const Mat &src2, Mat &dst)
 
void cv::max (const UMat &src1, const UMat &src2, UMat &dst)
 
void cv::max (InputArray src1, InputArray src2, OutputArray dst)
 Calculates per-element maximum of two arrays or an array and a scalar.
 
Scalar cv::mean (InputArray src, InputArray mask=noArray())
 Calculates an average (mean) of array elements.
 
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.
 
void cv::merge (InputArrayOfArrays mv, OutputArray dst)
 
void cv::min (const Mat &src1, const Mat &src2, Mat &dst)
 
void cv::min (const UMat &src1, const UMat &src2, UMat &dst)
 
void cv::min (InputArray src1, InputArray src2, OutputArray dst)
 Calculates per-element minimum of two arrays or an array and a scalar.
 
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.
 
void cv::minMaxLoc (const SparseMat &a, double *minVal, double *maxVal, int *minIdx=0, int *maxIdx=0)
 
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.
 
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.
 
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.
 
void cv::multiply (InputArray src1, InputArray src2, OutputArray dst, double scale=1, int dtype=-1)
 Calculates the per-element scaled product of two arrays.
 
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.
 
double cv::norm (const SparseMat &src, int normType)
 
double cv::norm (InputArray src1, InputArray src2, int normType=NORM_L2, InputArray mask=noArray())
 Calculates an absolute difference norm or a relative difference norm.
 
double cv::norm (InputArray src1, int normType=NORM_L2, InputArray mask=noArray())
 Calculates the absolute norm of an array.
 
void cv::normalize (const SparseMat &src, SparseMat &dst, double alpha, 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.
 
static Stringcv::operator<< (String &out, const Mat &mtx)
 
static Stringcv::operator<< (String &out, Ptr< Formatted > fmtd)
 
void cv::patchNaNs (InputOutputArray a, double val=0)
 Replaces NaNs by given number.
 
void cv::PCABackProject (InputArray data, InputArray mean, InputArray eigenvectors, OutputArray result)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, double retainedVariance)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, int maxComponents=0)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, OutputArray eigenvalues, double retainedVariance)
 
void cv::PCACompute (InputArray data, InputOutputArray mean, OutputArray eigenvectors, OutputArray eigenvalues, int maxComponents=0)
 
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.
 
void cv::phase (InputArray x, InputArray y, OutputArray angle, bool angleInDegrees=false)
 Calculates the rotation angle of 2D vectors.
 
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.
 
void cv::pow (InputArray src, double power, OutputArray dst)
 Raises every array element to a power.
 
double cv::PSNR (InputArray src1, InputArray src2, double R=255.)
 Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.
 
void cv::randn (InputOutputArray dst, InputArray mean, InputArray stddev)
 Fills the array with normally distributed random numbers.
 
void cv::randShuffle (InputOutputArray dst, double iterFactor=1., RNG *rng=0)
 Shuffles the array elements randomly.
 
void cv::randu (InputOutputArray dst, InputArray low, InputArray high)
 Generates a single uniformly-distributed random number or an array of random numbers.
 
void cv::reduce (InputArray src, OutputArray dst, int dim, int rtype, int dtype=-1)
 Reduces a matrix to a vector.
 
void cv::reduceArgMax (InputArray src, OutputArray dst, int axis, bool lastIndex=false)
 Finds indices of max elements along provided axis.
 
void cv::reduceArgMin (InputArray src, OutputArray dst, int axis, bool lastIndex=false)
 Finds indices of min elements along provided axis.
 
Mat cv::repeat (const Mat &src, int ny, int nx)
 
void cv::repeat (InputArray src, int ny, int nx, OutputArray dst)
 Fills the output array with repeated copies of the input array.
 
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).
 
void cv::scaleAdd (InputArray src1, double alpha, InputArray src2, OutputArray dst)
 Calculates the sum of a scaled array and another array.
 
void cv::setIdentity (InputOutputArray mtx, const Scalar &s=Scalar(1))
 Initializes a scaled identity matrix.
 
void cv::setRNGSeed (int seed)
 Sets state of default random number generator.
 
bool cv::solve (InputArray src1, InputArray src2, OutputArray dst, int flags=DECOMP_LU)
 Solves one or more linear systems or least-squares problems.
 
int cv::solveCubic (InputArray coeffs, OutputArray roots)
 Finds the real roots of a cubic equation.
 
double cv::solvePoly (InputArray coeffs, OutputArray roots, int maxIters=300)
 Finds the real or complex roots of a polynomial equation.
 
void cv::sort (InputArray src, OutputArray dst, int flags)
 Sorts each row or each column of a matrix.
 
void cv::sortIdx (InputArray src, OutputArray dst, int flags)
 Sorts each row or each column of a matrix.
 
void cv::split (const Mat &src, Mat *mvbegin)
 Divides a multi-channel array into several single-channel arrays.
 
void cv::split (InputArray m, OutputArrayOfArrays mv)
 
void cv::sqrt (InputArray src, OutputArray dst)
 Calculates a square root of array elements.
 
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.
 
Scalar cv::sum (InputArray src)
 Calculates the sum of array elements.
 
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.
 
void cv::swap (UMat &a, UMat &b)
 
RNGcv::theRNG ()
 Returns the default random number generator.
 
Scalar cv::trace (InputArray mtx)
 Returns the trace of a matrix.
 
void cv::transform (InputArray src, OutputArray dst, InputArray m)
 Performs the matrix transformation of every array element.
 
void cv::transpose (InputArray src, OutputArray dst)
 Transposes a matrix.
 
void cv::transposeND (InputArray src, const std::vector< int > &order, OutputArray dst)
 Transpose for n-dimensional matrices.
 
void cv::vconcat (const Mat *src, size_t nsrc, OutputArray dst)
 Applies vertical concatenation to given matrices.
 
void cv::vconcat (InputArray src1, InputArray src2, OutputArray dst)
 
void cv::vconcat (InputArrayOfArrays src, OutputArray dst)