http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations. Noise expected to be a gaussian white noise
@param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.
@param dst Output image with the same size and type as src .
@param templateWindowSize Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Parameter regulating filter strength. Big h value perfectly removes noise but also
removes image details, smaller h value preserves details but also preserves some noise
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.
fastNlMeansDenoising(src, h[, dst[, templateWindowSize[, searchWindowSize[, normType]]]]) -> dst
@brief Perform image denoising using Non-local Means Denoising algorithm
<http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
optimizations. Noise expected to be a gaussian white noise
@param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel image.
@param dst Output image with the same size and type as src .
@param templateWindowSize Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
This function expected to be applied to grayscale images. For colored images look at
fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
image to CIELAB colorspace and then separately denoise L and AB components with different h
parameter.
- fastNlMeansDenoisingColored(...)
- fastNlMeansDenoisingColored(src[, dst[, h[, hColor[, templateWindowSize[, searchWindowSize]]]]]) -> dst
@brief Modification of fastNlMeansDenoising function for colored images
@param src Input 8-bit 3-channel image.
@param dst Output image with the same size and type as src .
@param templateWindowSize Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise
@param hColor The same as h but for color components. For most images value equals 10
will be enough to remove colored noise and do not distort colors
The function converts image to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoising function.
- fastNlMeansDenoisingColoredMulti(...)
- fastNlMeansDenoisingColoredMulti(srcImgs, imgToDenoiseIndex, temporalWindowSize[, dst[, h[, hColor[, templateWindowSize[, searchWindowSize]]]]]) -> dst
@brief Modification of fastNlMeansDenoisingMulti function for colored images sequences
@param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and
size.
@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
@param temporalWindowSize Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.
@param dst Output image with the same size and type as srcImgs images.
@param templateWindowSize Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly
removes noise but also removes image details, smaller h value preserves details but also preserves
some noise.
@param hColor The same as h but for color components.
The function converts images to CIELAB colorspace and then separately denoise L and AB components
with given h parameters using fastNlMeansDenoisingMulti function.
- fastNlMeansDenoisingMulti(...)
- fastNlMeansDenoisingMulti(srcImgs, imgToDenoiseIndex, temporalWindowSize[, dst[, h[, templateWindowSize[, searchWindowSize]]]]) -> dst
@brief Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time. For example video. This version of the function is for grayscale
images or for manual manipulation with colorspaces. For more details see
<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394>
@param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or
4-channel images sequence. All images should have the same type and
size.
@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
@param temporalWindowSize Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.
@param dst Output image with the same size and type as srcImgs images.
@param templateWindowSize Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Parameter regulating filter strength. Bigger h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
fastNlMeansDenoisingMulti(srcImgs, imgToDenoiseIndex, temporalWindowSize, h[, dst[, templateWindowSize[, searchWindowSize[, normType]]]]) -> dst
@brief Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
captured in small period of time. For example video. This version of the function is for grayscale
images or for manual manipulation with colorspaces. For more details see
<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394>
@param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
2-channel, 3-channel or 4-channel images sequence. All images should
have the same type and size.
@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence
@param temporalWindowSize Number of surrounding images to use for target image denoising. Should
be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
srcImgs[imgToDenoiseIndex] image.
@param dst Output image with the same size and type as srcImgs images.
@param templateWindowSize Size in pixels of the template patch that is used to compute weights.
Should be odd. Recommended value 7 pixels
@param searchWindowSize Size in pixels of the window that is used to compute weighted average for
given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
denoising time. Recommended value 21 pixels
@param h Array of parameters regulating filter strength, either one
parameter applied to all channels or one per channel in dst. Big h value
perfectly removes noise but also removes image details, smaller h
value preserves details but also preserves some noise
@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
- fillConvexPoly(...)
- fillConvexPoly(img, points, color[, lineType[, shift]]) -> img
@brief Fills a convex polygon.
The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the
function #fillPoly . It can fill not only convex polygons but any monotonic polygon without
self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line)
twice at the most (though, its top-most and/or the bottom edge could be horizontal).
@param img Image.
@param points Polygon vertices.
@param color Polygon color.
@param lineType Type of the polygon boundaries. See #LineTypes
@param shift Number of fractional bits in the vertex coordinates.
- fillPoly(...)
- fillPoly(img, pts, color[, lineType[, shift[, offset]]]) -> img
@brief Fills the area bounded by one or more polygons.
The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
complex areas, for example, areas with holes, contours with self-intersections (some of their
parts), and so forth.
@param img Image.
@param pts Array of polygons where each polygon is represented as an array of points.
@param color Polygon color.
@param lineType Type of the polygon boundaries. See #LineTypes
@param shift Number of fractional bits in the vertex coordinates.
@param offset Optional offset of all points of the contours.
- filter2D(...)
- filter2D(src, ddepth, kernel[, dst[, anchor[, delta[, borderType]]]]) -> dst
@brief Convolves an image with the kernel.
The function applies an arbitrary linear filter to an image. In-place operation is supported. When
the aperture is partially outside the image, the function interpolates outlier pixel values
according to the specified border mode.
The function does actually compute correlation, not the convolution:
\f[\texttt{dst} (x,y) = \sum _{ \stackrel{0\leq x' < \texttt{kernel.cols},}{0\leq y' < \texttt{kernel.rows}} } \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\f]
That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
anchor.y - 1)`.
The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
larger) and the direct algorithm for small kernels.
@param src input image.
@param dst output image of the same size and the same number of channels as src.
@param ddepth desired depth of the destination image, see @ref filter_depths "combinations"
@param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point
matrix; if you want to apply different kernels to different channels, split the image into
separate color planes using split and process them individually.
@param anchor anchor of the kernel that indicates the relative position of a filtered point within
the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor
is at the kernel center.
@param delta optional value added to the filtered pixels before storing them in dst.
@param borderType pixel extrapolation method, see #BorderTypes
@sa sepFilter2D, dft, matchTemplate
- filterSpeckles(...)
- filterSpeckles(img, newVal, maxSpeckleSize, maxDiff[, buf]) -> img, buf
@brief Filters off small noise blobs (speckles) in the disparity map
@param img The input 16-bit signed disparity image
@param newVal The disparity value used to paint-off the speckles
@param maxSpeckleSize The maximum speckle size to consider it a speckle. Larger blobs are not
affected by the algorithm
@param maxDiff Maximum difference between neighbor disparity pixels to put them into the same
blob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point
disparity map, where disparity values are multiplied by 16, this scale factor should be taken into
account when specifying this parameter value.
@param buf The optional temporary buffer to avoid memory allocation within the function.
- findChessboardCorners(...)
- findChessboardCorners(image, patternSize[, corners[, flags]]) -> retval, corners
@brief Finds the positions of internal corners of the chessboard.
@param image Source chessboard view. It must be an 8-bit grayscale or color image.
@param patternSize Number of inner corners per a chessboard row and column
( patternSize = cvSize(points_per_row,points_per_colum) = cvSize(columns,rows) ).
@param corners Output array of detected corners.
@param flags Various operation flags that can be zero or a combination of the following values:
- **CALIB_CB_ADAPTIVE_THRESH** Use adaptive thresholding to convert the image to black
and white, rather than a fixed threshold level (computed from the average image brightness).
- **CALIB_CB_NORMALIZE_IMAGE** Normalize the image gamma with equalizeHist before
applying fixed or adaptive thresholding.
- **CALIB_CB_FILTER_QUADS** Use additional criteria (like contour area, perimeter,
square-like shape) to filter out false quads extracted at the contour retrieval stage.
- **CALIB_CB_FAST_CHECK** Run a fast check on the image that looks for chessboard corners,
and shortcut the call if none is found. This can drastically speed up the call in the
degenerate condition when no chessboard is observed.
The function attempts to determine whether the input image is a view of the chessboard pattern and
locate the internal chessboard corners. The function returns a non-zero value if all of the corners
are found and they are placed in a certain order (row by row, left to right in every row).
Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example,
a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black
squares touch each other. The detected coordinates are approximate, and to determine their positions
more accurately, the function calls cornerSubPix. You also may use the function cornerSubPix with
different parameters if returned coordinates are not accurate enough.
Sample usage of detecting and drawing chessboard corners: :
@code
Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE
+ CALIB_CB_FAST_CHECK);
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
@endcode
@note The function requires white space (like a square-thick border, the wider the better) around
the board to make the detection more robust in various environments. Otherwise, if there is no
border and the background is dark, the outer black squares cannot be segmented properly and so the
square grouping and ordering algorithm fails.
- findCirclesGrid(...)
- findCirclesGrid(image, patternSize, flags, blobDetector, parameters[, centers]) -> retval, centers
@brief Finds centers in the grid of circles.
@param image grid view of input circles; it must be an 8-bit grayscale or color image.
@param patternSize number of circles per row and column
( patternSize = Size(points_per_row, points_per_colum) ).
@param centers output array of detected centers.
@param flags various operation flags that can be one of the following values:
- **CALIB_CB_SYMMETRIC_GRID** uses symmetric pattern of circles.
- **CALIB_CB_ASYMMETRIC_GRID** uses asymmetric pattern of circles.
- **CALIB_CB_CLUSTERING** uses a special algorithm for grid detection. It is more robust to
perspective distortions but much more sensitive to background clutter.
@param blobDetector feature detector that finds blobs like dark circles on light background.
@param parameters struct for finding circles in a grid pattern.
The function attempts to determine whether the input image contains a grid of circles. If it is, the
function locates centers of the circles. The function returns a non-zero value if all of the centers
have been found and they have been placed in a certain order (row by row, left to right in every
row). Otherwise, if the function fails to find all the corners or reorder them, it returns 0.
Sample usage of detecting and drawing the centers of circles: :
@code
Size patternsize(7,7); //number of centers
Mat gray = ....; //source image
vector<Point2f> centers; //this will be filled by the detected centers
bool patternfound = findCirclesGrid(gray, patternsize, centers);
drawChessboardCorners(img, patternsize, Mat(centers), patternfound);
@endcode
@note The function requires white space (like a square-thick border, the wider the better) around
the board to make the detection more robust in various environments.
findCirclesGrid(image, patternSize[, centers[, flags[, blobDetector]]]) -> retval, centers
@overload
- findCirclesGrid2(...)
- findCirclesGrid2(image, patternSize, flags, blobDetector, parameters[, centers]) -> retval, centers
@overload
- findContours(...)
- findContours(image, mode, method[, contours[, hierarchy[, offset]]]) -> image, contours, hierarchy
@brief Finds contours in a binary image.
The function retrieves contours from the binary image using the algorithm @cite Suzuki85 . The contours
are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the
OpenCV sample directory.
@note Since opencv 3.2 source image is not modified by this function.
@param image Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero
pixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,
#adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.
If mode equals to #RETR_CCOMP or #RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1).
@param contours Detected contours. Each contour is stored as a vector of points (e.g.
std::vector<std::vector<cv::Point> >).
@param hierarchy Optional output vector (e.g. std::vector<cv::Vec4i>), containing information about the image topology. It has
as many elements as the number of contours. For each i-th contour contours[i], the elements
hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices
in contours of the next and previous contours at the same hierarchical level, the first child
contour and the parent contour, respectively. If for the contour i there are no next, previous,
parent, or nested contours, the corresponding elements of hierarchy[i] will be negative.
@param mode Contour retrieval mode, see #RetrievalModes
@param method Contour approximation method, see #ContourApproximationModes
@param offset Optional offset by which every contour point is shifted. This is useful if the
contours are extracted from the image ROI and then they should be analyzed in the whole image
context.
- findEssentialMat(...)
- findEssentialMat(points1, points2, cameraMatrix[, method[, prob[, threshold[, mask]]]]) -> retval, mask
@brief Calculates an essential matrix from the corresponding points in two images.
@param points1 Array of N (N \>= 5) 2D points from the first image. The point coordinates should
be floating-point (single or double precision).
@param points2 Array of the second image points of the same size and format as points1 .
@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ .
Note that this function assumes that points1 and points2 are feature points from cameras with the
same camera matrix.
@param method Method for computing an essential matrix.
- **RANSAC** for the RANSAC algorithm.
- **LMEDS** for the LMedS algorithm.
@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of
confidence (probability) that the estimated matrix is correct.
@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar
line in pixels, beyond which the point is considered an outlier and is not used for computing the
final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
point localization, image resolution, and the image noise.
@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1
for the other points. The array is computed only in the RANSAC and LMedS methods.
This function estimates essential matrix based on the five-point algorithm solver in @cite Nister03 .
@cite SteweniusCFS is also a related. The epipolar geometry is described by the following equation:
\f[[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\f]
where \f$E\f$ is an essential matrix, \f$p_1\f$ and \f$p_2\f$ are corresponding points in the first and the
second images, respectively. The result of this function may be passed further to
decomposeEssentialMat or recoverPose to recover the relative pose between cameras.
findEssentialMat(points1, points2[, focal[, pp[, method[, prob[, threshold[, mask]]]]]]) -> retval, mask
@overload
@param points1 Array of N (N \>= 5) 2D points from the first image. The point coordinates should
be floating-point (single or double precision).
@param points2 Array of the second image points of the same size and format as points1 .
@param focal focal length of the camera. Note that this function assumes that points1 and points2
are feature points from cameras with same focal length and principal point.
@param pp principal point of the camera.
@param method Method for computing a fundamental matrix.
- **RANSAC** for the RANSAC algorithm.
- **LMEDS** for the LMedS algorithm.
@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar
line in pixels, beyond which the point is considered an outlier and is not used for computing the
final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
point localization, image resolution, and the image noise.
@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of
confidence (probability) that the estimated matrix is correct.
@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1
for the other points. The array is computed only in the RANSAC and LMedS methods.
This function differs from the one above that it computes camera matrix from focal length and
principal point:
\f[K =
\begin{bmatrix}
f & 0 & x_{pp} \\
0 & f & y_{pp} \\
0 & 0 & 1
\end{bmatrix}\f]
- findFundamentalMat(...)
- findFundamentalMat(points1, points2[, method[, ransacReprojThreshold[, confidence[, mask]]]]) -> retval, mask
@brief Calculates a fundamental matrix from the corresponding points in two images.
@param points1 Array of N points from the first image. The point coordinates should be
floating-point (single or double precision).
@param points2 Array of the second image points of the same size and format as points1 .
@param method Method for computing a fundamental matrix.
- **CV_FM_7POINT** for a 7-point algorithm. \f$N = 7\f$
- **CV_FM_8POINT** for an 8-point algorithm. \f$N \ge 8\f$
- **CV_FM_RANSAC** for the RANSAC algorithm. \f$N \ge 8\f$
- **CV_FM_LMEDS** for the LMedS algorithm. \f$N \ge 8\f$
@param ransacReprojThreshold Parameter used only for RANSAC. It is the maximum distance from a point to an epipolar
line in pixels, beyond which the point is considered an outlier and is not used for computing the
final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
point localization, image resolution, and the image noise.
@param confidence Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level
of confidence (probability) that the estimated matrix is correct.
@param mask
The epipolar geometry is described by the following equation:
\f[[p_2; 1]^T F [p_1; 1] = 0\f]
where \f$F\f$ is a fundamental matrix, \f$p_1\f$ and \f$p_2\f$ are corresponding points in the first and the
second images, respectively.
The function calculates the fundamental matrix using one of four methods listed above and returns
the found fundamental matrix. Normally just one matrix is found. But in case of the 7-point
algorithm, the function may return up to 3 solutions ( \f$9 \times 3\f$ matrix that stores all 3
matrices sequentially).
The calculated fundamental matrix may be passed further to computeCorrespondEpilines that finds the
epipolar lines corresponding to the specified points. It can also be passed to
stereoRectifyUncalibrated to compute the rectification transformation. :
@code
// Example. Estimation of fundamental matrix using the RANSAC algorithm
int point_count = 100;
vector<Point2f> points1(point_count);
vector<Point2f> points2(point_count);
// initialize the points here ...
for( int i = 0; i < point_count; i++ )
{
points1[i] = ...;
points2[i] = ...;
}
Mat fundamental_matrix =
findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
@endcode
- findHomography(...)
- findHomography(srcPoints, dstPoints[, method[, ransacReprojThreshold[, mask[, maxIters[, confidence]]]]]) -> retval, mask
@brief Finds a perspective transformation between two planes.
@param srcPoints Coordinates of the points in the original plane, a matrix of the type CV_32FC2
or vector\<Point2f\> .
@param dstPoints Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or
a vector\<Point2f\> .
@param method Method used to compute a homography matrix. The following methods are possible:
- **0** - a regular method using all the points, i.e., the least squares method
- **RANSAC** - RANSAC-based robust method
- **LMEDS** - Least-Median robust method
- **RHO** - PROSAC-based robust method
@param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier
(used in the RANSAC and RHO methods only). That is, if
\f[\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} * \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\f]
then the point \f$i\f$ is considered as an outlier. If srcPoints and dstPoints are measured in pixels,
it usually makes sense to set this parameter somewhere in the range of 1 to 10.
@param mask Optional output mask set by a robust method ( RANSAC or LMEDS ). Note that the input
mask values are ignored.
@param maxIters The maximum number of RANSAC iterations.
@param confidence Confidence level, between 0 and 1.
The function finds and returns the perspective transformation \f$H\f$ between the source and the
destination planes:
\f[s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\f]
so that the back-projection error
\f[\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\f]
is minimized. If the parameter method is set to the default value 0, the function uses all the point
pairs to compute an initial homography estimate with a simple least-squares scheme.
However, if not all of the point pairs ( \f$srcPoints_i\f$, \f$dstPoints_i\f$ ) fit the rigid perspective
transformation (that is, there are some outliers), this initial estimate will be poor. In this case,
you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different
random subsets of the corresponding point pairs (of four pairs each, collinear pairs are discarded), estimate the homography matrix
using this subset and a simple least-squares algorithm, and then compute the quality/goodness of the
computed homography (which is the number of inliers for RANSAC or the least median re-projection error for
LMeDS). The best subset is then used to produce the initial estimate of the homography matrix and
the mask of inliers/outliers.
Regardless of the method, robust or not, the computed homography matrix is refined further (using
inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the
re-projection error even more.
The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to
distinguish inliers from outliers. The method LMeDS does not need any threshold but it works
correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the
noise is rather small, use the default method (method=0).
The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is
determined up to a scale. Thus, it is normalized so that \f$h_{33}=1\f$. Note that whenever an \f$H\f$ matrix
cannot be estimated, an empty one will be returned.
@sa
getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective,
perspectiveTransform
- findNonZero(...)
- findNonZero(src[, idx]) -> idx
@brief Returns the list of locations of non-zero pixels
Given a binary matrix (likely returned from an operation such
as threshold(), compare(), >, ==, etc, return all of
the non-zero indices as a cv::Mat or std::vector<cv::Point> (x,y)
For example:
@code{.cpp}
cv::Mat binaryImage; // input, binary image
cv::Mat locations; // output, locations of non-zero pixels
cv::findNonZero(binaryImage, locations);
// access pixel coordinates
Point pnt = locations.at<Point>(i);
@endcode
or
@code{.cpp}
cv::Mat binaryImage; // input, binary image
vector<Point> locations; // output, locations of non-zero pixels
cv::findNonZero(binaryImage, locations);
// access pixel coordinates
Point pnt = locations[i];
@endcode
@param src single-channel array (type CV_8UC1)
@param idx the output array, type of cv::Mat or std::vector<Point>, corresponding to non-zero indices in the input
- findTransformECC(...)
- findTransformECC(templateImage, inputImage, warpMatrix[, motionType[, criteria[, inputMask]]]) -> retval, warpMatrix
@brief Finds the geometric transform (warp) between two images in terms of the ECC criterion @cite EP08 .
@param templateImage single-channel template image; CV_8U or CV_32F array.
@param inputImage single-channel input image which should be warped with the final warpMatrix in
order to provide an image similar to templateImage, same type as temlateImage.
@param warpMatrix floating-point \f$2\times 3\f$ or \f$3\times 3\f$ mapping matrix (warp).
@param motionType parameter, specifying the type of motion:
- **MOTION_TRANSLATION** sets a translational motion model; warpMatrix is \f$2\times 3\f$ with
the first \f$2\times 2\f$ part being the unity matrix and the rest two parameters being
estimated.
- **MOTION_EUCLIDEAN** sets a Euclidean (rigid) transformation as motion model; three
parameters are estimated; warpMatrix is \f$2\times 3\f$.
- **MOTION_AFFINE** sets an affine motion model (DEFAULT); six parameters are estimated;
warpMatrix is \f$2\times 3\f$.
- **MOTION_HOMOGRAPHY** sets a homography as a motion model; eight parameters are
estimated;\`warpMatrix\` is \f$3\times 3\f$.
@param criteria parameter, specifying the termination criteria of the ECC algorithm;
criteria.epsilon defines the threshold of the increment in the correlation coefficient between two
iterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion).
Default values are shown in the declaration above.
@param inputMask An optional mask to indicate valid values of inputImage.
The function estimates the optimum transformation (warpMatrix) with respect to ECC criterion
(@cite EP08), that is
\f[\texttt{warpMatrix} = \texttt{warpMatrix} = \arg\max_{W} \texttt{ECC}(\texttt{templateImage}(x,y),\texttt{inputImage}(x',y'))\f]
where
\f[\begin{bmatrix} x' \\ y' \end{bmatrix} = W \cdot \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}\f]
(the equation holds with homogeneous coordinates for homography). It returns the final enhanced
correlation coefficient, that is the correlation coefficient between the template image and the
final warped input image. When a \f$3\times 3\f$ matrix is given with motionType =0, 1 or 2, the third
row is ignored.
Unlike findHomography and estimateRigidTransform, the function findTransformECC implements an
area-based alignment that builds on intensity similarities. In essence, the function updates the
initial transformation that roughly aligns the images. If this information is missing, the identity
warp (unity matrix) is used as an initialization. Note that if images undergo strong
displacements/rotations, an initial transformation that roughly aligns the images is necessary
(e.g., a simple euclidean/similarity transform that allows for the images showing the same image
content approximately). Use inverse warping in the second image to take an image close to the first
one, i.e. use the flag WARP_INVERSE_MAP with warpAffine or warpPerspective. See also the OpenCV
sample image_alignment.cpp that demonstrates the use of the function. Note that the function throws
an exception if algorithm does not converges.
@sa
estimateAffine2D, estimateAffinePartial2D, findHomography
- fitEllipse(...)
- fitEllipse(points) -> retval
@brief Fits an ellipse around a set of 2D points.
The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of
all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by @cite Fitzgibbon95
is used. Developer should keep in mind that it is possible that the returned
ellipse/rotatedRect data contains negative indices, due to the data points being close to the
border of the containing Mat element.
@param points Input 2D point set, stored in std::vector\<\> or Mat
- fitEllipseAMS(...)
- fitEllipseAMS(points) -> retval
@brief Fits an ellipse around a set of 2D points.
The function calculates the ellipse that fits a set of 2D points.
It returns the rotated rectangle in which the ellipse is inscribed.
The Approximate Mean Square (AMS) proposed by @cite Taubin1991 is used.
For an ellipse, this basis set is \f$ \chi= \left(x^2, x y, y^2, x, y, 1\right) \f$,
which is a set of six free coefficients \f$ A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} \f$.
However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \f$ (a,b) \f$,
the position \f$ (x_0,y_0) \f$, and the orientation \f$ \theta \f$. This is because the basis set includes lines,
quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.
If the fit is found to be a parabolic or hyperbolic function then the standard #fitEllipse method is used.
The AMS method restricts the fit to parabolic, hyperbolic and elliptical curves
by imposing the condition that \f$ A^T ( D_x^T D_x + D_y^T D_y) A = 1 \f$ where
the matrices \f$ Dx \f$ and \f$ Dy \f$ are the partial derivatives of the design matrix \f$ D \f$ with
respect to x and y. The matrices are formed row by row applying the following to
each of the points in the set:
\f{align*}{
D(i,:)&=\left\{x_i^2, x_i y_i, y_i^2, x_i, y_i, 1\right\} &
D_x(i,:)&=\left\{2 x_i,y_i,0,1,0,0\right\} &
D_y(i,:)&=\left\{0,x_i,2 y_i,0,1,0\right\}
\f}
The AMS method minimizes the cost function
\f{equation*}{
\epsilon ^2=\frac{ A^T D^T D A }{ A^T (D_x^T D_x + D_y^T D_y) A^T }
\f}
The minimum cost is found by solving the generalized eigenvalue problem.
\f{equation*}{
D^T D A = \lambda \left( D_x^T D_x + D_y^T D_y\right) A
\f}
@param points Input 2D point set, stored in std::vector\<\> or Mat
- fitEllipseDirect(...)
- fitEllipseDirect(points) -> retval
@brief Fits an ellipse around a set of 2D points.
The function calculates the ellipse that fits a set of 2D points.
It returns the rotated rectangle in which the ellipse is inscribed.
The Direct least square (Direct) method by @cite Fitzgibbon1999 is used.
For an ellipse, this basis set is \f$ \chi= \left(x^2, x y, y^2, x, y, 1\right) \f$,
which is a set of six free coefficients \f$ A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} \f$.
However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \f$ (a,b) \f$,
the position \f$ (x_0,y_0) \f$, and the orientation \f$ \theta \f$. This is because the basis set includes lines,
quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.
The Direct method confines the fit to ellipses by ensuring that \f$ 4 A_{xx} A_{yy}- A_{xy}^2 > 0 \f$.
The condition imposed is that \f$ 4 A_{xx} A_{yy}- A_{xy}^2=1 \f$ which satisfies the inequality
and as the coefficients can be arbitrarily scaled is not overly restrictive.
\f{equation*}{
\epsilon ^2= A^T D^T D A \quad \text{with} \quad A^T C A =1 \quad \text{and} \quad C=\left(\begin{matrix}
0 & 0 & 2 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 & 0 & 0 \\
2 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0
\end{matrix} \right)
\f}
The minimum cost is found by solving the generalized eigenvalue problem.
\f{equation*}{
D^T D A = \lambda \left( C\right) A
\f}
The system produces only one positive eigenvalue \f$ \lambda\f$ which is chosen as the solution
with its eigenvector \f$\mathbf{u}\f$. These are used to find the coefficients
\f{equation*}{
A = \sqrt{\frac{1}{\mathbf{u}^T C \mathbf{u}}} \mathbf{u}
\f}
The scaling factor guarantees that \f$A^T C A =1\f$.
@param points Input 2D point set, stored in std::vector\<\> or Mat
- fitLine(...)
- fitLine(points, distType, param, reps, aeps[, line]) -> line
@brief Fits a line to a 2D or 3D point set.
The function fitLine fits a line to a 2D or 3D point set by minimizing \f$\sum_i \rho(r_i)\f$ where
\f$r_i\f$ is a distance between the \f$i^{th}\f$ point, the line and \f$\rho(r)\f$ is a distance function, one
of the following:
- DIST_L2
\f[\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}\f]
- DIST_L1
\f[\rho (r) = r\f]
- DIST_L12
\f[\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)\f]
- DIST_FAIR
\f[\rho \left (r \right ) = C^2 \cdot \left ( \frac{r}{C} - \log{\left(1 + \frac{r}{C}\right)} \right ) \quad \text{where} \quad C=1.3998\f]
- DIST_WELSCH
\f[\rho \left (r \right ) = \frac{C^2}{2} \cdot \left ( 1 - \exp{\left(-\left(\frac{r}{C}\right)^2\right)} \right ) \quad \text{where} \quad C=2.9846\f]
- DIST_HUBER
\f[\rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345\f]
The algorithm is based on the M-estimator ( <http://en.wikipedia.org/wiki/M-estimator> ) technique
that iteratively fits the line using the weighted least-squares algorithm. After each iteration the
weights \f$w_i\f$ are adjusted to be inversely proportional to \f$\rho(r_i)\f$ .
@param points Input vector of 2D or 3D points, stored in std::vector\<\> or Mat.
@param line Output line parameters. In case of 2D fitting, it should be a vector of 4 elements
(like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and
(x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like
Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line
and (x0, y0, z0) is a point on the line.
@param distType Distance used by the M-estimator, see #DistanceTypes
@param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value
is chosen.
@param reps Sufficient accuracy for the radius (distance between the coordinate origin and the line).
@param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.
- flip(...)
- flip(src, flipCode[, dst]) -> dst
@brief Flips a 2D array around vertical, horizontal, or both axes.
The function cv::flip flips the array in one of three different ways (row
and column indices are 0-based):
\f[\texttt{dst} _{ij} =
\left\{
\begin{array}{l l}
\texttt{src} _{\texttt{src.rows}-i-1,j} & if\; \texttt{flipCode} = 0 \\
\texttt{src} _{i, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} > 0 \\
\texttt{src} _{ \texttt{src.rows} -i-1, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} < 0 \\
\end{array}
\right.\f]
The example scenarios of using the function are the following:
* Vertical flipping of the image (flipCode == 0) to switch between
top-left and bottom-left image origin. This is a typical operation
in video processing on Microsoft Windows\* OS.
* Horizontal flipping of the image with the subsequent horizontal
shift and absolute difference calculation to check for a
vertical-axis symmetry (flipCode \> 0).
* Simultaneous horizontal and vertical flipping of the image with
the subsequent shift and absolute difference calculation to check
for a central symmetry (flipCode \< 0).
* Reversing the order of point arrays (flipCode \> 0 or
flipCode == 0).
@param src input array.
@param dst output array of the same size and type as src.
@param flipCode a flag to specify how to flip the array; 0 means
flipping around the x-axis and positive value (for example, 1) means
flipping around y-axis. Negative value (for example, -1) means flipping
around both axes.
@sa transpose , repeat , completeSymm
- floodFill(...)
- floodFill(image, mask, seedPoint, newVal[, loDiff[, upDiff[, flags]]]) -> retval, image, mask, rect
@brief Fills a connected component with the given color.
The function cv::floodFill fills a connected component starting from the seed point with the specified
color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
pixel at \f$(x,y)\f$ is considered to belong to the repainted domain if:
- in case of a grayscale image and floating range
\f[\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\f]
- in case of a grayscale image and fixed range
\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\f]
- in case of a color image and floating range
\f[\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\f]
\f[\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\f]
and
\f[\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\f]
- in case of a color image and fixed range
\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\f]
\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\f]
and
\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\f]
where \f$src(x',y')\f$ is the value of one of pixel neighbors that is already known to belong to the
component. That is, to be added to the connected component, a color/brightness of the pixel should
be close enough to:
- Color/brightness of one of its neighbors that already belong to the connected component in case
of a floating range.
- Color/brightness of the seed point in case of a fixed range.
Use these functions to either mark a connected component with the specified color in-place, or build
a mask and then extract the contour, or copy the region to another image, and so on.
@param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
the details below.
@param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
taller than image. Since this is both an input and output parameter, you must take responsibility
of initializing it. Flood-filling cannot go across non-zero pixels in the input mask. For example,
an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
mask corresponding to filled pixels in the image are set to 1 or to the a value specified in flags
as described below. Additionally, the function fills the border of the mask with ones to simplify
internal processing. It is therefore possible to use the same mask in multiple calls to the function
to make sure the filled areas do not overlap.
@param seedPoint Starting point.
@param newVal New value of the repainted domain pixels.
@param loDiff Maximal lower brightness/color difference between the currently observed pixel and
one of its neighbors belonging to the component, or a seed pixel being added to the component.
@param upDiff Maximal upper brightness/color difference between the currently observed pixel and
one of its neighbors belonging to the component, or a seed pixel being added to the component.
@param rect Optional output parameter set by the function to the minimum bounding rectangle of the
repainted domain.
@param flags Operation flags. The first 8 bits contain a connectivity value. The default value of
4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
neighbours and fill the mask with a value of 255. The following additional options occupy higher
bits and therefore may be further combined with the connectivity and mask fill values using
bit-wise or (|), see #FloodFillFlags.
@note Since the mask is larger than the filled image, a pixel \f$(x, y)\f$ in image corresponds to the
pixel \f$(x+1, y+1)\f$ in the mask .
@sa findContours
- gemm(...)
- gemm(src1, src2, alpha, src3, beta[, dst[, flags]]) -> dst
@brief Performs generalized matrix multiplication.
The function cv::gemm performs generalized matrix multiplication similar to the
gemm functions in BLAS level 3. For example,
`gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)`
corresponds to
\f[\texttt{dst} = \texttt{alpha} \cdot \texttt{src1} ^T \cdot \texttt{src2} + \texttt{beta} \cdot \texttt{src3} ^T\f]
In case of complex (two-channel) data, performed a complex matrix
multiplication.
The function can be replaced with a matrix expression. For example, the
above call can be replaced with:
@code{.cpp}
dst = alpha*src1.t()*src2 + beta*src3.t();
@endcode
@param src1 first multiplied input matrix that could be real(CV_32FC1,
CV_64FC1) or complex(CV_32FC2, CV_64FC2).
@param src2 second multiplied input matrix of the same type as src1.
@param alpha weight of the matrix product.
@param src3 third optional delta matrix added to the matrix product; it
should have the same type as src1 and src2.
@param beta weight of src3.
@param dst output matrix; it has the proper size and the same type as
input matrices.
@param flags operation flags (cv::GemmFlags)
@sa mulTransposed , transform
- getAffineTransform(...)
- getAffineTransform(src, dst) -> retval
- getBuildInformation(...)
- getBuildInformation() -> retval
@brief Returns full configuration time cmake output.
Returned value is raw cmake output including version control system revision, compiler version,
compiler flags, enabled modules and third party libraries, etc. Output format depends on target
architecture.
- getCPUTickCount(...)
- getCPUTickCount() -> retval
@brief Returns the number of CPU ticks.
The function returns the current number of CPU ticks on some architectures (such as x86, x64,
PowerPC). On other platforms the function is equivalent to getTickCount. It can also be used for
very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU
systems a thread, from which getCPUTickCount is called, can be suspended and resumed at another CPU
with its own counter. So, theoretically (and practically) the subsequent calls to the function do
not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU
frequency depending on the load, the number of CPU clocks spent in some code cannot be directly
converted to time units. Therefore, getTickCount is generally a preferable solution for measuring
execution time.
- getDefaultNewCameraMatrix(...)
- getDefaultNewCameraMatrix(cameraMatrix[, imgsize[, centerPrincipalPoint]]) -> retval
@brief Returns the default new camera matrix.
The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when
centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true).
In the latter case, the new camera matrix will be:
\f[\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,\f]
where \f$f_x\f$ and \f$f_y\f$ are \f$(0,0)\f$ and \f$(1,1)\f$ elements of cameraMatrix, respectively.
By default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not
move the principal point. However, when you work with stereo, it is important to move the principal
points in both views to the same y-coordinate (which is required by most of stereo correspondence
algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for
each view where the principal points are located at the center.
@param cameraMatrix Input camera matrix.
@param imgsize Camera view image size in pixels.
@param centerPrincipalPoint Location of the principal point in the new camera matrix. The
parameter indicates whether this location should be at the image center or not.
- getDerivKernels(...)
- getDerivKernels(dx, dy, ksize[, kx[, ky[, normalize[, ktype]]]]) -> kx, ky
@brief Returns filter coefficients for computing spatial image derivatives.
The function computes and returns the filter coefficients for spatial image derivatives. When
`ksize=CV_SCHARR`, the Scharr \f$3 \times 3\f$ kernels are generated (see #Scharr). Otherwise, Sobel
kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
@param kx Output matrix of row filter coefficients. It has the type ktype .
@param ky Output matrix of column filter coefficients. It has the type ktype .
@param dx Derivative order in respect of x.
@param dy Derivative order in respect of y.
@param ksize Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7.
@param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not.
Theoretically, the coefficients should have the denominator \f$=2^{ksize*2-dx-dy-2}\f$. If you are
going to filter floating-point images, you are likely to use the normalized kernels. But if you
compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve
all the fractional bits, you may want to set normalize=false .
@param ktype Type of filter coefficients. It can be CV_32f or CV_64F .
- getFontScaleFromHeight(...)
- getFontScaleFromHeight(fontFace, pixelHeight[, thickness]) -> retval
@brief Calculates the font-specific size to use to achieve a given height in pixels.
@param fontFace Font to use, see cv::HersheyFonts.
@param pixelHeight Pixel height to compute the fontScale for
@param thickness Thickness of lines used to render the text.See putText for details.
@return The fontSize to use for cv::putText
@see cv::putText
- getGaborKernel(...)
- getGaborKernel(ksize, sigma, theta, lambd, gamma[, psi[, ktype]]) -> retval
@brief Returns Gabor filter coefficients.
For more details about gabor filter equations and parameters, see: [Gabor
Filter](http://en.wikipedia.org/wiki/Gabor_filter).
@param ksize Size of the filter returned.
@param sigma Standard deviation of the gaussian envelope.
@param theta Orientation of the normal to the parallel stripes of a Gabor function.
@param lambd Wavelength of the sinusoidal factor.
@param gamma Spatial aspect ratio.
@param psi Phase offset.
@param ktype Type of filter coefficients. It can be CV_32F or CV_64F .
- getGaussianKernel(...)
- getGaussianKernel(ksize, sigma[, ktype]) -> retval
@brief Returns Gaussian filter coefficients.
The function computes and returns the \f$\texttt{ksize} \times 1\f$ matrix of Gaussian filter
coefficients:
\f[G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},\f]
where \f$i=0..\texttt{ksize}-1\f$ and \f$\alpha\f$ is the scale factor chosen so that \f$\sum_i G_i=1\f$.
Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize
smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly.
You may also use the higher-level GaussianBlur.
@param ksize Aperture size. It should be odd ( \f$\texttt{ksize} \mod 2 = 1\f$ ) and positive.
@param sigma Gaussian standard deviation. If it is non-positive, it is computed from ksize as
`sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`.
@param ktype Type of filter coefficients. It can be CV_32F or CV_64F .
@sa sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur
- getHardwareFeatureName(...)
- getHardwareFeatureName(feature) -> retval
@brief Returns feature name by ID
Returns empty string if feature is not defined
- getNumThreads(...)
- getNumThreads() -> retval
@brief Returns the number of threads used by OpenCV for parallel regions.
Always returns 1 if OpenCV is built without threading support.
The exact meaning of return value depends on the threading framework used by OpenCV library:
- `TBB` - The number of threads, that OpenCV will try to use for parallel regions. If there is
any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns
default number of threads used by TBB library.
- `OpenMP` - An upper bound on the number of threads that could be used to form a new team.
- `Concurrency` - The number of threads, that OpenCV will try to use for parallel regions.
- `GCD` - Unsupported; returns the GCD thread pool limit (512) for compatibility.
- `C=` - The number of threads, that OpenCV will try to use for parallel regions, if before
called setNumThreads with threads \> 0, otherwise returns the number of logical CPUs,
available for the process.
@sa setNumThreads, getThreadNum
- getNumberOfCPUs(...)
- getNumberOfCPUs() -> retval
@brief Returns the number of logical CPUs available for the process.
- getOptimalDFTSize(...)
- getOptimalDFTSize(vecsize) -> retval
@brief Returns the optimal DFT size for a given vector size.
DFT performance is not a monotonic function of a vector size. Therefore, when you calculate
convolution of two arrays or perform the spectral analysis of an array, it usually makes sense to
pad the input data with zeros to get a bit larger array that can be transformed much faster than the
original one. Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the fastest to process.
Though, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5\*5\*3\*2\*2)
are also processed quite efficiently.
The function cv::getOptimalDFTSize returns the minimum number N that is greater than or equal to vecsize
so that the DFT of a vector of size N can be processed efficiently. In the current implementation N
= 2 ^p^ \* 3 ^q^ \* 5 ^r^ for some integer p, q, r.
The function returns a negative number if vecsize is too large (very close to INT_MAX ).
While the function cannot be used directly to estimate the optimal vector size for DCT transform
(since the current DCT implementation supports only even-size vectors), it can be easily processed
as getOptimalDFTSize((vecsize+1)/2)\*2.
@param vecsize vector size.
@sa dft , dct , idft , idct , mulSpectrums
- getOptimalNewCameraMatrix(...)
- getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha[, newImgSize[, centerPrincipalPoint]]) -> retval, validPixROI
@brief Returns the new camera matrix based on the free scaling parameter.
@param cameraMatrix Input camera matrix.
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
assumed.
@param imageSize Original image size.
@param alpha Free scaling parameter between 0 (when all the pixels in the undistorted image are
valid) and 1 (when all the source image pixels are retained in the undistorted image). See
stereoRectify for details.
@param newImgSize Image size after rectification. By default, it is set to imageSize .
@param validPixROI Optional output rectangle that outlines all-good-pixels region in the
undistorted image. See roi1, roi2 description in stereoRectify .
@param centerPrincipalPoint Optional flag that indicates whether in the new camera matrix the
principal point should be at the image center or not. By default, the principal point is chosen to
best fit a subset of the source image (determined by alpha) to the corrected image.
@return new_camera_matrix Output new camera matrix.
The function computes and returns the optimal new camera matrix based on the free scaling parameter.
By varying this parameter, you may retrieve only sensible pixels alpha=0 , keep all the original
image pixels if there is valuable information in the corners alpha=1 , or get something in between.
When alpha\>0 , the undistorted result is likely to have some black pixels corresponding to
"virtual" pixels outside of the captured distorted image. The original camera matrix, distortion
coefficients, the computed new camera matrix, and newImageSize should be passed to
initUndistortRectifyMap to produce the maps for remap .
- getPerspectiveTransform(...)
- getPerspectiveTransform(src, dst) -> retval
@brief Calculates a perspective transform from four pairs of the corresponding points.
The function calculates the \f$3 \times 3\f$ matrix of a perspective transform so that:
\f[\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f]
where
\f[dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\f]
@param src Coordinates of quadrangle vertices in the source image.
@param dst Coordinates of the corresponding quadrangle vertices in the destination image.
@sa findHomography, warpPerspective, perspectiveTransform
- getRectSubPix(...)
- getRectSubPix(image, patchSize, center[, patch[, patchType]]) -> patch
@brief Retrieves a pixel rectangle from an image with sub-pixel accuracy.
The function getRectSubPix extracts pixels from src:
\f[patch(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)\f]
where the values of the pixels at non-integer coordinates are retrieved using bilinear
interpolation. Every channel of multi-channel images is processed independently. Also
the image should be a single channel or three channel image. While the center of the
rectangle must be inside the image, parts of the rectangle may be outside.
@param image Source image.
@param patchSize Size of the extracted patch.
@param center Floating point coordinates of the center of the extracted rectangle within the
source image. The center must be inside the image.
@param patch Extracted patch that has the size patchSize and the same number of channels as src .
@param patchType Depth of the extracted pixels. By default, they have the same depth as src .
@sa warpAffine, warpPerspective
- getRotationMatrix2D(...)
- getRotationMatrix2D(center, angle, scale) -> retval
@brief Calculates an affine matrix of 2D rotation.
The function calculates the following matrix:
\f[\begin{bmatrix} \alpha & \beta & (1- \alpha ) \cdot \texttt{center.x} - \beta \cdot \texttt{center.y} \\ - \beta & \alpha & \beta \cdot \texttt{center.x} + (1- \alpha ) \cdot \texttt{center.y} \end{bmatrix}\f]
where
\f[\begin{array}{l} \alpha = \texttt{scale} \cdot \cos \texttt{angle} , \\ \beta = \texttt{scale} \cdot \sin \texttt{angle} \end{array}\f]
The transformation maps the rotation center to itself. If this is not the target, adjust the shift.
@param center Center of the rotation in the source image.
@param angle Rotation angle in degrees. Positive values mean counter-clockwise rotation (the
coordinate origin is assumed to be the top-left corner).
@param scale Isotropic scale factor.
@sa getAffineTransform, warpAffine, transform
- getStructuringElement(...)
- getStructuringElement(shape, ksize[, anchor]) -> retval
@brief Returns a structuring element of the specified size and shape for morphological operations.
The function constructs and returns the structuring element that can be further passed to #erode,
#dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as
the structuring element.
@param shape Element shape that could be one of #MorphShapes
@param ksize Size of the structuring element.
@param anchor Anchor position within the element. The default value \f$(-1, -1)\f$ means that the
anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor
position. In other cases the anchor just regulates how much the result of the morphological
operation is shifted.
- getTextSize(...)
- getTextSize(text, fontFace, fontScale, thickness) -> retval, baseLine
@brief Calculates the width and height of a text string.
The function cv::getTextSize calculates and returns the size of a box that contains the specified text.
That is, the following code renders some text, the tight box surrounding it, and the baseline: :
@code
String text = "Funny text inside the box";
int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;
double fontScale = 2;
int thickness = 3;
Mat img(600, 800, CV_8UC3, Scalar::all(0));
int baseline=0;
Size textSize = getTextSize(text, fontFace,
fontScale, thickness, &baseline);
baseline += thickness;
// center the text
Point textOrg((img.cols - textSize.width)/2,
(img.rows + textSize.height)/2);
// draw the box
rectangle(img, textOrg + Point(0, baseline),
textOrg + Point(textSize.width, -textSize.height),
Scalar(0,0,255));
// ... and the baseline first
line(img, textOrg + Point(0, thickness),
textOrg + Point(textSize.width, thickness),
Scalar(0, 0, 255));
// then put the text itself
putText(img, text, textOrg, fontFace, fontScale,
Scalar::all(255), thickness, 8);
@endcode
@param text Input text string.
@param fontFace Font to use, see #HersheyFonts.
@param fontScale Font scale factor that is multiplied by the font-specific base size.
@param thickness Thickness of lines used to render the text. See #putText for details.
@param[out] baseLine y-coordinate of the baseline relative to the bottom-most text
point.
@return The size of a box that contains the specified text.
@see putText
- getThreadNum(...)
- getThreadNum() -> retval
@brief Returns the index of the currently executed thread within the current parallel region. Always
returns 0 if called outside of parallel region.
@deprecated Current implementation doesn't corresponding to this documentation.
The exact meaning of the return value depends on the threading framework used by OpenCV library:
- `TBB` - Unsupported with current 4.1 TBB release. Maybe will be supported in future.
- `OpenMP` - The thread number, within the current team, of the calling thread.
- `Concurrency` - An ID for the virtual processor that the current context is executing on (0
for master thread and unique number for others, but not necessary 1,2,3,...).
- `GCD` - System calling thread's ID. Never returns 0 inside parallel region.
- `C=` - The index of the current parallel task.
@sa setNumThreads, getNumThreads
- getTickCount(...)
- getTickCount() -> retval
@brief Returns the number of ticks.
The function returns the number of ticks after the certain event (for example, when the machine was
turned on). It can be used to initialize RNG or to measure a function execution time by reading the
tick count before and after the function call.
@sa getTickFrequency, TickMeter
- getTickFrequency(...)
- getTickFrequency() -> retval
@brief Returns the number of ticks per second.
The function returns the number of ticks per second. That is, the following code computes the
execution time in seconds:
@code
double t = (double)getTickCount();
// do something ...
t = ((double)getTickCount() - t)/getTickFrequency();
@endcode
@sa getTickCount, TickMeter
- getTrackbarPos(...)
- getTrackbarPos(trackbarname, winname) -> retval
@brief Returns the trackbar position.
The function returns the current position of the specified trackbar.
@note
[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
panel.
@param trackbarname Name of the trackbar.
@param winname Name of the window that is the parent of the trackbar.
- getValidDisparityROI(...)
- getValidDisparityROI(roi1, roi2, minDisparity, numberOfDisparities, SADWindowSize) -> retval
- getWindowImageRect(...)
- getWindowImageRect(winname) -> retval
@brief Provides rectangle of image in the window.
The function getWindowImageRect returns the client screen coordinates, width and height of the image rendering area.
@param winname Name of the window.
@sa resizeWindow moveWindow
- getWindowProperty(...)
- getWindowProperty(winname, prop_id) -> retval
@brief Provides parameters of a window.
The function getWindowProperty returns properties of a window.
@param winname Name of the window.
@param prop_id Window property to retrieve. The following operation flags are available: (cv::WindowPropertyFlags)
@sa setWindowProperty
- goodFeaturesToTrack(...)
- goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance[, corners[, mask[, blockSize[, useHarrisDetector[, k]]]]]) -> corners
@brief Determines strong corners on an image.
The function finds the most prominent corners in the image or in the specified image region, as
described in @cite Shi94
- Function calculates the corner quality measure at every source image pixel using the
#cornerMinEigenVal or #cornerHarris .
- Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
retained).
- The corners with the minimal eigenvalue less than
\f$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\f$ are rejected.
- The remaining corners are sorted by the quality measure in the descending order.
- Function throws away each corner for which there is a stronger corner at a distance less than
maxDistance.
The function can be used to initialize a point-based tracker of an object.
@note If the function is called with different values A and B of the parameter qualityLevel , and
A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
with qualityLevel=B .
@param image Input 8-bit or floating-point 32-bit, single-channel image.
@param corners Output vector of detected corners.
@param maxCorners Maximum number of corners to return. If there are more corners than are found,
the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
and all detected corners are returned.
@param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
(see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
quality measure less than the product are rejected. For example, if the best corner has the
quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
less than 15 are rejected.
@param minDistance Minimum possible Euclidean distance between the returned corners.
@param mask Optional region of interest. If the image is not empty (it needs to have the type
CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
@param blockSize Size of an average block for computing a derivative covariation matrix over each
pixel neighborhood. See cornerEigenValsAndVecs .
@param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)
or #cornerMinEigenVal.
@param k Free parameter of the Harris detector.
@sa cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
goodFeaturesToTrack(image, maxCorners, qualityLevel, minDistance, mask, blockSize, gradientSize[, corners[, useHarrisDetector[, k]]]) -> corners
- grabCut(...)
- grabCut(img, mask, rect, bgdModel, fgdModel, iterCount[, mode]) -> mask, bgdModel, fgdModel
@brief Runs the GrabCut algorithm.
The function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut).
@param img Input 8-bit 3-channel image.
@param mask Input/output 8-bit single-channel mask. The mask is initialized by the function when
mode is set to #GC_INIT_WITH_RECT. Its elements may have one of the #GrabCutClasses.
@param rect ROI containing a segmented object. The pixels outside of the ROI are marked as
"obvious background". The parameter is only used when mode==#GC_INIT_WITH_RECT .
@param bgdModel Temporary array for the background model. Do not modify it while you are
processing the same image.
@param fgdModel Temporary arrays for the foreground model. Do not modify it while you are
processing the same image.
@param iterCount Number of iterations the algorithm should make before returning the result. Note
that the result can be refined with further calls with mode==#GC_INIT_WITH_MASK or
mode==GC_EVAL .
@param mode Operation mode that could be one of the #GrabCutModes
- groupRectangles(...)
- groupRectangles(rectList, groupThreshold[, eps]) -> rectList, weights
@overload
- haveOpenVX(...)
- haveOpenVX() -> retval
- hconcat(...)
- hconcat(src[, dst]) -> dst
@overload
@code{.cpp}
std::vector<cv::Mat> matrices = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)),
cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)),
cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),};
cv::Mat out;
cv::hconcat( matrices, out );
//out:
//[1, 2, 3;
// 1, 2, 3;
// 1, 2, 3;
// 1, 2, 3]
@endcode
@param src input array or vector of matrices. all of the matrices must have the same number of rows and the same depth.
@param dst output array. It has the same number of rows and depth as the src, and the sum of cols of the src.
same depth.
- idct(...)
- idct(src[, dst[, flags]]) -> dst
@brief Calculates the inverse Discrete Cosine Transform of a 1D or 2D array.
idct(src, dst, flags) is equivalent to dct(src, dst, flags | DCT_INVERSE).
@param src input floating-point single-channel array.
@param dst output array of the same size and type as src.
@param flags operation flags.
@sa dct, dft, idft, getOptimalDFTSize
- idft(...)
- idft(src[, dst[, flags[, nonzeroRows]]]) -> dst
@brief Calculates the inverse Discrete Fourier Transform of a 1D or 2D array.
idft(src, dst, flags) is equivalent to dft(src, dst, flags | #DFT_INVERSE) .
@note None of dft and idft scales the result by default. So, you should pass #DFT_SCALE to one of
dft or idft explicitly to make these transforms mutually inverse.
@sa dft, dct, idct, mulSpectrums, getOptimalDFTSize
@param src input floating-point real or complex array.
@param dst output array whose size and type depend on the flags.
@param flags operation flags (see dft and #DftFlags).
@param nonzeroRows number of dst rows to process; the rest of the rows have undefined content (see
the convolution sample in dft description.
- illuminationChange(...)
- illuminationChange(src, mask[, dst[, alpha[, beta]]]) -> dst
@brief Applying an appropriate non-linear transformation to the gradient field inside the selection and
then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
@param src Input 8-bit 3-channel image.
@param mask Input 8-bit 1 or 3-channel image.
@param dst Output image with the same size and type as src.
@param alpha Value ranges between 0-2.
@param beta Value ranges between 0-2.
This is useful to highlight under-exposed foreground objects or to reduce specular reflections.
- imdecode(...)
- imdecode(buf, flags) -> retval
@brief Reads an image from a buffer in memory.
The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or
contains invalid data, the function returns an empty matrix ( Mat::data==NULL ).
See cv::imread for the list of supported formats and flags description.
@note In the case of color images, the decoded images will have the channels stored in **B G R** order.
@param buf Input array or vector of bytes.
@param flags The same flags as in cv::imread, see cv::ImreadModes.
- imencode(...)
- imencode(ext, img[, params]) -> retval, buf
@brief Encodes an image into a memory buffer.
The function imencode compresses the image and stores it in the memory buffer that is resized to fit the
result. See cv::imwrite for the list of supported formats and flags description.
@param ext File extension that defines the output format.
@param img Image to be written.
@param buf Output buffer resized to fit the compressed image.
@param params Format-specific parameters. See cv::imwrite and cv::ImwriteFlags.
- imread(...)
- imread(filename[, flags]) -> retval
@brief Loads an image from a file.
@anchor imread
The function imread loads an image from the specified file and returns it. If the image cannot be
read (because of missing file, improper permissions, unsupported or invalid format), the function
returns an empty matrix ( Mat::data==NULL ).
Currently, the following file formats are supported:
- Windows bitmaps - \*.bmp, \*.dib (always supported)
- JPEG files - \*.jpeg, \*.jpg, \*.jpe (see the *Notes* section)
- JPEG 2000 files - \*.jp2 (see the *Notes* section)
- Portable Network Graphics - \*.png (see the *Notes* section)
- WebP - \*.webp (see the *Notes* section)
- Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported)
- Sun rasters - \*.sr, \*.ras (always supported)
- TIFF files - \*.tiff, \*.tif (see the *Notes* section)
- OpenEXR Image files - \*.exr (see the *Notes* section)
- Radiance HDR - \*.hdr, \*.pic (always supported)
- Raster and Vector geospatial data supported by Gdal (see the *Notes* section)
@note
- The function determines the type of an image by the content, not by the file extension.
- In the case of color images, the decoded images will have the channels stored in **B G R** order.
- On Microsoft Windows\* OS and MacOSX\*, the codecs shipped with an OpenCV image (libjpeg,
libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs,
and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware
that currently these native image loaders give images with different pixel values because of
the color management embedded into MacOSX.
- On Linux\*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for
codecs supplied with an OS image. Install the relevant packages (do not forget the development
files, for example, "libjpeg-dev", in Debian\* and Ubuntu\*) to get the codec support or turn
on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.
- In the case you set *WITH_GDAL* flag to true in CMake and @ref IMREAD_LOAD_GDAL to load the image,
then [GDAL](http://www.gdal.org) driver will be used in order to decode the image by supporting
the following formats: [Raster](http://www.gdal.org/formats_list.html),
[Vector](http://www.gdal.org/ogr_formats.html).
- If EXIF information are embedded in the image file, the EXIF orientation will be taken into account
and thus the image will be rotated accordingly except if the flag @ref IMREAD_IGNORE_ORIENTATION is passed.
@param filename Name of file to be loaded.
@param flags Flag that can take values of cv::ImreadModes
- imreadmulti(...)
- imreadmulti(filename[, mats[, flags]]) -> retval, mats
@brief Loads a multi-page image from a file.
The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects.
@param filename Name of file to be loaded.
@param flags Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR.
@param mats A vector of Mat objects holding each page, if more than one.
@sa cv::imread
- imshow(...)
- imshow(winname, mat) -> None
@brief Displays an image in the specified window.
The function imshow displays an image in the specified window. If the window was created with the
cv::WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution.
Otherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth:
- If the image is 8-bit unsigned, it is displayed as is.
- If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the
value range [0,255\*256] is mapped to [0,255].
- If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255. That is, the
value range [0,1] is mapped to [0,255].
If window was created with OpenGL support, cv::imshow also support ogl::Buffer , ogl::Texture2D and
cuda::GpuMat as input.
If the window was not created before this function, it is assumed creating a window with cv::WINDOW_AUTOSIZE.
If you need to show an image that is bigger than the screen resolution, you will need to call namedWindow("", WINDOW_NORMAL) before the imshow.
@note This function should be followed by cv::waitKey function which displays the image for specified
milliseconds. Otherwise, it won't display the image. For example, **waitKey(0)** will display the window
infinitely until any keypress (it is suitable for image display). **waitKey(25)** will display a frame
for 25 ms, after which display will be automatically closed. (If you put it in a loop to read
videos, it will display the video frame-by-frame)
@note
[__Windows Backend Only__] Pressing Ctrl+C will copy the image to the clipboard.
[__Windows Backend Only__] Pressing Ctrl+S will show a dialog to save the image.
@param winname Name of the window.
@param mat Image to be shown.
- imwrite(...)
- imwrite(filename, img[, params]) -> retval
@brief Saves an image to a specified file.
The function imwrite saves the image to the specified file. The image format is chosen based on the
filename extension (see cv::imread for the list of extensions). Only 8-bit (or 16-bit unsigned (CV_16U)
in case of PNG, JPEG 2000, and TIFF) single-channel or 3-channel (with 'BGR' channel order) images
can be saved using this function. If the format, depth or channel order is different, use
Mat::convertTo , and cv::cvtColor to convert it before saving. Or, use the universal FileStorage I/O
functions to save the image to XML or YAML format.
It is possible to store PNG images with an alpha channel using this function. To do this, create
8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels
should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535.
The sample below shows how to create such a BGRA image and store to PNG file. It also demonstrates how to set custom
compression parameters :
@include snippets/imgcodecs_imwrite.cpp
@param filename Name of the file.
@param img Image to be saved.
@param params Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags
- inRange(...)
- inRange(src, lowerb, upperb[, dst]) -> dst
@brief Checks if array elements lie between the elements of two other arrays.
The function checks the range as follows:
- For every element of a single-channel input array:
\f[\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0\f]
- For two-channel arrays:
\f[\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0 \land \texttt{lowerb} (I)_1 \leq \texttt{src} (I)_1 \leq \texttt{upperb} (I)_1\f]
- and so forth.
That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the
specified 1D, 2D, 3D, ... box and 0 otherwise.
When the lower and/or upper boundary parameters are scalars, the indexes
(I) at lowerb and upperb in the above formulas should be omitted.
@param src first input array.
@param lowerb inclusive lower boundary array or a scalar.
@param upperb inclusive upper boundary array or a scalar.
@param dst output array of the same size as src and CV_8U type.
- initCameraMatrix2D(...)
- initCameraMatrix2D(objectPoints, imagePoints, imageSize[, aspectRatio]) -> retval
@brief Finds an initial camera matrix from 3D-2D point correspondences.
@param objectPoints Vector of vectors of the calibration pattern points in the calibration pattern
coordinate space. In the old interface all the per-view vectors are concatenated. See
calibrateCamera for details.
@param imagePoints Vector of vectors of the projections of the calibration pattern points. In the
old interface all the per-view vectors are concatenated.
@param imageSize Image size in pixels used to initialize the principal point.
@param aspectRatio If it is zero or negative, both \f$f_x\f$ and \f$f_y\f$ are estimated independently.
Otherwise, \f$f_x = f_y * \texttt{aspectRatio}\f$ .
The function estimates and returns an initial camera matrix for the camera calibration process.
Currently, the function only supports planar calibration patterns, which are patterns where each
object point has z-coordinate =0.
- initUndistortRectifyMap(...)
- initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix, size, m1type[, map1[, map2]]) -> map1, map2
@brief Computes the undistortion and rectification transformation map.
The function computes the joint undistortion and rectification transformation and represents the
result in the form of maps for remap. The undistorted image looks like original, as if it is
captured with a camera using the camera matrix =newCameraMatrix and zero distortion. In case of a
monocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by
#getOptimalNewCameraMatrix for a better control over scaling. In case of a stereo camera,
newCameraMatrix is normally set to P1 or P2 computed by #stereoRectify .
Also, this new camera is oriented differently in the coordinate space, according to R. That, for
example, helps to align two heads of a stereo camera so that the epipolar lines on both images
become horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera).
The function actually builds the maps for the inverse mapping algorithm that is used by remap. That
is, for each pixel \f$(u, v)\f$ in the destination (corrected and rectified) image, the function
computes the corresponding coordinates in the source image (that is, in the original image from
camera). The following process is applied:
\f[
\begin{array}{l}
x \leftarrow (u - {c'}_x)/{f'}_x \\
y \leftarrow (v - {c'}_y)/{f'}_y \\
{[X\,Y\,W]} ^T \leftarrow R^{-1}*[x \, y \, 1]^T \\
x' \leftarrow X/W \\
y' \leftarrow Y/W \\
r^2 \leftarrow x'^2 + y'^2 \\
x'' \leftarrow x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}
+ 2p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4\\
y'' \leftarrow y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}
+ p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\
s\vecthree{x'''}{y'''}{1} =
\vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}((\tau_x, \tau_y)}
{0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)}
{0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\
map_x(u,v) \leftarrow x''' f_x + c_x \\
map_y(u,v) \leftarrow y''' f_y + c_y
\end{array}
\f]
where \f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$
are the distortion coefficients.
In case of a stereo camera, this function is called twice: once for each camera head, after
stereoRectify, which in its turn is called after #stereoCalibrate. But if the stereo camera
was not calibrated, it is still possible to compute the rectification transformations directly from
the fundamental matrix using #stereoRectifyUncalibrated. For each camera, the function computes
homography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D
space. R can be computed from H as
\f[\texttt{R} = \texttt{cameraMatrix} ^{-1} \cdot \texttt{H} \cdot \texttt{cameraMatrix}\f]
where cameraMatrix can be chosen arbitrarily.
@param cameraMatrix Input camera matrix \f$A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$
of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
@param R Optional rectification transformation in the object space (3x3 matrix). R1 or R2 ,
computed by #stereoRectify can be passed here. If the matrix is empty, the identity transformation
is assumed. In cvInitUndistortMap R assumed to be an identity matrix.
@param newCameraMatrix New camera matrix \f$A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}\f$.
@param size Undistorted image size.
@param m1type Type of the first output map that can be CV_32FC1, CV_32FC2 or CV_16SC2, see #convertMaps
@param map1 The first output map.
@param map2 The second output map.
- initWideAngleProjMap(...)
- initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize, destImageWidth, m1type[, map1[, map2[, projType[, alpha]]]]) -> retval, map1, map2
- inpaint(...)
- inpaint(src, inpaintMask, inpaintRadius, flags[, dst]) -> dst
@brief Restores the selected region in an image using the region neighborhood.
@param src Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.
@param inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that
needs to be inpainted.
@param dst Output image with the same size and type as src .
@param inpaintRadius Radius of a circular neighborhood of each point inpainted that is considered
by the algorithm.
@param flags Inpainting method that could be one of the following:
- **INPAINT_NS** Navier-Stokes based method [Navier01]
- **INPAINT_TELEA** Method by Alexandru Telea @cite Telea04 .
The function reconstructs the selected image area from the pixel near the area boundary. The
function may be used to remove dust and scratches from a scanned photo, or to remove undesirable
objects from still images or video. See <http://en.wikipedia.org/wiki/Inpainting> for more details.
@note
- An example using the inpainting technique can be found at
opencv_source_code/samples/cpp/inpaint.cpp
- (Python) An example using the inpainting technique can be found at
opencv_source_code/samples/python/inpaint.py
- insertChannel(...)
- insertChannel(src, dst, coi) -> dst
@brief Inserts a single channel to dst (coi is 0-based index)
@param src input array
@param dst output array
@param coi index of channel for insertion
@sa mixChannels, merge
- integral(...)
- integral(src[, sum[, sdepth]]) -> sum
@overload
- integral2(...)
- integral2(src[, sum[, sqsum[, sdepth[, sqdepth]]]]) -> sum, sqsum
@overload
- integral3(...)
- integral3(src[, sum[, sqsum[, tilted[, sdepth[, sqdepth]]]]]) -> sum, sqsum, tilted
@brief Calculates the integral of an image.
The function calculates one or more integral images for the source image as follows:
\f[\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)\f]
\f[\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2\f]
\f[\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)\f]
Using these integral images, you can calculate sum, mean, and standard deviation over a specific
up-right or rotated rectangular region of the image in a constant time, for example:
\f[\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)\f]
It makes possible to do a fast blurring or fast block correlation with a variable window size, for
example. In case of multi-channel images, sums for each channel are accumulated independently.
As a practical example, the next figure shows the calculation of the integral of a straight
rectangle Rect(3,3,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the
original image are shown, as well as the relative pixels in the integral images sum and tilted .

@param src input image as \f$W \times H\f$, 8-bit or floating-point (32f or 64f).
@param sum integral image as \f$(W+1)\times (H+1)\f$ , 32-bit integer or floating-point (32f or 64f).
@param sqsum integral image for squared pixel values; it is \f$(W+1)\times (H+1)\f$, double-precision
floating-point (64f) array.
@param tilted integral for the image rotated by 45 degrees; it is \f$(W+1)\times (H+1)\f$ array with
the same data type as sum.
@param sdepth desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or
CV_64F.
@param sqdepth desired depth of the integral image of squared pixel values, CV_32F or CV_64F.
- intersectConvexConvex(...)
- intersectConvexConvex(_p1, _p2[, _p12[, handleNested]]) -> retval, _p12
- invert(...)
- invert(src[, dst[, flags]]) -> retval, dst
@brief Finds the inverse or pseudo-inverse of a matrix.
The function cv::invert inverts the matrix src and stores the result in dst
. When the matrix src is singular or non-square, the function calculates
the pseudo-inverse matrix (the dst matrix) so that norm(src\*dst - I) is
minimal, where I is an identity matrix.
In case of the #DECOMP_LU method, the function returns non-zero value if
the inverse has been successfully calculated and 0 if src is singular.
In case of the #DECOMP_SVD method, the function returns the inverse
condition number of src (the ratio of the smallest singular value to the
largest singular value) and 0 if src is singular. The SVD method
calculates a pseudo-inverse matrix if src is singular.
Similarly to #DECOMP_LU, the method #DECOMP_CHOLESKY works only with
non-singular square matrices that should also be symmetrical and
positively defined. In this case, the function stores the inverted
matrix in dst and returns non-zero. Otherwise, it returns 0.
@param src input floating-point M x N matrix.
@param dst output matrix of N x M size and the same type as src.
@param flags inversion method (cv::DecompTypes)
@sa solve, SVD
- invertAffineTransform(...)
- invertAffineTransform(M[, iM]) -> iM
@brief Inverts an affine transformation.
The function computes an inverse affine transformation represented by \f$2 \times 3\f$ matrix M:
\f[\begin{bmatrix} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \end{bmatrix}\f]
The result is also a \f$2 \times 3\f$ matrix of the same type as M.
@param M Original affine transformation.
@param iM Output reverse affine transformation.
- isContourConvex(...)
- isContourConvex(contour) -> retval
@brief Tests a contour convexity.
The function tests whether the input contour is convex or not. The contour must be simple, that is,
without self-intersections. Otherwise, the function output is undefined.
@param contour Input vector of 2D points, stored in std::vector\<\> or Mat
- kmeans(...)
- kmeans(data, K, bestLabels, criteria, attempts, flags[, centers]) -> retval, bestLabels, centers
@brief Finds centers of clusters and groups input samples around the clusters.
The function kmeans implements a k-means algorithm that finds the centers of cluster_count clusters
and groups the input samples around the clusters. As an output, \f$\texttt{labels}_i\f$ contains a
0-based cluster index for the sample stored in the \f$i^{th}\f$ row of the samples matrix.
@note
- (Python) An example on K-means clustering can be found at
opencv_source_code/samples/python/kmeans.py
@param data Data for clustering. An array of N-Dimensional points with float coordinates is needed.
Examples of this array can be:
- Mat points(count, 2, CV_32F);
- Mat points(count, 1, CV_32FC2);
- Mat points(1, count, CV_32FC2);
- std::vector\<cv::Point2f\> points(sampleCount);
@param K Number of clusters to split the set by.
@param bestLabels Input/output integer array that stores the cluster indices for every sample.
@param criteria The algorithm termination criteria, that is, the maximum number of iterations and/or
the desired accuracy. The accuracy is specified as criteria.epsilon. As soon as each of the cluster
centers moves by less than criteria.epsilon on some iteration, the algorithm stops.
@param attempts Flag to specify the number of times the algorithm is executed using different
initial labellings. The algorithm returns the labels that yield the best compactness (see the last
function parameter).
@param flags Flag that can take values of cv::KmeansFlags
@param centers Output matrix of the cluster centers, one row per each cluster center.
@return The function returns the compactness measure that is computed as
\f[\sum _i \| \texttt{samples} _i - \texttt{centers} _{ \texttt{labels} _i} \| ^2\f]
after every attempt. The best (minimum) value is chosen and the corresponding labels and the
compactness value are returned by the function. Basically, you can use only the core of the
function, set the number of attempts to 1, initialize labels each time using a custom algorithm,
pass them with the ( flags = #KMEANS_USE_INITIAL_LABELS ) flag, and then choose the best
(most-compact) clustering.
- line(...)
- line(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> img
@brief Draws a line segment connecting two points.
The function line draws the line segment between pt1 and pt2 points in the image. The line is
clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected
or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased
lines are drawn using Gaussian filtering.
@param img Image.
@param pt1 First point of the line segment.
@param pt2 Second point of the line segment.
@param color Line color.
@param thickness Line thickness.
@param lineType Type of the line. See #LineTypes.
@param shift Number of fractional bits in the point coordinates.
- linearPolar(...)
- linearPolar(src, center, maxRadius, flags[, dst]) -> dst
@brief Remaps an image to polar coordinates space.
@anchor polar_remaps_reference_image

Transform the source image using the following transformation:
\f[\begin{array}{l}
dst( \rho , \phi ) = src(x,y) \\
dst.size() \leftarrow src.size()
\end{array}\f]
where
\f[\begin{array}{l}
I = (dx,dy) = (x - center.x,y - center.y) \\
\rho = Kx \cdot \texttt{magnitude} (I) ,\\
\phi = Ky \cdot \texttt{angle} (I)_{0..360 deg}
\end{array}\f]
and
\f[\begin{array}{l}
Kx = src.cols / maxRadius \\
Ky = src.rows / 360
\end{array}\f]
@param src Source image
@param dst Destination image. It will have same size and type as src.
@param center The transformation center;
@param maxRadius The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.
@param flags A combination of interpolation methods, see #InterpolationFlags
@note
- The function can not operate in-place.
- To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
- log(...)
- log(src[, dst]) -> dst
@brief Calculates the natural logarithm of every array element.
The function cv::log calculates the natural logarithm of every element of the input array:
\f[\texttt{dst} (I) = \log (\texttt{src}(I)) \f]
Output on zero, negative and special (NaN, Inf) values is undefined.
@param src input array.
@param dst output array of the same size and type as src .
@sa exp, cartToPolar, polarToCart, phase, pow, sqrt, magnitude
- logPolar(...)
- logPolar(src, center, M, flags[, dst]) -> dst
@brief Remaps an image to semilog-polar coordinates space.
Transform the source image using the following transformation (See @ref polar_remaps_reference_image "Polar remaps reference image"):
\f[\begin{array}{l}
dst( \rho , \phi ) = src(x,y) \\
dst.size() \leftarrow src.size()
\end{array}\f]
where
\f[\begin{array}{l}
I = (dx,dy) = (x - center.x,y - center.y) \\
\rho = M \cdot log_e(\texttt{magnitude} (I)) ,\\
\phi = Ky \cdot \texttt{angle} (I)_{0..360 deg} \\
\end{array}\f]
and
\f[\begin{array}{l}
M = src.cols / log_e(maxRadius) \\
Ky = src.rows / 360 \\
\end{array}\f]
The function emulates the human "foveal" vision and can be used for fast scale and
rotation-invariant template matching, for object tracking and so forth.
@param src Source image
@param dst Destination image. It will have same size and type as src.
@param center The transformation center; where the output precision is maximal
@param M Magnitude scale parameter. It determines the radius of the bounding circle to transform too.
@param flags A combination of interpolation methods, see #InterpolationFlags
@note
- The function can not operate in-place.
- To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
- magnitude(...)
- magnitude(x, y[, magnitude]) -> magnitude
@brief Calculates the magnitude of 2D vectors.
The function cv::magnitude calculates the magnitude of 2D vectors formed
from the corresponding elements of x and y arrays:
\f[\texttt{dst} (I) = \sqrt{\texttt{x}(I)^2 + \texttt{y}(I)^2}\f]
@param x floating-point array of x-coordinates of the vectors.
@param y floating-point array of y-coordinates of the vectors; it must
have the same size as x.
@param magnitude output array of the same size and type as x.
@sa cartToPolar, polarToCart, phase, sqrt
- matMulDeriv(...)
- matMulDeriv(A, B[, dABdA[, dABdB]]) -> dABdA, dABdB
@brief Computes partial derivatives of the matrix product for each multiplied matrix.
@param A First multiplied matrix.
@param B Second multiplied matrix.
@param dABdA First output derivative matrix d(A\*B)/dA of size
\f$\texttt{A.rows*B.cols} \times {A.rows*A.cols}\f$ .
@param dABdB Second output derivative matrix d(A\*B)/dB of size
\f$\texttt{A.rows*B.cols} \times {B.rows*B.cols}\f$ .
The function computes partial derivatives of the elements of the matrix product \f$A*B\f$ with regard to
the elements of each of the two input matrices. The function is used to compute the Jacobian
matrices in stereoCalibrate but can also be used in any other similar optimization function.
- matchShapes(...)
- matchShapes(contour1, contour2, method, parameter) -> retval
@brief Compares two shapes.
The function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)
@param contour1 First contour or grayscale image.
@param contour2 Second contour or grayscale image.
@param method Comparison method, see #ShapeMatchModes
@param parameter Method-specific parameter (not supported now).
- matchTemplate(...)
- matchTemplate(image, templ, method[, result[, mask]]) -> result
@brief Compares a template against overlapped image regions.
The function slides through image , compares the overlapped patches of size \f$w \times h\f$ against
templ using the specified method and stores the comparison results in result . Here are the formulae
for the available comparison methods ( \f$I\f$ denotes image, \f$T\f$ template, \f$R\f$ result ). The summation
is done over template and/or the image patch: \f$x' = 0...w-1, y' = 0...h-1\f$
After the function finishes the comparison, the best matches can be found as global minimums (when
#TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the
#minMaxLoc function. In case of a color image, template summation in the numerator and each sum in
the denominator is done over all of the channels and separate mean values are used for each channel.
That is, the function can take a color template and a color image. The result will still be a
single-channel image, which is easier to analyze.
@param image Image where the search is running. It must be 8-bit or 32-bit floating-point.
@param templ Searched template. It must be not greater than the source image and have the same
data type.
@param result Map of comparison results. It must be single-channel 32-bit floating-point. If image
is \f$W \times H\f$ and templ is \f$w \times h\f$ , then result is \f$(W-w+1) \times (H-h+1)\f$ .
@param method Parameter specifying the comparison method, see #TemplateMatchModes
@param mask Mask of searched template. It must have the same datatype and size with templ. It is
not set by default. Currently, only the #TM_SQDIFF and #TM_CCORR_NORMED methods are supported.
- max(...)
- max(src1, src2[, dst]) -> dst
@brief Calculates per-element maximum of two arrays or an array and a scalar.
The function cv::max calculates the per-element maximum of two arrays:
\f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{src2} (I))\f]
or array and a scalar:
\f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{value} )\f]
@param src1 first input array.
@param src2 second input array of the same size and type as src1 .
@param dst output array of the same size and type as src1.
@sa min, compare, inRange, minMaxLoc, @ref MatrixExpressions
- mean(...)
- mean(src[, mask]) -> retval
@brief Calculates an average (mean) of array elements.
The function cv::mean calculates the mean value M of array elements,
independently for each channel, and return it:
\f[\begin{array}{l} N = \sum _{I: \; \texttt{mask} (I) \ne 0} 1 \\ M_c = \left ( \sum _{I: \; \texttt{mask} (I) \ne 0}{ \texttt{mtx} (I)_c} \right )/N \end{array}\f]
When all the mask elements are 0's, the function returns Scalar::all(0)
@param src input array that should have from 1 to 4 channels so that the result can be stored in
Scalar_ .
@param mask optional operation mask.
@sa countNonZero, meanStdDev, norm, minMaxLoc
- meanShift(...)
- meanShift(probImage, window, criteria) -> retval, window
@brief Finds an object on a back projection image.
@param probImage Back projection of the object histogram. See calcBackProject for details.
@param window Initial search window.
@param criteria Stop criteria for the iterative search algorithm.
returns
: Number of iterations CAMSHIFT took to converge.
The function implements the iterative object search algorithm. It takes the input back projection of
an object and the initial position. The mass center in window of the back projection image is
computed and the search window center shifts to the mass center. The procedure is repeated until the
specified number of iterations criteria.maxCount is done or until the window center shifts by less
than criteria.epsilon. The algorithm is used inside CamShift and, unlike CamShift , the search
window size or orientation do not change during the search. You can simply pass the output of
calcBackProject to this function. But better results can be obtained if you pre-filter the back
projection and remove the noise. For example, you can do this by retrieving connected components
with findContours , throwing away contours with small area ( contourArea ), and rendering the
remaining contours with drawContours.
- meanStdDev(...)
- meanStdDev(src[, mean[, stddev[, mask]]]) -> mean, stddev
Calculates a mean and standard deviation of array elements.
The function cv::meanStdDev calculates the mean and the standard deviation M
of array elements independently for each channel and returns it via the
output parameters:
\f[\begin{array}{l} N = \sum _{I, \texttt{mask} (I) \ne 0} 1 \\ \texttt{mean} _c = \frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \texttt{src} (I)_c}{N} \\ \texttt{stddev} _c = \sqrt{\frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \left ( \texttt{src} (I)_c - \texttt{mean} _c \right )^2}{N}} \end{array}\f]
When all the mask elements are 0's, the function returns
mean=stddev=Scalar::all(0).
@note The calculated standard deviation is only the diagonal of the
complete normalized covariance matrix. If the full matrix is needed, you
can reshape the multi-channel array M x N to the single-channel array
M\*N x mtx.channels() (only possible when the matrix is continuous) and
then pass the matrix to calcCovarMatrix .
@param src input array that should have from 1 to 4 channels so that the results can be stored in
Scalar_ 's.
@param mean output parameter: calculated mean value.
@param stddev output parameter: calculated standard deviation.
@param mask optional operation mask.
@sa countNonZero, mean, norm, minMaxLoc, calcCovarMatrix
- medianBlur(...)
- medianBlur(src, ksize[, dst]) -> dst
@brief Blurs an image using the median filter.
The function smoothes an image using the median filter with the \f$\texttt{ksize} \times
\texttt{ksize}\f$ aperture. Each channel of a multi-channel image is processed independently.
In-place operation is supported.
@note The median filter uses #BORDER_REPLICATE internally to cope with border pixels, see #BorderTypes
@param src input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be
CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
@param dst destination array of the same size and type as src.
@param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
@sa bilateralFilter, blur, boxFilter, GaussianBlur
- merge(...)
- merge(mv[, dst]) -> dst
@overload
@param mv input vector of matrices to be merged; all the matrices in mv must have the same
size and the same depth.
@param dst output array of the same size and the same depth as mv[0]; The number of channels will
be the total number of channels in the matrix array.
- min(...)
- min(src1, src2[, dst]) -> dst
@brief Calculates per-element minimum of two arrays or an array and a scalar.
The function cv::min calculates the per-element minimum of two arrays:
\f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{src2} (I))\f]
or array and a scalar:
\f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{value} )\f]
@param src1 first input array.
@param src2 second input array of the same size and type as src1.
@param dst output array of the same size and type as src1.
@sa max, compare, inRange, minMaxLoc
- minAreaRect(...)
- minAreaRect(points) -> retval
@brief Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a
specified point set. Developer should keep in mind that the returned RotatedRect can contain negative
indices when data is close to the containing Mat element boundary.
@param points Input vector of 2D points, stored in std::vector\<\> or Mat
- minEnclosingCircle(...)
- minEnclosingCircle(points) -> center, radius
@brief Finds a circle of the minimum area enclosing a 2D point set.
The function finds the minimal enclosing circle of a 2D point set using an iterative algorithm.
@param points Input vector of 2D points, stored in std::vector\<\> or Mat
@param center Output center of the circle.
@param radius Output radius of the circle.
- minEnclosingTriangle(...)
- minEnclosingTriangle(points[, triangle]) -> retval, triangle
@brief Finds a triangle of minimum area enclosing a 2D point set and returns its area.
The function finds a triangle of minimum area enclosing the given set of 2D points and returns its
area. The output for a given 2D point set is shown in the image below. 2D points are depicted in
*red* and the enclosing triangle in *yellow*.

The implementation of the algorithm is based on O'Rourke's @cite ORourke86 and Klee and Laskowski's
@cite KleeLaskowski85 papers. O'Rourke provides a \f$\theta(n)\f$ algorithm for finding the minimal
enclosing triangle of a 2D convex polygon with n vertices. Since the #minEnclosingTriangle function
takes a 2D point set as input an additional preprocessing step of computing the convex hull of the
2D point set is required. The complexity of the #convexHull function is \f$O(n log(n))\f$ which is higher
than \f$\theta(n)\f$. Thus the overall complexity of the function is \f$O(n log(n))\f$.
@param points Input vector of 2D points with depth CV_32S or CV_32F, stored in std::vector\<\> or Mat
@param triangle Output vector of three 2D points defining the vertices of the triangle. The depth
of the OutputArray must be CV_32F.
- minMaxLoc(...)
- minMaxLoc(src[, mask]) -> minVal, maxVal, minLoc, maxLoc
@brief Finds the global minimum and maximum in an array.
The function cv::minMaxLoc finds the minimum and maximum element values and their positions. The
extremums are searched across the whole array or, if mask is not an empty array, in the specified
array region.
The function do not work with multi-channel arrays. If you need to find minimum or maximum
elements across all the channels, use Mat::reshape first to reinterpret the array as
single-channel. Or you may extract the particular channel using either extractImageCOI , or
mixChannels , or split .
@param src input single-channel array.
@param minVal pointer to the returned minimum value; NULL is used if not required.
@param maxVal pointer to the returned maximum value; NULL is used if not required.
@param minLoc pointer to the returned minimum location (in 2D case); NULL is used if not required.
@param maxLoc pointer to the returned maximum location (in 2D case); NULL is used if not required.
@param mask optional mask used to select a sub-array.
@sa max, min, compare, inRange, extractImageCOI, mixChannels, split, Mat::reshape
- mixChannels(...)
- mixChannels(src, dst, fromTo) -> dst
@overload
@param src input array or vector of matrices; all of the matrices must have the same size and the
same depth.
@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and
depth must be the same as in src[0].
@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to
src[0].channels()-1, the second input image channels are indexed from src[0].channels() to
src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image
channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is
filled with zero .
- moments(...)
- moments(array[, binaryImage]) -> retval
@brief Calculates all of the moments up to the third order of a polygon or rasterized shape.
The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The
results are returned in the structure cv::Moments.
@param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array (
\f$1 \times N\f$ or \f$N \times 1\f$ ) of 2D points (Point or Point2f ).
@param binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is
used for images only.
@returns moments.
@note Only applicable to contour moments calculations from Python bindings: Note that the numpy
type for the input array should be either np.int32 or np.float32.
@sa contourArea, arcLength
- morphologyEx(...)
- morphologyEx(src, op, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]) -> dst
@brief Performs advanced morphological transformations.
The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
basic operations.
Any of the operations can be done in-place. In case of multi-channel images, each channel is
processed independently.
@param src Source image. The number of channels can be arbitrary. The depth should be one of
CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
@param dst Destination image of the same size and type as source image.
@param op Type of a morphological operation, see #MorphTypes
@param kernel Structuring element. It can be created using #getStructuringElement.
@param anchor Anchor position with the kernel. Negative values mean that the anchor is at the
kernel center.
@param iterations Number of times erosion and dilation are applied.
@param borderType Pixel extrapolation method, see #BorderTypes
@param borderValue Border value in case of a constant border. The default value has a special
meaning.
@sa dilate, erode, getStructuringElement
@note The number of iterations is the number of times erosion or dilatation operation will be applied.
For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
- moveWindow(...)
- moveWindow(winname, x, y) -> None
@brief Moves window to the specified position
@param winname Name of the window.
@param x The new x-coordinate of the window.
@param y The new y-coordinate of the window.
- mulSpectrums(...)
- mulSpectrums(a, b, flags[, c[, conjB]]) -> c
@brief Performs the per-element multiplication of two Fourier spectrums.
The function cv::mulSpectrums performs the per-element multiplication of the two CCS-packed or complex
matrices that are results of a real or complex Fourier transform.
The function, together with dft and idft , may be used to calculate convolution (pass conjB=false )
or correlation (pass conjB=true ) of two arrays rapidly. When the arrays are complex, they are
simply multiplied (per element) with an optional conjugation of the second-array elements. When the
arrays are real, they are assumed to be CCS-packed (see dft for details).
@param a first input array.
@param b second input array of the same size and type as src1 .
@param c output array of the same size and type as src1 .
@param flags operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that
each row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value.
@param conjB optional flag that conjugates the second input array before the multiplication (true)
or not (false).
- mulTransposed(...)
- mulTransposed(src, aTa[, dst[, delta[, scale[, dtype]]]]) -> dst
@brief Calculates the product of a matrix and its transposition.
The function cv::mulTransposed calculates the product of src and its
transposition:
\f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} )^T ( \texttt{src} - \texttt{delta} )\f]
if aTa=true , and
\f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} ) ( \texttt{src} - \texttt{delta} )^T\f]
otherwise. The function is used to calculate the covariance matrix. With
zero delta, it can be used as a faster substitute for general matrix
product A\*B when B=A'
@param src input single-channel matrix. Note that unlike gemm, the
function can multiply not only floating-point matrices.
@param dst output square matrix.
@param aTa Flag specifying the multiplication ordering. See the
description below.
@param delta Optional delta matrix subtracted from src before the
multiplication. When the matrix is empty ( delta=noArray() ), it is
assumed to be zero, that is, nothing is subtracted. If it has the same
size as src , it is simply subtracted. Otherwise, it is "repeated" (see
repeat ) to cover the full src and then subtracted. Type of the delta
matrix, when it is not empty, must be the same as the type of created
output matrix. See the dtype parameter description below.
@param scale Optional scale factor for the matrix product.
@param dtype Optional type of the output matrix. When it is negative,
the output matrix will have the same type as src . Otherwise, it will be
type=CV_MAT_DEPTH(dtype) that should be either CV_32F or CV_64F .
@sa calcCovarMatrix, gemm, repeat, reduce
- multiply(...)
- multiply(src1, src2[, dst[, scale[, dtype]]]) -> dst
@brief Calculates the per-element scaled product of two arrays.
The function multiply calculates the per-element product of two arrays:
\f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{scale} \cdot \texttt{src1} (I) \cdot \texttt{src2} (I))\f]
There is also a @ref MatrixExpressions -friendly variant of the first function. See Mat::mul .
For a not-per-element matrix product, see gemm .
@note Saturation is not applied when the output array has the depth
CV_32S. You may even get result of an incorrect sign in the case of
overflow.
@param src1 first input array.
@param src2 second input array of the same size and the same type as src1.
@param dst output array of the same size and type as src1.
@param scale optional scale factor.
@param dtype optional depth of the output array
@sa add, subtract, divide, scaleAdd, addWeighted, accumulate, accumulateProduct, accumulateSquare,
Mat::convertTo
- namedWindow(...)
- namedWindow(winname[, flags]) -> None
@brief Creates a window.
The function namedWindow creates a window that can be used as a placeholder for images and
trackbars. Created windows are referred to by their names.
If a window with the same name already exists, the function does nothing.
You can call cv::destroyWindow or cv::destroyAllWindows to close the window and de-allocate any associated
memory usage. For a simple program, you do not really have to call these functions because all the
resources and windows of the application are closed automatically by the operating system upon exit.
@note
Qt backend supports additional flags:
- **WINDOW_NORMAL or WINDOW_AUTOSIZE:** WINDOW_NORMAL enables you to resize the
window, whereas WINDOW_AUTOSIZE adjusts automatically the window size to fit the
displayed image (see imshow ), and you cannot change the window size manually.
- **WINDOW_FREERATIO or WINDOW_KEEPRATIO:** WINDOW_FREERATIO adjusts the image
with no respect to its ratio, whereas WINDOW_KEEPRATIO keeps the image ratio.
- **WINDOW_GUI_NORMAL or WINDOW_GUI_EXPANDED:** WINDOW_GUI_NORMAL is the old way to draw the window
without statusbar and toolbar, whereas WINDOW_GUI_EXPANDED is a new enhanced GUI.
By default, flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED
@param winname Name of the window in the window caption that may be used as a window identifier.
@param flags Flags of the window. The supported flags are: (cv::WindowFlags)
- norm(...)
- norm(src1[, normType[, mask]]) -> retval
@brief Calculates the absolute norm of an array.
This version of #norm calculates the absolute norm of src1. The type of norm to calculate is specified using #NormTypes.
As example for one array consider the function \f$r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]\f$.
The \f$ L_{1}, L_{2} \f$ and \f$ L_{\infty} \f$ norm for the sample value \f$r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}\f$
is calculated as follows
\f{align*}
\| r(-1) \|_{L_1} &= |-1| + |2| = 3 \\
\| r(-1) \|_{L_2} &= \sqrt{(-1)^{2} + (2)^{2}} = \sqrt{5} \\
\| r(-1) \|_{L_\infty} &= \max(|-1|,|2|) = 2
\f}
and for \f$r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}\f$ the calculation is
\f{align*}
\| r(0.5) \|_{L_1} &= |0.5| + |0.5| = 1 \\
\| r(0.5) \|_{L_2} &= \sqrt{(0.5)^{2} + (0.5)^{2}} = \sqrt{0.5} \\
\| r(0.5) \|_{L_\infty} &= \max(|0.5|,|0.5|) = 0.5.
\f}
The following graphic shows all values for the three norm functions \f$\| r(x) \|_{L_1}, \| r(x) \|_{L_2}\f$ and \f$\| r(x) \|_{L_\infty}\f$.
It is notable that the \f$ L_{1} \f$ norm forms the upper and the \f$ L_{\infty} \f$ norm forms the lower border for the example function \f$ r(x) \f$.

When the mask parameter is specified and it is not empty, the norm is
If normType is not specified, #NORM_L2 is used.
calculated only over the region specified by the mask.
Multi-channel input arrays are treated as single-channel arrays, that is,
the results for all channels are combined.
Hamming norms can only be calculated with CV_8U depth arrays.
@param src1 first input array.
@param normType type of the norm (see #NormTypes).
@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.
norm(src1, src2[, normType[, mask]]) -> retval
@brief Calculates an absolute difference norm or a relative difference norm.
This version of cv::norm calculates the absolute difference norm
or the relative difference norm of arrays src1 and src2.
The type of norm to calculate is specified using #NormTypes.
@param src1 first input array.
@param src2 second input array of the same size and the same type as src1.
@param normType type of the norm (see #NormTypes).
@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type.
- normalize(...)
- normalize(src, dst[, alpha[, beta[, norm_type[, dtype[, mask]]]]]) -> dst
@brief Normalizes the norm or value range of an array.
The function cv::normalize normalizes scale and shift the input array elements so that
\f[\| \texttt{dst} \| _{L_p}= \texttt{alpha}\f]
(where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that
\f[\min _I \texttt{dst} (I)= \texttt{alpha} , \, \, \max _I \texttt{dst} (I)= \texttt{beta}\f]
when normType=NORM_MINMAX (for dense arrays only). The optional mask specifies a sub-array to be
normalized. This means that the norm or min-n-max are calculated over the sub-array, and then this
sub-array is modified to be normalized. If you want to only use the mask to calculate the norm or
min-max but modify the whole array, you can use norm and Mat::convertTo.
In case of sparse matrices, only the non-zero values are analyzed and transformed. Because of this,
the range transformation for sparse matrices is not allowed since it can shift the zero level.
Possible usage with some positive example data:
@code{.cpp}
vector<double> positiveData = { 2.0, 8.0, 10.0 };
vector<double> normalizedData_l1, normalizedData_l2, normalizedData_inf, normalizedData_minmax;
// Norm to probability (total count)
// sum(numbers) = 20.0
// 2.0 0.1 (2.0/20.0)
// 8.0 0.4 (8.0/20.0)
// 10.0 0.5 (10.0/20.0)
normalize(positiveData, normalizedData_l1, 1.0, 0.0, NORM_L1);
// Norm to unit vector: ||positiveData|| = 1.0
// 2.0 0.15
// 8.0 0.62
// 10.0 0.77
normalize(positiveData, normalizedData_l2, 1.0, 0.0, NORM_L2);
// Norm to max element
// 2.0 0.2 (2.0/10.0)
// 8.0 0.8 (8.0/10.0)
// 10.0 1.0 (10.0/10.0)
normalize(positiveData, normalizedData_inf, 1.0, 0.0, NORM_INF);
// Norm to range [0.0;1.0]
// 2.0 0.0 (shift to left border)
// 8.0 0.75 (6.0/8.0)
// 10.0 1.0 (shift to right border)
normalize(positiveData, normalizedData_minmax, 1.0, 0.0, NORM_MINMAX);
@endcode
@param src input array.
@param dst output array of the same size as src .
@param alpha norm value to normalize to or the lower range boundary in case of the range
normalization.
@param beta upper range boundary in case of the range normalization; it is not used for the norm
normalization.
@param norm_type normalization type (see cv::NormTypes).
@param dtype when negative, the output array has the same type as src; otherwise, it has the same
number of channels as src and the depth =CV_MAT_DEPTH(dtype).
@param mask optional operation mask.
@sa norm, Mat::convertTo, SparseMat::convertTo
- patchNaNs(...)
- patchNaNs(a[, val]) -> a
@brief converts NaN's to the given number
- pencilSketch(...)
- pencilSketch(src[, dst1[, dst2[, sigma_s[, sigma_r[, shade_factor]]]]]) -> dst1, dst2
@brief Pencil-like non-photorealistic line drawing
@param src Input 8-bit 3-channel image.
@param dst1 Output 8-bit 1-channel image.
@param dst2 Output image with the same size and type as src.
@param sigma_s Range between 0 to 200.
@param sigma_r Range between 0 to 1.
@param shade_factor Range between 0 to 0.1.
- perspectiveTransform(...)
- perspectiveTransform(src, m[, dst]) -> dst
@brief Performs the perspective matrix transformation of vectors.
The function cv::perspectiveTransform transforms every element of src by
treating it as a 2D or 3D vector, in the following way:
\f[(x, y, z) \rightarrow (x'/w, y'/w, z'/w)\f]
where
\f[(x', y', z', w') = \texttt{mat} \cdot \begin{bmatrix} x & y & z & 1 \end{bmatrix}\f]
and
\f[w = \fork{w'}{if \(w' \ne 0\)}{\infty}{otherwise}\f]
Here a 3D vector transformation is shown. In case of a 2D vector
transformation, the z component is omitted.
@note The function transforms a sparse set of 2D or 3D vectors. If you
want to transform an image using perspective transformation, use
warpPerspective . If you have an inverse problem, that is, you want to
compute the most probable perspective transformation out of several
pairs of corresponding points, you can use getPerspectiveTransform or
findHomography .
@param src input two-channel or three-channel floating-point array; each
element is a 2D/3D vector to be transformed.
@param dst output array of the same size and type as src.
@param m 3x3 or 4x4 floating-point transformation matrix.
@sa transform, warpPerspective, getPerspectiveTransform, findHomography
- phase(...)
- phase(x, y[, angle[, angleInDegrees]]) -> angle
@brief Calculates the rotation angle of 2D vectors.
The function cv::phase calculates the rotation angle of each 2D vector that
is formed from the corresponding elements of x and y :
\f[\texttt{angle} (I) = \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))\f]
The angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 ,
the corresponding angle(I) is set to 0.
@param x input floating-point array of x-coordinates of 2D vectors.
@param y input array of y-coordinates of 2D vectors; it must have the
same size and the same type as x.
@param angle output array of vector angles; it has the same size and
same type as x .
@param angleInDegrees when true, the function calculates the angle in
degrees, otherwise, they are measured in radians.
- phaseCorrelate(...)
- phaseCorrelate(src1, src2[, window]) -> retval, response
@brief The function is used to detect translational shifts that occur between two images.
The operation takes advantage of the Fourier shift theorem for detecting the translational shift in
the frequency domain. It can be used for fast image registration as well as motion estimation. For
more information please see <http://en.wikipedia.org/wiki/Phase_correlation>
Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed
with getOptimalDFTSize.
The function performs the following equations:
- First it applies a Hanning window (see <http://en.wikipedia.org/wiki/Hann_function>) to each
image to remove possible edge effects. This window is cached until the array size changes to speed
up processing time.
- Next it computes the forward DFTs of each source array:
\f[\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}\f]
where \f$\mathcal{F}\f$ is the forward DFT.
- It then computes the cross-power spectrum of each frequency domain array:
\f[R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}\f]
- Next the cross-correlation is converted back into the time domain via the inverse DFT:
\f[r = \mathcal{F}^{-1}\{R\}\f]
- Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to
achieve sub-pixel accuracy.
\f[(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}\f]
- If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5
centroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single
peak) and will be smaller when there are multiple peaks.
@param src1 Source floating point array (CV_32FC1 or CV_64FC1)
@param src2 Source floating point array (CV_32FC1 or CV_64FC1)
@param window Floating point array with windowing coefficients to reduce edge effects (optional).
@param response Signal power within the 5x5 centroid around the peak, between 0 and 1 (optional).
@returns detected phase shift (sub-pixel) between the two arrays.
@sa dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow
- pointPolygonTest(...)
- pointPolygonTest(contour, pt, measureDist) -> retval
@brief Performs a point-in-contour test.
The function determines whether the point is inside a contour, outside, or lies on an edge (or
coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge)
value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively.
Otherwise, the return value is a signed distance between the point and the nearest contour edge.
See below a sample output of the function where each image pixel is tested against the contour:

@param contour Input contour.
@param pt Point tested against the contour.
@param measureDist If true, the function estimates the signed distance from the point to the
nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.
- polarToCart(...)
- polarToCart(magnitude, angle[, x[, y[, angleInDegrees]]]) -> x, y
@brief Calculates x and y coordinates of 2D vectors from their magnitude and angle.
The function cv::polarToCart calculates the Cartesian coordinates of each 2D
vector represented by the corresponding elements of magnitude and angle:
\f[\begin{array}{l} \texttt{x} (I) = \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) = \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}\f]
The relative accuracy of the estimated coordinates is about 1e-6.
@param magnitude input floating-point array of magnitudes of 2D vectors;
it can be an empty matrix (=Mat()), in this case, the function assumes
that all the magnitudes are =1; if it is not empty, it must have the
same size and type as angle.
@param angle input floating-point array of angles of 2D vectors.
@param x output array of x-coordinates of 2D vectors; it has the same
size and type as angle.
@param y output array of y-coordinates of 2D vectors; it has the same
size and type as angle.
@param angleInDegrees when true, the input angles are measured in
degrees, otherwise, they are measured in radians.
@sa cartToPolar, magnitude, phase, exp, log, pow, sqrt
- polylines(...)
- polylines(img, pts, isClosed, color[, thickness[, lineType[, shift]]]) -> img
@brief Draws several polygonal curves.
@param img Image.
@param pts Array of polygonal curves.
@param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed,
the function draws a line from the last vertex of each curve to its first vertex.
@param color Polyline color.
@param thickness Thickness of the polyline edges.
@param lineType Type of the line segments. See #LineTypes
@param shift Number of fractional bits in the vertex coordinates.
The function cv::polylines draws one or more polygonal curves.
- pow(...)
- pow(src, power[, dst]) -> dst
@brief Raises every array element to a power.
The function cv::pow raises every element of the input array to power :
\f[\texttt{dst} (I) = \fork{\texttt{src}(I)^{power}}{if \(\texttt{power}\) is integer}{|\texttt{src}(I)|^{power}}{otherwise}\f]
So, for a non-integer power exponent, the absolute values of input array
elements are used. However, it is possible to get true values for
negative values using some extra operations. In the example below,
computing the 5th root of array src shows:
@code{.cpp}
Mat mask = src < 0;
pow(src, 1./5, dst);
subtract(Scalar::all(0), dst, dst, mask);
@endcode
For some values of power, such as integer values, 0.5 and -0.5,
specialized faster algorithms are used.
Special values (NaN, Inf) are not handled.
@param src input array.
@param power exponent of power.
@param dst output array of the same size and type as src.
@sa sqrt, exp, log, cartToPolar, polarToCart
- preCornerDetect(...)
- preCornerDetect(src, ksize[, dst[, borderType]]) -> dst
@brief Calculates a feature map for corner detection.
The function calculates the complex spatial derivative-based function of the source image
\f[\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}\f]
where \f$D_x\f$,\f$D_y\f$ are the first image derivatives, \f$D_{xx}\f$,\f$D_{yy}\f$ are the second image
derivatives, and \f$D_{xy}\f$ is the mixed derivative.
The corners can be found as local maximums of the functions, as shown below:
@code
Mat corners, dilated_corners;
preCornerDetect(image, corners, 3);
// dilation with 3x3 rectangular structuring element
dilate(corners, dilated_corners, Mat(), 1);
Mat corner_mask = corners == dilated_corners;
@endcode
@param src Source single-channel 8-bit of floating-point image.
@param dst Output image that has the type CV_32F and the same size as src .
@param ksize %Aperture size of the Sobel .
@param borderType Pixel extrapolation method. See #BorderTypes.
- projectPoints(...)
- projectPoints(objectPoints, rvec, tvec, cameraMatrix, distCoeffs[, imagePoints[, jacobian[, aspectRatio]]]) -> imagePoints, jacobian
@brief Projects 3D points to an image plane.
@param objectPoints Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or
vector\<Point3f\> ), where N is the number of points in the view.
@param rvec Rotation vector. See Rodrigues for details.
@param tvec Translation vector.
@param cameraMatrix Camera matrix \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. If the vector is empty, the zero distortion coefficients are assumed.
@param imagePoints Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or
vector\<Point2f\> .
@param jacobian Optional output 2Nx(10+\<numDistCoeffs\>) jacobian matrix of derivatives of image
points with respect to components of the rotation vector, translation vector, focal lengths,
coordinates of the principal point and the distortion coefficients. In the old interface different
components of the jacobian are returned via different output parameters.
@param aspectRatio Optional "fixed aspect ratio" parameter. If the parameter is not 0, the
function assumes that the aspect ratio (*fx/fy*) is fixed and correspondingly adjusts the jacobian
matrix.
The function computes projections of 3D points to the image plane given intrinsic and extrinsic
camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of
image points coordinates (as functions of all the input parameters) with respect to the particular
parameters, intrinsic and/or extrinsic. The Jacobians are used during the global optimization in
calibrateCamera, solvePnP, and stereoCalibrate . The function itself can also be used to compute a
re-projection error given the current intrinsic and extrinsic parameters.
@note By setting rvec=tvec=(0,0,0) or by setting cameraMatrix to a 3x3 identity matrix, or by
passing zero distortion coefficients, you can get various useful partial cases of the function. This
means that you can compute the distorted coordinates for a sparse set of points or apply a
perspective transformation (and also compute the derivatives) in the ideal zero-distortion setup.
- putText(...)
- putText(img, text, org, fontFace, fontScale, color[, thickness[, lineType[, bottomLeftOrigin]]]) -> img
@brief Draws a text string.
The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered
using the specified font are replaced by question marks. See #getTextSize for a text rendering code
example.
@param img Image.
@param text Text string to be drawn.
@param org Bottom-left corner of the text string in the image.
@param fontFace Font type, see #HersheyFonts.
@param fontScale Font scale factor that is multiplied by the font-specific base size.
@param color Text color.
@param thickness Thickness of the lines used to draw a text.
@param lineType Line type. See #LineTypes
@param bottomLeftOrigin When true, the image data origin is at the bottom-left corner. Otherwise,
it is at the top-left corner.
- pyrDown(...)
- pyrDown(src[, dst[, dstsize[, borderType]]]) -> dst
@brief Blurs an image and downsamples it.
By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
any case, the following conditions should be satisfied:
\f[\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}\f]
The function performs the downsampling step of the Gaussian pyramid construction. First, it
convolves the source image with the kernel:
\f[\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}\f]
Then, it downsamples the image by rejecting even rows and columns.
@param src input image.
@param dst output image; it has the specified size and the same type as src.
@param dstsize size of the output image.
@param borderType Pixel extrapolation method, see #BorderTypes (#BORDER_CONSTANT isn't supported)
- pyrMeanShiftFiltering(...)
- pyrMeanShiftFiltering(src, sp, sr[, dst[, maxLevel[, termcrit]]]) -> dst
@brief Performs initial step of meanshift segmentation of an image.
The function implements the filtering stage of meanshift segmentation, that is, the output of the
function is the filtered "posterized" image with color gradients and fine-grain texture flattened.
At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes
meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is
considered:
\f[(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}\f]
where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively
(though, the algorithm does not depend on the color space used, so any 3-component color space can
be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector
(R',G',B') are found and they act as the neighborhood center on the next iteration:
\f[(X,Y)~(X',Y'), (R,G,B)~(R',G',B').\f]
After the iterations over, the color components of the initial pixel (that is, the pixel from where
the iterations started) are set to the final value (average color at the last iteration):
\f[I(X,Y) <- (R*,G*,B*)\f]
When maxLevel \> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is
run on the smallest layer first. After that, the results are propagated to the larger layer and the
iterations are run again only on those pixels where the layer colors differ by more than sr from the
lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the
results will be actually different from the ones obtained by running the meanshift procedure on the
whole original image (i.e. when maxLevel==0).
@param src The source 8-bit, 3-channel image.
@param dst The destination image of the same format and the same size as the source.
@param sp The spatial window radius.
@param sr The color window radius.
@param maxLevel Maximum level of the pyramid for the segmentation.
@param termcrit Termination criteria: when to stop meanshift iterations.
- pyrUp(...)
- pyrUp(src[, dst[, dstsize[, borderType]]]) -> dst
@brief Upsamples an image and then blurs it.
By default, size of the output image is computed as `Size(src.cols\*2, (src.rows\*2)`, but in any
case, the following conditions should be satisfied:
\f[\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}\f]
The function performs the upsampling step of the Gaussian pyramid construction, though it can
actually be used to construct the Laplacian pyramid. First, it upsamples the source image by
injecting even zero rows and columns and then convolves the result with the same kernel as in
pyrDown multiplied by 4.
@param src input image.
@param dst output image. It has the specified size and the same type as src .
@param dstsize size of the output image.
@param borderType Pixel extrapolation method, see #BorderTypes (only #BORDER_DEFAULT is supported)
- randShuffle(...)
- randShuffle(dst[, iterFactor]) -> dst
@brief Shuffles the array elements randomly.
The function cv::randShuffle shuffles the specified 1D array by randomly choosing pairs of elements and
swapping them. The number of such swap operations will be dst.rows\*dst.cols\*iterFactor .
@param dst input/output numerical 1D array.
@param iterFactor scale factor that determines the number of random swap operations (see the details
below).
@param rng optional random number generator used for shuffling; if it is zero, theRNG () is used
instead.
@sa RNG, sort
- randn(...)
- randn(dst, mean, stddev) -> dst
@brief Fills the array with normally distributed random numbers.
The function cv::randn fills the matrix dst with normally distributed random numbers with the specified
mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the
value range of the output array data type.
@param dst output array of random numbers; the array must be pre-allocated and have 1 to 4 channels.
@param mean mean value (expectation) of the generated random numbers.
@param stddev standard deviation of the generated random numbers; it can be either a vector (in
which case a diagonal standard deviation matrix is assumed) or a square matrix.
@sa RNG, randu
- randu(...)
- randu(dst, low, high) -> dst
@brief Generates a single uniformly-distributed random number or an array of random numbers.
Non-template variant of the function fills the matrix dst with uniformly-distributed
random numbers from the specified range:
\f[\texttt{low} _c \leq \texttt{dst} (I)_c < \texttt{high} _c\f]
@param dst output array of random numbers; the array must be pre-allocated.
@param low inclusive lower boundary of the generated random numbers.
@param high exclusive upper boundary of the generated random numbers.
@sa RNG, randn, theRNG
- recoverPose(...)
- recoverPose(E, points1, points2, cameraMatrix[, R[, t[, mask]]]) -> retval, R, t, mask
@brief Recover relative camera rotation and translation from an estimated essential matrix and the
corresponding points in two images, using cheirality check. Returns the number of inliers which pass
the check.
@param E The input essential matrix.
@param points1 Array of N 2D points from the first image. The point coordinates should be
floating-point (single or double precision).
@param points2 Array of the second image points of the same size and format as points1 .
@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ .
Note that this function assumes that points1 and points2 are feature points from cameras with the
same camera matrix.
@param R Recovered relative rotation.
@param t Recovered relative translation.
@param mask Input/output mask for inliers in points1 and points2.
: If it is not empty, then it marks inliers in points1 and points2 for then given essential
matrix E. Only these inliers will be used to recover pose. In the output mask only inliers
which pass the cheirality check.
This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible
pose hypotheses by doing cheirality check. The cheirality check basically means that the
triangulated 3D points should have positive depth. Some details can be found in @cite Nister03 .
This function can be used to process output E and mask from findEssentialMat. In this scenario,
points1 and points2 are the same input for findEssentialMat. :
@code
// Example. Estimation of fundamental matrix using the RANSAC algorithm
int point_count = 100;
vector<Point2f> points1(point_count);
vector<Point2f> points2(point_count);
// initialize the points here ...
for( int i = 0; i < point_count; i++ )
{
points1[i] = ...;
points2[i] = ...;
}
// cametra matrix with both focal lengths = 1, and principal point = (0, 0)
Mat cameraMatrix = Mat::eye(3, 3, CV_64F);
Mat E, R, t, mask;
E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask);
recoverPose(E, points1, points2, cameraMatrix, R, t, mask);
@endcode
recoverPose(E, points1, points2[, R[, t[, focal[, pp[, mask]]]]]) -> retval, R, t, mask
@overload
@param E The input essential matrix.
@param points1 Array of N 2D points from the first image. The point coordinates should be
floating-point (single or double precision).
@param points2 Array of the second image points of the same size and format as points1 .
@param R Recovered relative rotation.
@param t Recovered relative translation.
@param focal Focal length of the camera. Note that this function assumes that points1 and points2
are feature points from cameras with same focal length and principal point.
@param pp principal point of the camera.
@param mask Input/output mask for inliers in points1 and points2.
: If it is not empty, then it marks inliers in points1 and points2 for then given essential
matrix E. Only these inliers will be used to recover pose. In the output mask only inliers
which pass the cheirality check.
This function differs from the one above that it computes camera matrix from focal length and
principal point:
\f[K =
\begin{bmatrix}
f & 0 & x_{pp} \\
0 & f & y_{pp} \\
0 & 0 & 1
\end{bmatrix}\f]
recoverPose(E, points1, points2, cameraMatrix, distanceThresh[, R[, t[, mask[, triangulatedPoints]]]]) -> retval, R, t, mask, triangulatedPoints
@overload
@param E The input essential matrix.
@param points1 Array of N 2D points from the first image. The point coordinates should be
floating-point (single or double precision).
@param points2 Array of the second image points of the same size and format as points1.
@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ .
Note that this function assumes that points1 and points2 are feature points from cameras with the
same camera matrix.
@param R Recovered relative rotation.
@param t Recovered relative translation.
@param distanceThresh threshold distance which is used to filter out far away points (i.e. infinite points).
@param mask Input/output mask for inliers in points1 and points2.
: If it is not empty, then it marks inliers in points1 and points2 for then given essential
matrix E. Only these inliers will be used to recover pose. In the output mask only inliers
which pass the cheirality check.
@param triangulatedPoints 3d points which were reconstructed by triangulation.
- rectangle(...)
- rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> img
@brief Draws a simple, thick, or filled up-right rectangle.
The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners
are pt1 and pt2.
@param img Image.
@param pt1 Vertex of the rectangle.
@param pt2 Vertex of the rectangle opposite to pt1 .
@param color Rectangle color or brightness (grayscale image).
@param thickness Thickness of lines that make up the rectangle. Negative values, like #FILLED,
mean that the function has to draw a filled rectangle.
@param lineType Type of the line. See #LineTypes
@param shift Number of fractional bits in the point coordinates.
- rectify3Collinear(...)
- rectify3Collinear(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, cameraMatrix3, distCoeffs3, imgpt1, imgpt3, imageSize, R12, T12, R13, T13, alpha, newImgSize, flags[, R1[, R2[, R3[, P1[, P2[, P3[, Q]]]]]]]) -> retval, R1, R2, R3, P1, P2, P3, Q, roi1, roi2
- reduce(...)
- reduce(src, dim, rtype[, dst[, dtype]]) -> dst
@brief Reduces a matrix to a vector.
The function #reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of
1D vectors and performing the specified operation on the vectors until a single row/column is
obtained. For example, the function can be used to compute horizontal and vertical projections of a
raster image. In case of #REDUCE_MAX and #REDUCE_MIN , the output image should have the same type as the source one.
In case of #REDUCE_SUM and #REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.
And multi-channel arrays are also supported in these two reduction modes.
The following code demonstrates its usage for a single channel matrix.
@snippet snippets/core_reduce.cpp example
And the following code demonstrates its usage for a two-channel matrix.
@snippet snippets/core_reduce.cpp example2
@param src input 2D matrix.
@param dst output vector. Its size and type is defined by dim and dtype parameters.
@param dim dimension index along which the matrix is reduced. 0 means that the matrix is reduced to
a single row. 1 means that the matrix is reduced to a single column.
@param rtype reduction operation that could be one of #ReduceTypes
@param dtype when negative, the output vector will have the same type as the input matrix,
otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels()).
@sa repeat
- remap(...)
- remap(src, map1, map2, interpolation[, dst[, borderMode[, borderValue]]]) -> dst
@brief Applies a generic geometrical transformation to an image.
The function remap transforms the source image using the specified map:
\f[\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))\f]
where values of pixels with non-integer coordinates are computed using one of available
interpolation methods. \f$map_x\f$ and \f$map_y\f$ can be encoded as separate floating-point maps
in \f$map_1\f$ and \f$map_2\f$ respectively, or interleaved floating-point maps of \f$(x,y)\f$ in
\f$map_1\f$, or fixed-point maps created by using convertMaps. The reason you might want to
convert from floating to fixed-point representations of a map is that they can yield much faster
(\~2x) remapping operations. In the converted case, \f$map_1\f$ contains pairs (cvFloor(x),
cvFloor(y)) and \f$map_2\f$ contains indices in a table of interpolation coefficients.
This function cannot operate in-place.
@param src Source image.
@param dst Destination image. It has the same size as map1 and the same type as src .
@param map1 The first map of either (x,y) points or just x values having the type CV_16SC2 ,
CV_32FC1, or CV_32FC2. See convertMaps for details on converting a floating point
representation to fixed-point for speed.
@param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map
if map1 is (x,y) points), respectively.
@param interpolation Interpolation method (see #InterpolationFlags). The method #INTER_AREA is
not supported by this function.
@param borderMode Pixel extrapolation method (see #BorderTypes). When
borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that
corresponds to the "outliers" in the source image are not modified by the function.
@param borderValue Value used in case of a constant border. By default, it is 0.
@note
Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
- repeat(...)
- repeat(src, ny, nx[, dst]) -> dst
@brief Fills the output array with repeated copies of the input array.
The function cv::repeat duplicates the input array one or more times along each of the two axes:
\f[\texttt{dst} _{ij}= \texttt{src} _{i\mod src.rows, \; j\mod src.cols }\f]
The second variant of the function is more convenient to use with @ref MatrixExpressions.
@param src input array to replicate.
@param ny Flag to specify how many times the `src` is repeated along the
vertical axis.
@param nx Flag to specify how many times the `src` is repeated along the
horizontal axis.
@param dst output array of the same type as `src`.
@sa cv::reduce
- reprojectImageTo3D(...)
- reprojectImageTo3D(disparity, Q[, _3dImage[, handleMissingValues[, ddepth]]]) -> _3dImage
@brief Reprojects a disparity image to 3D space.
@param disparity Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit
floating-point disparity image. If 16-bit signed format is used, the values are assumed to have no
fractional bits.
@param _3dImage Output 3-channel floating-point image of the same size as disparity . Each
element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity
map.
@param Q \f$4 \times 4\f$ perspective transformation matrix that can be obtained with stereoRectify.
@param handleMissingValues Indicates, whether the function should handle missing values (i.e.
points where the disparity was not computed). If handleMissingValues=true, then pixels with the
minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed
to 3D points with a very large Z value (currently set to 10000).
@param ddepth The optional output array depth. If it is -1, the output image will have CV_32F
depth. ddepth can also be set to CV_16S, CV_32S or CV_32F.
The function transforms a single-channel disparity map to a 3-channel image representing a 3D
surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it
computes:
\f[\begin{array}{l} [X \; Y \; Z \; W]^T = \texttt{Q} *[x \; y \; \texttt{disparity} (x,y) \; 1]^T \\ \texttt{\_3dImage} (x,y) = (X/W, \; Y/W, \; Z/W) \end{array}\f]
The matrix Q can be an arbitrary \f$4 \times 4\f$ matrix (for example, the one computed by
stereoRectify). To reproject a sparse set of points {(x,y,d),...} to 3D space, use
perspectiveTransform .
- resize(...)
- resize(src, dsize[, dst[, fx[, fy[, interpolation]]]]) -> dst
@brief Resizes an image.
The function resize resizes the image src down to or up to the specified size. Note that the
initial dst type or size are not taken into account. Instead, the size and type are derived from
the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
you may call the function as follows:
@code
// explicitly specify dsize=dst.size(); fx and fy will be computed from that.
resize(src, dst, dst.size(), 0, 0, interpolation);
@endcode
If you want to decimate the image by factor of 2 in each direction, you can call the function this
way:
@code
// specify fx and fy and let the function compute the destination image size.
resize(src, dst, Size(), 0.5, 0.5, interpolation);
@endcode
To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
enlarge an image, it will generally look best with c#INTER_CUBIC (slow) or #INTER_LINEAR
(faster but still looks OK).
@param src input image.
@param dst output image; it has the size dsize (when it is non-zero) or the size computed from
src.size(), fx, and fy; the type of dst is the same as of src.
@param dsize output image size; if it equals zero, it is computed as:
\f[\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\f]
Either dsize or both fx and fy must be non-zero.
@param fx scale factor along the horizontal axis; when it equals 0, it is computed as
\f[\texttt{(double)dsize.width/src.cols}\f]
@param fy scale factor along the vertical axis; when it equals 0, it is computed as
\f[\texttt{(double)dsize.height/src.rows}\f]
@param interpolation interpolation method, see #InterpolationFlags
@sa warpAffine, warpPerspective, remap
- resizeWindow(...)
- resizeWindow(winname, width, height) -> None
@brief Resizes window to the specified size
@note
- The specified window size is for the image area. Toolbars are not counted.
- Only windows created without cv::WINDOW_AUTOSIZE flag can be resized.
@param winname Window name.
@param width The new window width.
@param height The new window height.
resizeWindow(winname, size) -> None
@overload
@param winname Window name.
@param size The new window size.
- rotate(...)
- rotate(src, rotateCode[, dst]) -> dst
@brief Rotates a 2D array in multiples of 90 degrees.
The function rotate rotates the array in one of three different ways:
* Rotate by 90 degrees clockwise (rotateCode = ROTATE_90).
* Rotate by 180 degrees clockwise (rotateCode = ROTATE_180).
* Rotate by 270 degrees clockwise (rotateCode = ROTATE_270).
@param src input array.
@param dst output array of the same type as src. The size is the same with ROTATE_180,
and the rows and cols are switched for ROTATE_90 and ROTATE_270.
@param rotateCode an enum to specify how to rotate the array; see the enum RotateFlags
@sa transpose , repeat , completeSymm, flip, RotateFlags
- rotatedRectangleIntersection(...)
- rotatedRectangleIntersection(rect1, rect2[, intersectingRegion]) -> retval, intersectingRegion
@brief Finds out if there is any intersection between two rotated rectangles.
If there is then the vertices of the intersecting region are returned as well.
Below are some examples of intersection configurations. The hatched pattern indicates the
intersecting region and the red vertices are returned by the function.

@param rect1 First rectangle
@param rect2 Second rectangle
@param intersectingRegion The output array of the vertices of the intersecting region. It returns
at most 8 vertices. Stored as std::vector\<cv::Point2f\> or cv::Mat as Mx1 of type CV_32FC2.
@returns One of #RectanglesIntersectTypes
- sampsonDistance(...)
- sampsonDistance(pt1, pt2, F) -> retval
@brief Calculates the Sampson Distance between two points.
The function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as:
\f[
sd( \texttt{pt1} , \texttt{pt2} )=
\frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2}
{((\texttt{F} \cdot \texttt{pt1})(0))^2 +
((\texttt{F} \cdot \texttt{pt1})(1))^2 +
((\texttt{F}^t \cdot \texttt{pt2})(0))^2 +
((\texttt{F}^t \cdot \texttt{pt2})(1))^2}
\f]
The fundamental matrix may be calculated using the cv::findFundamentalMat function. See @cite HartleyZ00 11.4.3 for details.
@param pt1 first homogeneous 2d point
@param pt2 second homogeneous 2d point
@param F fundamental matrix
@return The computed Sampson distance.
- scaleAdd(...)
- scaleAdd(src1, alpha, src2[, dst]) -> dst
@brief Calculates the sum of a scaled array and another array.
The function scaleAdd is one of the classical primitive linear algebra operations, known as DAXPY
or SAXPY in [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms). It calculates
the sum of a scaled array and another array:
\f[\texttt{dst} (I)= \texttt{scale} \cdot \texttt{src1} (I) + \texttt{src2} (I)\f]
The function can also be emulated with a matrix expression, for example:
@code{.cpp}
Mat A(3, 3, CV_64F);
...
A.row(0) = A.row(1)*2 + A.row(2);
@endcode
@param src1 first input array.
@param alpha scale factor for the first array.
@param src2 second input array of the same size and type as src1.
@param dst output array of the same size and type as src1.
@sa add, addWeighted, subtract, Mat::dot, Mat::convertTo
- seamlessClone(...)
- seamlessClone(src, dst, mask, p, flags[, blend]) -> blend
@brief Image editing tasks concern either global changes (color/intensity corrections, filters,
deformations) or local changes concerned to a selection. Here we are interested in achieving local
changes, ones that are restricted to a region manually selected (ROI), in a seamless and effortless
manner. The extent of the changes ranges from slight distortions to complete replacement by novel
content @cite PM03 .
@param src Input 8-bit 3-channel image.
@param dst Input 8-bit 3-channel image.
@param mask Input 8-bit 1 or 3-channel image.
@param p Point in dst image where object is placed.
@param blend Output image with the same size and type as dst.
@param flags Cloning method that could be one of the following:
- **NORMAL_CLONE** The power of the method is fully expressed when inserting objects with
complex outlines into a new background
- **MIXED_CLONE** The classic method, color-based selection and alpha masking might be time
consuming and often leaves an undesirable halo. Seamless cloning, even averaged with the
original image, is not effective. Mixed seamless cloning based on a loose selection proves
effective.
- **MONOCHROME_TRANSFER** Monochrome transfer allows the user to easily replace certain features of
one object by alternative features.
- selectROI(...)
- selectROI(windowName, img[, showCrosshair[, fromCenter]]) -> retval
@brief Selects ROI on the given image.
Function creates a window and allows user to select a ROI using mouse.
Controls: use `space` or `enter` to finish selection, use key `c` to cancel selection (function will return the zero cv::Rect).
@param windowName name of the window where selection process will be shown.
@param img image to select a ROI.
@param showCrosshair if true crosshair of selection rectangle will be shown.
@param fromCenter if true center of selection will match initial mouse position. In opposite case a corner of
selection rectangle will correspont to the initial mouse position.
@return selected ROI or empty rect if selection canceled.
@note The function sets it's own mouse callback for specified window using cv::setMouseCallback(windowName, ...).
After finish of work an empty callback will be set for the used window.
selectROI(img[, showCrosshair[, fromCenter]]) -> retval
@overload
- selectROIs(...)
- selectROIs(windowName, img[, showCrosshair[, fromCenter]]) -> boundingBoxes
@brief Selects ROIs on the given image.
Function creates a window and allows user to select a ROIs using mouse.
Controls: use `space` or `enter` to finish current selection and start a new one,
use `esc` to terminate multiple ROI selection process.
@param windowName name of the window where selection process will be shown.
@param img image to select a ROI.
@param boundingBoxes selected ROIs.
@param showCrosshair if true crosshair of selection rectangle will be shown.
@param fromCenter if true center of selection will match initial mouse position. In opposite case a corner of
selection rectangle will correspont to the initial mouse position.
@note The function sets it's own mouse callback for specified window using cv::setMouseCallback(windowName, ...).
After finish of work an empty callback will be set for the used window.
- sepFilter2D(...)
- sepFilter2D(src, ddepth, kernelX, kernelY[, dst[, anchor[, delta[, borderType]]]]) -> dst
@brief Applies a separable linear filter to an image.
The function applies a separable linear filter to the image. That is, first, every row of src is
filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D
kernel kernelY. The final result shifted by delta is stored in dst .
@param src Source image.
@param dst Destination image of the same size and the same number of channels as src .
@param ddepth Destination image depth, see @ref filter_depths "combinations"
@param kernelX Coefficients for filtering each row.
@param kernelY Coefficients for filtering each column.
@param anchor Anchor position within the kernel. The default value \f$(-1,-1)\f$ means that the anchor
is at the kernel center.
@param delta Value added to the filtered results before storing them.
@param borderType Pixel extrapolation method, see #BorderTypes
@sa filter2D, Sobel, GaussianBlur, boxFilter, blur
- setIdentity(...)
- setIdentity(mtx[, s]) -> mtx
@brief Initializes a scaled identity matrix.
The function cv::setIdentity initializes a scaled identity matrix:
\f[\texttt{mtx} (i,j)= \fork{\texttt{value}}{ if \(i=j\)}{0}{otherwise}\f]
The function can also be emulated using the matrix initializers and the
matrix expressions:
@code
Mat A = Mat::eye(4, 3, CV_32F)*5;
// A will be set to [[5, 0, 0], [0, 5, 0], [0, 0, 5], [0, 0, 0]]
@endcode
@param mtx matrix to initialize (not necessarily square).
@param s value to assign to diagonal elements.
@sa Mat::zeros, Mat::ones, Mat::setTo, Mat::operator=
- setMouseCallback(...)
- setMouseCallback(windowName, onMouse [, param]) -> None
- setNumThreads(...)
- setNumThreads(nthreads) -> None
@brief OpenCV will try to set the number of threads for the next parallel region.
If threads == 0, OpenCV will disable threading optimizations and run all it's functions
sequentially. Passing threads \< 0 will reset threads number to system default. This function must
be called outside of parallel region.
OpenCV will try to run its functions with specified threads number, but some behaviour differs from
framework:
- `TBB` - User-defined parallel constructions will run with the same threads number, if
another is not specified. If later on user creates his own scheduler, OpenCV will use it.
- `OpenMP` - No special defined behaviour.
- `Concurrency` - If threads == 1, OpenCV will disable threading optimizations and run its
functions sequentially.
- `GCD` - Supports only values \<= 0.
- `C=` - No special defined behaviour.
@param nthreads Number of threads used by OpenCV.
@sa getNumThreads, getThreadNum
- setRNGSeed(...)
- setRNGSeed(seed) -> None
@brief Sets state of default random number generator.
The function cv::setRNGSeed sets state of default random number generator to custom value.
@param seed new state for default random number generator
@sa RNG, randu, randn
- setTrackbarMax(...)
- setTrackbarMax(trackbarname, winname, maxval) -> None
@brief Sets the trackbar maximum position.
The function sets the maximum position of the specified trackbar in the specified window.
@note
[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
panel.
@param trackbarname Name of the trackbar.
@param winname Name of the window that is the parent of trackbar.
@param maxval New maximum position.
- setTrackbarMin(...)
- setTrackbarMin(trackbarname, winname, minval) -> None
@brief Sets the trackbar minimum position.
The function sets the minimum position of the specified trackbar in the specified window.
@note
[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
panel.
@param trackbarname Name of the trackbar.
@param winname Name of the window that is the parent of trackbar.
@param minval New minimum position.
- setTrackbarPos(...)
- setTrackbarPos(trackbarname, winname, pos) -> None
@brief Sets the trackbar position.
The function sets the position of the specified trackbar in the specified window.
@note
[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
panel.
@param trackbarname Name of the trackbar.
@param winname Name of the window that is the parent of trackbar.
@param pos New position.
- setUseOpenVX(...)
- setUseOpenVX(flag) -> None
- setUseOptimized(...)
- setUseOptimized(onoff) -> None
@brief Enables or disables the optimized code.
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX,
and other instructions on the platforms that support it). It sets a global flag that is further
checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only
safe to call the function on the very top level in your application where you can be sure that no
other OpenCV function is currently executed.
By default, the optimized code is enabled unless you disable it in CMake. The current status can be
retrieved using useOptimized.
@param onoff The boolean flag specifying whether the optimized code should be used (onoff=true)
or not (onoff=false).
- setWindowProperty(...)
- setWindowProperty(winname, prop_id, prop_value) -> None
@brief Changes parameters of a window dynamically.
The function setWindowProperty enables changing properties of a window.
@param winname Name of the window.
@param prop_id Window property to edit. The supported operation flags are: (cv::WindowPropertyFlags)
@param prop_value New value of the window property. The supported flags are: (cv::WindowFlags)
- setWindowTitle(...)
- setWindowTitle(winname, title) -> None
@brief Updates window title
@param winname Name of the window.
@param title New title.
- solve(...)
- solve(src1, src2[, dst[, flags]]) -> retval, dst
@brief Solves one or more linear systems or least-squares problems.
The function cv::solve solves a linear system or least-squares problem (the
latter is possible with SVD or QR methods, or by specifying the flag
#DECOMP_NORMAL ):
\f[\texttt{dst} = \arg \min _X \| \texttt{src1} \cdot \texttt{X} - \texttt{src2} \|\f]
If #DECOMP_LU or #DECOMP_CHOLESKY method is used, the function returns 1
if src1 (or \f$\texttt{src1}^T\texttt{src1}\f$ ) is non-singular. Otherwise,
it returns 0. In the latter case, dst is not valid. Other methods find a
pseudo-solution in case of a singular left-hand side part.
@note If you want to find a unity-norm solution of an under-defined
singular system \f$\texttt{src1}\cdot\texttt{dst}=0\f$ , the function solve
will not do the work. Use SVD::solveZ instead.
@param src1 input matrix on the left-hand side of the system.
@param src2 input matrix on the right-hand side of the system.
@param dst output solution.
@param flags solution (matrix inversion) method (#DecompTypes)
@sa invert, SVD, eigen
- solveCubic(...)
- solveCubic(coeffs[, roots]) -> retval, roots
@brief Finds the real roots of a cubic equation.
The function solveCubic finds the real roots of a cubic equation:
- if coeffs is a 4-element vector:
\f[\texttt{coeffs} [0] x^3 + \texttt{coeffs} [1] x^2 + \texttt{coeffs} [2] x + \texttt{coeffs} [3] = 0\f]
- if coeffs is a 3-element vector:
\f[x^3 + \texttt{coeffs} [0] x^2 + \texttt{coeffs} [1] x + \texttt{coeffs} [2] = 0\f]
The roots are stored in the roots array.
@param coeffs equation coefficients, an array of 3 or 4 elements.
@param roots output array of real roots that has 1 or 3 elements.
@return number of real roots. It can be 0, 1 or 2.
- solveLP(...)
- solveLP(Func, Constr, z) -> retval
@brief Solve given (non-integer) linear programming problem using the Simplex Algorithm (Simplex Method).
What we mean here by "linear programming problem" (or LP problem, for short) can be formulated as:
\f[\mbox{Maximize } c\cdot x\\
\mbox{Subject to:}\\
Ax\leq b\\
x\geq 0\f]
Where \f$c\f$ is fixed `1`-by-`n` row-vector, \f$A\f$ is fixed `m`-by-`n` matrix, \f$b\f$ is fixed `m`-by-`1`
column vector and \f$x\f$ is an arbitrary `n`-by-`1` column vector, which satisfies the constraints.
Simplex algorithm is one of many algorithms that are designed to handle this sort of problems
efficiently. Although it is not optimal in theoretical sense (there exist algorithms that can solve
any problem written as above in polynomial time, while simplex method degenerates to exponential
time for some special cases), it is well-studied, easy to implement and is shown to work well for
real-life purposes.
The particular implementation is taken almost verbatim from **Introduction to Algorithms, third
edition** by T. H. Cormen, C. E. Leiserson, R. L. Rivest and Clifford Stein. In particular, the
Bland's rule <http://en.wikipedia.org/wiki/Bland%27s_rule> is used to prevent cycling.
@param Func This row-vector corresponds to \f$c\f$ in the LP problem formulation (see above). It should
contain 32- or 64-bit floating point numbers. As a convenience, column-vector may be also submitted,
in the latter case it is understood to correspond to \f$c^T\f$.
@param Constr `m`-by-`n+1` matrix, whose rightmost column corresponds to \f$b\f$ in formulation above
and the remaining to \f$A\f$. It should contain 32- or 64-bit floating point numbers.
@param z The solution will be returned here as a column-vector - it corresponds to \f$c\f$ in the
formulation above. It will contain 64-bit floating point numbers.
@return One of cv::SolveLPResult
- solveP3P(...)
- solveP3P(objectPoints, imagePoints, cameraMatrix, distCoeffs, flags[, rvecs[, tvecs]]) -> retval, rvecs, tvecs
@brief Finds an object pose from 3 3D-2D point correspondences.
@param objectPoints Array of object points in the object coordinate space, 3x3 1-channel or
1x3/3x1 3-channel. vector\<Point3f\> can be also passed here.
@param imagePoints Array of corresponding image points, 3x2 1-channel or 1x3/3x1 2-channel.
vector\<Point2f\> can be also passed here.
@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
assumed.
@param rvecs Output rotation vectors (see Rodrigues ) that, together with tvecs , brings points from
the model coordinate system to the camera coordinate system. A P3P problem has up to 4 solutions.
@param tvecs Output translation vectors.
@param flags Method for solving a P3P problem:
- **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang
"Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete).
- **SOLVEPNP_AP3P** Method is based on the paper of Tong Ke and Stergios I. Roumeliotis.
"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17).
The function estimates the object pose given 3 object points, their corresponding image
projections, as well as the camera matrix and the distortion coefficients.
- solvePnP(...)
- solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs[, rvec[, tvec[, useExtrinsicGuess[, flags]]]]) -> retval, rvec, tvec
@brief Finds an object pose from 3D-2D point correspondences.
@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or
1xN/Nx1 3-channel, where N is the number of points. vector\<Point3f\> can be also passed here.
@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,
where N is the number of points. vector\<Point2f\> can be also passed here.
@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
assumed.
@param rvec Output rotation vector (see @ref Rodrigues ) that, together with tvec , brings points from
the model coordinate system to the camera coordinate system.
@param tvec Output translation vector.
@param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses
the provided rvec and tvec values as initial approximations of the rotation and translation
vectors, respectively, and further optimizes them.
@param flags Method for solving a PnP problem:
- **SOLVEPNP_ITERATIVE** Iterative method is based on Levenberg-Marquardt optimization. In
this case the function finds such a pose that minimizes reprojection error, that is the sum
of squared distances between the observed projections imagePoints and the projected (using
projectPoints ) objectPoints .
- **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang
"Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete).
In this case the function requires exactly four object and image points.
- **SOLVEPNP_AP3P** Method is based on the paper of T. Ke, S. Roumeliotis
"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17).
In this case the function requires exactly four object and image points.
- **SOLVEPNP_EPNP** Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the
paper "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" (@cite lepetit2009epnp).
- **SOLVEPNP_DLS** Method is based on the paper of Joel A. Hesch and Stergios I. Roumeliotis.
"A Direct Least-Squares (DLS) Method for PnP" (@cite hesch2011direct).
- **SOLVEPNP_UPNP** Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto,
F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length
Estimation" (@cite penate2013exhaustive). In this case the function also estimates the parameters \f$f_x\f$ and \f$f_y\f$
assuming that both have the same value. Then the cameraMatrix is updated with the estimated
focal length.
- **SOLVEPNP_AP3P** Method is based on the paper of Tong Ke and Stergios I. Roumeliotis.
"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17). In this case the
function requires exactly four object and image points.
The function estimates the object pose given a set of object points, their corresponding image
projections, as well as the camera matrix and the distortion coefficients, see the figure below
(more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward
and the Z-axis forward).

Points expressed in the world frame \f$ \bf{X}_w \f$ are projected into the image plane \f$ \left[ u, v \right] \f$
using the perspective projection model \f$ \Pi \f$ and the camera intrinsic parameters matrix \f$ \bf{A} \f$:
\f[
\begin{align*}
\begin{bmatrix}
u \\
v \\
1
\end{bmatrix} &=
\bf{A} \hspace{0.1em} \Pi \hspace{0.2em} ^{c}\bf{M}_w
\begin{bmatrix}
X_{w} \\
Y_{w} \\
Z_{w} \\
1
\end{bmatrix} \\
\begin{bmatrix}
u \\
v \\
1
\end{bmatrix} &=
\begin{bmatrix}
f_x & 0 & c_x \\
0 & f_y & c_y \\
0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0
\end{bmatrix}
\begin{bmatrix}
r_{11} & r_{12} & r_{13} & t_x \\
r_{21} & r_{22} & r_{23} & t_y \\
r_{31} & r_{32} & r_{33} & t_z \\
0 & 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
X_{w} \\
Y_{w} \\
Z_{w} \\
1
\end{bmatrix}
\end{align*}
\f]
The estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow to transform
a 3D point expressed in the world frame into the camera frame:
\f[
\begin{align*}
\begin{bmatrix}
X_c \\
Y_c \\
Z_c \\
1
\end{bmatrix} &=
\hspace{0.2em} ^{c}\bf{M}_w
\begin{bmatrix}
X_{w} \\
Y_{w} \\
Z_{w} \\
1
\end{bmatrix} \\
\begin{bmatrix}
X_c \\
Y_c \\
Z_c \\
1
\end{bmatrix} &=
\begin{bmatrix}
r_{11} & r_{12} & r_{13} & t_x \\
r_{21} & r_{22} & r_{23} & t_y \\
r_{31} & r_{32} & r_{33} & t_z \\
0 & 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
X_{w} \\
Y_{w} \\
Z_{w} \\
1
\end{bmatrix}
\end{align*}
\f]
@note
- An example of how to use solvePnP for planar augmented reality can be found at
opencv_source_code/samples/python/plane_ar.py
- If you are using Python:
- Numpy array slices won't work as input because solvePnP requires contiguous
arrays (enforced by the assertion using cv::Mat::checkVector() around line 55 of
modules/calib3d/src/solvepnp.cpp version 2.4.9)
- The P3P algorithm requires image points to be in an array of shape (N,1,2) due
to its calling of cv::undistortPoints (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9)
which requires 2-channel information.
- Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of
it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints =
np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- The methods **SOLVEPNP_DLS** and **SOLVEPNP_UPNP** cannot be used as the current implementations are
unstable and sometimes give completely wrong results. If you pass one of these two
flags, **SOLVEPNP_EPNP** method will be used instead.
- The minimum number of points is 4 in the general case. In the case of **SOLVEPNP_P3P** and **SOLVEPNP_AP3P**
methods, it is required to use exactly 4 points (the first 3 points are used to estimate all the solutions
of the P3P problem, the last one is used to retain the best solution that minimizes the reprojection error).
- With **SOLVEPNP_ITERATIVE** method and `useExtrinsicGuess=true`, the minimum number of points is 3 (3 points
are sufficient to compute a pose but there are up to 4 solutions). The initial solution should be close to the
global solution to converge.
- solvePnPRansac(...)
- solvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs[, rvec[, tvec[, useExtrinsicGuess[, iterationsCount[, reprojectionError[, confidence[, inliers[, flags]]]]]]]]) -> retval, rvec, tvec, inliers
@brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.
@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or
1xN/Nx1 3-channel, where N is the number of points. vector\<Point3f\> can be also passed here.
@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,
where N is the number of points. vector\<Point2f\> can be also passed here.
@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
assumed.
@param rvec Output rotation vector (see Rodrigues ) that, together with tvec , brings points from
the model coordinate system to the camera coordinate system.
@param tvec Output translation vector.
@param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses
the provided rvec and tvec values as initial approximations of the rotation and translation
vectors, respectively, and further optimizes them.
@param iterationsCount Number of iterations.
@param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value
is the maximum allowed distance between the observed and computed point projections to consider it
an inlier.
@param confidence The probability that the algorithm produces a useful result.
@param inliers Output vector that contains indices of inliers in objectPoints and imagePoints .
@param flags Method for solving a PnP problem (see solvePnP ).
The function estimates an object pose given a set of object points, their corresponding image
projections, as well as the camera matrix and the distortion coefficients. This function finds such
a pose that minimizes reprojection error, that is, the sum of squared distances between the observed
projections imagePoints and the projected (using projectPoints ) objectPoints. The use of RANSAC
makes the function resistant to outliers.
@note
- An example of how to use solvePNPRansac for object detection can be found at
opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/
- The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- if you choose #SOLVEPNP_P3P or #SOLVEPNP_AP3P, these methods will be used.
- if the number of input points is equal to 4, #SOLVEPNP_P3P is used.
- The method used to estimate the camera pose using all the inliers is defined by the
flags parameters unless it is equal to #SOLVEPNP_P3P or #SOLVEPNP_AP3P. In this case,
the method #SOLVEPNP_EPNP will be used instead.
- solvePoly(...)
- solvePoly(coeffs[, roots[, maxIters]]) -> retval, roots
@brief Finds the real or complex roots of a polynomial equation.
The function cv::solvePoly finds real and complex roots of a polynomial equation:
\f[\texttt{coeffs} [n] x^{n} + \texttt{coeffs} [n-1] x^{n-1} + ... + \texttt{coeffs} [1] x + \texttt{coeffs} [0] = 0\f]
@param coeffs array of polynomial coefficients.
@param roots output (complex) array of roots.
@param maxIters maximum number of iterations the algorithm does.
- sort(...)
- sort(src, flags[, dst]) -> dst
@brief Sorts each row or each column of a matrix.
The function cv::sort sorts each matrix row or each matrix column in
ascending or descending order. So you should pass two operation flags to
get desired behaviour. If you want to sort matrix rows or columns
lexicographically, you can use STL std::sort generic function with the
proper comparison predicate.
@param src input single-channel array.
@param dst output array of the same size and type as src.
@param flags operation flags, a combination of #SortFlags
@sa sortIdx, randShuffle
- sortIdx(...)
- sortIdx(src, flags[, dst]) -> dst
@brief Sorts each row or each column of a matrix.
The function cv::sortIdx sorts each matrix row or each matrix column in the
ascending or descending order. So you should pass two operation flags to
get desired behaviour. Instead of reordering the elements themselves, it
stores the indices of sorted elements in the output array. For example:
@code
Mat A = Mat::eye(3,3,CV_32F), B;
sortIdx(A, B, SORT_EVERY_ROW + SORT_ASCENDING);
// B will probably contain
// (because of equal elements in A some permutations are possible):
// [[1, 2, 0], [0, 2, 1], [0, 1, 2]]
@endcode
@param src input single-channel array.
@param dst output integer array of the same size as src.
@param flags operation flags that could be a combination of cv::SortFlags
@sa sort, randShuffle
- spatialGradient(...)
- spatialGradient(src[, dx[, dy[, ksize[, borderType]]]]) -> dx, dy
@brief Calculates the first order image derivative in both x and y using a Sobel operator
Equivalent to calling:
@code
Sobel( src, dx, CV_16SC1, 1, 0, 3 );
Sobel( src, dy, CV_16SC1, 0, 1, 3 );
@endcode
@param src input image.
@param dx output image with first-order derivative in x.
@param dy output image with first-order derivative in y.
@param ksize size of Sobel kernel. It must be 3.
@param borderType pixel extrapolation method, see #BorderTypes
@sa Sobel
- split(...)
- split(m[, mv]) -> mv
@overload
@param m input multi-channel array.
@param mv output vector of arrays; the arrays themselves are reallocated, if needed.
- sqrBoxFilter(...)
- sqrBoxFilter(_src, ddepth, ksize[, _dst[, anchor[, normalize[, borderType]]]]) -> _dst
@brief Calculates the normalized sum of squares of the pixel values overlapping the filter.
For every pixel \f$ (x, y) \f$ in the source image, the function calculates the sum of squares of those neighboring
pixel values which overlap the filter placed over the pixel \f$ (x, y) \f$.
The unnormalized square box filter can be useful in computing local image statistics such as the the local
variance and standard deviation around the neighborhood of a pixel.
@param _src input image
@param _dst output image of the same size and type as _src
@param ddepth the output image depth (-1 to use src.depth())
@param ksize kernel size
@param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel
center.
@param normalize flag, specifying whether the kernel is to be normalized by it's area or not.
@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes
@sa boxFilter
- sqrt(...)
- sqrt(src[, dst]) -> dst
@brief Calculates a square root of array elements.
The function cv::sqrt calculates a square root of each input array element.
In case of multi-channel arrays, each channel is processed
independently. The accuracy is approximately the same as of the built-in
std::sqrt .
@param src input floating-point array.
@param dst output array of the same size and type as src.
- startWindowThread(...)
- startWindowThread() -> retval
- stereoCalibrate(...)
- stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize[, R[, T[, E[, F[, flags[, criteria]]]]]]) -> retval, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, R, T, E, F
- stereoCalibrateExtended(...)
- stereoCalibrateExtended(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T[, E[, F[, perViewErrors[, flags[, criteria]]]]]) -> retval, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, R, T, E, F, perViewErrors
@brief Calibrates the stereo camera.
@param objectPoints Vector of vectors of the calibration pattern points.
@param imagePoints1 Vector of vectors of the projections of the calibration pattern points,
observed by the first camera.
@param imagePoints2 Vector of vectors of the projections of the calibration pattern points,
observed by the second camera.
@param cameraMatrix1 Input/output first camera matrix:
\f$\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\f$ , \f$j = 0,\, 1\f$ . If
any of CALIB_USE_INTRINSIC_GUESS , CALIB_FIX_ASPECT_RATIO ,
CALIB_FIX_INTRINSIC , or CALIB_FIX_FOCAL_LENGTH are specified, some or all of the
matrix components must be initialized. See the flags description for details.
@param distCoeffs1 Input/output vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of
4, 5, 8, 12 or 14 elements. The output vector length depends on the flags.
@param cameraMatrix2 Input/output second camera matrix. The parameter is similar to cameraMatrix1
@param distCoeffs2 Input/output lens distortion coefficients for the second camera. The parameter
is similar to distCoeffs1 .
@param imageSize Size of the image used only to initialize intrinsic camera matrix.
@param R Output rotation matrix between the 1st and the 2nd camera coordinate systems.
@param T Output translation vector between the coordinate systems of the cameras.
@param E Output essential matrix.
@param F Output fundamental matrix.
@param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.
@param flags Different flags that may be zero or a combination of the following values:
- **CALIB_FIX_INTRINSIC** Fix cameraMatrix? and distCoeffs? so that only R, T, E , and F
matrices are estimated.
- **CALIB_USE_INTRINSIC_GUESS** Optimize some or all of the intrinsic parameters
according to the specified flags. Initial values are provided by the user.
- **CALIB_USE_EXTRINSIC_GUESS** R, T contain valid initial values that are optimized further.
Otherwise R, T are initialized to the median value of the pattern views (each dimension separately).
- **CALIB_FIX_PRINCIPAL_POINT** Fix the principal points during the optimization.
- **CALIB_FIX_FOCAL_LENGTH** Fix \f$f^{(j)}_x\f$ and \f$f^{(j)}_y\f$ .
- **CALIB_FIX_ASPECT_RATIO** Optimize \f$f^{(j)}_y\f$ . Fix the ratio \f$f^{(j)}_x/f^{(j)}_y\f$
.
- **CALIB_SAME_FOCAL_LENGTH** Enforce \f$f^{(0)}_x=f^{(1)}_x\f$ and \f$f^{(0)}_y=f^{(1)}_y\f$ .
- **CALIB_ZERO_TANGENT_DIST** Set tangential distortion coefficients for each camera to
zeros and fix there.
- **CALIB_FIX_K1,...,CALIB_FIX_K6** Do not change the corresponding radial
distortion coefficient during the optimization. If CALIB_USE_INTRINSIC_GUESS is set,
the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0.
- **CALIB_RATIONAL_MODEL** Enable coefficients k4, k5, and k6. To provide the backward
compatibility, this extra flag should be explicitly specified to make the calibration
function use the rational model and return 8 coefficients. If the flag is not set, the
function computes and returns only 5 distortion coefficients.
- **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the
backward compatibility, this extra flag should be explicitly specified to make the
calibration function use the thin prism model and return 12 coefficients. If the flag is not
set, the function computes and returns only 5 distortion coefficients.
- **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during
the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
supplied distCoeffs matrix is used. Otherwise, it is set to 0.
- **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the
backward compatibility, this extra flag should be explicitly specified to make the
calibration function use the tilted sensor model and return 14 coefficients. If the flag is not
set, the function computes and returns only 5 distortion coefficients.
- **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during
the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
supplied distCoeffs matrix is used. Otherwise, it is set to 0.
@param criteria Termination criteria for the iterative optimization algorithm.
The function estimates transformation between two cameras making a stereo pair. If you have a stereo
camera where the relative position and orientation of two cameras is fixed, and if you computed
poses of an object relative to the first camera and to the second camera, (R1, T1) and (R2, T2),
respectively (this can be done with solvePnP ), then those poses definitely relate to each other.
This means that, given ( \f$R_1\f$,\f$T_1\f$ ), it should be possible to compute ( \f$R_2\f$,\f$T_2\f$ ). You only
need to know the position and orientation of the second camera relative to the first camera. This is
what the described function does. It computes ( \f$R\f$,\f$T\f$ ) so that:
\f[R_2=R*R_1\f]
\f[T_2=R*T_1 + T,\f]
Optionally, it computes the essential matrix E:
\f[E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} *R\f]
where \f$T_i\f$ are components of the translation vector \f$T\f$ : \f$T=[T_0, T_1, T_2]^T\f$ . And the function
can also compute the fundamental matrix F:
\f[F = cameraMatrix2^{-T} E cameraMatrix1^{-1}\f]
Besides the stereo-related information, the function can also perform a full calibration of each of
two cameras. However, due to the high dimensionality of the parameter space and noise in the input
data, the function can diverge from the correct solution. If the intrinsic parameters can be
estimated with high accuracy for each of the cameras individually (for example, using
calibrateCamera ), you are recommended to do so and then pass CALIB_FIX_INTRINSIC flag to the
function along with the computed intrinsic parameters. Otherwise, if all the parameters are
estimated at once, it makes sense to restrict some parameters, for example, pass
CALIB_SAME_FOCAL_LENGTH and CALIB_ZERO_TANGENT_DIST flags, which is usually a
reasonable assumption.
Similarly to calibrateCamera , the function minimizes the total re-projection error for all the
points in all the available views from both cameras. The function returns the final value of the
re-projection error.
- stereoRectify(...)
- stereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T[, R1[, R2[, P1[, P2[, Q[, flags[, alpha[, newImageSize]]]]]]]]) -> R1, R2, P1, P2, Q, validPixROI1, validPixROI2
@brief Computes rectification transforms for each head of a calibrated stereo camera.
@param cameraMatrix1 First camera matrix.
@param distCoeffs1 First camera distortion parameters.
@param cameraMatrix2 Second camera matrix.
@param distCoeffs2 Second camera distortion parameters.
@param imageSize Size of the image used for stereo calibration.
@param R Rotation matrix between the coordinate systems of the first and the second cameras.
@param T Translation vector between coordinate systems of the cameras.
@param R1 Output 3x3 rectification transform (rotation matrix) for the first camera.
@param R2 Output 3x3 rectification transform (rotation matrix) for the second camera.
@param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first
camera.
@param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second
camera.
@param Q Output \f$4 \times 4\f$ disparity-to-depth mapping matrix (see reprojectImageTo3D ).
@param flags Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set,
the function makes the principal points of each camera have the same pixel coordinates in the
rectified views. And if the flag is not set, the function may still shift the images in the
horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the
useful image area.
@param alpha Free scaling parameter. If it is -1 or absent, the function performs the default
scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified
images are zoomed and shifted so that only valid pixels are visible (no black areas after
rectification). alpha=1 means that the rectified image is decimated and shifted so that all the
pixels from the original images from the cameras are retained in the rectified images (no source
image pixels are lost). Obviously, any intermediate value yields an intermediate result between
those two extreme cases.
@param newImageSize New image resolution after rectification. The same size should be passed to
initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0)
is passed (default), it is set to the original imageSize . Setting it to larger value can help you
preserve details in the original image, especially when there is a big radial distortion.
@param validPixROI1 Optional output rectangles inside the rectified images where all the pixels
are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller
(see the picture below).
@param validPixROI2 Optional output rectangles inside the rectified images where all the pixels
are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller
(see the picture below).
The function computes the rotation matrices for each camera that (virtually) make both camera image
planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies
the dense stereo correspondence problem. The function takes the matrices computed by stereoCalibrate
as input. As output, it provides two rotation matrices and also two projection matrices in the new
coordinates. The function distinguishes the following two cases:
- **Horizontal stereo**: the first and the second camera views are shifted relative to each other
mainly along the x axis (with possible small vertical shift). In the rectified images, the
corresponding epipolar lines in the left and right cameras are horizontal and have the same
y-coordinate. P1 and P2 look like:
\f[\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\f]
\f[\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x*f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\f]
where \f$T_x\f$ is a horizontal shift between the cameras and \f$cx_1=cx_2\f$ if
CALIB_ZERO_DISPARITY is set.
- **Vertical stereo**: the first and the second camera views are shifted relative to each other
mainly in vertical direction (and probably a bit in the horizontal direction too). The epipolar
lines in the rectified images are vertical and have the same x-coordinate. P1 and P2 look like:
\f[\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\f]
\f[\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y*f \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\f]
where \f$T_y\f$ is a vertical shift between the cameras and \f$cy_1=cy_2\f$ if CALIB_ZERO_DISPARITY is
set.
As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera
matrices. The matrices, together with R1 and R2 , can then be passed to initUndistortRectifyMap to
initialize the rectification map for each camera.
See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through
the corresponding image regions. This means that the images are well rectified, which is what most
stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that
their interiors are all valid pixels.

- stereoRectifyUncalibrated(...)
- stereoRectifyUncalibrated(points1, points2, F, imgSize[, H1[, H2[, threshold]]]) -> retval, H1, H2
@brief Computes a rectification transform for an uncalibrated stereo camera.
@param points1 Array of feature points in the first image.
@param points2 The corresponding points in the second image. The same formats as in
findFundamentalMat are supported.
@param F Input fundamental matrix. It can be computed from the same set of point pairs using
findFundamentalMat .
@param imgSize Size of the image.
@param H1 Output rectification homography matrix for the first image.
@param H2 Output rectification homography matrix for the second image.
@param threshold Optional threshold used to filter out the outliers. If the parameter is greater
than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points
for which \f$|\texttt{points2[i]}^T*\texttt{F}*\texttt{points1[i]}|>\texttt{threshold}\f$ ) are
rejected prior to computing the homographies. Otherwise, all the points are considered inliers.
The function computes the rectification transformations without knowing intrinsic parameters of the
cameras and their relative position in the space, which explains the suffix "uncalibrated". Another
related difference from stereoRectify is that the function outputs not the rectification
transformations in the object (3D) space, but the planar perspective transformations encoded by the
homography matrices H1 and H2 . The function implements the algorithm @cite Hartley99 .
@note
While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily
depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion,
it would be better to correct it before computing the fundamental matrix and calling this
function. For example, distortion coefficients can be estimated for each head of stereo camera
separately by using calibrateCamera . Then, the images can be corrected using undistort , or
just the point coordinates can be corrected with undistortPoints .
- stylization(...)
- stylization(src[, dst[, sigma_s[, sigma_r]]]) -> dst
@brief Stylization aims to produce digital imagery with a wide variety of effects not focused on
photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low
contrast while preserving, or enhancing, high-contrast features.
@param src Input 8-bit 3-channel image.
@param dst Output image with the same size and type as src.
@param sigma_s Range between 0 to 200.
@param sigma_r Range between 0 to 1.
- subtract(...)
- subtract(src1, src2[, dst[, mask[, dtype]]]) -> dst
@brief Calculates the per-element difference between two arrays or array and a scalar.
The function subtract calculates:
- Difference between two arrays, when both input arrays have the same size and the same number of
channels:
\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) - \texttt{src2}(I)) \quad \texttt{if mask}(I) \ne0\f]
- Difference between an array and a scalar, when src2 is constructed from Scalar or has the same
number of elements as `src1.channels()`:
\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) - \texttt{src2} ) \quad \texttt{if mask}(I) \ne0\f]
- Difference between a scalar and an array, when src1 is constructed from Scalar or has the same
number of elements as `src2.channels()`:
\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1} - \texttt{src2}(I) ) \quad \texttt{if mask}(I) \ne0\f]
- The reverse difference between a scalar and an array in the case of `SubRS`:
\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src2} - \texttt{src1}(I) ) \quad \texttt{if mask}(I) \ne0\f]
where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each
channel is processed independently.
The first function in the list above can be replaced with matrix expressions:
@code{.cpp}
dst = src1 - src2;
dst -= src1; // equivalent to subtract(dst, src1, dst);
@endcode
The input arrays and the output array can all have the same or different depths. For example, you
can subtract to 8-bit unsigned arrays and store the difference in a 16-bit signed array. Depth of
the output array is determined by dtype parameter. In the second and third cases above, as well as
in the first case, when src1.depth() == src2.depth(), dtype can be set to the default -1. In this
case the output array will have the same depth as the input array, be it src1, src2 or both.
@note Saturation is not applied when the output array has the depth CV_32S. You may even get
result of an incorrect sign in the case of overflow.
@param src1 first input array or a scalar.
@param src2 second input array or a scalar.
@param dst output array of the same size and the same number of channels as the input array.
@param mask optional operation mask; this is an 8-bit single channel array that specifies elements
of the output array to be changed.
@param dtype optional depth of the output array
@sa add, addWeighted, scaleAdd, Mat::convertTo
- sumElems(...)
- sumElems(src) -> retval
@brief Calculates the sum of array elements.
The function cv::sum calculates and returns the sum of array elements,
independently for each channel.
@param src input array that must have from 1 to 4 channels.
@sa countNonZero, mean, meanStdDev, norm, minMaxLoc, reduce
- textureFlattening(...)
- textureFlattening(src, mask[, dst[, low_threshold[, high_threshold[, kernel_size]]]]) -> dst
@brief By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge
Detector is used.
@param src Input 8-bit 3-channel image.
@param mask Input 8-bit 1 or 3-channel image.
@param dst Output image with the same size and type as src.
@param low_threshold Range from 0 to 100.
@param high_threshold Value \> 100.
@param kernel_size The size of the Sobel kernel to be used.
**NOTE:**
The algorithm assumes that the color of the source image is close to that of the destination. This
assumption means that when the colors don't match, the source image color gets tinted toward the
color of the destination image.
- threshold(...)
- threshold(src, thresh, maxval, type[, dst]) -> retval, dst
@brief Applies a fixed-level threshold to each array element.
The function applies fixed-level thresholding to a multiple-channel array. The function is typically
used to get a bi-level (binary) image out of a grayscale image ( #compare could be also used for
this purpose) or for removing a noise, that is, filtering out pixels with too small or too large
values. There are several types of thresholding supported by the function. They are determined by
type parameter.
Also, the special values #THRESH_OTSU or #THRESH_TRIANGLE may be combined with one of the
above values. In these cases, the function determines the optimal threshold value using the Otsu's
or Triangle algorithm and uses it instead of the specified thresh.
@note Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images.
@param src input array (multiple-channel, 8-bit or 32-bit floating point).
@param dst output array of the same size and type and the same number of channels as src.
@param thresh threshold value.
@param maxval maximum value to use with the #THRESH_BINARY and #THRESH_BINARY_INV thresholding
types.
@param type thresholding type (see #ThresholdTypes).
@return the computed threshold value if Otsu's or Triangle methods used.
@sa adaptiveThreshold, findContours, compare, min, max
- trace(...)
- trace(mtx) -> retval
@brief Returns the trace of a matrix.
The function cv::trace returns the sum of the diagonal elements of the
matrix mtx .
\f[\mathrm{tr} ( \texttt{mtx} ) = \sum _i \texttt{mtx} (i,i)\f]
@param mtx input matrix.
- transform(...)
- transform(src, m[, dst]) -> dst
@brief Performs the matrix transformation of every array element.
The function cv::transform performs the matrix transformation of every
element of the array src and stores the results in dst :
\f[\texttt{dst} (I) = \texttt{m} \cdot \texttt{src} (I)\f]
(when m.cols=src.channels() ), or
\f[\texttt{dst} (I) = \texttt{m} \cdot [ \texttt{src} (I); 1]\f]
(when m.cols=src.channels()+1 )
Every element of the N -channel array src is interpreted as N -element
vector that is transformed using the M x N or M x (N+1) matrix m to
M-element vector - the corresponding element of the output array dst .
The function may be used for geometrical transformation of
N -dimensional points, arbitrary linear color space transformation (such
as various kinds of RGB to YUV transforms), shuffling the image
channels, and so forth.
@param src input array that must have as many channels (1 to 4) as
m.cols or m.cols-1.
@param dst output array of the same size and depth as src; it has as
many channels as m.rows.
@param m transformation 2x2 or 2x3 floating-point matrix.
@sa perspectiveTransform, getAffineTransform, estimateAffine2D, warpAffine, warpPerspective
- transpose(...)
- transpose(src[, dst]) -> dst
@brief Transposes a matrix.
The function cv::transpose transposes the matrix src :
\f[\texttt{dst} (i,j) = \texttt{src} (j,i)\f]
@note No complex conjugation is done in case of a complex matrix. It
should be done separately if needed.
@param src input array.
@param dst output array of the same type as src.
- triangulatePoints(...)
- triangulatePoints(projMatr1, projMatr2, projPoints1, projPoints2[, points4D]) -> points4D
@brief Reconstructs points by triangulation.
@param projMatr1 3x4 projection matrix of the first camera.
@param projMatr2 3x4 projection matrix of the second camera.
@param projPoints1 2xN array of feature points in the first image. In case of c++ version it can
be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
@param projPoints2 2xN array of corresponding points in the second image. In case of c++ version
it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
@param points4D 4xN array of reconstructed points in homogeneous coordinates.
The function reconstructs 3-dimensional points (in homogeneous coordinates) by using their
observations with a stereo camera. Projections matrices can be obtained from stereoRectify.
@note
Keep in mind that all input data should be of float type in order for this function to work.
@sa
reprojectImageTo3D
- undistort(...)
- undistort(src, cameraMatrix, distCoeffs[, dst[, newCameraMatrix]]) -> dst
@brief Transforms an image to compensate for lens distortion.
The function transforms an image to compensate radial and tangential lens distortion.
The function is simply a combination of #initUndistortRectifyMap (with unity R ) and #remap
(with bilinear interpolation). See the former function for details of the transformation being
performed.
Those pixels in the destination image, for which there is no correspondent pixels in the source
image, are filled with zeros (black color).
A particular subset of the source image that will be visible in the corrected image can be regulated
by newCameraMatrix. You can use #getOptimalNewCameraMatrix to compute the appropriate
newCameraMatrix depending on your requirements.
The camera matrix and the distortion parameters can be determined using #calibrateCamera. If
the resolution of images is different from the resolution used at the calibration stage, \f$f_x,
f_y, c_x\f$ and \f$c_y\f$ need to be scaled accordingly, while the distortion coefficients remain
the same.
@param src Input (distorted) image.
@param dst Output (corrected) image that has the same size and type as src .
@param cameraMatrix Input camera matrix \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$
of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
@param newCameraMatrix Camera matrix of the distorted image. By default, it is the same as
cameraMatrix but you may additionally scale and shift the result by using a different matrix.
- undistortPoints(...)
- undistortPoints(src, cameraMatrix, distCoeffs[, dst[, R[, P]]]) -> dst
@brief Computes the ideal point coordinates from the observed point coordinates.
The function is similar to #undistort and #initUndistortRectifyMap but it operates on a
sparse set of points instead of a raster image. Also the function performs a reverse transformation
to projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a
planar object, it does, up to a translation vector, if the proper R is specified.
For each observed point coordinate \f$(u, v)\f$ the function computes:
\f[
\begin{array}{l}
x^{"} \leftarrow (u - c_x)/f_x \\
y^{"} \leftarrow (v - c_y)/f_y \\
(x',y') = undistort(x^{"},y^{"}, \texttt{distCoeffs}) \\
{[X\,Y\,W]} ^T \leftarrow R*[x' \, y' \, 1]^T \\
x \leftarrow X/W \\
y \leftarrow Y/W \\
\text{only performed if P is specified:} \\
u' \leftarrow x {f'}_x + {c'}_x \\
v' \leftarrow y {f'}_y + {c'}_y
\end{array}
\f]
where *undistort* is an approximate iterative algorithm that estimates the normalized original
point coordinates out of the normalized distorted point coordinates ("normalized" means that the
coordinates do not depend on the camera matrix).
The function can be used for both a stereo camera head or a monocular camera (when R is empty).
@param src Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
@param dst Output ideal point coordinates after undistortion and reverse perspective
transformation. If matrix P is identity or omitted, dst will contain normalized point coordinates.
@param cameraMatrix Camera matrix \f$\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ .
@param distCoeffs Input vector of distortion coefficients
\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$
of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
@param R Rectification transformation in the object space (3x3 matrix). R1 or R2 computed by
#stereoRectify can be passed here. If the matrix is empty, the identity transformation is used.
@param P New camera matrix (3x3) or new projection matrix (3x4) \f$\begin{bmatrix} {f'}_x & 0 & {c'}_x & t_x \\ 0 & {f'}_y & {c'}_y & t_y \\ 0 & 0 & 1 & t_z \end{bmatrix}\f$. P1 or P2 computed by
#stereoRectify can be passed here. If the matrix is empty, the identity new camera matrix is used.
- undistortPointsIter(...)
- undistortPointsIter(src, cameraMatrix, distCoeffs, R, P, criteria[, dst]) -> dst
@overload
@note Default version of #undistortPoints does 5 iterations to compute undistorted points.
- useOpenVX(...)
- useOpenVX() -> retval
- useOptimized(...)
- useOptimized() -> retval
@brief Returns the status of optimized code usage.
The function returns true if the optimized code is enabled. Otherwise, it returns false.
- validateDisparity(...)
- validateDisparity(disparity, cost, minDisparity, numberOfDisparities[, disp12MaxDisp]) -> disparity
- vconcat(...)
- vconcat(src[, dst]) -> dst
@overload
@code{.cpp}
std::vector<cv::Mat> matrices = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)),
cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)),
cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),};
cv::Mat out;
cv::vconcat( matrices, out );
//out:
//[1, 1, 1, 1;
// 2, 2, 2, 2;
// 3, 3, 3, 3]
@endcode
@param src input array or vector of matrices. all of the matrices must have the same number of cols and the same depth
@param dst output array. It has the same number of cols and depth as the src, and the sum of rows of the src.
same depth.
- waitKey(...)
- waitKey([, delay]) -> retval
@brief Waits for a pressed key.
The function waitKey waits for a key event infinitely (when \f$\texttt{delay}\leq 0\f$ ) or for delay
milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the
function will not wait exactly delay ms, it will wait at least delay ms, depending on what else is
running on your computer at that time. It returns the code of the pressed key or -1 if no key was
pressed before the specified time had elapsed.
@note
This function is the only method in HighGUI that can fetch and handle events, so it needs to be
called periodically for normal event processing unless HighGUI is used within an environment that
takes care of event processing.
@note
The function only works if there is at least one HighGUI window created and the window is active.
If there are several HighGUI windows, any of them can be active.
@param delay Delay in milliseconds. 0 is the special value that means "forever".
- waitKeyEx(...)
- waitKeyEx([, delay]) -> retval
@brief Similar to #waitKey, but returns full key code.
@note
Key code is implementation specific and depends on used backend: QT/GTK/Win32/etc
- warpAffine(...)
- warpAffine(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst
@brief Applies an affine transformation to an image.
The function warpAffine transforms the source image using the specified matrix:
\f[\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\f]
when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted
with #invertAffineTransform and then put in the formula above instead of M. The function cannot
operate in-place.
@param src input image.
@param dst output image that has the size dsize and the same type as src .
@param M \f$2\times 3\f$ transformation matrix.
@param dsize size of the output image.
@param flags combination of interpolation methods (see #InterpolationFlags) and the optional
flag #WARP_INVERSE_MAP that means that M is the inverse transformation (
\f$\texttt{dst}\rightarrow\texttt{src}\f$ ).
@param borderMode pixel extrapolation method (see #BorderTypes); when
borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to
the "outliers" in the source image are not modified by the function.
@param borderValue value used in case of a constant border; by default, it is 0.
@sa warpPerspective, resize, remap, getRectSubPix, transform
- warpPerspective(...)
- warpPerspective(src, M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) -> dst
@brief Applies a perspective transformation to an image.
The function warpPerspective transforms the source image using the specified matrix:
\f[\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
\frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\f]
when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert
and then put in the formula above instead of M. The function cannot operate in-place.
@param src input image.
@param dst output image that has the size dsize and the same type as src .
@param M \f$3\times 3\f$ transformation matrix.
@param dsize size of the output image.
@param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the
optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
\f$\texttt{dst}\rightarrow\texttt{src}\f$ ).
@param borderMode pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).
@param borderValue value used in case of a constant border; by default, it equals 0.
@sa warpAffine, resize, remap, getRectSubPix, perspectiveTransform
- watershed(...)
- watershed(image, markers) -> markers
@brief Performs a marker-based image segmentation using the watershed algorithm.
The function implements one of the variants of watershed, non-parametric marker-based segmentation
algorithm, described in @cite Meyer92 .
Before passing the image to the function, you have to roughly outline the desired regions in the
image markers with positive (\>0) indices. So, every region is represented as one or more connected
components with the pixel values 1, 2, 3, and so on. Such markers can be retrieved from a binary
mask using #findContours and #drawContours (see the watershed.cpp demo). The markers are "seeds" of
the future image regions. All the other pixels in markers , whose relation to the outlined regions
is not known and should be defined by the algorithm, should be set to 0's. In the function output,
each pixel in markers is set to a value of the "seed" components or to -1 at boundaries between the
regions.
@note Any two neighbor connected components are not necessarily separated by a watershed boundary
(-1's pixels); for example, they can touch each other in the initial marker image passed to the
function.
@param image Input 8-bit 3-channel image.
@param markers Input/output 32-bit single-channel image (map) of markers. It should have the same
size as image .
@sa findContours
@ingroup imgproc_misc
ACCESS_FAST = 67108864
ACCESS_MASK = 50331648
ACCESS_READ = 16777216
ACCESS_RW = 50331648
ACCESS_WRITE = 33554432
ADAPTIVE_THRESH_GAUSSIAN_C = 1
ADAPTIVE_THRESH_MEAN_C = 0
AGAST_FEATURE_DETECTOR_AGAST_5_8 = 0
AGAST_FEATURE_DETECTOR_AGAST_7_12D = 1
AGAST_FEATURE_DETECTOR_AGAST_7_12S = 2
AGAST_FEATURE_DETECTOR_NONMAX_SUPPRESSION = 10001
AGAST_FEATURE_DETECTOR_OAST_9_16 = 3
AGAST_FEATURE_DETECTOR_THRESHOLD = 10000
AKAZE_DESCRIPTOR_KAZE = 3
AKAZE_DESCRIPTOR_KAZE_UPRIGHT = 2
AKAZE_DESCRIPTOR_MLDB = 5
AKAZE_DESCRIPTOR_MLDB_UPRIGHT = 4
AgastFeatureDetector_AGAST_5_8 = 0
AgastFeatureDetector_AGAST_7_12d = 1
AgastFeatureDetector_AGAST_7_12s = 2
AgastFeatureDetector_NONMAX_SUPPRESSION = 10001
AgastFeatureDetector_OAST_9_16 = 3
AgastFeatureDetector_THRESHOLD = 10000
BORDER_CONSTANT = 0
BORDER_DEFAULT = 4
BORDER_ISOLATED = 16
BORDER_REFLECT = 2
BORDER_REFLECT101 = 4
BORDER_REFLECT_101 = 4
BORDER_REPLICATE = 1
BORDER_TRANSPARENT = 5
BORDER_WRAP = 3
CALIB_CB_ADAPTIVE_THRESH = 1
CALIB_CB_ASYMMETRIC_GRID = 2
CALIB_CB_CLUSTERING = 4
CALIB_CB_FAST_CHECK = 8
CALIB_CB_FILTER_QUADS = 4
CALIB_CB_NORMALIZE_IMAGE = 2
CALIB_CB_SYMMETRIC_GRID = 1
CALIB_FIX_ASPECT_RATIO = 2
CALIB_FIX_FOCAL_LENGTH = 16
CALIB_FIX_INTRINSIC = 256
CALIB_FIX_K1 = 32
CALIB_FIX_K2 = 64
CALIB_FIX_K3 = 128
CALIB_FIX_K4 = 2048
CALIB_FIX_K5 = 4096
CALIB_FIX_K6 = 8192
CALIB_FIX_PRINCIPAL_POINT = 4
CALIB_FIX_S1_S2_S3_S4 = 65536
CALIB_FIX_TANGENT_DIST = 2097152
CALIB_FIX_TAUX_TAUY = 524288
CALIB_RATIONAL_MODEL = 16384
CALIB_SAME_FOCAL_LENGTH = 512
CALIB_THIN_PRISM_MODEL = 32768
CALIB_TILTED_MODEL = 262144
CALIB_USE_EXTRINSIC_GUESS = 4194304
CALIB_USE_INTRINSIC_GUESS = 1
CALIB_USE_LU = 131072
CALIB_USE_QR = 1048576
CALIB_ZERO_DISPARITY = 1024
CALIB_ZERO_TANGENT_DIST = 8
CAP_ANDROID = 1000
CAP_ANY = 0
CAP_ARAVIS = 2100
CAP_AVFOUNDATION = 1200
CAP_CMU1394 = 300
CAP_DC1394 = 300
CAP_DSHOW = 700
CAP_FFMPEG = 1900
CAP_FIREWARE = 300
CAP_FIREWIRE = 300
CAP_GIGANETIX = 1300
CAP_GPHOTO2 = 1700
CAP_GSTREAMER = 1800
CAP_IEEE1394 = 300
CAP_IMAGES = 2000
CAP_INTELPERC = 1500
CAP_INTELPERC_DEPTH_GENERATOR = 536870912
CAP_INTELPERC_DEPTH_MAP = 0
CAP_INTELPERC_GENERATORS_MASK = 805306368
CAP_INTELPERC_IMAGE = 3
CAP_INTELPERC_IMAGE_GENERATOR = 268435456
CAP_INTELPERC_IR_MAP = 2
CAP_INTELPERC_UVDEPTH_MAP = 1
CAP_INTEL_MFX = 2300
CAP_MODE_BGR = 0
CAP_MODE_GRAY = 2
CAP_MODE_RGB = 1
CAP_MODE_YUYV = 3
CAP_MSMF = 1400
CAP_OPENCV_MJPEG = 2200
CAP_OPENNI = 900
CAP_OPENNI2 = 1600
CAP_OPENNI2_ASUS = 1610
CAP_OPENNI_ASUS = 910
CAP_OPENNI_BGR_IMAGE = 5
CAP_OPENNI_DEPTH_GENERATOR = -2147483648
CAP_OPENNI_DEPTH_GENERATOR_BASELINE = -2147483546
CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = -2147483545
CAP_OPENNI_DEPTH_GENERATOR_PRESENT = -2147483539
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = -2147483544
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = -2147483544
CAP_OPENNI_DEPTH_MAP = 0
CAP_OPENNI_DISPARITY_MAP = 2
CAP_OPENNI_DISPARITY_MAP_32F = 3
CAP_OPENNI_GENERATORS_MASK = -536870912
CAP_OPENNI_GRAY_IMAGE = 6
CAP_OPENNI_IMAGE_GENERATOR = 1073741824
CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = 1073741924
CAP_OPENNI_IMAGE_GENERATOR_PRESENT = 1073741933
CAP_OPENNI_IR_GENERATOR = 536870912
CAP_OPENNI_IR_GENERATOR_PRESENT = 536871021
CAP_OPENNI_IR_IMAGE = 7
CAP_OPENNI_POINT_CLOUD_MAP = 1
CAP_OPENNI_QVGA_30HZ = 3
CAP_OPENNI_QVGA_60HZ = 4
CAP_OPENNI_SXGA_15HZ = 1
CAP_OPENNI_SXGA_30HZ = 2
CAP_OPENNI_VALID_DEPTH_MASK = 4
CAP_OPENNI_VGA_30HZ = 0
CAP_PROP_APERTURE = 17008
CAP_PROP_AUTOFOCUS = 39
CAP_PROP_AUTO_EXPOSURE = 21
CAP_PROP_BACKLIGHT = 32
CAP_PROP_BRIGHTNESS = 10
CAP_PROP_BUFFERSIZE = 38
CAP_PROP_CONTRAST = 11
CAP_PROP_CONVERT_RGB = 16
CAP_PROP_DC1394_MAX = 31
CAP_PROP_DC1394_MODE_AUTO = -2
CAP_PROP_DC1394_MODE_MANUAL = -3
CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1
CAP_PROP_DC1394_OFF = -4
CAP_PROP_EXPOSURE = 15
CAP_PROP_EXPOSUREPROGRAM = 17009
CAP_PROP_FOCUS = 28
CAP_PROP_FORMAT = 8
CAP_PROP_FOURCC = 6
CAP_PROP_FPS = 5
CAP_PROP_FRAME_COUNT = 7
CAP_PROP_FRAME_HEIGHT = 4
CAP_PROP_FRAME_WIDTH = 3
CAP_PROP_GAIN = 14
CAP_PROP_GAMMA = 22
CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004
CAP_PROP_GIGA_FRAME_OFFSET_X = 10001
CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002
CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005
CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003
CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005
CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006
CAP_PROP_GPHOTO2_PREVIEW = 17001
CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003
CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004
CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002
CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200
CAP_PROP_GUID = 29
CAP_PROP_HUE = 13
CAP_PROP_IMAGES_BASE = 18000
CAP_PROP_IMAGES_LAST = 19000
CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007
CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003
CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004
CAP_PROP_INTELPERC_PROFILE_COUNT = 11001
CAP_PROP_INTELPERC_PROFILE_IDX = 11002
CAP_PROP_IOS_DEVICE_EXPOSURE = 9002
CAP_PROP_IOS_DEVICE_FLASH = 9003
CAP_PROP_IOS_DEVICE_FOCUS = 9001
CAP_PROP_IOS_DEVICE_TORCH = 9005
CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004
CAP_PROP_IRIS = 36
CAP_PROP_ISO_SPEED = 30
CAP_PROP_MODE = 9
CAP_PROP_MONOCHROME = 19
CAP_PROP_OPENNI2_MIRROR = 111
CAP_PROP_OPENNI2_SYNC = 110
CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105
CAP_PROP_OPENNI_BASELINE = 102
CAP_PROP_OPENNI_CIRCLE_BUFFER = 107
CAP_PROP_OPENNI_FOCAL_LENGTH = 103
CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101
CAP_PROP_OPENNI_GENERATOR_PRESENT = 109
CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106
CAP_PROP_OPENNI_MAX_TIME_DURATION = 108
CAP_PROP_OPENNI_OUTPUT_MODE = 100
CAP_PROP_OPENNI_REGISTRATION = 104
CAP_PROP_OPENNI_REGISTRATION_ON = 104
CAP_PROP_PAN = 33
CAP_PROP_POS_AVI_RATIO = 2
CAP_PROP_POS_FRAMES = 1
CAP_PROP_POS_MSEC = 0
CAP_PROP_PVAPI_BINNINGX = 304
CAP_PROP_PVAPI_BINNINGY = 305
CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302
CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303
CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301
CAP_PROP_PVAPI_MULTICASTIP = 300
CAP_PROP_PVAPI_PIXELFORMAT = 306
CAP_PROP_RECTIFICATION = 18
CAP_PROP_ROLL = 35
CAP_PROP_SAR_DEN = 41
CAP_PROP_SAR_NUM = 40
CAP_PROP_SATURATION = 12
CAP_PROP_SETTINGS = 37
CAP_PROP_SHARPNESS = 20
CAP_PROP_SPEED = 17007
CAP_PROP_TEMPERATURE = 23
CAP_PROP_TILT = 34
CAP_PROP_TRIGGER = 24
CAP_PROP_TRIGGER_DELAY = 25
CAP_PROP_VIEWFINDER = 17010
CAP_PROP_WHITE_BALANCE_BLUE_U = 17
CAP_PROP_WHITE_BALANCE_RED_V = 26
CAP_PROP_XI_ACQ_BUFFER_SIZE = 548
CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549
CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499
CAP_PROP_XI_ACQ_TIMING_MODE = 538
CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552
CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550
CAP_PROP_XI_AEAG = 415
CAP_PROP_XI_AEAG_LEVEL = 419
CAP_PROP_XI_AEAG_ROI_HEIGHT = 442
CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439
CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440
CAP_PROP_XI_AEAG_ROI_WIDTH = 441
CAP_PROP_XI_AE_MAX_LIMIT = 417
CAP_PROP_XI_AG_MAX_LIMIT = 418
CAP_PROP_XI_APPLY_CMS = 471
CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573
CAP_PROP_XI_AUTO_WB = 414
CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539
CAP_PROP_XI_BINNING_HORIZONTAL = 429
CAP_PROP_XI_BINNING_PATTERN = 430
CAP_PROP_XI_BINNING_SELECTOR = 427
CAP_PROP_XI_BINNING_VERTICAL = 428
CAP_PROP_XI_BPC = 445
CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551
CAP_PROP_XI_BUFFER_POLICY = 540
CAP_PROP_XI_CC_MATRIX_00 = 479
CAP_PROP_XI_CC_MATRIX_01 = 480
CAP_PROP_XI_CC_MATRIX_02 = 481
CAP_PROP_XI_CC_MATRIX_03 = 482
CAP_PROP_XI_CC_MATRIX_10 = 483
CAP_PROP_XI_CC_MATRIX_11 = 484
CAP_PROP_XI_CC_MATRIX_12 = 485
CAP_PROP_XI_CC_MATRIX_13 = 486
CAP_PROP_XI_CC_MATRIX_20 = 487
CAP_PROP_XI_CC_MATRIX_21 = 488
CAP_PROP_XI_CC_MATRIX_22 = 489
CAP_PROP_XI_CC_MATRIX_23 = 490
CAP_PROP_XI_CC_MATRIX_30 = 491
CAP_PROP_XI_CC_MATRIX_31 = 492
CAP_PROP_XI_CC_MATRIX_32 = 493
CAP_PROP_XI_CC_MATRIX_33 = 494
CAP_PROP_XI_CHIP_TEMP = 468
CAP_PROP_XI_CMS = 470
CAP_PROP_XI_COLOR_FILTER_ARRAY = 475
CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555
CAP_PROP_XI_COOLING = 466
CAP_PROP_XI_COUNTER_SELECTOR = 536
CAP_PROP_XI_COUNTER_VALUE = 537
CAP_PROP_XI_DATA_FORMAT = 401
CAP_PROP_XI_DEBOUNCE_EN = 507
CAP_PROP_XI_DEBOUNCE_POL = 510
CAP_PROP_XI_DEBOUNCE_T0 = 508
CAP_PROP_XI_DEBOUNCE_T1 = 509
CAP_PROP_XI_DEBUG_LEVEL = 572
CAP_PROP_XI_DECIMATION_HORIZONTAL = 433
CAP_PROP_XI_DECIMATION_PATTERN = 434
CAP_PROP_XI_DECIMATION_SELECTOR = 431
CAP_PROP_XI_DECIMATION_VERTICAL = 432
CAP_PROP_XI_DEFAULT_CC_MATRIX = 495
CAP_PROP_XI_DEVICE_MODEL_ID = 521
CAP_PROP_XI_DEVICE_RESET = 554
CAP_PROP_XI_DEVICE_SN = 522
CAP_PROP_XI_DOWNSAMPLING = 400
CAP_PROP_XI_DOWNSAMPLING_TYPE = 426
CAP_PROP_XI_EXPOSURE = 421
CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422
CAP_PROP_XI_EXP_PRIORITY = 416
CAP_PROP_XI_FFS_ACCESS_KEY = 583
CAP_PROP_XI_FFS_FILE_ID = 594
CAP_PROP_XI_FFS_FILE_SIZE = 580
CAP_PROP_XI_FRAMERATE = 535
CAP_PROP_XI_FREE_FFS_SIZE = 581
CAP_PROP_XI_GAIN = 424
CAP_PROP_XI_GAIN_SELECTOR = 423
CAP_PROP_XI_GAMMAC = 477
CAP_PROP_XI_GAMMAY = 476
CAP_PROP_XI_GPI_LEVEL = 408
CAP_PROP_XI_GPI_MODE = 407
CAP_PROP_XI_GPI_SELECTOR = 406
CAP_PROP_XI_GPO_MODE = 410
CAP_PROP_XI_GPO_SELECTOR = 409
CAP_PROP_XI_HDR = 559
CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560
CAP_PROP_XI_HDR_T1 = 561
CAP_PROP_XI_HDR_T2 = 562
CAP_PROP_XI_HEIGHT = 452
CAP_PROP_XI_HOUS_BACK_SIDE_TEMP = 590
CAP_PROP_XI_HOUS_TEMP = 469
CAP_PROP_XI_HW_REVISION = 571
CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565
CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462
CAP_PROP_XI_IMAGE_DATA_FORMAT = 435
CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529
CAP_PROP_XI_IMAGE_IS_COLOR = 474
CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530
CAP_PROP_XI_IS_COOLED = 465
CAP_PROP_XI_IS_DEVICE_EXIST = 547
CAP_PROP_XI_KNEEPOINT1 = 563
CAP_PROP_XI_KNEEPOINT2 = 564
CAP_PROP_XI_LED_MODE = 412
CAP_PROP_XI_LED_SELECTOR = 411
CAP_PROP_XI_LENS_APERTURE_VALUE = 512
CAP_PROP_XI_LENS_FEATURE = 518
CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517
CAP_PROP_XI_LENS_FOCAL_LENGTH = 516
CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515
CAP_PROP_XI_LENS_FOCUS_MOVE = 514
CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513
CAP_PROP_XI_LENS_MODE = 511
CAP_PROP_XI_LIMIT_BANDWIDTH = 459
CAP_PROP_XI_LUT_EN = 541
CAP_PROP_XI_LUT_INDEX = 542
CAP_PROP_XI_LUT_VALUE = 543
CAP_PROP_XI_MANUAL_WB = 413
CAP_PROP_XI_OFFSET_X = 402
CAP_PROP_XI_OFFSET_Y = 403
CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461
CAP_PROP_XI_OUTPUT_DATA_PACKING = 463
CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464
CAP_PROP_XI_RECENT_FRAME = 553
CAP_PROP_XI_REGION_MODE = 595
CAP_PROP_XI_REGION_SELECTOR = 589
CAP_PROP_XI_ROW_FPN_CORRECTION = 591
CAP_PROP_XI_SENSOR_BOARD_TEMP = 596
CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532
CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533
CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460
CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585
CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586
CAP_PROP_XI_SENSOR_MODE = 558
CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534
CAP_PROP_XI_SENSOR_TAPS = 437
CAP_PROP_XI_SHARPNESS = 478
CAP_PROP_XI_SHUTTER_TYPE = 436
CAP_PROP_XI_TARGET_TEMP = 467
CAP_PROP_XI_TEST_PATTERN = 588
CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR = 587
CAP_PROP_XI_TIMEOUT = 420
CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531
CAP_PROP_XI_TRG_DELAY = 544
CAP_PROP_XI_TRG_SELECTOR = 498
CAP_PROP_XI_TRG_SOFTWARE = 405
CAP_PROP_XI_TRG_SOURCE = 404
CAP_PROP_XI_TS_RST_MODE = 545
CAP_PROP_XI_TS_RST_SOURCE = 546
CAP_PROP_XI_USED_FFS_SIZE = 582
CAP_PROP_XI_WB_KB = 450
CAP_PROP_XI_WB_KG = 449
CAP_PROP_XI_WB_KR = 448
CAP_PROP_XI_WIDTH = 451
CAP_PROP_ZOOM = 27
CAP_PVAPI = 800
CAP_PVAPI_DECIMATION_2OUTOF16 = 8
CAP_PVAPI_DECIMATION_2OUTOF4 = 2
CAP_PVAPI_DECIMATION_2OUTOF8 = 4
CAP_PVAPI_DECIMATION_OFF = 1
CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3
CAP_PVAPI_FSTRIGMODE_FREERUN = 0
CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4
CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1
CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2
CAP_PVAPI_PIXELFORMAT_BAYER16 = 4
CAP_PVAPI_PIXELFORMAT_BAYER8 = 3
CAP_PVAPI_PIXELFORMAT_BGR24 = 6
CAP_PVAPI_PIXELFORMAT_BGRA32 = 8
CAP_PVAPI_PIXELFORMAT_MONO16 = 2
CAP_PVAPI_PIXELFORMAT_MONO8 = 1
CAP_PVAPI_PIXELFORMAT_RGB24 = 5
CAP_PVAPI_PIXELFORMAT_RGBA32 = 7
CAP_QT = 500
CAP_UNICAP = 600
CAP_V4L = 200
CAP_V4L2 = 200
CAP_VFW = 200
CAP_WINRT = 1410
CAP_XIAPI = 1100
CASCADE_DO_CANNY_PRUNING = 1
CASCADE_DO_ROUGH_SEARCH = 8
CASCADE_FIND_BIGGEST_OBJECT = 4
CASCADE_SCALE_IMAGE = 2
CCL_DEFAULT = -1
CCL_GRANA = 1
CCL_WU = 0
CC_STAT_AREA = 4
CC_STAT_HEIGHT = 3
CC_STAT_LEFT = 0
CC_STAT_MAX = 5
CC_STAT_TOP = 1
CC_STAT_WIDTH = 2
CHAIN_APPROX_NONE = 1
CHAIN_APPROX_SIMPLE = 2
CHAIN_APPROX_TC89_KCOS = 4
CHAIN_APPROX_TC89_L1 = 3
CIRCLES_GRID_FINDER_PARAMETERS_ASYMMETRIC_GRID = 1
CIRCLES_GRID_FINDER_PARAMETERS_SYMMETRIC_GRID = 0
CMP_EQ = 0
CMP_GE = 2
CMP_GT = 1
CMP_LE = 4
CMP_LT = 3
CMP_NE = 5
COLORMAP_AUTUMN = 0
COLORMAP_BONE = 1
COLORMAP_COOL = 8
COLORMAP_HOT = 11
COLORMAP_HSV = 9
COLORMAP_JET = 2
COLORMAP_OCEAN = 5
COLORMAP_PARULA = 12
COLORMAP_PINK = 10
COLORMAP_RAINBOW = 4
COLORMAP_SPRING = 7
COLORMAP_SUMMER = 6
COLORMAP_WINTER = 3
COLORSPACE_BGR = 2
COLORSPACE_GRAY = 0
COLORSPACE_RGBA = 1
COLORSPACE_YUV444P = 3
COLOR_BAYER_BG2BGR = 46
COLOR_BAYER_BG2BGRA = 139
COLOR_BAYER_BG2BGR_EA = 135
COLOR_BAYER_BG2BGR_VNG = 62
COLOR_BAYER_BG2GRAY = 86
COLOR_BAYER_BG2RGB = 48
COLOR_BAYER_BG2RGBA = 141
COLOR_BAYER_BG2RGB_EA = 137
COLOR_BAYER_BG2RGB_VNG = 64
COLOR_BAYER_GB2BGR = 47
COLOR_BAYER_GB2BGRA = 140
COLOR_BAYER_GB2BGR_EA = 136
COLOR_BAYER_GB2BGR_VNG = 63
COLOR_BAYER_GB2GRAY = 87
COLOR_BAYER_GB2RGB = 49
COLOR_BAYER_GB2RGBA = 142
COLOR_BAYER_GB2RGB_EA = 138
COLOR_BAYER_GB2RGB_VNG = 65
COLOR_BAYER_GR2BGR = 49
COLOR_BAYER_GR2BGRA = 142
COLOR_BAYER_GR2BGR_EA = 138
COLOR_BAYER_GR2BGR_VNG = 65
COLOR_BAYER_GR2GRAY = 89
COLOR_BAYER_GR2RGB = 47
COLOR_BAYER_GR2RGBA = 140
COLOR_BAYER_GR2RGB_EA = 136
COLOR_BAYER_GR2RGB_VNG = 63
COLOR_BAYER_RG2BGR = 48
COLOR_BAYER_RG2BGRA = 141
COLOR_BAYER_RG2BGR_EA = 137
COLOR_BAYER_RG2BGR_VNG = 64
COLOR_BAYER_RG2GRAY = 88
COLOR_BAYER_RG2RGB = 46
COLOR_BAYER_RG2RGBA = 139
COLOR_BAYER_RG2RGB_EA = 135
COLOR_BAYER_RG2RGB_VNG = 62
COLOR_BGR2BGR555 = 22
COLOR_BGR2BGR565 = 12
COLOR_BGR2BGRA = 0
COLOR_BGR2GRAY = 6
COLOR_BGR2HLS = 52
COLOR_BGR2HLS_FULL = 68
COLOR_BGR2HSV = 40
COLOR_BGR2HSV_FULL = 66
COLOR_BGR2LAB = 44
COLOR_BGR2LUV = 50
COLOR_BGR2Lab = 44
COLOR_BGR2Luv = 50
COLOR_BGR2RGB = 4
COLOR_BGR2RGBA = 2
COLOR_BGR2XYZ = 32
COLOR_BGR2YCR_CB = 36
COLOR_BGR2YCrCb = 36
COLOR_BGR2YUV = 82
COLOR_BGR2YUV_I420 = 128
COLOR_BGR2YUV_IYUV = 128
COLOR_BGR2YUV_YV12 = 132
COLOR_BGR5552BGR = 24
COLOR_BGR5552BGRA = 28
COLOR_BGR5552GRAY = 31
COLOR_BGR5552RGB = 25
COLOR_BGR5552RGBA = 29
COLOR_BGR5652BGR = 14
COLOR_BGR5652BGRA = 18
COLOR_BGR5652GRAY = 21
COLOR_BGR5652RGB = 15
COLOR_BGR5652RGBA = 19
COLOR_BGRA2BGR = 1
COLOR_BGRA2BGR555 = 26
COLOR_BGRA2BGR565 = 16
COLOR_BGRA2GRAY = 10
COLOR_BGRA2RGB = 3
COLOR_BGRA2RGBA = 5
COLOR_BGRA2YUV_I420 = 130
COLOR_BGRA2YUV_IYUV = 130
COLOR_BGRA2YUV_YV12 = 134
COLOR_BayerBG2BGR = 46
COLOR_BayerBG2BGRA = 139
COLOR_BayerBG2BGR_EA = 135
COLOR_BayerBG2BGR_VNG = 62
COLOR_BayerBG2GRAY = 86
COLOR_BayerBG2RGB = 48
COLOR_BayerBG2RGBA = 141
COLOR_BayerBG2RGB_EA = 137
COLOR_BayerBG2RGB_VNG = 64
COLOR_BayerGB2BGR = 47
COLOR_BayerGB2BGRA = 140
COLOR_BayerGB2BGR_EA = 136
COLOR_BayerGB2BGR_VNG = 63
COLOR_BayerGB2GRAY = 87
COLOR_BayerGB2RGB = 49
COLOR_BayerGB2RGBA = 142
COLOR_BayerGB2RGB_EA = 138
COLOR_BayerGB2RGB_VNG = 65
COLOR_BayerGR2BGR = 49
COLOR_BayerGR2BGRA = 142
COLOR_BayerGR2BGR_EA = 138
COLOR_BayerGR2BGR_VNG = 65
COLOR_BayerGR2GRAY = 89
COLOR_BayerGR2RGB = 47
COLOR_BayerGR2RGBA = 140
COLOR_BayerGR2RGB_EA = 136
COLOR_BayerGR2RGB_VNG = 63
COLOR_BayerRG2BGR = 48
COLOR_BayerRG2BGRA = 141
COLOR_BayerRG2BGR_EA = 137
COLOR_BayerRG2BGR_VNG = 64
COLOR_BayerRG2GRAY = 88
COLOR_BayerRG2RGB = 46
COLOR_BayerRG2RGBA = 139
COLOR_BayerRG2RGB_EA = 135
COLOR_BayerRG2RGB_VNG = 62
COLOR_COLORCVT_MAX = 143
COLOR_GRAY2BGR = 8
COLOR_GRAY2BGR555 = 30
COLOR_GRAY2BGR565 = 20
COLOR_GRAY2BGRA = 9
COLOR_GRAY2RGB = 8
COLOR_GRAY2RGBA = 9
COLOR_HLS2BGR = 60
COLOR_HLS2BGR_FULL = 72
COLOR_HLS2RGB = 61
COLOR_HLS2RGB_FULL = 73
COLOR_HSV2BGR = 54
COLOR_HSV2BGR_FULL = 70
COLOR_HSV2RGB = 55
COLOR_HSV2RGB_FULL = 71
COLOR_LAB2BGR = 56
COLOR_LAB2LBGR = 78
COLOR_LAB2LRGB = 79
COLOR_LAB2RGB = 57
COLOR_LBGR2LAB = 74
COLOR_LBGR2LUV = 76
COLOR_LBGR2Lab = 74
COLOR_LBGR2Luv = 76
COLOR_LRGB2LAB = 75
COLOR_LRGB2LUV = 77
COLOR_LRGB2Lab = 75
COLOR_LRGB2Luv = 77
COLOR_LUV2BGR = 58
COLOR_LUV2LBGR = 80
COLOR_LUV2LRGB = 81
COLOR_LUV2RGB = 59
COLOR_Lab2BGR = 56
COLOR_Lab2LBGR = 78
COLOR_Lab2LRGB = 79
COLOR_Lab2RGB = 57
COLOR_Luv2BGR = 58
COLOR_Luv2LBGR = 80
COLOR_Luv2LRGB = 81
COLOR_Luv2RGB = 59
COLOR_M_RGBA2RGBA = 126
COLOR_RGB2BGR = 4
COLOR_RGB2BGR555 = 23
COLOR_RGB2BGR565 = 13
COLOR_RGB2BGRA = 2
COLOR_RGB2GRAY = 7
COLOR_RGB2HLS = 53
COLOR_RGB2HLS_FULL = 69
COLOR_RGB2HSV = 41
COLOR_RGB2HSV_FULL = 67
COLOR_RGB2LAB = 45
COLOR_RGB2LUV = 51
COLOR_RGB2Lab = 45
COLOR_RGB2Luv = 51
COLOR_RGB2RGBA = 0
COLOR_RGB2XYZ = 33
COLOR_RGB2YCR_CB = 37
COLOR_RGB2YCrCb = 37
COLOR_RGB2YUV = 83
COLOR_RGB2YUV_I420 = 127
COLOR_RGB2YUV_IYUV = 127
COLOR_RGB2YUV_YV12 = 131
COLOR_RGBA2BGR = 3
COLOR_RGBA2BGR555 = 27
COLOR_RGBA2BGR565 = 17
COLOR_RGBA2BGRA = 5
COLOR_RGBA2GRAY = 11
COLOR_RGBA2M_RGBA = 125
COLOR_RGBA2RGB = 1
COLOR_RGBA2YUV_I420 = 129
COLOR_RGBA2YUV_IYUV = 129
COLOR_RGBA2YUV_YV12 = 133
COLOR_RGBA2mRGBA = 125
COLOR_XYZ2BGR = 34
COLOR_XYZ2RGB = 35
COLOR_YCR_CB2BGR = 38
COLOR_YCR_CB2RGB = 39
COLOR_YCrCb2BGR = 38
COLOR_YCrCb2RGB = 39
COLOR_YUV2BGR = 84
COLOR_YUV2BGRA_I420 = 105
COLOR_YUV2BGRA_IYUV = 105
COLOR_YUV2BGRA_NV12 = 95
COLOR_YUV2BGRA_NV21 = 97
COLOR_YUV2BGRA_UYNV = 112
COLOR_YUV2BGRA_UYVY = 112
COLOR_YUV2BGRA_Y422 = 112
COLOR_YUV2BGRA_YUNV = 120
COLOR_YUV2BGRA_YUY2 = 120
COLOR_YUV2BGRA_YUYV = 120
COLOR_YUV2BGRA_YV12 = 103
COLOR_YUV2BGRA_YVYU = 122
COLOR_YUV2BGR_I420 = 101
COLOR_YUV2BGR_IYUV = 101
COLOR_YUV2BGR_NV12 = 91
COLOR_YUV2BGR_NV21 = 93
COLOR_YUV2BGR_UYNV = 108
COLOR_YUV2BGR_UYVY = 108
COLOR_YUV2BGR_Y422 = 108
COLOR_YUV2BGR_YUNV = 116
COLOR_YUV2BGR_YUY2 = 116
COLOR_YUV2BGR_YUYV = 116
COLOR_YUV2BGR_YV12 = 99
COLOR_YUV2BGR_YVYU = 118
COLOR_YUV2GRAY_420 = 106
COLOR_YUV2GRAY_I420 = 106
COLOR_YUV2GRAY_IYUV = 106
COLOR_YUV2GRAY_NV12 = 106
COLOR_YUV2GRAY_NV21 = 106
COLOR_YUV2GRAY_UYNV = 123
COLOR_YUV2GRAY_UYVY = 123
COLOR_YUV2GRAY_Y422 = 123
COLOR_YUV2GRAY_YUNV = 124
COLOR_YUV2GRAY_YUY2 = 124
COLOR_YUV2GRAY_YUYV = 124
COLOR_YUV2GRAY_YV12 = 106
COLOR_YUV2GRAY_YVYU = 124
COLOR_YUV2RGB = 85
COLOR_YUV2RGBA_I420 = 104
COLOR_YUV2RGBA_IYUV = 104
COLOR_YUV2RGBA_NV12 = 94
COLOR_YUV2RGBA_NV21 = 96
COLOR_YUV2RGBA_UYNV = 111
COLOR_YUV2RGBA_UYVY = 111
COLOR_YUV2RGBA_Y422 = 111
COLOR_YUV2RGBA_YUNV = 119
COLOR_YUV2RGBA_YUY2 = 119
COLOR_YUV2RGBA_YUYV = 119
COLOR_YUV2RGBA_YV12 = 102
COLOR_YUV2RGBA_YVYU = 121
COLOR_YUV2RGB_I420 = 100
COLOR_YUV2RGB_IYUV = 100
COLOR_YUV2RGB_NV12 = 90
COLOR_YUV2RGB_NV21 = 92
COLOR_YUV2RGB_UYNV = 107
COLOR_YUV2RGB_UYVY = 107
COLOR_YUV2RGB_Y422 = 107
COLOR_YUV2RGB_YUNV = 115
COLOR_YUV2RGB_YUY2 = 115
COLOR_YUV2RGB_YUYV = 115
COLOR_YUV2RGB_YV12 = 98
COLOR_YUV2RGB_YVYU = 117
COLOR_YUV420P2BGR = 99
COLOR_YUV420P2BGRA = 103
COLOR_YUV420P2GRAY = 106
COLOR_YUV420P2RGB = 98
COLOR_YUV420P2RGBA = 102
COLOR_YUV420SP2BGR = 93
COLOR_YUV420SP2BGRA = 97
COLOR_YUV420SP2GRAY = 106
COLOR_YUV420SP2RGB = 92
COLOR_YUV420SP2RGBA = 96
COLOR_YUV420p2BGR = 99
COLOR_YUV420p2BGRA = 103
COLOR_YUV420p2GRAY = 106
COLOR_YUV420p2RGB = 98
COLOR_YUV420p2RGBA = 102
COLOR_YUV420sp2BGR = 93
COLOR_YUV420sp2BGRA = 97
COLOR_YUV420sp2GRAY = 106
COLOR_YUV420sp2RGB = 92
COLOR_YUV420sp2RGBA = 96
COLOR_mRGBA2RGBA = 126
CONTOURS_MATCH_I1 = 1
CONTOURS_MATCH_I2 = 2
CONTOURS_MATCH_I3 = 3
COVAR_COLS = 16
COVAR_NORMAL = 1
COVAR_ROWS = 8
COVAR_SCALE = 4
COVAR_SCRAMBLED = 0
COVAR_USE_AVG = 2
CV_16S = 3
CV_16SC1 = 3
CV_16SC2 = 11
CV_16SC3 = 19
CV_16SC4 = 27
CV_16U = 2
CV_16UC1 = 2
CV_16UC2 = 10
CV_16UC3 = 18
CV_16UC4 = 26
CV_32F = 5
CV_32FC1 = 5
CV_32FC2 = 13
CV_32FC3 = 21
CV_32FC4 = 29
CV_32S = 4
CV_32SC1 = 4
CV_32SC2 = 12
CV_32SC3 = 20
CV_32SC4 = 28
CV_64F = 6
CV_64FC1 = 6
CV_64FC2 = 14
CV_64FC3 = 22
CV_64FC4 = 30
CV_8S = 1
CV_8SC1 = 1
CV_8SC2 = 9
CV_8SC3 = 17
CV_8SC4 = 25
CV_8U = 0
CV_8UC1 = 0
CV_8UC2 = 8
CV_8UC3 = 16
CV_8UC4 = 24
CirclesGridFinderParameters_ASYMMETRIC_GRID = 1
CirclesGridFinderParameters_SYMMETRIC_GRID = 0
DB = 0
DC = 1
DCT_INVERSE = 1
DCT_ROWS = 4
DECOMP_CHOLESKY = 3
DECOMP_EIG = 2
DECOMP_LU = 0
DECOMP_NORMAL = 16
DECOMP_QR = 4
DECOMP_SVD = 1
DESCRIPTOR_MATCHER_BRUTEFORCE = 2
DESCRIPTOR_MATCHER_BRUTEFORCE_HAMMING = 4
DESCRIPTOR_MATCHER_BRUTEFORCE_HAMMINGLUT = 5
DESCRIPTOR_MATCHER_BRUTEFORCE_L1 = 3
DESCRIPTOR_MATCHER_BRUTEFORCE_SL2 = 6
DESCRIPTOR_MATCHER_FLANNBASED = 1
DFT_COMPLEX_INPUT = 64
DFT_COMPLEX_OUTPUT = 16
DFT_INVERSE = 1
DFT_REAL_OUTPUT = 32
DFT_ROWS = 4
DFT_SCALE = 2
DIST_C = 3
DIST_FAIR = 5
DIST_HUBER = 7
DIST_L1 = 1
DIST_L12 = 4
DIST_L2 = 2
DIST_LABEL_CCOMP = 0
DIST_LABEL_PIXEL = 1
DIST_MASK_3 = 3
DIST_MASK_5 = 5
DIST_MASK_PRECISE = 0
DIST_USER = -1
DIST_WELSCH = 6
DRAW_MATCHES_FLAGS_DEFAULT = 0
DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG = 1
DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS = 4
DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS = 2
DescriptorMatcher_BRUTEFORCE = 2
DescriptorMatcher_BRUTEFORCE_HAMMING = 4
DescriptorMatcher_BRUTEFORCE_HAMMINGLUT = 5
DescriptorMatcher_BRUTEFORCE_L1 = 3
DescriptorMatcher_BRUTEFORCE_SL2 = 6
DescriptorMatcher_FLANNBASED = 1
DrawMatchesFlags_DEFAULT = 0
DrawMatchesFlags_DRAW_OVER_OUTIMG = 1
DrawMatchesFlags_DRAW_RICH_KEYPOINTS = 4
DrawMatchesFlags_NOT_DRAW_SINGLE_POINTS = 2
EVENT_FLAG_ALTKEY = 32
EVENT_FLAG_CTRLKEY = 8
EVENT_FLAG_LBUTTON = 1
EVENT_FLAG_MBUTTON = 4
EVENT_FLAG_RBUTTON = 2
EVENT_FLAG_SHIFTKEY = 16
EVENT_LBUTTONDBLCLK = 7
EVENT_LBUTTONDOWN = 1
EVENT_LBUTTONUP = 4
EVENT_MBUTTONDBLCLK = 9
EVENT_MBUTTONDOWN = 3
EVENT_MBUTTONUP = 6
EVENT_MOUSEHWHEEL = 11
EVENT_MOUSEMOVE = 0
EVENT_MOUSEWHEEL = 10
EVENT_RBUTTONDBLCLK = 8
EVENT_RBUTTONDOWN = 2
EVENT_RBUTTONUP = 5
FAST_FEATURE_DETECTOR_FAST_N = 10002
FAST_FEATURE_DETECTOR_NONMAX_SUPPRESSION = 10001
FAST_FEATURE_DETECTOR_THRESHOLD = 10000
FAST_FEATURE_DETECTOR_TYPE_5_8 = 0
FAST_FEATURE_DETECTOR_TYPE_7_12 = 1
FAST_FEATURE_DETECTOR_TYPE_9_16 = 2
FILE_NODE_EMPTY = 32
FILE_NODE_FLOAT = 2
FILE_NODE_FLOW = 8
FILE_NODE_INT = 1
FILE_NODE_MAP = 6
FILE_NODE_NAMED = 64
FILE_NODE_NONE = 0
FILE_NODE_REAL = 2
FILE_NODE_REF = 4
FILE_NODE_SEQ = 5
FILE_NODE_STR = 3
FILE_NODE_STRING = 3
FILE_NODE_TYPE_MASK = 7
FILE_NODE_USER = 16
FILE_STORAGE_APPEND = 2
FILE_STORAGE_BASE64 = 64
FILE_STORAGE_FORMAT_AUTO = 0
FILE_STORAGE_FORMAT_JSON = 24
FILE_STORAGE_FORMAT_MASK = 56
FILE_STORAGE_FORMAT_XML = 8
FILE_STORAGE_FORMAT_YAML = 16
FILE_STORAGE_INSIDE_MAP = 4
FILE_STORAGE_MEMORY = 4
FILE_STORAGE_NAME_EXPECTED = 2
FILE_STORAGE_READ = 0
FILE_STORAGE_UNDEFINED = 0
FILE_STORAGE_VALUE_EXPECTED = 1
FILE_STORAGE_WRITE = 1
FILE_STORAGE_WRITE_BASE64 = 65
FILLED = -1
FLOODFILL_FIXED_RANGE = 65536
FLOODFILL_MASK_ONLY = 131072
FM_7POINT = 1
FM_8POINT = 2
FM_LMEDS = 4
FM_RANSAC = 8
FONT_HERSHEY_COMPLEX = 3
FONT_HERSHEY_COMPLEX_SMALL = 5
FONT_HERSHEY_DUPLEX = 2
FONT_HERSHEY_PLAIN = 1
FONT_HERSHEY_SCRIPT_COMPLEX = 7
FONT_HERSHEY_SCRIPT_SIMPLEX = 6
FONT_HERSHEY_SIMPLEX = 0
FONT_HERSHEY_TRIPLEX = 4
FONT_ITALIC = 16
FORMATTER_FMT_C = 5
FORMATTER_FMT_CSV = 2
FORMATTER_FMT_DEFAULT = 0
FORMATTER_FMT_MATLAB = 1
FORMATTER_FMT_NUMPY = 4
FORMATTER_FMT_PYTHON = 3
FastFeatureDetector_FAST_N = 10002
FastFeatureDetector_NONMAX_SUPPRESSION = 10001
FastFeatureDetector_THRESHOLD = 10000
FastFeatureDetector_TYPE_5_8 = 0
FastFeatureDetector_TYPE_7_12 = 1
FastFeatureDetector_TYPE_9_16 = 2
FileNode_EMPTY = 32
FileNode_FLOAT = 2
FileNode_FLOW = 8
FileNode_INT = 1
FileNode_MAP = 6
FileNode_NAMED = 64
FileNode_NONE = 0
FileNode_REAL = 2
FileNode_REF = 4
FileNode_SEQ = 5
FileNode_STR = 3
FileNode_STRING = 3
FileNode_TYPE_MASK = 7
FileNode_USER = 16
FileStorage_APPEND = 2
FileStorage_BASE64 = 64
FileStorage_FORMAT_AUTO = 0
FileStorage_FORMAT_JSON = 24
FileStorage_FORMAT_MASK = 56
FileStorage_FORMAT_XML = 8
FileStorage_FORMAT_YAML = 16
FileStorage_INSIDE_MAP = 4
FileStorage_MEMORY = 4
FileStorage_NAME_EXPECTED = 2
FileStorage_READ = 0
FileStorage_UNDEFINED = 0
FileStorage_VALUE_EXPECTED = 1
FileStorage_WRITE = 1
FileStorage_WRITE_BASE64 = 65
Formatter_FMT_C = 5
Formatter_FMT_CSV = 2
Formatter_FMT_DEFAULT = 0
Formatter_FMT_MATLAB = 1
Formatter_FMT_NUMPY = 4
Formatter_FMT_PYTHON = 3
GC_BGD = 0
GC_EVAL = 2
GC_FGD = 1
GC_INIT_WITH_MASK = 1
GC_INIT_WITH_RECT = 0
GC_PR_BGD = 2
GC_PR_FGD = 3
GEMM_1_T = 1
GEMM_2_T = 2
GEMM_3_T = 4
HAMMING_NORM_TYPE = 6
HISTCMP_BHATTACHARYYA = 3
HISTCMP_CHISQR = 1
HISTCMP_CHISQR_ALT = 4
HISTCMP_CORREL = 0
HISTCMP_HELLINGER = 3
HISTCMP_INTERSECT = 2
HISTCMP_KL_DIV = 5
HOGDESCRIPTOR_DEFAULT_NLEVELS = 64
HOGDESCRIPTOR_L2HYS = 0
HOGDescriptor_DEFAULT_NLEVELS = 64
HOGDescriptor_L2Hys = 0
HOUGH_GRADIENT = 3
HOUGH_MULTI_SCALE = 2
HOUGH_PROBABILISTIC = 1
HOUGH_STANDARD = 0
Hamming_normType = 6
IMREAD_ANYCOLOR = 4
IMREAD_ANYDEPTH = 2
IMREAD_COLOR = 1
IMREAD_GRAYSCALE = 0
IMREAD_IGNORE_ORIENTATION = 128
IMREAD_LOAD_GDAL = 8
IMREAD_REDUCED_COLOR_2 = 17
IMREAD_REDUCED_COLOR_4 = 33
IMREAD_REDUCED_COLOR_8 = 65
IMREAD_REDUCED_GRAYSCALE_2 = 16
IMREAD_REDUCED_GRAYSCALE_4 = 32
IMREAD_REDUCED_GRAYSCALE_8 = 64
IMREAD_UNCHANGED = -1
IMWRITE_EXR_TYPE = 48
IMWRITE_EXR_TYPE_FLOAT = 2
IMWRITE_EXR_TYPE_HALF = 1
IMWRITE_JPEG_CHROMA_QUALITY = 6
IMWRITE_JPEG_LUMA_QUALITY = 5
IMWRITE_JPEG_OPTIMIZE = 3
IMWRITE_JPEG_PROGRESSIVE = 2
IMWRITE_JPEG_QUALITY = 1
IMWRITE_JPEG_RST_INTERVAL = 4
IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1
IMWRITE_PAM_FORMAT_GRAYSCALE = 2
IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3
IMWRITE_PAM_FORMAT_NULL = 0
IMWRITE_PAM_FORMAT_RGB = 4
IMWRITE_PAM_FORMAT_RGB_ALPHA = 5
IMWRITE_PAM_TUPLETYPE = 128
IMWRITE_PNG_BILEVEL = 18
IMWRITE_PNG_COMPRESSION = 16
IMWRITE_PNG_STRATEGY = 17
IMWRITE_PNG_STRATEGY_DEFAULT = 0
IMWRITE_PNG_STRATEGY_FILTERED = 1
IMWRITE_PNG_STRATEGY_FIXED = 4
IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2
IMWRITE_PNG_STRATEGY_RLE = 3
IMWRITE_PXM_BINARY = 32
IMWRITE_WEBP_QUALITY = 64
INPAINT_NS = 0
INPAINT_TELEA = 1
INTERSECT_FULL = 2
INTERSECT_NONE = 0
INTERSECT_PARTIAL = 1
INTER_AREA = 3
INTER_BITS = 5
INTER_BITS2 = 10
INTER_CUBIC = 2
INTER_LANCZOS4 = 4
INTER_LINEAR = 1
INTER_LINEAR_EXACT = 5
INTER_MAX = 7
INTER_NEAREST = 0
INTER_TAB_SIZE = 32
INTER_TAB_SIZE2 = 1024
KAZE_DIFF_CHARBONNIER = 3
KAZE_DIFF_PM_G1 = 0
KAZE_DIFF_PM_G2 = 1
KAZE_DIFF_WEICKERT = 2
KMEANS_PP_CENTERS = 2
KMEANS_RANDOM_CENTERS = 0
KMEANS_USE_INITIAL_LABELS = 1
LDR_SIZE = 256
LINE_4 = 4
LINE_8 = 8
LINE_AA = 16
LMEDS = 4
LSD_REFINE_ADV = 2
LSD_REFINE_NONE = 0
LSD_REFINE_STD = 1
MARKER_CROSS = 0
MARKER_DIAMOND = 3
MARKER_SQUARE = 4
MARKER_STAR = 2
MARKER_TILTED_CROSS = 1
MARKER_TRIANGLE_DOWN = 6
MARKER_TRIANGLE_UP = 5
MAT_AUTO_STEP = 0
MAT_CONTINUOUS_FLAG = 16384
MAT_DEPTH_MASK = 7
MAT_MAGIC_MASK = 4294901760
MAT_MAGIC_VAL = 1124007936
MAT_SUBMATRIX_FLAG = 32768
MAT_TYPE_MASK = 4095
MIXED_CLONE = 2
MJPEG = 0
MONOCHROME_TRANSFER = 3
MORPH_BLACKHAT = 6
MORPH_CLOSE = 3
MORPH_CROSS = 1
MORPH_DILATE = 1
MORPH_ELLIPSE = 2
MORPH_ERODE = 0
MORPH_GRADIENT = 4
MORPH_HITMISS = 7
MORPH_OPEN = 2
MORPH_RECT = 0
MORPH_TOPHAT = 5
MOTION_AFFINE = 2
MOTION_EUCLIDEAN = 1
MOTION_HOMOGRAPHY = 3
MOTION_TRANSLATION = 0
Mat_AUTO_STEP = 0
Mat_CONTINUOUS_FLAG = 16384
Mat_DEPTH_MASK = 7
Mat_MAGIC_MASK = 4294901760
Mat_MAGIC_VAL = 1124007936
Mat_SUBMATRIX_FLAG = 32768
Mat_TYPE_MASK = 4095
NORMAL_CLONE = 1
NORMCONV_FILTER = 2
NORM_HAMMING = 6
NORM_HAMMING2 = 7
NORM_INF = 1
NORM_L1 = 2
NORM_L2 = 4
NORM_L2SQR = 5
NORM_MINMAX = 32
NORM_RELATIVE = 8
NORM_TYPE_MASK = 7
OPTFLOW_FARNEBACK_GAUSSIAN = 256
OPTFLOW_LK_GET_MIN_EIGENVALS = 8
OPTFLOW_USE_INITIAL_FLOW = 4
ORB_FAST_SCORE = 1
ORB_HARRIS_SCORE = 0
ORB_K_BYTES = 32
ORB_kBytes = 32
PARAM_ALGORITHM = 6
PARAM_BOOLEAN = 1
PARAM_FLOAT = 7
PARAM_INT = 0
PARAM_MAT = 4
PARAM_MAT_VECTOR = 5
PARAM_REAL = 2
PARAM_STRING = 3
PARAM_UCHAR = 11
PARAM_UINT64 = 9
PARAM_UNSIGNED_INT = 8
PC = 2
PCA_DATA_AS_COL = 1
PCA_DATA_AS_ROW = 0
PCA_USE_AVG = 2
PROJ_SPHERICAL_EQRECT = 1
PROJ_SPHERICAL_ORTHO = 0
Param_ALGORITHM = 6
Param_BOOLEAN = 1
Param_FLOAT = 7
Param_INT = 0
Param_MAT = 4
Param_MAT_VECTOR = 5
Param_REAL = 2
Param_STRING = 3
Param_UCHAR = 11
Param_UINT64 = 9
Param_UNSIGNED_INT = 8
QT_CHECKBOX = 1
QT_FONT_BLACK = 87
QT_FONT_BOLD = 75
QT_FONT_DEMIBOLD = 63
QT_FONT_LIGHT = 25
QT_FONT_NORMAL = 50
QT_NEW_BUTTONBAR = 1024
QT_PUSH_BUTTON = 0
QT_RADIOBOX = 2
QT_STYLE_ITALIC = 1
QT_STYLE_NORMAL = 0
QT_STYLE_OBLIQUE = 2
RANSAC = 8
RECURS_FILTER = 1
REDUCE_AVG = 1
REDUCE_MAX = 2
REDUCE_MIN = 3
REDUCE_SUM = 0
RETR_CCOMP = 2
RETR_EXTERNAL = 0
RETR_FLOODFILL = 4
RETR_LIST = 1
RETR_TREE = 3
RHO = 16
RNG_NORMAL = 1
RNG_UNIFORM = 0
ROTATE_180 = 1
ROTATE_90_CLOCKWISE = 0
ROTATE_90_COUNTERCLOCKWISE = 2
SOLVELP_MULTI = 1
SOLVELP_SINGLE = 0
SOLVELP_UNBOUNDED = -2
SOLVELP_UNFEASIBLE = -1
SOLVEPNP_AP3P = 5
SOLVEPNP_DLS = 3
SOLVEPNP_EPNP = 1
SOLVEPNP_ITERATIVE = 0
SOLVEPNP_MAX_COUNT = 6
SOLVEPNP_P3P = 2
SOLVEPNP_UPNP = 4
SORT_ASCENDING = 0
SORT_DESCENDING = 16
SORT_EVERY_COLUMN = 1
SORT_EVERY_ROW = 0
SPARSE_MAT_HASH_BIT = 2147483648
SPARSE_MAT_HASH_SCALE = 1540483477
SPARSE_MAT_MAGIC_VAL = 1123876864
SPARSE_MAT_MAX_DIM = 32
STEREO_BM_PREFILTER_NORMALIZED_RESPONSE = 0
STEREO_BM_PREFILTER_XSOBEL = 1
STEREO_MATCHER_DISP_SCALE = 16
STEREO_MATCHER_DISP_SHIFT = 4
STEREO_SGBM_MODE_HH = 1
STEREO_SGBM_MODE_HH4 = 3
STEREO_SGBM_MODE_SGBM = 0
STEREO_SGBM_MODE_SGBM_3WAY = 2
STITCHER_ERR_CAMERA_PARAMS_ADJUST_FAIL = 3
STITCHER_ERR_HOMOGRAPHY_EST_FAIL = 2
STITCHER_ERR_NEED_MORE_IMGS = 1
STITCHER_OK = 0
STITCHER_ORIG_RESOL = -1
STITCHER_PANORAMA = 0
STITCHER_SCANS = 1
SUBDIV2D_NEXT_AROUND_DST = 34
SUBDIV2D_NEXT_AROUND_LEFT = 19
SUBDIV2D_NEXT_AROUND_ORG = 0
SUBDIV2D_NEXT_AROUND_RIGHT = 49
SUBDIV2D_PREV_AROUND_DST = 51
SUBDIV2D_PREV_AROUND_LEFT = 32
SUBDIV2D_PREV_AROUND_ORG = 17
SUBDIV2D_PREV_AROUND_RIGHT = 2
SUBDIV2D_PTLOC_ERROR = -2
SUBDIV2D_PTLOC_INSIDE = 0
SUBDIV2D_PTLOC_ON_EDGE = 2
SUBDIV2D_PTLOC_OUTSIDE_RECT = -1
SUBDIV2D_PTLOC_VERTEX = 1
SVD_FULL_UV = 4
SVD_MODIFY_A = 1
SVD_NO_UV = 2
SparseMat_HASH_BIT = 2147483648
SparseMat_HASH_SCALE = 1540483477
SparseMat_MAGIC_VAL = 1123876864
SparseMat_MAX_DIM = 32
StereoBM_PREFILTER_NORMALIZED_RESPONSE = 0
StereoBM_PREFILTER_XSOBEL = 1
StereoMatcher_DISP_SCALE = 16
StereoMatcher_DISP_SHIFT = 4
StereoSGBM_MODE_HH = 1
StereoSGBM_MODE_HH4 = 3
StereoSGBM_MODE_SGBM = 0
StereoSGBM_MODE_SGBM_3WAY = 2
Stitcher_ERR_CAMERA_PARAMS_ADJUST_FAIL = 3
Stitcher_ERR_HOMOGRAPHY_EST_FAIL = 2
Stitcher_ERR_NEED_MORE_IMGS = 1
Stitcher_OK = 0
Stitcher_ORIG_RESOL = -1
Stitcher_PANORAMA = 0
Stitcher_SCANS = 1
Subdiv2D_NEXT_AROUND_DST = 34
Subdiv2D_NEXT_AROUND_LEFT = 19
Subdiv2D_NEXT_AROUND_ORG = 0
Subdiv2D_NEXT_AROUND_RIGHT = 49
Subdiv2D_PREV_AROUND_DST = 51
Subdiv2D_PREV_AROUND_LEFT = 32
Subdiv2D_PREV_AROUND_ORG = 17
Subdiv2D_PREV_AROUND_RIGHT = 2
Subdiv2D_PTLOC_ERROR = -2
Subdiv2D_PTLOC_INSIDE = 0
Subdiv2D_PTLOC_ON_EDGE = 2
Subdiv2D_PTLOC_OUTSIDE_RECT = -1
Subdiv2D_PTLOC_VERTEX = 1
TERM_CRITERIA_COUNT = 1
TERM_CRITERIA_EPS = 2
TERM_CRITERIA_MAX_ITER = 1
THRESH_BINARY = 0
THRESH_BINARY_INV = 1
THRESH_MASK = 7
THRESH_OTSU = 8
THRESH_TOZERO = 3
THRESH_TOZERO_INV = 4
THRESH_TRIANGLE = 16
THRESH_TRUNC = 2
TM_CCOEFF = 4
TM_CCOEFF_NORMED = 5
TM_CCORR = 2
TM_CCORR_NORMED = 3
TM_SQDIFF = 0
TM_SQDIFF_NORMED = 1
TermCriteria_COUNT = 1
TermCriteria_EPS = 2
TermCriteria_MAX_ITER = 1
UMAT_AUTO_STEP = 0
UMAT_CONTINUOUS_FLAG = 16384
UMAT_DATA_ASYNC_CLEANUP = 128
UMAT_DATA_COPY_ON_MAP = 1
UMAT_DATA_DEVICE_COPY_OBSOLETE = 4
UMAT_DATA_DEVICE_MEM_MAPPED = 64
UMAT_DATA_HOST_COPY_OBSOLETE = 2
UMAT_DATA_TEMP_COPIED_UMAT = 24
UMAT_DATA_TEMP_UMAT = 8
UMAT_DATA_USER_ALLOCATED = 32
UMAT_DEPTH_MASK = 7
UMAT_MAGIC_MASK = 4294901760
UMAT_MAGIC_VAL = 1124007936
UMAT_SUBMATRIX_FLAG = 32768
UMAT_TYPE_MASK = 4095
UMatData_ASYNC_CLEANUP = 128
UMatData_COPY_ON_MAP = 1
UMatData_DEVICE_COPY_OBSOLETE = 4
UMatData_DEVICE_MEM_MAPPED = 64
UMatData_HOST_COPY_OBSOLETE = 2
UMatData_TEMP_COPIED_UMAT = 24
UMatData_TEMP_UMAT = 8
UMatData_USER_ALLOCATED = 32
UMat_AUTO_STEP = 0
UMat_CONTINUOUS_FLAG = 16384
UMat_DEPTH_MASK = 7
UMat_MAGIC_MASK = 4294901760
UMat_MAGIC_VAL = 1124007936
UMat_SUBMATRIX_FLAG = 32768
UMat_TYPE_MASK = 4095
USAGE_ALLOCATE_DEVICE_MEMORY = 2
USAGE_ALLOCATE_HOST_MEMORY = 1
USAGE_ALLOCATE_SHARED_MEMORY = 4
USAGE_DEFAULT = 0
VIDEOWRITER_PROP_FRAMEBYTES = 2
VIDEOWRITER_PROP_NSTRIPES = 3
VIDEOWRITER_PROP_QUALITY = 1
WARP_FILL_OUTLIERS = 8
WARP_INVERSE_MAP = 16
WB = 3
WINDOW_AUTOSIZE = 1
WINDOW_FREERATIO = 256
WINDOW_FULLSCREEN = 1
WINDOW_GUI_EXPANDED = 0
WINDOW_GUI_NORMAL = 16
WINDOW_KEEPRATIO = 0
WINDOW_NORMAL = 0
WINDOW_OPENGL = 4096
WND_PROP_ASPECT_RATIO = 2
WND_PROP_AUTOSIZE = 1
WND_PROP_FULLSCREEN = 0
WND_PROP_OPENGL = 3
WND_PROP_VISIBLE = 4
db = 0
dc = 1
haarcascades = '/Users/ollin/anaconda/envs/py3k/lib/python3.5/site-packages/cv2/data/'
pc = 2
wb = 3