Skip to content

geometry

All modules / geometry

approxPolyDPfunction

geometry_subdiv2d

approxPolyNfunction

Approximates a polygon with a convex hull with a specified accuracy and number of sides.

arcLengthfunction

Calculates a contour perimeter or a curve length.

boundingRectfunction

Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.

boxPointsfunction

Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.

buildMSTfunction

Builds a Minimum Spanning Tree (MST) using the specified algorithm (see `MSTAlgorithm`).

calibrationMatrixValuesfunction

Computes useful camera characteristics from the camera intrinsic matrix.

composeRTfunction

Combines two rotation-and-shift transformations.

computeCorrespondEpilinesfunction

For points in an image of a stereo pair, computes the corresponding epilines in the other image.

contourAreafunction

Calculates a contour area.

convertPointsFromHomogeneousfunction

Converts points from homogeneous to Euclidean space.

convertPointsToHomogeneousfunction

Converts points from Euclidean to homogeneous space.

convexHullfunction

example: samples/cpp/geometry.cpp

convexityDefectsfunction

Finds the convexity defects of a contour.

correctMatchesfunction

Refines coordinates of corresponding points.

decomposeEssentialMatfunction

Decompose an essential matrix to possible rotations and translation.

decomposeHomographyMatfunction

example: samples/cpp/tutorial_code/features/Homography/decompose_homography.cpp

decomposeProjectionMatrixfunction

Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.

DistanceTypesclass

Distance types for Distance Transform and M-estimators

estimateAffine2Dfunction

Computes an optimal affine transformation between two 2D point sets.

estimateAffine2D1function

Computes an optimal affine transformation between two 2D point sets.

estimateAffine3Dfunction

Computes an optimal affine transformation between two 3D point sets.

estimateAffine3D1function

Computes an optimal affine transformation between two 3D point sets.

estimateAffinePartial2Dfunction

Computes an optimal limited affine transformation with 4 degrees of freedom between

estimateTranslation2Dfunction

Computes a pure 2D translation between two 2D point sets.

estimateTranslation3Dfunction

Computes an optimal translation between two 3D point sets.

filterHomographyDecompByVisibleRefpointsfunction

Filters homography decompositions based on additional information.

findEssentialMatfunction

Calculates an essential matrix from the corresponding points in two images.

findEssentialMat1function

Calculates an essential matrix from the corresponding points in two images.

findEssentialMat2function

Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.

findEssentialMat3function

Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.

findFundamentalMatfunction

example: samples/cpp/snippets/epipolar_lines.cpp

findFundamentalMat1function

example: samples/cpp/snippets/epipolar_lines.cpp

findFundamentalMat2function

example: samples/cpp/snippets/epipolar_lines.cpp

findHomographyfunction

example: samples/cpp/tutorial_code/features/Homography/pose_from_homography.cpp

findHomography1function

example: samples/cpp/tutorial_code/features/Homography/pose_from_homography.cpp

fisheye_distortPointsfunction

Distorts 2D points using fisheye model.

fisheye_distortPoints1function

Overload of distortPoints function to handle cases when undistorted points are got with non-identity

fisheye_estimateNewCameraMatrixForUndistortRectifyfunction

Estimates new camera intrinsic matrix for undistortion or rectification.

fisheye_projectPointsfunction

Projects points using fisheye model

fisheye_solvePnPfunction

Finds an object pose from 3D-2D point correspondences for fisheye camera model.

fisheye_solvePnPRansacfunction

Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.

fisheye_undistortPointsfunction

Undistorts 2D points using fisheye camera model

fitEllipsefunction

Fits an ellipse around a set of 2D points.

fitEllipseAMSfunction

Fits an ellipse around a set of 2D points.

fitEllipseDirectfunction

Fits an ellipse around a set of 2D points.

fitLinefunction

Fits a line to a 2D or 3D point set.

getAffineTransformfunction

Calculates an affine transform from three pairs of the corresponding points.

getClosestEllipsePointsfunction

example: samples/python/snippets/fitline.py

getDefaultNewCameraMatrixfunction

Returns the default new camera matrix.

getOptimalNewCameraMatrixfunction

Returns the new camera intrinsic matrix based on the free scaling parameter.

getPerspectiveTransformfunction

Calculates a perspective transform from four pairs of the corresponding points.

getRotationMatrix2Dfunction

Calculates an affine matrix of 2D rotation.

HuMomentsfunction

Calculates seven Hu invariants.

intersectConvexConvexfunction

example: samples/cpp/snippets/intersectExample.cpp

invertAffineTransformfunction

Inverts an affine transformation.

isContourConvexfunction

Tests a contour convexity.

LocalOptimMethodclass

Native enum entries for local optim method. Pass an entry to enum-typed arguments or its .value to numeric arguments.

matchShapesfunction

Compares two shapes.

matMulDerivfunction

Computes partial derivatives of the matrix product for each multiplied matrix.

MatrixTypeclass

Type of matrix used in LevMarq solver

minAreaRectfunction

Finds a rotated rectangle of the minimum area enclosing the input 2D point set.

minEnclosingCirclefunction

Finds a circle of the minimum area enclosing a 2D point set.

minEnclosingConvexPolygonfunction

Finds a convex polygon of minimum area enclosing a 2D point set and returns its area.

minEnclosingTrianglefunction

Finds a triangle of minimum area enclosing a 2D point set and returns its area.

momentsfunction

Calculates all of the moments up to the third order of a polygon or rasterized shape.

MSTAlgorithmclass

Represents the algorithms available for building a Minimum Spanning Tree (MST).

MSTEdgeclass

Represents an edge in a graph for Minimum Spanning Tree (MST) computation.

NeighborSearchMethodclass

Native enum entries for neighbor search method. Pass an entry to enum-typed arguments or its .value to numeric arguments.

pointPolygonTestfunction

Performs a point-in-contour test.

PolishingMethodclass

Native enum entries for polishing method. Pass an entry to enum-typed arguments or its .value to numeric arguments.

projectPointsfunction

Projects 3D points to an image plane.

projectPointsSepJfunction

Projects 3D points to an image plane.

recoverPosefunction

Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using chirality check. Returns the number of

recoverPose1function

Recovers the relative camera rotation and the translation from an estimated essential

recoverPose2function

Recovers the relative camera rotation and the translation from an estimated essential

recoverPose3function

Recovers the relative camera rotation and the translation from an estimated essential

RectanglesIntersectTypesclass

types of intersection between rectangles

Rodriguesfunction

Converts a rotation matrix to a rotation vector or vice versa.

rotatedRectangleIntersectionfunction

Finds out if there is any intersection between two rotated rectangles.

RQDecomp3x3function

Computes an RQ decomposition of 3x3 matrices.

SacMethodclass

type of the robust estimation algorithm

SacModelTypeclass

Native enum entries for sac model type. Pass an entry to enum-typed arguments or its .value to numeric arguments.

SamplingMethodclass

Native enum entries for sampling method. Pass an entry to enum-typed arguments or its .value to numeric arguments.

sampsonDistancefunction

Calculates the Sampson Distance between two points.

ScoreMethodclass

Native enum entries for score method. Pass an entry to enum-typed arguments or its .value to numeric arguments.

solveP3Pfunction

Finds an object pose ` {}^{c}\mathbf{T}_o ` from 3 3D-2D point correspondences.

solvePnPfunction

example: samples/cpp/tutorial_code/features/Homography/homography_from_camera_displacement.cpp

solvePnPGenericfunction

Finds an object pose ` {}^{c}\mathbf{T}_o ` from 3D-2D point correspondences.

SolvePnPMethodclass

Native enum entries for solve pn pmethod. Pass an entry to enum-typed arguments or its .value to numeric arguments.

solvePnPRansacfunction

Finds an object pose ` {}^{c}\mathbf{T}_o ` from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.

solvePnPRansac1function

Finds rotation and translation vector.

solvePnPRefineLMfunction

Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame

solvePnPRefineVVSfunction

Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame

Subdiv2Dclass

subdiv2 d value in the OpenCV API.

triangulatePointsfunction

This function reconstructs 3-dimensional points (in homogeneous coordinates) by using

undistortImagePointsfunction

Compute undistorted image points position

undistortPointsfunction

Computes the ideal point coordinates from the observed point coordinates.

UsacParamsclass

usac params value in the OpenCV API.

VariableTypeclass

Type of variables used in LevMarq solver

Constants

Use the named constant from cv. In particular, OpenCV 5 matrix type codes differ from OpenCV 4.

INTERSECT_NONE

No intersection

INTERSECT_PARTIAL

There is a partial intersection

INTERSECT_FULL

One of the rectangle is fully enclosed in the other

DIST_USER

User defined distance

DIST_L1

distance = |x1-x2| + |y1-y2|

DIST_L2

the simple euclidean distance

DIST_C

distance = max(|x1-x2|,|y1-y2|)

DIST_L12

L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1))

DIST_FAIR

distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998

DIST_WELSCH

distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846

DIST_HUBER

distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345

Subdiv2D_PTLOC_ERROR

Point location error

SUBDIV2D_PTLOC_ERROR

Point location error

Subdiv2D_PTLOC_OUTSIDE_RECT

Point outside the subdivision bounding rect

SUBDIV2D_PTLOC_OUTSIDE_RECT

Point outside the subdivision bounding rect

Subdiv2D_PTLOC_INSIDE

Point inside some facet

SUBDIV2D_PTLOC_INSIDE

Point inside some facet

Subdiv2D_PTLOC_VERTEX

Point coincides with one of the subdivision vertices

SUBDIV2D_PTLOC_VERTEX

Point coincides with one of the subdivision vertices

Subdiv2D_PTLOC_ON_EDGE

Point on some edge

SUBDIV2D_PTLOC_ON_EDGE

Point on some edge

Subdiv2D_NEXT_AROUND_ORG

Subdiv2D edge type navigation (see: getEdge())

SUBDIV2D_NEXT_AROUND_ORG

Subdiv2D edge type navigation (see: getEdge())

Subdiv2D_NEXT_AROUND_DST

subdiv2 d next around dst constant (0x22), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_NEXT_AROUND_DST

subdiv2 d next around dst constant (0x22), defined by OpenCV for cv::Subdiv2D.

Subdiv2D_PREV_AROUND_ORG

subdiv2 d prev around org constant (0x11), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_PREV_AROUND_ORG

subdiv2 d prev around org constant (0x11), defined by OpenCV for cv::Subdiv2D.

Subdiv2D_PREV_AROUND_DST

subdiv2 d prev around dst constant (0x33), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_PREV_AROUND_DST

subdiv2 d prev around dst constant (0x33), defined by OpenCV for cv::Subdiv2D.

Subdiv2D_NEXT_AROUND_LEFT

subdiv2 d next around left constant (0x13), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_NEXT_AROUND_LEFT

subdiv2 d next around left constant (0x13), defined by OpenCV for cv::Subdiv2D.

Subdiv2D_NEXT_AROUND_RIGHT

subdiv2 d next around right constant (0x31), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_NEXT_AROUND_RIGHT

subdiv2 d next around right constant (0x31), defined by OpenCV for cv::Subdiv2D.

Subdiv2D_PREV_AROUND_LEFT

subdiv2 d prev around left constant (0x20), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_PREV_AROUND_LEFT

subdiv2 d prev around left constant (0x20), defined by OpenCV for cv::Subdiv2D.

Subdiv2D_PREV_AROUND_RIGHT

subdiv2 d prev around right constant (0x02), defined by OpenCV for cv::Subdiv2D.

SUBDIV2D_PREV_AROUND_RIGHT

subdiv2 d prev around right constant (0x02), defined by OpenCV for cv::Subdiv2D.

LMEDS

least-median of squares algorithm

RANSAC

RANSAC algorithm

RHO

RHO: RHO algorithm

USAC_DEFAULT

USAC algorithm, default settings

USAC_PARALLEL

USAC, parallel version

USAC_FM_8PTS

USAC, fundamental matrix 8 points

USAC_FAST

USAC, fast settings

USAC_ACCURATE

USAC, accurate settings

USAC_PROSAC

USAC, sorted points, runs PROSAC

USAC_MAGSAC

USAC, runs MAGSAC++

SOLVEPNP_ITERATIVE

Pose refinement using non-linear Levenberg-Marquardt minimization scheme [Madsen04] [Eade13] \n

SOLVEPNP_EPNP

EPnP: Efficient Perspective-n-Point Camera Pose Estimation [lepetit2009epnp]

SOLVEPNP_P3P

Revisiting the P3P Problem [ding2023revisiting]

SOLVEPNP_AP3P

An Efficient Algebraic Solution to the Perspective-Three-Point Problem [Ke17]

SOLVEPNP_IPPE

Infinitesimal Plane-Based Pose Estimation [Collins14] \n

SOLVEPNP_IPPE_SQUARE

Infinitesimal Plane-Based Pose Estimation [Collins14] \n

SOLVEPNP_SQPNP

SQPnP: A Consistently Fast and Globally OptimalSolution to the Perspective-n-Point Problem [Terzakis2020SQPnP]

SOLVEPNP_MAX_COUNT

SOLVEPNP_MAX_COUNT: Used for count

FM_7POINT

7-point algorithm

FM_8POINT

8-point algorithm

FM_LMEDS

least-median algorithm. 7-point algorithm is used.

FM_RANSAC

RANSAC algorithm. It needs at least 15 points. 7-point algorithm is used.

SAMPLING_UNIFORM

sampling uniform constant (0), defined by OpenCV for cv.

SAMPLING_PROGRESSIVE_NAPSAC

sampling progressive napsac constant (1), defined by OpenCV for cv.

SAMPLING_NAPSAC

sampling napsac constant (2), defined by OpenCV for cv.

SAMPLING_PROSAC

sampling prosac constant (3), defined by OpenCV for cv.

LOCAL_OPTIM_NULL

local optim null constant (0), defined by OpenCV for cv.

LOCAL_OPTIM_INNER_LO

local optim inner lo constant (1), defined by OpenCV for cv.

LOCAL_OPTIM_INNER_AND_ITER_LO

local optim inner and iter lo constant (2), defined by OpenCV for cv.

LOCAL_OPTIM_GC

local optim gc constant (3), defined by OpenCV for cv.

LOCAL_OPTIM_SIGMA

local optim sigma constant (4), defined by OpenCV for cv.

SCORE_METHOD_RANSAC

score method ransac constant (0), defined by OpenCV for cv.

SCORE_METHOD_MSAC

score method msac constant (1), defined by OpenCV for cv.

SCORE_METHOD_MAGSAC

score method magsac constant (2), defined by OpenCV for cv.

SCORE_METHOD_LMEDS

score method lmeds constant (3), defined by OpenCV for cv.

NEIGH_FLANN_KNN

neigh flann knn constant (0), defined by OpenCV for cv.

NEIGH_GRID

neigh grid constant (1), defined by OpenCV for cv.

NEIGH_FLANN_RADIUS

neigh flann radius constant (2), defined by OpenCV for cv.

NONE_POLISHER

none polisher constant (0), defined by OpenCV for cv.

LSQ_POLISHER

lsq polisher constant (1), defined by OpenCV for cv.

MAGSAC

magsac constant (2), defined by OpenCV for cv.

COV_POLISHER

cov polisher constant (3), defined by OpenCV for cv.

MatrixType_AUTO

matrix type auto constant (0), defined by OpenCV for cv::MatrixType.

MATRIX_TYPE_AUTO

matrix type auto constant (0), defined by OpenCV for cv::MatrixType.

MatrixType_DENSE

matrix type dense constant (1), defined by OpenCV for cv::MatrixType.

MATRIX_TYPE_DENSE

matrix type dense constant (1), defined by OpenCV for cv::MatrixType.

MatrixType_SPARSE

matrix type sparse constant (2), defined by OpenCV for cv::MatrixType.

MATRIX_TYPE_SPARSE

matrix type sparse constant (2), defined by OpenCV for cv::MatrixType.

VariableType_LINEAR

variable type linear constant (0), defined by OpenCV for cv::VariableType.

VARIABLE_TYPE_LINEAR

variable type linear constant (0), defined by OpenCV for cv::VariableType.

VariableType_SO3

variable type so3 constant (1), defined by OpenCV for cv::VariableType.

VARIABLE_TYPE_SO3

variable type so3 constant (1), defined by OpenCV for cv::VariableType.

VariableType_SE3

variable type se3 constant (2), defined by OpenCV for cv::VariableType.

VARIABLE_TYPE_SE3

variable type se3 constant (2), defined by OpenCV for cv::VariableType.

MST_PRIM

mst prim constant (0), defined by OpenCV for cv.

MST_KRUSKAL

mst kruskal constant (1), defined by OpenCV for cv.

SAC_METHOD_RANSAC

The RANSAC algorithm described in [fischler1981random].

SAC_MODEL_PLANE

The 3D PLANE model coefficients in list [a, b, c, d], corresponding to the coefficients of equation ax + by + cz + d = 0.

SAC_MODEL_SPHERE

The 3D SPHERE model coefficients in list [center_x, center_y, center_z, radius], corresponding to the coefficients of equation (x - center\_x)^2 + (y - center\_y)^2 + (z - center\_z)^2 = radius^2.