#1205 fixed more bugs/typos in parameters

pull/13383/head
Andrey Kamaev 13 years ago
parent 008a1c91fd
commit ec793df30f
  1. 196
      modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
  2. 274
      modules/core/doc/dynamic_structures.rst
  3. 64
      modules/features2d/doc/common_interfaces_of_feature_detectors.rst
  4. 2
      modules/gpu/doc/feature_detection_and_description.rst
  5. 4
      modules/gpu/doc/image_processing.rst
  6. 9
      modules/gpu/doc/per_element_operations.rst
  7. 4
      modules/gpu/doc/video.rst
  8. 3
      modules/objdetect/doc/latent_svm.rst
  9. 9
      modules/stitching/doc/exposure_compensation.rst
  10. 2
      modules/stitching/doc/introduction.rst
  11. 2
      modules/stitching/doc/matching.rst
  12. 1
      modules/stitching/doc/motion_estimation.rst
  13. 2
      modules/stitching/doc/warpers.rst

@ -34,7 +34,7 @@ where:
* :math:`A` is a camera matrix, or a matrix of intrinsic parameters
* :math:`(cx, cy)` is a principal point that is usually at the image center
* :math:`fx, fy` are the focal lengths expressed in pixel-related units
Thus, if an image from the camera is
scaled by a factor, all of these parameters should
@ -120,13 +120,13 @@ Finds the camera intrinsic and extrinsic parameters from several views of a cali
.. ocv:pyoldfunction:: cv.CalibrateCamera2(objectPoints, imagePoints, pointCounts, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags=0)-> None
:param objectPoints: In the new interface it is a vector of vectors of calibration pattern points in the calibration pattern coordinate space. The outer vector contains as many elements as the number of the pattern views. If the same calibration pattern is shown in each view and it is fully visible, all the vectors will be the same. Although, it is possible to use partially occluded patterns, or even different patterns in different views. Then, the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that Z-coordinate of each input object point is 0.
In the old interface all the vectors of object points from different views are concatenated together.
:param imagePoints: In the new interface it is a vector of vectors of the projections of calibration pattern points. ``imagePoints.size()`` and ``objectPoints.size()`` and ``imagePoints[i].size()`` must be equal to ``objectPoints[i].size()`` for each ``i``.
In the old interface all the vectors of object points from different views are concatenated together.
:param pointCounts: In the old interface this is a vector of integers, containing as many elements, as the number of views of the calibration pattern. Each element is the number of points in each view. Usually, all the elements are the same and equal to the number of feature points on the calibration pattern.
:param imageSize: Size of the image used only to initialize the intrinsic camera matrix.
@ -186,7 +186,7 @@ The function returns the final re-projection error.
:ocv:func:`findChessboardCorners`,
:ocv:func:`solvePnP`,
:ocv:func:`initCameraMatrix2D`,
:ocv:func:`initCameraMatrix2D`,
:ocv:func:`stereoCalibrate`,
:ocv:func:`undistort`
@ -201,7 +201,7 @@ Computes useful camera characteristics from the camera matrix.
.. ocv:pyfunction:: cv2.calibrationMatrixValues(cameraMatrix, imageSize, apertureWidth, apertureHeight) -> fovx, fovy, focalLength, principalPoint, aspectRatio
:param cameraMatrix: Input camera matrix that can be estimated by :ocv:func:`calibrateCamera` or :ocv:func:`stereoCalibrate` .
:param imageSize: Input image size in pixels.
:param apertureWidth: Physical width of the sensor.
@ -217,7 +217,7 @@ Computes useful camera characteristics from the camera matrix.
:param principalPoint: Principal point in pixels.
:param aspectRatio: :math:`f_y/f_x`
The function computes various useful camera characteristics from the previously estimated camera matrix.
@ -269,13 +269,13 @@ For points in an image of a stereo pair, computes the corresponding epilines in
.. ocv:pyoldfunction:: cv.ComputeCorrespondEpilines(points, whichImage, F, lines) -> None
:param points: Input points. :math:`N \times 1` or :math:`1 \times N` matrix of type ``CV_32FC2`` or ``vector<Point2f>`` .
:param whichImage: Index of the image (1 or 2) that contains the ``points`` .
:param F: Fundamental matrix that can be estimated using :ocv:func:`findFundamentalMat` or :ocv:func:`stereoRectify` .
:param lines: Output vector of the epipolar lines corresponding to the points in the other image. Each line :math:`ax + by + c=0` is encoded by 3 numbers :math:`(a, b, c)` .
For every point in one of the two images of a stereo pair, the function finds the equation of the
corresponding epipolar line in the other image.
@ -349,7 +349,7 @@ Converts points to/from homogeneous coordinates.
:param dst: Output vector of 2D, 3D, or 4D points.
The function converts 2D or 3D points from/to homogeneous coordinates by calling either :ocv:func:`convertPointsToHomogeneous` or :ocv:func:`convertPointsFromHomogeneous`.
The function converts 2D or 3D points from/to homogeneous coordinates by calling either :ocv:func:`convertPointsToHomogeneous` or :ocv:func:`convertPointsFromHomogeneous`.
.. note:: The function is obsolete. Use one of the previous two functions instead.
@ -429,7 +429,7 @@ Finds the positions of internal corners of the chessboard.
: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 corners: Output array of detected corners.
:param flags: Various operation flags that can be zero or a combination of the following values:
@ -485,14 +485,14 @@ Finds the centers in the grid of circles.
:param patternSize: Number of circles per a grid row and column ``( patternSize = Size(points_per_row, points_per_colum) )`` .
:param centers: Output array of detected centers.
:param centers: Output array of detected centers.
:param flags: Various operation flags that can be one of the following values:
* **CALIB_CB_SYMMETRIC_GRID** Use symmetric pattern of circles.
* **CALIB_CB_ASYMMETRIC_GRID** Use asymmetric pattern of circles.
* **CALIB_CB_CLUSTERING** Use a special algorithm for grid detection. It is more robust to perspective distortions but much more sensitive to background clutter.
:param blobDetector: FeatureDetector that finds blobs like dark circles on light background
@ -527,7 +527,7 @@ Finds an object pose from 3D-2D point correspondences.
.. ocv:pyfunction:: cv2.solvePnP( objectPoints, imagePoints, cameraMatrix, distCoeffs[, rvec[, tvec[, useExtrinsicGuess[, flags]]]] ) -> rvec, tvec
.. ocv:cfunction:: void cvFindExtrinsicCameraParams2( const CvMat* objectPoints, const CvMat* imagePoints, const CvMat* cameraMatrix, const CvMat* distCoeffs, CvMat* rvec, CvMat* tvec, int useExtrinsicGuess=0 )
.. ocv:pyoldfunction:: cv.FindExtrinsicCameraParams2( objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess=0 )-> None
:param objectPoints: Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. ``vector<Point3f>`` can be also passed here.
@ -535,7 +535,7 @@ Finds an object pose from 3D-2D point correspondences.
:param imagePoints: Array of corresponding image points, 2xN/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 :math:`A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}` .
:param distCoeffs: Input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param rvec: Output rotation vector (see :ocv:func:`Rodrigues` ) that, together with ``tvec`` , brings points from the model coordinate system to the camera coordinate system.
@ -545,11 +545,11 @@ Finds an object pose from 3D-2D point correspondences.
:param useExtrinsicGuess: 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:
* **CV_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 :ocv:func:`projectPoints` ) ``objectPoints`` .
* **CV_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". In this case the function requires exactly four object and image points.
* **CV_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".
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.
@ -567,7 +567,7 @@ Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.
:param imagePoints: Array of corresponding image points, 2xN/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 :math:`A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}` .
:param distCoeffs: Input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
:param rvec: Output rotation vector (see :ocv:func:`Rodrigues` ) that, together with ``tvec`` , brings points from the model coordinate system to the camera coordinate system.
@ -576,12 +576,12 @@ Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.
:param useExtrinsicGuess: 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 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 minInliersCount: Number of inliers. If the algorithm at some stage finds more inliers than ``minInliersCount`` , it finishes.
:param inliers: Output vector that contains indices of inliers in ``objectPoints`` and ``imagePoints`` .
:param flags: Method for solving a PnP problem (see :ocv:func:`solvePnP` ).
@ -605,14 +605,14 @@ 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. :math:`N = 7`
* **CV_FM_8POINT** for an 8-point algorithm. :math:`N \ge 8`
* **CV_FM_RANSAC** for the RANSAC algorithm. :math:`N \ge 8`
* **CV_FM_LMEDS** for the LMedS algorithm. :math:`N \ge 8`
:param param1: 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 param2: Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
@ -772,15 +772,15 @@ Filters off small noise blobs (speckles) in the disparity map
.. ocv:pyfunction:: cv2.filterSpeckles(img, newVal, maxSpeckleSize, maxDiff[, buf]) -> None
: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.
getOptimalNewCameraMatrix
-----------------------------
@ -809,7 +809,7 @@ Returns the new camera matrix based on the free scaling parameter.
:param validPixROI: Optional output rectangle that outlines all-good-pixels region in the undistorted image. See ``roi1, roi2`` description in :ocv:func:`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.
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 undistortion 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
:ocv:func:`initUndistortRectifyMap` to produce the maps for
@ -830,15 +830,15 @@ Finds an initial camera matrix from 3D-2D point correspondences.
.. ocv:pyoldfunction:: cv.InitIntrinsicParams2D(objectPoints, imagePoints, pointCounts, imageSize, cameraMatrix, aspectRatio=1.) -> None
: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 :ocv:func:`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 imagePoints: Vector of vectors of the projections of the calibration pattern points. In the old interface all the per-view vectors are concatenated.
:param pointCounts: The integer vector of point counters for each view.
:param imageSize: Image size in pixels used to initialize the principal point.
:param aspectRatio: If it is zero or negative, both :math:`f_x` and :math:`f_y` are estimated independently. Otherwise, :math:`f_x = f_y * \texttt{aspectRatio}` .
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.
@ -857,7 +857,7 @@ Computes partial derivatives of the matrix product for each multiplied matrix.
:param B: Second multiplied matrix.
:param dABdA: First output derivative matrix ``d(A*B)/dA`` of size :math:`\texttt{A.rows*B.cols} \times {A.rows*A.cols}` .
:param dABdB: Second output derivative matrix ``d(A*B)/dB`` of size :math:`\texttt{A.rows*B.cols} \times {B.rows*B.cols}` .
The function computes partial derivatives of the elements of the matrix product
@ -880,11 +880,11 @@ 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 :ocv:func:`Rodrigues` for details.
:param tvec: Translation vector.
:param cameraMatrix: Camera matrix :math:`A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}` .
:param distCoeffs: Input vector of distortion coefficients :math:`(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]])` of 4, 5, or 8 elements. If the vector is NULL/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>`` .
@ -900,8 +900,8 @@ 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
:ocv:func:`calibrateCamera`,
:ocv:func:`solvePnP`, and
:ocv:func:`calibrateCamera`,
:ocv:func:`solvePnP`, and
:ocv:func:`stereoCalibrate` . The
function itself can also be used to compute a re-projection error given the
current intrinsic and extrinsic parameters.
@ -927,11 +927,11 @@ Reprojects a disparity image to 3D space.
: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: :math:`4 \times 4` perspective transformation matrix that can be obtained with :ocv:func:`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 :ocv:funcx:`StereoBM::operator()` ) 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)`` andthe corresponding disparity ``d=disparity(x,y)`` , it computes:
.. math::
@ -1044,7 +1044,7 @@ Class for computing stereo correspondence using the block matching algorithm. ::
};
The class is a C++ wrapper for the associated functions. In particular, :ocv:funcx:`StereoBM::operator()` is the wrapper for
:ocv:cfunc:`cvFindStereoCorrespondenceBM`.
:ocv:cfunc:`cvFindStereoCorrespondenceBM`.
StereoBM::StereoBM
@ -1061,17 +1061,17 @@ The constructors.
.. ocv:pyoldfunction:: cv.CreateStereoBMState(preset=CV_STEREO_BM_BASIC, ndisparities=0)-> StereoBMState
:param preset: specifies the whole set of algorithm parameters, one of:
* BASIC_PRESET - parameters suitable for general cameras
* FISH_EYE_PRESET - parameters suitable for wide-angle cameras
* BASIC_PRESET - parameters suitable for general cameras
* FISH_EYE_PRESET - parameters suitable for wide-angle cameras
* NARROW_PRESET - parameters suitable for narrow-angle cameras
After constructing the class, you can override any parameters set by the preset.
:param ndisparities: the disparity search range. For each pixel algorithm will find the best disparity from 0 (default minimum disparity) to ``ndisparities``. The search range can then be shifted by changing the minimum disparity.
:param SADWindowSize: the linear size of the blocks compared by the algorithm. The size should be odd (as the block is centered at the current pixel). Larger block size implies smoother, though less accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher chance for algorithm to find a wrong correspondence.
The constructors initialize ``StereoBM`` state. You can then call ``StereoBM::operator()`` to compute disparity for a specific stereo pair.
.. note:: In the C API you need to deallocate ``CvStereoBM`` state when it is not needed anymore using ``cvReleaseStereoBMState(&stereobm)``.
@ -1093,9 +1093,9 @@ Computes disparity using the BM algorithm for a rectified stereo pair.
:param right: Right image of the same size and the same type as the left one.
:param disp: Output disparity map. It has the same size as the input images. When ``disptype==CV_16S``, the map is a 16-bit signed single-channel image, containing disparity values scaled by 16. To get the true disparity values from such fixed-point representation, you will need to divide each ``disp`` element by 16. If ``disptype==CV_32F``, the disparity map will already contain the real disparity values on output.
:param disptype: Type of the output disparity map, ``CV_16S`` (default) or ``CV_32F``.
:param state: The pre-initialized ``CvStereoBMState`` structure in the case of the old API.
The method executes the BM algorithm on a rectified stereo pair. See the ``stereo_match.cpp`` OpenCV sample on how to prepare images and call the method. Note that the method is not constant, thus you should not use the same ``StereoBM`` instance from within different threads simultaneously.
@ -1165,7 +1165,7 @@ StereoSGBM::StereoSGBM
:param SADWindowSize: Matched block size. It must be an odd number ``>=1`` . Normally, it should be somewhere in the ``3..11`` range.
:param P1: The first parameter controlling the disparity smoothness. See below.
:param P2: The second parameter controlling the disparity smoothness. The larger the values are, the smoother the disparity is. ``P1`` is the penalty on the disparity change by plus or minus 1 between neighbor pixels. ``P2`` is the penalty on the disparity change by more than 1 between neighbor pixels. The algorithm requires ``P2 > P1`` . See ``stereo_match.cpp`` sample where some reasonably good ``P1`` and ``P2`` values are shown (like ``8*number_of_image_channels*SADWindowSize*SADWindowSize`` and ``32*number_of_image_channels*SADWindowSize*SADWindowSize`` , respectively).
:param disp12MaxDiff: Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to a non-positive value to disable the check.
@ -1199,7 +1199,7 @@ StereoSGBM::operator ()
:param disp: Output disparity map. It is a 16-bit signed single-channel image of the same size as the input image. It contains disparity values scaled by 16. So, to get the floating-point disparity map, you need to divide each ``disp`` element by 16.
The method executes the SGBM algorithm on a rectified stereo pair. See ``stereo_match.cpp`` OpenCV sample on how to prepare images and call the method.
The method executes the SGBM algorithm on a rectified stereo pair. See ``stereo_match.cpp`` OpenCV sample on how to prepare images and call the method.
.. note:: The method is not constant, so you should not use the same ``StereoSGBM`` instance from different threads simultaneously.
@ -1214,27 +1214,27 @@ Class for computing stereo correspondence using the variational matching algorit
class StereoVar
{
StereoVar();
StereoVar( int levels, double pyrScale,
int nIt, int minDisp, int maxDisp,
int poly_n, double poly_sigma, float fi,
float lambda, int penalization, int cycle,
int flags);
StereoVar( int levels, double pyrScale,
int nIt, int minDisp, int maxDisp,
int poly_n, double poly_sigma, float fi,
float lambda, int penalization, int cycle,
int flags);
virtual ~StereoVar();
virtual void operator()(InputArray left, InputArray right, OutputArray disp);
int levels;
double pyrScale;
int nIt;
int minDisp;
int maxDisp;
int poly_n;
double poly_sigma;
float fi;
float lambda;
int penalization;
int cycle;
int flags;
int levels;
double pyrScale;
int nIt;
int minDisp;
int maxDisp;
int poly_n;
double poly_sigma;
float fi;
float lambda;
int penalization;
int cycle;
int flags;
...
};
@ -1242,9 +1242,9 @@ Class for computing stereo correspondence using the variational matching algorit
The class implements the modified S. G. Kosov algorithm [Publication] that differs from the original one as follows:
* The automatic initialization of method's parameters is added.
* The method of Smart Iteration Distribution (SID) is implemented.
* The support of Multi-Level Adaptation Technique (MLAT) is not included.
* The method of dynamic adaptation of method's parameters is not included.
@ -1259,39 +1259,39 @@ StereoVar::StereoVar
The constructor
:param levels: The number of pyramid layers, including the initial image. levels=1 means that no extra layers are created and only the original images are used. This parameter is ignored if flag USE_AUTO_PARAMS is set.
:param pyrScale: Specifies the image scale (<1) to build the pyramids for each image. pyrScale=0.5 means the classical pyramid, where each next layer is twice smaller than the previous. (This parameter is ignored if flag USE_AUTO_PARAMS is set).
:param nIt: The number of iterations the algorithm does at each pyramid level. (If the flag USE_SMART_ID is set, the number of iterations will be redistributed in such a way, that more iterations will be done on more coarser levels.)
:param minDisp: Minimum possible disparity value. Could be negative in case the left and right input images change places.
:param maxDisp: Maximum possible disparity value.
:param maxDisp: Maximum possible disparity value.
:param poly_n: Size of the pixel neighbourhood used to find polynomial expansion in each pixel. The larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field. Typically, poly_n = 3, 5 or 7
:param poly_sigma: Standard deviation of the Gaussian that is used to smooth derivatives that are used as a basis for the polynomial expansion. For poly_n=5 you can set poly_sigma=1.1 , for poly_n=7 a good value would be poly_sigma=1.5
:param fi: The smoothness parameter, ot the weight coefficient for the smoothness term.
:param lambda: The threshold parameter for edge-preserving smoothness. (This parameter is ignored if PENALIZATION_CHARBONNIER or PENALIZATION_PERONA_MALIK is used.)
:param penalization: Possible values: PENALIZATION_TICHONOV - linear smoothness; PENALIZATION_CHARBONNIER - non-linear edge preserving smoothness; PENALIZATION_PERONA_MALIK - non-linear edge-enhancing smoothness. (This parameter is ignored if flag USE_AUTO_PARAMS is set).
:param cycle: Type of the multigrid cycle. Possible values: CYCLE_O and CYCLE_V for null- and v-cycles respectively. (This parameter is ignored if flag USE_AUTO_PARAMS is set).
:param flags: The operation flags; can be a combination of the following:
* USE_INITIAL_DISPARITY: Use the input flow as the initial flow approximation.
* USE_EQUALIZE_HIST: Use the histogram equalization in the pre-processing phase.
* USE_SMART_ID: Use the smart iteration distribution (SID).
* USE_AUTO_PARAMS: Allow the method to initialize the main parameters.
* USE_MEDIAN_FILTERING: Use the median filer of the solution in the post processing phase.
The first constructor initializes ``StereoVar`` with all the default parameters. So, you only have to set ``StereoVar::maxDisp`` and / or ``StereoVar::minDisp`` at minimum. The second constructor enables you to set each parameter to a custom value.
@ -1307,9 +1307,9 @@ StereoVar::operator ()
:param right: Right image of the same size and the same type as the left one.
:param disp: Output disparity map. It is a 8-bit signed single-channel image of the same size as the input image.
:param disp: Output disparity map. It is a 8-bit signed single-channel image of the same size as the input image.
The method executes the variational algorithm on a rectified stereo pair. See ``stereo_match.cpp`` OpenCV sample on how to prepare images and call the method.
The method executes the variational algorithm on a rectified stereo pair. See ``stereo_match.cpp`` OpenCV sample on how to prepare images and call the method.
**Note**:
@ -1367,7 +1367,7 @@ Calibrates the stereo camera.
* **CV_CALIB_FIX_ASPECT_RATIO** Optimize :math:`f^{(j)}_y` . Fix the ratio :math:`f^{(j)}_x/f^{(j)}_y` .
* **CV_CALIB_SAME_FOCAL_LENGTH** Enforce :math:`f^{(0)}_x=f^{(1)}_x` and :math:`f^{(0)}_y=f^{(1)}_y` .
* **CV_CALIB_ZERO_TANGENT_DIST** Set tangential distortion coefficients for each camera to zeros and fix there.
* **CV_CALIB_FIX_K1,...,CV_CALIB_FIX_K6** Do not change the corresponding radial distortion coefficient during the optimization. If ``CV_CALIB_USE_INTRINSIC_GUESS`` is set, the coefficient from the supplied ``distCoeffs`` matrix is used. Otherwise, it is set to 0.
@ -1417,11 +1417,11 @@ Computes rectification transforms for each head of a calibrated stereo camera.
.. ocv:pyoldfunction:: cv.StereoRectify( cameraMatrix1, cameraMatrix2, distCoeffs1, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q=None, flags=CV_CALIB_ZERO_DISPARITY, alpha=-1, newImageSize=(0, 0))-> (roi1, roi2)
:param cameraMatrix1: First camera matrix.
:param cameraMatrix2: Second camera matrix.
:param distCoeffs1: First camera distortion parameters.
:param distCoeffs2: Second camera distortion parameters.
:param imageSize: Size of the image used for stereo calibration.
@ -1431,11 +1431,11 @@ Computes rectification transforms for each head of a calibrated stereo camera.
: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 :math:`4 \times 4` disparity-to-depth mapping matrix (see :ocv:func:`reprojectImageTo3D` ).
@ -1447,7 +1447,7 @@ Computes rectification transforms for each head of a calibrated stereo camera.
:param newImageSize: New image resolution after rectification. The same size should be passed to :ocv:func:`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 roi1:
:param roi2: 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
@ -1506,7 +1506,7 @@ Computes a rectification transform for an uncalibrated stereo camera.
.. ocv:pyoldfunction:: cv.StereoRectifyUncalibrated(points1, points2, F, imageSize, H1, H2, threshold=5)-> None
:param points1: Array of feature points in the first image.
:param points2: The corresponding points in the second image. The same formats as in :ocv:func:`findFundamentalMat` are supported.
:param F: Input fundamental matrix. It can be computed from the same set of point pairs using :ocv:func:`findFundamentalMat` .
@ -1514,7 +1514,7 @@ Computes a rectification transform for an uncalibrated stereo camera.
:param imageSize: 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 :math:`|\texttt{points2[i]}^T*\texttt{F}*\texttt{points1[i]}|>\texttt{threshold}` ) are rejected prior to computing the homographies. Otherwise,all the points are considered inliers.

@ -1,5 +1,5 @@
Dynamic Structures
==================
==================
.. highlight:: c
@ -13,36 +13,36 @@ CvMemStorage
A storage for various OpenCV dynamic data structures, such as ``CvSeq``, ``CvSet`` etc.
.. ocv:member:: CvMemBlock* bottom
the first memory block in the double-linked list of blocks
.. ocv:member:: CvMemBlock* top
the current partially allocated memory block in the list of blocks
.. ocv:member:: CvMemStorage* parent
the parent storage (if any) from which the new memory blocks are borrowed.
.. ocv:member:: int free_space
number of free bytes in the ``top`` block
.. ocv:member:: int block_size
the total size of the memory blocks
Memory storage is a low-level structure used to store dynamically growing data structures such as sequences, contours, graphs, subdivisions, etc. It is organized as a list of memory blocks of equal size -
Memory storage is a low-level structure used to store dynamically growing data structures such as sequences, contours, graphs, subdivisions, etc. It is organized as a list of memory blocks of equal size -
``bottom`` field is the beginning of the list of blocks and ``top`` is the currently used block, but not necessarily the last block of the list. All blocks between ``bottom`` and ``top``, not including the
latter, are considered fully occupied; all blocks between ``top`` and the last block, not including ``top``, are considered free and ``top`` itself is partly ocupied - ``free_space`` contains the number of free bytes left in the end of ``top``.
A new memory buffer that may be allocated explicitly by :ocv:cfunc:`MemStorageAlloc` function or implicitly by higher-level functions, such as :ocv:cfunc:`SeqPush`, :ocv:cfunc:`GraphAddEdge` etc.
A new memory buffer that may be allocated explicitly by :ocv:cfunc:`MemStorageAlloc` function or implicitly by higher-level functions, such as :ocv:cfunc:`SeqPush`, :ocv:cfunc:`GraphAddEdge` etc.
The buffer is put in the end of already allocated space in the ``top`` memory block, if there is enough free space. After allocation, ``free_space`` is decreased by the size of the allocated buffer plus some padding to keep the proper alignment. When the allocated buffer does not fit into the available portion of
The buffer is put in the end of already allocated space in the ``top`` memory block, if there is enough free space. After allocation, ``free_space`` is decreased by the size of the allocated buffer plus some padding to keep the proper alignment. When the allocated buffer does not fit into the available portion of
``top``, the next storage block from the list is taken as ``top`` and ``free_space`` is reset to the whole block size prior to the allocation.
If there are no more free blocks, a new block is allocated (or borrowed from the parent, see :ocv:cfunc:`CreateChildMemStorage`) and added to the end of list. Thus, the storage behaves as a stack with ``bottom`` indicating bottom of the stack and the pair (``top``, ``free_space``)
indicating top of the stack. The stack top may be saved via :ocv:cfunc:`SaveMemStoragePos`, restored via
indicating top of the stack. The stack top may be saved via :ocv:cfunc:`SaveMemStoragePos`, restored via
:ocv:cfunc:`RestoreMemStoragePos`, or reset via :ocv:cfunc:`ClearMemStorage`.
CvMemBlock
@ -67,37 +67,37 @@ CvSeq
Dynamically growing sequence.
.. ocv:member:: int flags
sequence flags, including the sequence signature (CV_SEQ_MAGIC_VAL or CV_SET_MAGIC_VAL), type of the elements and some other information about the sequence.
.. ocv:member:: int header_size
size of the sequence header. It should be sizeof(CvSeq) at minimum. See :ocv:cfunc:`CreateSeq`.
.. ocv:member:: CvSeq* h_prev
.. ocv:member:: CvSeq* h_next
.. ocv:member:: CvSeq* v_prev
.. ocv:member:: CvSeq* v_next
pointers to another sequences in a sequence tree. Sequence trees are used to store hierarchical contour structures, retrieved by :ocv:cfunc:`FindContours`
.. ocv:member:: int total
the number of sequence elements
.. ocv:member:: int elem_size
size of each sequence element in bytes
.. ocv:member:: CvMemStorage* storage
memory storage where the sequence resides. It can be a NULL pointer.
.. ocv:member:: CvSeqBlock* first
pointer to the first data block
The structure ``CvSeq`` is a base for all of OpenCV dynamic data structures.
The structure ``CvSeq`` is a base for all of OpenCV dynamic data structures.
There are two types of sequences - dense and sparse. The base type for dense
sequences is :ocv:struct:`CvSeq` and such sequences are used to represent
growable 1d arrays - vectors, stacks, queues, and deques. They have no gaps
@ -115,13 +115,13 @@ CvSlice
A sequence slice. In C++ interface the class :ocv:class:`Range` should be used instead.
.. ocv:member:: int start_index
inclusive start index of the sequence slice
.. ocv:member:: int end_index
exclusive end index of the sequence slice
There are helper functions to construct the slice and to compute its length:
.. ocv:cfunction:: CvSlice cvSlice( int start, int end )
@ -165,7 +165,7 @@ CvGraph
-------
.. ocv:struct:: CvGraph
The structure ``CvGraph`` is a base for graphs used in OpenCV 1.x. It inherits from
The structure ``CvGraph`` is a base for graphs used in OpenCV 1.x. It inherits from
:ocv:struct:`CvSet`, that is, it is considered as a set of vertices. Besides, it contains another set as a member, a set of graph edges. Graphs in OpenCV are represented using adjacency lists format.
@ -324,7 +324,7 @@ CreateGraphScanner
Creates structure for depth-first graph traversal.
.. ocv:cfunction:: CvGraphScanner* cvCreateGraphScanner( CvGraph* graph, CvGraphVtx* vtx=NULL, int mask=CV_GRAPH_ALL_ITEMS )
:param graph: Graph
@ -332,23 +332,23 @@ Creates structure for depth-first graph traversal.
:param mask: Event mask indicating which events are of interest to the user (where :ocv:cfunc:`NextGraphItem` function returns control to the user) It can be ``CV_GRAPH_ALL_ITEMS`` (all events are of interest) or a combination of the following flags:
* **CV_GRAPH_VERTEX** stop at the graph vertices visited for the first time
* **CV_GRAPH_TREE_EDGE** stop at tree edges ( ``tree edge`` is the edge connecting the last visited vertex and the vertex to be visited next)
* **CV_GRAPH_BACK_EDGE** stop at back edges ( ``back edge`` is an edge connecting the last visited vertex with some of its ancestors in the search tree)
* **CV_GRAPH_FORWARD_EDGE** stop at forward edges ( ``forward edge`` is an edge conecting the last visited vertex with some of its descendants in the search tree. The forward edges are only possible during oriented graph traversal)
* **CV_GRAPH_CROSS_EDGE** stop at cross edges ( ``cross edge`` is an edge connecting different search trees or branches of the same tree. The ``cross edges`` are only possible during oriented graph traversal)
* **CV_GRAPH_ANY_EDGE** stop at any edge ( ``tree, back, forward`` , and ``cross edges`` )
* **CV_GRAPH_NEW_TREE** stop in the beginning of every new search tree. When the traversal procedure visits all vertices and edges reachable from the initial vertex (the visited vertices together with tree edges make up a tree), it searches for some unvisited vertex in the graph and resumes the traversal process from that vertex. Before starting a new tree (including the very first tree when ``cvNextGraphItem`` is called for the first time) it generates a ``CV_GRAPH_NEW_TREE`` event. For unoriented graphs, each search tree corresponds to a connected component of the graph.
* **CV_GRAPH_VERTEX** stop at the graph vertices visited for the first time
* **CV_GRAPH_TREE_EDGE** stop at tree edges ( ``tree edge`` is the edge connecting the last visited vertex and the vertex to be visited next)
* **CV_GRAPH_BACK_EDGE** stop at back edges ( ``back edge`` is an edge connecting the last visited vertex with some of its ancestors in the search tree)
* **CV_GRAPH_FORWARD_EDGE** stop at forward edges ( ``forward edge`` is an edge conecting the last visited vertex with some of its descendants in the search tree. The forward edges are only possible during oriented graph traversal)
* **CV_GRAPH_CROSS_EDGE** stop at cross edges ( ``cross edge`` is an edge connecting different search trees or branches of the same tree. The ``cross edges`` are only possible during oriented graph traversal)
* **CV_GRAPH_ANY_EDGE** stop at any edge ( ``tree, back, forward`` , and ``cross edges`` )
* **CV_GRAPH_NEW_TREE** stop in the beginning of every new search tree. When the traversal procedure visits all vertices and edges reachable from the initial vertex (the visited vertices together with tree edges make up a tree), it searches for some unvisited vertex in the graph and resumes the traversal process from that vertex. Before starting a new tree (including the very first tree when ``cvNextGraphItem`` is called for the first time) it generates a ``CV_GRAPH_NEW_TREE`` event. For unoriented graphs, each search tree corresponds to a connected component of the graph.
* **CV_GRAPH_BACKTRACKING** stop at every already visited vertex during backtracking - returning to already visited vertexes of the traversal tree.
The function creates a structure for depth-first graph traversal/search. The initialized structure is used in the
The function creates a structure for depth-first graph traversal/search. The initialized structure is used in the
:ocv:cfunc:`NextGraphItem`
function - the incremental traversal procedure.
@ -358,11 +358,11 @@ Creates memory storage.
.. ocv:cfunction:: CvMemStorage* cvCreateMemStorage( int blockSize=0 )
.. ocv:pyoldfunction:: cv.CreateMemStorage(blockSize=0) -> memstorage
:param blockSize: Size of the storage blocks in bytes. If it is 0, the block size is set to a default value - currently it is about 64K.
The function creates an empty memory storage. See
The function creates an empty memory storage. See
:ocv:struct:`CvMemStorage`
description.
@ -371,7 +371,7 @@ CreateSeq
Creates a sequence.
.. ocv:cfunction:: CvSeq* cvCreateSeq( int seqFlags, int headerSize, int elemSize, CvMemStorage* storage)
:param seqFlags: Flags of the created sequence. If the sequence is not passed to any function working with a specific type of sequences, the sequence value may be set to 0, otherwise the appropriate type must be selected from the list of predefined sequence types.
@ -384,21 +384,21 @@ Creates a sequence.
The function creates a sequence and returns
the pointer to it. The function allocates the sequence header in
the storage block as one continuous chunk and sets the structure
fields
fields
``flags``
,
,
``elemSize``
,
,
``headerSize``
, and
``storage``
to passed values, sets
to passed values, sets
``delta_elems``
to the
default value (that may be reassigned using the
default value (that may be reassigned using the
:ocv:cfunc:`SetSeqBlockSize`
function), and clears other header fields, including the space following
the first
the first
``sizeof(CvSeq)``
bytes.
@ -416,7 +416,7 @@ Creates an empty set.
:param storage: Container for the set
The function creates an empty set with a specified header size and element size, and returns the pointer to the set. This function is just a thin layer on top of
The function creates an empty set with a specified header size and element size, and returns the pointer to the set. This function is just a thin layer on top of
:ocv:cfunc:`CreateSeq`.
CvtSeqToArray
@ -445,9 +445,9 @@ The function finishes the writing process and
returns the pointer to the written sequence. The function also truncates
the last incomplete sequence block to return the remaining part of the
block to memory storage. After that, the sequence can be read and
modified safely. See
modified safely. See
:ocv:cfunc:`StartWriteSeq`
and
and
:ocv:cfunc:`StartAppendToSeq`
FindGraphEdge
@ -461,7 +461,7 @@ Finds an edge in a graph.
:param start_idx: Index of the starting vertex of the edge
:param end_idx: Index of the ending vertex of the edge. For an unoriented graph, the order of the vertex parameters does not matter.
::
#define cvGraphFindEdge cvFindGraphEdge
@ -481,7 +481,7 @@ Finds an edge in a graph by using its pointer.
:param startVtx: Pointer to the starting vertex of the edge
:param endVtx: Pointer to the ending vertex of the edge. For an unoriented graph, the order of the vertex parameters does not matter.
::
#define cvGraphFindEdgeByPtr cvFindGraphEdgeByPtr
@ -528,7 +528,7 @@ Returns a pointer to a sequence element according to its index.
:param seq: Sequence
:param index: Index of element
::
#define CV_GET_SEQ_ELEM( TYPE, seq, index ) (TYPE*)cvGetSeqElem( (CvSeq*)(seq), (index) )
@ -544,22 +544,22 @@ the one before last, etc. If the sequence is most likely to consist of
a single sequence block or the desired element is likely to be located
in the first block, then the macro
``CV_GET_SEQ_ELEM( elemType, seq, index )``
should be used, where the parameter
should be used, where the parameter
``elemType``
is the
type of sequence elements (
type of sequence elements (
:ocv:struct:`CvPoint`
for example), the parameter
``seq``
is a sequence, and the parameter
is a sequence, and the parameter
``index``
is the index
of the desired element. The macro checks first whether the desired element
belongs to the first block of the sequence and returns it if it does;
otherwise the macro calls the main function
otherwise the macro calls the main function
``GetSeqElem``
. Negative
indices always cause the
indices always cause the
:ocv:cfunc:`GetSeqElem`
call. The function has O(1)
time complexity assuming that the number of blocks is much smaller than the
@ -573,7 +573,7 @@ Returns the current reader position.
:param reader: Reader state
The function returns the current reader position (within 0 ...
The function returns the current reader position (within 0 ...
``reader->seq->total``
- 1).
@ -587,7 +587,7 @@ Finds a set element by its index.
:param index: Index of the set element within a sequence
The function finds a set element by its index. The function returns the pointer to it or 0 if the index is invalid or the corresponding node is free. The function supports negative indices as it uses
The function finds a set element by its index. The function returns the pointer to it or 0 if the index is invalid or the corresponding node is free. The function supports negative indices as it uses
:ocv:cfunc:`GetSeqElem`
to locate the node.
@ -736,11 +736,11 @@ The function returns the number of edges incident to the specified vertex, both
..
The macro
The macro
``CV_NEXT_GRAPH_EDGE( edge, vertex )``
returns the edge incident to
returns the edge incident to
``vertex``
that follows after
that follows after
``edge``
.
@ -851,7 +851,7 @@ Allocates a text string in a storage block.
:param ptr: The string
:param len: Length of the string (not counting the ending ``NUL`` ) . If the parameter is negative, the function computes the length.
::
typedef struct CvString
@ -877,34 +877,34 @@ Executes one or more steps of the graph traversal procedure.
The function traverses through the graph
until an event of interest to the user (that is, an event, specified
in the
in the
``mask``
in the
in the
:ocv:cfunc:`CreateGraphScanner`
call) is met or the
traversal is completed. In the first case, it returns one of the events
listed in the description of the
listed in the description of the
``mask``
parameter above and with
the next call it resumes the traversal. In the latter case, it returns
``CV_GRAPH_OVER``
(-1). When the event is
(-1). When the event is
``CV_GRAPH_VERTEX``
,
``CV_GRAPH_BACKTRACKING``
, or
, or
``CV_GRAPH_NEW_TREE``
,
the currently observed vertex is stored in
the currently observed vertex is stored in
``scanner-:math:`>`vtx``
. And if the
event is edge-related, the edge itself is stored at
event is edge-related, the edge itself is stored at
``scanner-:math:`>`edge``
,
the previously visited vertex - at
the previously visited vertex - at
``scanner-:math:`>`vtx``
and the other ending
vertex of the edge - at
vertex of the edge - at
``scanner-:math:`>`dst``
.
@ -918,7 +918,7 @@ Returns the currently observed node and moves the iterator toward the next node.
The function returns the currently observed node and then updates the
iterator - moving it toward the next node. In other words, the function
behavior is similar to the
behavior is similar to the
``*p++``
expression on a typical C
pointer or C++ collection iterator. The function returns NULL if there
@ -934,7 +934,7 @@ Returns the currently observed node and moves the iterator toward the previous n
The function returns the currently observed node and then updates
the iterator - moving it toward the previous node. In other words,
the function behavior is similar to the
the function behavior is similar to the
``*p--``
expression on a
typical C pointer or C++ collection iterator. The function returns NULL
@ -960,8 +960,8 @@ Releases memory storage.
The function deallocates all storage memory
blocks or returns them to the parent, if any. Then it deallocates the
storage header and clears the pointer to the storage. All child storage
associated with a given parent storage block must be released before the
storage header and clears the pointer to the storage. All child storage
associated with a given parent storage block must be released before the
parent storage block is released.
RestoreMemStoragePos
@ -974,9 +974,9 @@ Restores memory storage position.
:param pos: New storage top position
The function restores the position of the storage top from the parameter
The function restores the position of the storage top from the parameter
``pos``
. This function and the function
. This function and the function
``cvClearMemStorage``
are the only methods to release memory occupied in memory blocks. Note again that there is no way to free memory in the middle of an occupied portion of a storage block.
@ -991,7 +991,7 @@ Saves memory storage position.
:param pos: The output position of the storage top
The function saves the current position
of the storage top to the parameter
of the storage top to the parameter
``pos``
. The function
``cvRestoreMemStoragePos``
@ -1023,7 +1023,7 @@ Inserts an element in the middle of a sequence.
:param element: Inserted element
The function shifts the sequence elements from the inserted position to the nearest end of the sequence and copies the
The function shifts the sequence elements from the inserted position to the nearest end of the sequence and copies the
``element``
content there if the pointer is not NULL. The function returns a pointer to the inserted element.
@ -1033,13 +1033,13 @@ Inserts an array in the middle of a sequence.
.. ocv:cfunction:: void cvSeqInsertSlice( CvSeq* seq, int beforeIndex, const CvArr* fromArr )
:param seq: Sequence
:param seq: Sequence
:param beforeIndex: Index before which the array is inserted
:param fromArr: The array to take elements from
The function inserts all
The function inserts all
``fromArr``
array elements at the specified position of the sequence. The array
``fromArr``
@ -1050,9 +1050,9 @@ SeqInvert
Reverses the order of sequence elements.
.. ocv:cfunction:: void cvSeqInvert( CvSeq* seq )
:param seq: Sequence
:param seq: Sequence
The function reverses the sequence in-place - the first element becomes the last one, the last element becomes the first one and so forth.
SeqPop
@ -1060,11 +1060,11 @@ SeqPop
Removes an element from the end of a sequence.
.. ocv:cfunction:: void cvSeqPop( CvSeq* seq, void* element=NULL )
:param seq: Sequence
:param element: Optional parameter . If the pointer is not zero, the function copies the removed element to this location.
:param seq: Sequence
:param element: Optional parameter . If the pointer is not zero, the function copies the removed element to this location.
The function removes an element from a sequence. The function reports an error if the sequence is already empty. The function has O(1) complexity.
SeqPopFront
@ -1091,10 +1091,10 @@ Removes several elements from either end of a sequence.
:param count: Number of elements to pop
:param in_front: The flags specifying which end of the modified sequence.
* **CV_BACK** the elements are added to the end of the sequence
:param in_front: The flags specifying which end of the modified sequence.
* **CV_BACK** the elements are added to the end of the sequence
* **CV_FRONT** the elements are added to the beginning of the sequence
The function removes several elements from either end of the sequence. If the number of the elements to be removed exceeds the total number of elements in the sequence, the function removes as many elements as possible.
@ -1109,7 +1109,7 @@ Adds an element to the end of a sequence.
:param element: Added element
The function adds an element to the end of a sequence and returns a pointer to the allocated element. If the input
The function adds an element to the end of a sequence and returns a pointer to the allocated element. If the input
``element``
is NULL, the function simply allocates a space for one more element.
@ -1128,14 +1128,14 @@ The following code demonstrates how to create a new sequence using this function
int* added = (int*)cvSeqPush( seq, &i );
printf( "
}
...
/* release memory storage in the end */
cvReleaseMemStorage( &storage );
..
The function has O(1) complexity, but there is a faster method for writing large sequences (see
The function has O(1) complexity, but there is a faster method for writing large sequences (see
:ocv:cfunc:`StartWriteSeq`
and related functions).
@ -1149,7 +1149,7 @@ Adds an element to the beginning of a sequence.
:param element: Added element
The function is similar to
The function is similar to
:ocv:cfunc:`SeqPush`
but it adds the new element to the beginning of the sequence. The function has O(1) complexity.
@ -1165,10 +1165,10 @@ Pushes several elements to either end of a sequence.
:param count: Number of elements to push
:param in_front: The flags specifying which end of the modified sequence.
* **CV_BACK** the elements are added to the end of the sequence
:param in_front: The flags specifying which end of the modified sequence.
* **CV_BACK** the elements are added to the end of the sequence
* **CV_FRONT** the elements are added to the beginning of the sequence
The function adds several elements to either
@ -1266,7 +1266,7 @@ Sorts sequence element using the specified comparison function.
:param func: The comparison function that returns a negative, zero, or positive value depending on the relationships among the elements (see the above declaration and the example below) - a similar function is used by ``qsort`` from C runline except that in the latter, ``userdata`` is not used
:param userdata: The user parameter passed to the compasion function; helps to avoid global variables in some cases
::
/* a < b ? -1 : a > b ? 1 : 0 */
@ -1287,30 +1287,30 @@ The function sorts the sequence in-place using the specified criteria. Below is
int x_diff = a->x - b->x;
return y_diff ? y_diff : x_diff;
}
...
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq* seq = cvCreateSeq( CV_32SC2, sizeof(CvSeq), sizeof(CvPoint), storage );
int i;
for( i = 0; i < 10; i++ )
{
CvPoint pt;
pt.x = rand()
pt.y = rand()
pt.x = rand()
pt.y = rand()
cvSeqPush( seq, &pt );
}
cvSeqSort( seq, cmp_func, 0 /* userdata is not used here */ );
/* print out the sorted sequence */
for( i = 0; i < seq->total; i++ )
{
CvPoint* pt = (CvPoint*)cvSeqElem( seq, i );
printf( "(
}
cvReleaseMemStorage( &storage );
..
@ -1329,10 +1329,10 @@ Occupies a node in the set.
The function allocates a new node, optionally copies
input element data to it, and returns the pointer and the index to the
node. The index value is taken from the lower bits of the
node. The index value is taken from the lower bits of the
``flags``
field of the node. The function has O(1) complexity; however, there exists
a faster function for allocating set nodes (see
a faster function for allocating set nodes (see
:ocv:cfunc:`SetNew`
).
@ -1344,7 +1344,7 @@ Adds an element to a set (fast variant).
:param setHeader: Set
The function is an inline lightweight variant of
The function is an inline lightweight variant of
:ocv:cfunc:`SetAdd`
. It occupies a new node and returns a pointer to it rather than an index.
@ -1375,7 +1375,7 @@ Removes a set element based on its pointer.
:param elem: Removed element
The function is an inline lightweight variant of
The function is an inline lightweight variant of
:ocv:cfunc:`SetRemove`
that requires an element pointer. The function does not check whether the node is occupied or not - the user should take care of that.
@ -1391,14 +1391,14 @@ Sets up sequence block size.
The function affects memory allocation
granularity. When the free space in the sequence buffers has run out,
the function allocates the space for
the function allocates the space for
``deltaElems``
sequence
elements. If this block immediately follows the one previously allocated,
the two blocks are concatenated; otherwise, a new sequence block is
created. Therefore, the bigger the parameter is, the lower the possible
sequence fragmentation, but the more space in the storage block is wasted. When
the sequence is created, the parameter
the sequence is created, the parameter
``deltaElems``
is set to
the default value of about 1K. The function can be called any time after
@ -1459,19 +1459,19 @@ can be read by subsequent calls of the macro
in the case of forward reading and by using
``CV_REV_READ_SEQ_ELEM( read_elem, reader )``
in the case of reverse
reading. Both macros put the sequence element to
reading. Both macros put the sequence element to
``read_elem``
and
move the reading pointer toward the next element. A circular structure
of sequence blocks is used for the reading process, that is, after the
last element has been read by the macro
last element has been read by the macro
``CV_READ_SEQ_ELEM``
, the
first element is read when the macro is called again. The same applies to
``CV_REV_READ_SEQ_ELEM``
. There is no function to finish the reading
process, since it neither changes the sequence nor creates any temporary
buffers. The reader field
buffers. The reader field
``ptr``
points to the current element of
the sequence that is to be read next. The code below demonstrates how
@ -1484,7 +1484,7 @@ to use the sequence writer and reader.
CvSeqWriter writer;
CvSeqReader reader;
int i;
cvStartAppendToSeq( seq, &writer );
for( i = 0; i < 10; i++ )
{
@ -1493,7 +1493,7 @@ to use the sequence writer and reader.
printf("
}
cvEndWriteSeq( &writer );
cvStartReadSeq( seq, &reader, 0 );
for( i = 0; i < seq->total; i++ )
{
@ -1508,7 +1508,7 @@ to use the sequence writer and reader.
#endif
}
...
cvReleaseStorage( &storage );
..
@ -1531,7 +1531,7 @@ Creates a new sequence and initializes a writer for it.
The function is a combination of
:ocv:cfunc:`CreateSeq`
and
and
:ocv:cfunc:`StartAppendToSeq`
. The pointer to the
created sequence is stored at

@ -15,27 +15,27 @@ KeyPoint
Data structure for salient point detectors.
.. ocv:member:: Point2f pt
coordinates of the keypoint
.. ocv:member:: float size
diameter of the meaningful keypoint neighborhood
.. ocv:member:: float angle
computed orientation of the keypoint (-1 if not applicable)
.. ocv:member:: float response
the response by which the most strong keypoints have been selected. Can be used for further sorting or subsampling
.. ocv:member:: int octave
octave (pyramid layer) from which the keypoint has been extracted
.. ocv:member:: int class_id
object id that can be used to clustered keypoints by an object they belong to
KeyPoint::KeyPoint
@ -51,19 +51,19 @@ The keypoint constructors
.. ocv:pyfunction:: cv2.KeyPoint(x, y, _size[, _angle[, _response[, _octave[, _class_id]]]]) -> <KeyPoint object>
:param x: x-coordinate of the keypoint
:param y: y-coordinate of the keypoint
:param _pt: x & y coordinates of the keypoint
:param _size: keypoint diameter
:param _angle: keypoint orientation
:param _response: keypoint detector response on the keypoint (that is, strength of the keypoint)
:param _octave: pyramid octave in which the keypoint has been detected
:param _class_id: object id
@ -309,7 +309,7 @@ Wrapping class for feature detection using the
protected:
...
};
DenseFeatureDetector
--------------------
@ -317,18 +317,18 @@ DenseFeatureDetector
Class for generation of image features which are distributed densely and regularly over the image. ::
class DenseFeatureDetector : public FeatureDetector
{
public:
DenseFeatureDetector( float initFeatureScale=1.f, int featureScaleLevels=1,
class DenseFeatureDetector : public FeatureDetector
{
public:
DenseFeatureDetector( float initFeatureScale=1.f, int featureScaleLevels=1,
float featureScaleMul=0.1f,
int initXyStep=6, int initImgBound=0,
bool varyXyStepWithScale=true,
bool varyImgBoundWithScale=false );
protected:
protected:
...
};
The detector generates several levels (in the amount of ``featureScaleLevels``) of features. Features of each level are located in the nodes of a regular grid over the image (excluding the image boundary of given size). The level parameters (a feature scale, a node size, a size of boundary) are multiplied by ``featureScaleMul`` with level index growing depending on input flags, viz.:
* Feature scale is multiplied always.
@ -380,11 +380,11 @@ Class for extracting blobs from an image. ::
The class implements a simple algorithm for extracting blobs from an image:
#. Convert the source image to binary images by applying thresholding with several thresholds from ``minThreshold`` (inclusive) to ``maxThreshold`` (exclusive) with distance ``thresholdStep`` between neighboring thresholds.
#. Convert the source image to binary images by applying thresholding with several thresholds from ``minThreshold`` (inclusive) to ``maxThreshold`` (exclusive) with distance ``thresholdStep`` between neighboring thresholds.
#. Extract connected components from every binary image by :ocv:func:`findContours` and calculate their centers.
#. Extract connected components from every binary image by :ocv:func:`findContours` and calculate their centers.
#. Group centers from several binary images by their coordinates. Close centers form one group that corresponds to one blob, which is controlled by the ``minDistBetweenBlobs`` parameter.
#. Group centers from several binary images by their coordinates. Close centers form one group that corresponds to one blob, which is controlled by the ``minDistBetweenBlobs`` parameter.
#. From the groups, estimate final centers of blobs and their radiuses and return as locations and sizes of keypoints.
@ -468,7 +468,7 @@ panorama series.
``DynamicAdaptedFeatureDetector`` uses another detector, such as FAST or SURF, to do the dirty work,
with the help of ``AdjusterAdapter`` .
If the detected number of features is not large enough,
``AdjusterAdapter`` adjusts the detection parameters so that the next detection
``AdjusterAdapter`` adjusts the detection parameters so that the next detection
results in a bigger or smaller number of features. This is repeated until either the number of desired features are found
or the parameters are maxed out.
@ -500,14 +500,14 @@ The constructor
:param max_features: Maximum desired number of features.
:param max_iters: Maximum number of times to try adjusting the feature detector parameters. For :ocv:class:`FastAdjuster` , this number can be high, but with ``Star`` or ``Surf`` many iterations can be time-comsuming. At each iteration the detector is rerun.
:param max_iters: Maximum number of times to try adjusting the feature detector parameters. For :ocv:class:`FastAdjuster` , this number can be high, but with ``Star`` or ``Surf`` many iterations can be time-comsuming. At each iteration the detector is rerun.
AdjusterAdapter
---------------
.. ocv:class:: AdjusterAdapter
Class providing an interface for adjusting parameters of a feature detector. This interface is used by :ocv:class:`DynamicAdaptedFeatureDetector` . It is a wrapper for :ocv:class:`FeatureDetector` that enables adjusting parameters after feature detection. ::
class AdjusterAdapter: public FeatureDetector
{
public:
@ -562,7 +562,7 @@ Example: ::
AdjusterAdapter::good
-------------------------
Returns false if the detector parameters cannot be adjusted any more.
Returns false if the detector parameters cannot be adjusted any more.
.. ocv:function:: bool AdjusterAdapter::good() const

@ -211,7 +211,7 @@ gpu::FAST_GPU::calcKeyPointsLocation
-------------------------------------
Find keypoints and compute it's response if ``nonmaxSupression`` is true.
.. int gpu::FAST_GPU::calcKeyPointsLocation(const GpuMat& image, const GpuMat& mask)
.. ocv:function:: int gpu::FAST_GPU::calcKeyPointsLocation(const GpuMat& image, const GpuMat& mask)
:param image: Image where keypoints (corners) are detected. Only 8-bit grayscale images are supported.

@ -769,7 +769,7 @@ Performs linear blending of two images.
:param img1: First image. Supports only ``CV_8U`` and ``CV_32F`` depth.
:param img1: Second image. Must have the same size and the same type as ``img1`` .
:param img2: Second image. Must have the same size and the same type as ``img1`` .
:param weights1: Weights for first image. Must have tha same size as ``img1`` . Supports only ``CV_32F`` type.
@ -789,7 +789,7 @@ Composites two images using alpha opacity values contained in each image.
:param img1: First image. Supports ``CV_8UC4`` , ``CV_16UC4`` , ``CV_32SC4`` and ``CV_32FC4`` types.
:param img1: Second image. Must have the same size and the same type as ``img1`` .
:param img2: Second image. Must have the same size and the same type as ``img1`` .
:param dst: Destination image.

@ -78,13 +78,11 @@ Computes a matrix-matrix or matrix-scalar per-element product.
gpu::divide
---------------
-----------
Computes a matrix-matrix or matrix-scalar division.
.. ocv:function:: void gpu::divide(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, double scale = 1, int dtype = -1, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::divide(const GpuMat& src1, const Scalar& src2, GpuMat& dst, double scale = 1, int dtype = -1, Stream& stream = Stream::Null())
.. ocv:function:: void gpu::divide(double src1, const GpuMat& src2, GpuMat& dst, int dtype = -1, Stream& stream = Stream::Null())
:param src1: First source matrix or a scalar.
@ -104,9 +102,8 @@ This function, in contrast to :ocv:func:`divide`, uses a round-down rounding mod
.. seealso:: :ocv:func:`divide`
addWeighted
---------------
gpu::addWeighted
----------------
Computes the weighted sum of two arrays.
.. ocv:function:: void gpu::addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2, double beta, double gamma, GpuMat& dst, int dtype = -1, Stream& stream = Stream::Null())

@ -47,6 +47,7 @@ Class computing the optical flow for two images using Brox et al Optical Flow al
gpu::GoodFeaturesToTrackDetector_GPU
------------------------------------
.. ocv:class:: gpu::GoodFeaturesToTrackDetector_GPU
Class used for strong corners detection on an image. ::
@ -120,6 +121,8 @@ Releases inner buffers memory.
gpu::FarnebackOpticalFlow
-------------------------
.. ocv:class:: gpu::FarnebackOpticalFlow
Class computing a dense optical flow using the Gunnar Farneback’s algorithm. ::
class CV_EXPORTS FarnebackOpticalFlow
@ -179,6 +182,7 @@ Releases unused auxiliary memory buffers.
gpu::PyrLKOpticalFlow
---------------------
.. ocv:class:: gpu::PyrLKOpticalFlow
Class used for calculating an optical flow. ::

@ -76,7 +76,8 @@ Description of the filter, which corresponds to the part of the object.
vector describes penalty function (d_i in the paper)
pf[0] * x + pf[1] * y + pf[2] * x^2 + pf[3] * y^2
.. ocv:member:: int sizeX, sizeY
.. ocv:member:: int sizeX
.. ocv:member:: int sizeY
Rectangular map (sizeX x sizeY),
every cell stores feature vector (dimension = p)

@ -29,15 +29,6 @@ detail::ExposureCompensation::feed
.. ocv:function:: void detail::ExposureCompensation::feed(const std::vector<Point> &corners, const std::vector<Mat> &images, const std::vector<Mat> &masks)
:param corners: Source image top-left corners
:param images: Source images
:param masks: Image masks to update
detail::ExposureCompensation::feed
----------------------------------
.. ocv:function:: void detail::ExposureCompensation::feed(const std::vector<Point> &corners, const std::vector<Mat> &images, const std::vector<std::pair<Mat,uchar> > &masks)
:param corners: Source image top-left corners

@ -10,7 +10,7 @@ The implemented stitching pipeline is very similar to the one proposed in [BL07]
.. image:: StitchingPipeline.jpg
References
----------
==========
.. [BL07] M. Brown and D. Lowe. Automatic Panoramic Image Stitching using Invariant Features. International Journal of Computer Vision, 74(1), pages 59-73, 2007.

@ -245,4 +245,4 @@ Constructs a "best of 2 nearest" matcher.
:param num_matches_thresh1: Minimum number of matches required for the 2D projective transform estimation used in the inliers classification step
:param num_matches_thresh1: Minimum number of matches required for the 2D projective transform re-estimation on inliers
:param num_matches_thresh2: Minimum number of matches required for the 2D projective transform re-estimation on inliers

@ -204,6 +204,7 @@ Implementation of the camera parameters refinement algorithm which minimizes sum
detail::BundleAdjusterRay
-------------------------
.. ocv:class:: detail::BundleAdjusterRay
Implementation of the camera parameters refinement algorithm which minimizes sum of the distances between the rays passing through the camera center and a feature. ::

@ -101,7 +101,7 @@ Projects the image backward.
:param dst_size: Backward-projected image size
:param dst_size: Backward-projected image
:param dst: Backward-projected image
detail::RotationWarper::warpRoi
-------------------------------

Loading…
Cancel
Save