🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.geometry
クラス Geometry
- java.lang.Object
-
- org.opencv.geometry.Geometry
-
public class Geometry extends java.lang.Object
-
-
フィールドの要約
-
コンストラクタの要約
コンストラクタ Constructor Description Geometry()
-
メソッドの要約
すべてのメソッド 静的メソッド 具象メソッド Modifier and Type Method Description static voidapproxPolyDP​(MatOfPoint2f curve, MatOfPoint2f approxCurve, double epsilon, boolean closed)Approximates a polygonal curve(s) with the specified precision.static voidapproxPolyN​(Mat curve, Mat approxCurve, int nsides)Approximates a polygon with a convex hull with a specified accuracy and number of sides.static voidapproxPolyN​(Mat curve, Mat approxCurve, int nsides, float epsilon_percentage)Approximates a polygon with a convex hull with a specified accuracy and number of sides.static voidapproxPolyN​(Mat curve, Mat approxCurve, int nsides, float epsilon_percentage, boolean ensure_convex)Approximates a polygon with a convex hull with a specified accuracy and number of sides.static doublearcLength​(MatOfPoint2f curve, boolean closed)Calculates a contour perimeter or a curve length.static RectboundingRect​(Mat array)Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.static voidboxPoints​(RotatedRect box, Mat points)Finds the four vertices of a rotated rect.static voidcalibrationMatrixValues​(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double[] fovx, double[] fovy, double[] focalLength, Point principalPoint, double[] aspectRatio)Computes useful camera characteristics from the camera intrinsic matrix.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1, Mat dt3dr2)Combines two rotation-and-shift transformations.static voidcomposeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1, Mat dt3dr2, Mat dt3dt2)Combines two rotation-and-shift transformations.static voidcomputeCorrespondEpilines​(Mat points, int whichImage, Mat F, Mat lines)For points in an image of a stereo pair, computes the corresponding epilines in the other image.static doublecontourArea​(Mat contour)Calculates a contour area.static doublecontourArea​(Mat contour, boolean oriented)Calculates a contour area.static voidconvertPointsFromHomogeneous​(Mat src, Mat dst)Converts points from homogeneous to Euclidean space.static voidconvertPointsFromHomogeneous​(Mat src, Mat dst, int dtype)Converts points from homogeneous to Euclidean space.static voidconvertPointsToHomogeneous​(Mat src, Mat dst)Converts points from Euclidean to homogeneous space.static voidconvertPointsToHomogeneous​(Mat src, Mat dst, int dtype)Converts points from Euclidean to homogeneous space.static voidconvexHull​(MatOfPoint points, MatOfInt hull)Finds the convex hull of a point set.static voidconvexHull​(MatOfPoint points, MatOfInt hull, boolean clockwise)Finds the convex hull of a point set.static voidconvexityDefects​(MatOfPoint contour, MatOfInt convexhull, MatOfInt4 convexityDefects)Finds the convexity defects of a contour.static voidcorrectMatches​(Mat F, Mat points1, Mat points2, Mat newPoints1, Mat newPoints2)Refines coordinates of corresponding points.static voiddecomposeEssentialMat​(Mat E, Mat R1, Mat R2, Mat t)Decompose an essential matrix to possible rotations and translation.static intdecomposeHomographyMat​(Mat H, Mat K, java.util.List<Mat> rotations, java.util.List<Mat> translations, java.util.List<Mat> normals)Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).static voiddecomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect)Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.static voiddecomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX)Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.static voiddecomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY)Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.static voiddecomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY, Mat rotMatrixZ)Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.static voiddecomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY, Mat rotMatrixZ, Mat eulerAngles)Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.static MatestimateAffine2D​(Mat from, Mat to)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat from, Mat to, Mat inliers)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat from, Mat to, Mat inliers, int method)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters)Computes an optimal affine transformation between two 2D point sets.static MatestimateAffine2D​(Mat pts1, Mat pts2, Mat inliers, UsacParams params)static MatestimateAffine3D​(Mat src, Mat dst)Computes an optimal affine transformation between two 3D point sets.static MatestimateAffine3D​(Mat src, Mat dst, double[] scale)Computes an optimal affine transformation between two 3D point sets.static MatestimateAffine3D​(Mat src, Mat dst, double[] scale, boolean force_rotation)Computes an optimal affine transformation between two 3D point sets.static booleanestimateAffine3D​(Mat src, Mat dst, Mat out, Mat inliers)Computes an optimal affine transformation between two 3D point sets.static booleanestimateAffine3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold)Computes an optimal affine transformation between two 3D point sets.static booleanestimateAffine3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold, double confidence)Computes an optimal affine transformation between two 3D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to, Mat inliers)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static MatestimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters)Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to)Computes a pure 2D translation between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to, Mat inliers)Computes a pure 2D translation between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method)Computes a pure 2D translation between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold)Computes a pure 2D translation between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters)Computes a pure 2D translation between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence)Computes a pure 2D translation between two 2D point sets.static double[]estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters)Computes a pure 2D translation between two 2D point sets.static booleanestimateTranslation3D​(Mat src, Mat dst, Mat out, Mat inliers)Computes an optimal translation between two 3D point sets.static booleanestimateTranslation3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold)Computes an optimal translation between two 3D point sets.static booleanestimateTranslation3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold, double confidence)Computes an optimal translation between two 3D point sets.static voidfilterHomographyDecompByVisibleRefpoints​(java.util.List<Mat> rotations, java.util.List<Mat> normals, Mat beforePoints, Mat afterPoints, Mat possibleSolutions)Filters homography decompositions based on additional information.static voidfilterHomographyDecompByVisibleRefpoints​(java.util.List<Mat> rotations, java.util.List<Mat> normals, Mat beforePoints, Mat afterPoints, Mat possibleSolutions, Mat pointsMask)Filters homography decompositions based on additional information.static MatfindEssentialMat​(Mat points1, Mat points2)static MatfindEssentialMat​(Mat points1, Mat points2, double focal)static MatfindEssentialMat​(Mat points1, Mat points2, double focal, Point pp)static MatfindEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method)static MatfindEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob)static MatfindEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold)static MatfindEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold, int maxIters)static MatfindEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold, int maxIters, Mat mask)static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix)Calculates an essential matrix from the corresponding points in two images.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method)Calculates an essential matrix from the corresponding points in two images.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob)Calculates an essential matrix from the corresponding points in two images.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold)Calculates an essential matrix from the corresponding points in two images.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold, int maxIters)Calculates an essential matrix from the corresponding points in two images.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold, int maxIters, Mat mask)Calculates an essential matrix from the corresponding points in two images.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2)Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method)Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method, double prob)Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method, double prob, double threshold)Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method, double prob, double threshold, Mat mask)Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.static MatfindEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat cameraMatrix2, Mat dist_coeff1, Mat dist_coeff2, Mat mask, UsacParams params)static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2)static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method)static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold)static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence)static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence, int maxIters)Calculates a fundamental matrix from the corresponding points in two images.static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence, int maxIters, Mat mask)Calculates a fundamental matrix from the corresponding points in two images.static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence, Mat mask)static MatfindFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, Mat mask, UsacParams params)static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints)Finds a perspective transformation between two planes.static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method)Finds a perspective transformation between two planes.static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold)Finds a perspective transformation between two planes.static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask)Finds a perspective transformation between two planes.static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters)Finds a perspective transformation between two planes.static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters, double confidence)Finds a perspective transformation between two planes.static MatfindHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, Mat mask, UsacParams params)static voidfisheye_distortPoints​(Mat undistorted, Mat distorted, Mat K, Mat D)Distorts 2D points using fisheye model.static voidfisheye_distortPoints​(Mat undistorted, Mat distorted, Mat K, Mat D, double alpha)Distorts 2D points using fisheye model.static voidfisheye_distortPoints​(Mat undistorted, Mat distorted, Mat Kundistorted, Mat K, Mat D)Overload of distortPoints function to handle cases when undistorted points are got with non-identity camera matrix, e.g.static voidfisheye_distortPoints​(Mat undistorted, Mat distorted, Mat Kundistorted, Mat K, Mat D, double alpha)Overload of distortPoints function to handle cases when undistorted points are got with non-identity camera matrix, e.g.static voidfisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P)Estimates new camera intrinsic matrix for undistortion or rectification.static voidfisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance)Estimates new camera intrinsic matrix for undistortion or rectification.static voidfisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance, Size new_size)Estimates new camera intrinsic matrix for undistortion or rectification.static voidfisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance, Size new_size, double fov_scale)Estimates new camera intrinsic matrix for undistortion or rectification.static voidfisheye_projectPoints​(Mat objectPoints, Mat imagePoints, Mat rvec, Mat tvec, Mat K, Mat D)static voidfisheye_projectPoints​(Mat objectPoints, Mat imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha)static voidfisheye_projectPoints​(Mat objectPoints, Mat imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha, Mat jacobian)static booleanfisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)Finds an object pose from 3D-2D point correspondences for fisheye camera model.static booleanfisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)Finds an object pose from 3D-2D point correspondences for fisheye camera model.static booleanfisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags)Finds an object pose from 3D-2D point correspondences for fisheye camera model.static booleanfisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags, TermCriteria criteria)Finds an object pose from 3D-2D point correspondences for fisheye camera model.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static booleanfisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags, TermCriteria criteria)Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.static voidfisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D)Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints.static voidfisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R)Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints.static voidfisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R, Mat P)Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints.static voidfisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R, Mat P, TermCriteria criteria)Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints.static RotatedRectfitEllipse​(MatOfPoint2f points)Fits an ellipse around a set of 2D points.static RotatedRectfitEllipseAMS​(Mat points)Fits an ellipse around a set of 2D points.static RotatedRectfitEllipseDirect​(Mat points)Fits an ellipse around a set of 2D points.static voidfitLine​(Mat points, Mat line, int distType, double param, double reps, double aeps)Fits a line to a 2D or 3D point set.static MatgetAffineTransform​(MatOfPoint2f src, MatOfPoint2f dst)static voidgetClosestEllipsePoints​(RotatedRect ellipse_params, Mat points, Mat closest_pts)Compute for each 2d point the nearest 2d point located on a given ellipse.static MatgetDefaultNewCameraMatrix​(Mat cameraMatrix)Returns the default new camera matrix.static MatgetDefaultNewCameraMatrix​(Mat cameraMatrix, Size imgsize)Returns the default new camera matrix.static MatgetDefaultNewCameraMatrix​(Mat cameraMatrix, Size imgsize, boolean centerPrincipalPoint)Returns the default new camera matrix.static MatgetOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha)Returns the new camera intrinsic matrix based on the free scaling parameter.static MatgetOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize)Returns the new camera intrinsic matrix based on the free scaling parameter.static MatgetOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI)Returns the new camera intrinsic matrix based on the free scaling parameter.static MatgetOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI, boolean centerPrincipalPoint)Returns the new camera intrinsic matrix based on the free scaling parameter.static MatgetPerspectiveTransform​(Mat src, Mat dst)Calculates a perspective transform from four pairs of the corresponding points.static MatgetPerspectiveTransform​(Mat src, Mat dst, int solveMethod)Calculates a perspective transform from four pairs of the corresponding points.static MatgetRotationMatrix2D​(Point center, double angle, double scale)Calculates an affine matrix of 2D rotation.static voidHuMoments​(Moments m, Mat hu)static floatintersectConvexConvex​(Mat p1, Mat p2, Mat p12)Finds intersection of two convex polygonsstatic floatintersectConvexConvex​(Mat p1, Mat p2, Mat p12, boolean handleNested)Finds intersection of two convex polygonsstatic voidinvertAffineTransform​(Mat M, Mat iM)Inverts an affine transformation.static booleanisContourConvex​(MatOfPoint contour)Tests a contour convexity.static doublematchShapes​(Mat contour1, Mat contour2, int method, double parameter)Compares two shapes.static voidmatMulDeriv​(Mat A, Mat B, Mat dABdA, Mat dABdB)Computes partial derivatives of the matrix product for each multiplied matrix.static RotatedRectminAreaRect​(MatOfPoint2f points)Finds a rotated rectangle of the minimum area enclosing the input 2D point set.static voidminEnclosingCircle​(MatOfPoint2f points, Point center, float[] radius)Finds a circle of the minimum area enclosing a 2D point set.static doubleminEnclosingConvexPolygon​(Mat points, Mat polygon, int k)Finds a convex polygon of minimum area enclosing a 2D point set and returns its area.static doubleminEnclosingTriangle​(Mat points, Mat triangle)Finds a triangle of minimum area enclosing a 2D point set and returns its area.static Momentsmoments​(Mat array)Calculates all of the moments up to the third order of a polygon or rasterized shape.static Momentsmoments​(Mat array, boolean binaryImage)Calculates all of the moments up to the third order of a polygon or rasterized shape.static doublepointPolygonTest​(MatOfPoint2f contour, Point pt, boolean measureDist)Performs a point-in-contour test.static voidprojectPoints​(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints)Projects 3D points to an image plane.static voidprojectPoints​(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints, Mat jacobian)Projects 3D points to an image plane.static voidprojectPoints​(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints, Mat jacobian, double aspectRatio)Projects 3D points to an image plane.static voidprojectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt)static voidprojectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf)static voidprojectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc)static voidprojectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc, Mat dpdk)static voidprojectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc, Mat dpdk, Mat dpdo)static voidprojectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc, Mat dpdk, Mat dpdo, double aspectRatio)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp, Mat mask)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t)Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check.static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh, Mat mask)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh, Mat mask, Mat triangulatedPoints)static intrecoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, Mat mask)Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check.static intrecoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t)Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using chirality check.static intrecoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method)Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using chirality check.static intrecoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method, double prob)Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using chirality check.static intrecoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method, double prob, double threshold)Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using chirality check.static intrecoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method, double prob, double threshold, Mat mask)Recovers the relative camera rotation and the translation from corresponding points in two images from two different cameras, using chirality check.static voidRodrigues​(Mat src, Mat dst)Converts a rotation matrix to a rotation vector or vice versa.static voidRodrigues​(Mat src, Mat dst, Mat jacobian)Converts a rotation matrix to a rotation vector or vice versa.static introtatedRectangleIntersection​(RotatedRect rect1, RotatedRect rect2, Mat intersectingRegion)Finds out if there is any intersection between two rotated rectangles.static double[]RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ)Computes an RQ decomposition of 3x3 matrices.static double[]RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ, Mat Qx)Computes an RQ decomposition of 3x3 matrices.static double[]RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ, Mat Qx, Mat Qy)Computes an RQ decomposition of 3x3 matrices.static double[]RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ, Mat Qx, Mat Qy, Mat Qz)Computes an RQ decomposition of 3x3 matrices.static doublesampsonDistance​(Mat pt1, Mat pt2, Mat F)Calculates the Sampson Distance between two points.static intsolveP3P​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, int flags)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3 3D-2D point correspondences.static booleansolvePnP​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: { width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods: P3P methods (REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): need 4 input points to return a unique solution.static booleansolvePnP​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: { width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods: P3P methods (REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): need 4 input points to return a unique solution.static booleansolvePnP​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: { width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods: P3P methods (REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): need 4 input points to return a unique solution.static intsolvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences.static intsolvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences.static intsolvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences.static intsolvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags, Mat rvec)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences.static intsolvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags, Mat rvec, Mat tvec)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences.static intsolvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags, Mat rvec, Mat tvec, Mat reprojectionError)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags)Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches.static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, Mat inliers)static booleansolvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, Mat inliers, UsacParams params)static voidsolvePnPRefineLM​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.static voidsolvePnPRefineLM​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, TermCriteria criteria)Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.static voidsolvePnPRefineVVS​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.static voidsolvePnPRefineVVS​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, TermCriteria criteria)Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.static voidsolvePnPRefineVVS​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, TermCriteria criteria, double VVSlambda)Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution.static voidtriangulatePoints​(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat points4D)This function reconstructs 3-dimensional points (in homogeneous coordinates) by using their observations with a stereo camera.static voidundistortImagePoints​(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs)Compute undistorted image points positionstatic voidundistortImagePoints​(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, TermCriteria arg1)Compute undistorted image points positionstatic voidundistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs)Computes the ideal point coordinates from the observed point coordinates.static voidundistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R)Computes the ideal point coordinates from the observed point coordinates.static voidundistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P)Computes the ideal point coordinates from the observed point coordinates.static voidundistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P, TermCriteria criteria)Computes the ideal point coordinates from the observed point coordinates.
-
-
-
フィールドの詳細
-
LMEDS
public static final int LMEDS
- 関連項目:
- 定数フィールド値
-
RANSAC
public static final int RANSAC
- 関連項目:
- 定数フィールド値
-
RHO
public static final int RHO
- 関連項目:
- 定数フィールド値
-
USAC_DEFAULT
public static final int USAC_DEFAULT
- 関連項目:
- 定数フィールド値
-
USAC_PARALLEL
public static final int USAC_PARALLEL
- 関連項目:
- 定数フィールド値
-
USAC_FM_8PTS
public static final int USAC_FM_8PTS
- 関連項目:
- 定数フィールド値
-
USAC_FAST
public static final int USAC_FAST
- 関連項目:
- 定数フィールド値
-
USAC_ACCURATE
public static final int USAC_ACCURATE
- 関連項目:
- 定数フィールド値
-
USAC_PROSAC
public static final int USAC_PROSAC
- 関連項目:
- 定数フィールド値
-
USAC_MAGSAC
public static final int USAC_MAGSAC
- 関連項目:
- 定数フィールド値
-
FM_7POINT
public static final int FM_7POINT
- 関連項目:
- 定数フィールド値
-
FM_8POINT
public static final int FM_8POINT
- 関連項目:
- 定数フィールド値
-
FM_LMEDS
public static final int FM_LMEDS
- 関連項目:
- 定数フィールド値
-
FM_RANSAC
public static final int FM_RANSAC
- 関連項目:
- 定数フィールド値
-
DIST_USER
public static final int DIST_USER
- 関連項目:
- 定数フィールド値
-
DIST_L1
public static final int DIST_L1
- 関連項目:
- 定数フィールド値
-
DIST_L2
public static final int DIST_L2
- 関連項目:
- 定数フィールド値
-
DIST_C
public static final int DIST_C
- 関連項目:
- 定数フィールド値
-
DIST_L12
public static final int DIST_L12
- 関連項目:
- 定数フィールド値
-
DIST_FAIR
public static final int DIST_FAIR
- 関連項目:
- 定数フィールド値
-
DIST_WELSCH
public static final int DIST_WELSCH
- 関連項目:
- 定数フィールド値
-
DIST_HUBER
public static final int DIST_HUBER
- 関連項目:
- 定数フィールド値
-
LOCAL_OPTIM_NULL
public static final int LOCAL_OPTIM_NULL
- 関連項目:
- 定数フィールド値
-
LOCAL_OPTIM_INNER_LO
public static final int LOCAL_OPTIM_INNER_LO
- 関連項目:
- 定数フィールド値
-
LOCAL_OPTIM_INNER_AND_ITER_LO
public static final int LOCAL_OPTIM_INNER_AND_ITER_LO
- 関連項目:
- 定数フィールド値
-
LOCAL_OPTIM_GC
public static final int LOCAL_OPTIM_GC
- 関連項目:
- 定数フィールド値
-
LOCAL_OPTIM_SIGMA
public static final int LOCAL_OPTIM_SIGMA
- 関連項目:
- 定数フィールド値
-
MST_PRIM
public static final int MST_PRIM
- 関連項目:
- 定数フィールド値
-
MST_KRUSKAL
public static final int MST_KRUSKAL
- 関連項目:
- 定数フィールド値
-
MatrixType_AUTO
public static final int MatrixType_AUTO
- 関連項目:
- 定数フィールド値
-
MatrixType_DENSE
public static final int MatrixType_DENSE
- 関連項目:
- 定数フィールド値
-
MatrixType_SPARSE
public static final int MatrixType_SPARSE
- 関連項目:
- 定数フィールド値
-
NEIGH_FLANN_KNN
public static final int NEIGH_FLANN_KNN
- 関連項目:
- 定数フィールド値
-
NEIGH_GRID
public static final int NEIGH_GRID
- 関連項目:
- 定数フィールド値
-
NEIGH_FLANN_RADIUS
public static final int NEIGH_FLANN_RADIUS
- 関連項目:
- 定数フィールド値
-
NONE_POLISHER
public static final int NONE_POLISHER
- 関連項目:
- 定数フィールド値
-
LSQ_POLISHER
public static final int LSQ_POLISHER
- 関連項目:
- 定数フィールド値
-
MAGSAC
public static final int MAGSAC
- 関連項目:
- 定数フィールド値
-
COV_POLISHER
public static final int COV_POLISHER
- 関連項目:
- 定数フィールド値
-
INTERSECT_NONE
public static final int INTERSECT_NONE
- 関連項目:
- 定数フィールド値
-
INTERSECT_PARTIAL
public static final int INTERSECT_PARTIAL
- 関連項目:
- 定数フィールド値
-
INTERSECT_FULL
public static final int INTERSECT_FULL
- 関連項目:
- 定数フィールド値
-
SAC_METHOD_RANSAC
public static final int SAC_METHOD_RANSAC
- 関連項目:
- 定数フィールド値
-
SAC_MODEL_PLANE
public static final int SAC_MODEL_PLANE
- 関連項目:
- 定数フィールド値
-
SAC_MODEL_SPHERE
public static final int SAC_MODEL_SPHERE
- 関連項目:
- 定数フィールド値
-
SAMPLING_UNIFORM
public static final int SAMPLING_UNIFORM
- 関連項目:
- 定数フィールド値
-
SAMPLING_PROGRESSIVE_NAPSAC
public static final int SAMPLING_PROGRESSIVE_NAPSAC
- 関連項目:
- 定数フィールド値
-
SAMPLING_NAPSAC
public static final int SAMPLING_NAPSAC
- 関連項目:
- 定数フィールド値
-
SAMPLING_PROSAC
public static final int SAMPLING_PROSAC
- 関連項目:
- 定数フィールド値
-
SCORE_METHOD_RANSAC
public static final int SCORE_METHOD_RANSAC
- 関連項目:
- 定数フィールド値
-
SCORE_METHOD_MSAC
public static final int SCORE_METHOD_MSAC
- 関連項目:
- 定数フィールド値
-
SCORE_METHOD_MAGSAC
public static final int SCORE_METHOD_MAGSAC
- 関連項目:
- 定数フィールド値
-
SCORE_METHOD_LMEDS
public static final int SCORE_METHOD_LMEDS
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_ITERATIVE
public static final int SOLVEPNP_ITERATIVE
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_EPNP
public static final int SOLVEPNP_EPNP
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_P3P
public static final int SOLVEPNP_P3P
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_AP3P
public static final int SOLVEPNP_AP3P
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_IPPE
public static final int SOLVEPNP_IPPE
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_IPPE_SQUARE
public static final int SOLVEPNP_IPPE_SQUARE
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_SQPNP
public static final int SOLVEPNP_SQPNP
- 関連項目:
- 定数フィールド値
-
SOLVEPNP_MAX_COUNT
public static final int SOLVEPNP_MAX_COUNT
- 関連項目:
- 定数フィールド値
-
VariableType_LINEAR
public static final int VariableType_LINEAR
- 関連項目:
- 定数フィールド値
-
VariableType_SO3
public static final int VariableType_SO3
- 関連項目:
- 定数フィールド値
-
VariableType_SE3
public static final int VariableType_SE3
- 関連項目:
- 定数フィールド値
-
-
メソッドの詳細
-
Rodrigues
public static void Rodrigues​(Mat src, Mat dst, Mat jacobian)
Converts a rotation matrix to a rotation vector or vice versa.- 引数:
src- 入力の回転ベクトル (3x1 または 1x3) もしくは回転行列 (3x3)。dst- 出力の回転行列 (3x3) もしくは回転ベクトル (3x1 または 1x3)。入力に応じてそれぞれ対応する。jacobian- Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial derivatives of the output array components with respect to the input array components. \(\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos(\theta) I + (1- \cos{\theta} ) r r^T + \sin(\theta) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}\) Inverse transformation can be also done easily, since \(\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}\) A rotation vector is a convenient and most compact representation of a rotation matrix (since any rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry optimization procedures like REF: calibrateCamera, REF: stereoCalibrate, or REF: solvePnP . 覚え書き: More information about the computation of the derivative of a 3D rotation matrix with respect to its exponential coordinate can be found in:- A Compact Formula for the Derivative of a 3-D Rotation in Exponential Coordinates, Guillermo Gallego, Anthony J. Yezzi CITE: Gallego2014ACF
- A tutorial on SE(3) transformation parameterizations and on-manifold optimization, Jose-Luis Blanco CITE: blanco2010tutorial
- Lie Groups for 2D and 3D Transformation, Ethan Eade CITE: Eade17
- A micro Lie theory for state estimation in robotics, Joan Solà, Jérémie Deray, Dinesh Atchuthan CITE: Sol2018AML
-
Rodrigues
public static void Rodrigues​(Mat src, Mat dst)
Converts a rotation matrix to a rotation vector or vice versa.- 引数:
src- 入力の回転ベクトル (3x1 または 1x3) もしくは回転行列 (3x3)。dst- Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively. derivatives of the output array components with respect to the input array components. \(\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos(\theta) I + (1- \cos{\theta} ) r r^T + \sin(\theta) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}\) Inverse transformation can be also done easily, since \(\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}\) A rotation vector is a convenient and most compact representation of a rotation matrix (since any rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry optimization procedures like REF: calibrateCamera, REF: stereoCalibrate, or REF: solvePnP . 覚え書き: More information about the computation of the derivative of a 3D rotation matrix with respect to its exponential coordinate can be found in:- A Compact Formula for the Derivative of a 3-D Rotation in Exponential Coordinates, Guillermo Gallego, Anthony J. Yezzi CITE: Gallego2014ACF
- A tutorial on SE(3) transformation parameterizations and on-manifold optimization, Jose-Luis Blanco CITE: blanco2010tutorial
- Lie Groups for 2D and 3D Transformation, Ethan Eade CITE: Eade17
- A micro Lie theory for state estimation in robotics, Joan Solà, Jérémie Deray, Dinesh Atchuthan CITE: Sol2018AML
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters, double confidence)
Finds a perspective transformation between two planes.- 引数:
srcPoints- 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。dstPoints- 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。method- Method used to compute a homography matrix. The following methods are possible:- 0 - すべての点を使用する通常の手法、すなわち最小二乗法
- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
- REF: RHO - PROSACベースのロバスト推定法
ransacReprojThreshold- 点ペアをインライアとして扱うために許容される最大の再投影誤差 (RANSAC法およびRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints をピクセル単位で計測している場合、通常はこのパラメータを 1 から 10 の範囲のどこかに設定するのが妥当である。mask- ロバスト推定法 ( RANSAC または LMeDS ) によって設定される省略可能な出力マスク。入力マスクの値は無視される点に注意。maxIters- RANSACの最大反復回数。confidence- 信頼度。0 から 1 の間の値。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) のように、逆投影誤差 \(\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\) を最小化する。パラメータ method がデフォルト値 0 に設定されている場合、関数は単純な最小二乗法によって初期ホモグラフィ推定値を計算するためにすべての点ペアを使用する。しかし、すべての点ペア ( \(srcPoints_i\), \(dstPoints_i\) ) が剛体の透視変換に適合しない (すなわちいくつかのアウトライアが存在する) 場合、この初期推定値は不正確になる。この場合、3 つのロバスト推定法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点ペアの多数の異なるランダムなサブセット (各 4 ペアずつで、共線なペアは破棄される) を試し、このサブセットと単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質/良さ (RANSAC ではインライアの数、LMeDS では再投影誤差の最小メディアン) を計算する。次に、最良のサブセットを用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。手法がロバストであるか否かにかかわらず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法を用いて (ロバスト推定法の場合はインライアのみを使用して) さらに洗練される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく機能する。最後に、アウトライアが存在せずノイズがかなり小さい場合は、デフォルトの手法 (method=0) を使用する。この関数は、初期の内部行列および外部行列を求めるために使用される。ホモグラフィ行列はスケールを除いて決定される。\(h_{33}\) が非ゼロの場合、行列は \(h_{33}=1\) となるように正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform- 戻り値:
- 自動生成
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters)
Finds a perspective transformation between two planes.- 引数:
srcPoints- 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。dstPoints- 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。method- Method used to compute a homography matrix. The following methods are possible:- 0 - すべての点を使用する通常の手法、すなわち最小二乗法
- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
- REF: RHO - PROSACベースのロバスト推定法
ransacReprojThreshold- 点ペアをインライアとして扱うために許容される最大の再投影誤差 (RANSAC法およびRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints をピクセル単位で計測している場合、通常はこのパラメータを 1 から 10 の範囲のどこかに設定するのが妥当である。mask- ロバスト推定法 ( RANSAC または LMeDS ) によって設定される省略可能な出力マスク。入力マスクの値は無視される点に注意。maxIters- RANSACの最大反復回数。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) のように、逆投影誤差 \(\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\) を最小化する。パラメータ method がデフォルト値 0 に設定されている場合、関数は単純な最小二乗法によって初期ホモグラフィ推定値を計算するためにすべての点ペアを使用する。しかし、すべての点ペア ( \(srcPoints_i\), \(dstPoints_i\) ) が剛体の透視変換に適合しない (すなわちいくつかのアウトライアが存在する) 場合、この初期推定値は不正確になる。この場合、3 つのロバスト推定法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点ペアの多数の異なるランダムなサブセット (各 4 ペアずつで、共線なペアは破棄される) を試し、このサブセットと単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質/良さ (RANSAC ではインライアの数、LMeDS では再投影誤差の最小メディアン) を計算する。次に、最良のサブセットを用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。手法がロバストであるか否かにかかわらず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法を用いて (ロバスト推定法の場合はインライアのみを使用して) さらに洗練される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく機能する。最後に、アウトライアが存在せずノイズがかなり小さい場合は、デフォルトの手法 (method=0) を使用する。この関数は、初期の内部行列および外部行列を求めるために使用される。ホモグラフィ行列はスケールを除いて決定される。\(h_{33}\) が非ゼロの場合、行列は \(h_{33}=1\) となるように正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform- 戻り値:
- 自動生成
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask)
Finds a perspective transformation between two planes.- 引数:
srcPoints- 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。dstPoints- 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。method- Method used to compute a homography matrix. The following methods are possible:- 0 - すべての点を使用する通常の手法、すなわち最小二乗法
- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
- REF: RHO - PROSACベースのロバスト推定法
ransacReprojThreshold- 点ペアをインライアとして扱うために許容される最大の再投影誤差 (RANSAC法およびRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints をピクセル単位で計測している場合、通常はこのパラメータを 1 から 10 の範囲のどこかに設定するのが妥当である。mask- ロバスト推定法 ( RANSAC または LMeDS ) によって設定される省略可能な出力マスク。入力マスクの値は無視される点に注意。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) のように、逆投影誤差 \(\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\) を最小化する。パラメータ method がデフォルト値 0 に設定されている場合、関数は単純な最小二乗法によって初期ホモグラフィ推定値を計算するためにすべての点ペアを使用する。しかし、すべての点ペア ( \(srcPoints_i\), \(dstPoints_i\) ) が剛体の透視変換に適合しない (すなわちいくつかのアウトライアが存在する) 場合、この初期推定値は不正確になる。この場合、3 つのロバスト推定法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点ペアの多数の異なるランダムなサブセット (各 4 ペアずつで、共線なペアは破棄される) を試し、このサブセットと単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質/良さ (RANSAC ではインライアの数、LMeDS では再投影誤差の最小メディアン) を計算する。次に、最良のサブセットを用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。手法がロバストであるか否かにかかわらず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法を用いて (ロバスト推定法の場合はインライアのみを使用して) さらに洗練される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく機能する。最後に、アウトライアが存在せずノイズがかなり小さい場合は、デフォルトの手法 (method=0) を使用する。この関数は、初期の内部行列および外部行列を求めるために使用される。ホモグラフィ行列はスケールを除いて決定される。\(h_{33}\) が非ゼロの場合、行列は \(h_{33}=1\) となるように正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform- 戻り値:
- 自動生成
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold)
Finds a perspective transformation between two planes.- 引数:
srcPoints- 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。dstPoints- 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。method- Method used to compute a homography matrix. The following methods are possible:- 0 - すべての点を使用する通常の手法、すなわち最小二乗法
- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
- REF: RHO - PROSACベースのロバスト推定法
ransacReprojThreshold- 点のペアをインライアとして扱うために許容される再投影誤差の最大値(RANSAC法とRHO法でのみ使用される)。すなわち、\(\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} \cdot \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\) であれば、点 \(i\) はアウトライアとみなされる。srcPoints と dstPoints がピクセル単位で計測されている場合、この引数は通常 1 から 10 の範囲に設定するのが妥当である。mask の値は無視される。この関数は、ソース平面とデスティネーション平面の間の透視変換 \(H\) を求めて返す: \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) これは、逆投影誤差 \(\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\) を最小化するように行われる。引数 method がデフォルト値の 0 に設定されている場合、この関数はすべての点のペアを用いて、単純な最小二乗法によりホモグラフィの初期推定値を計算する。ただし、すべての点のペア( \(srcPoints_i\), \(dstPoints_i\) )が剛体的な透視変換に適合しない場合(すなわち、いくつかのアウトライアが存在する場合)、この初期推定値は不正確になる。この場合、3つのロバストな手法のいずれかを使用できる。RANSAC、LMeDS、RHO の各手法は、対応する点のペアのさまざまなランダムな部分集合(それぞれ4組ずつで、共線なペアは除外される)を多数試行し、その部分集合と単純な最小二乗アルゴリズムを用いてホモグラフィ行列を推定し、計算されたホモグラフィの品質・良さ(RANSAC の場合はインライアの数、LMeDS の場合は再投影誤差の最小中央値)を計算する。次に、最良の部分集合を用いてホモグラフィ行列の初期推定値とインライア/アウトライアのマスクを生成する。ロバストか否かを問わず、計算されたホモグラフィ行列は、再投影誤差をさらに低減するために Levenberg-Marquardt 法により(ロバストな手法の場合はインライアのみを用いて)さらに精緻化される。RANSAC 法と RHO 法は実質的に任意の比率のアウトライアを扱えるが、インライアとアウトライアを区別するためのしきい値を必要とする。LMeDS 法はしきい値を必要としないが、インライアが 50% を超える場合にのみ正しく動作する。最後に、アウトライアが存在せずノイズが比較的小さい場合は、デフォルトの手法(method=0)を使用する。この関数は内部・外部パラメータ行列の初期値を求めるために使用される。ホモグラフィ行列はスケール倍の不定性をもって決定される。\(h_{33}\) が非ゼロの場合、\(h_{33}=1\) となるように行列が正規化される。覚え書き: \(H\) 行列を推定できない場合は、常に空の行列が返される。SEE: getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, perspectiveTransform- 戻り値:
- 自動生成
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method)
Finds a perspective transformation between two planes.- 引数:
srcPoints- 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。dstPoints- 変換先の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。method- Method used to compute a homography matrix. The following methods are possible:- 0 - すべての点を使用する通常の手法、すなわち最小二乗法
- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
- REF: RHO - PROSACベースのロバスト推定法
- 戻り値:
- 自動生成
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints)
Finds a perspective transformation between two planes.- 引数:
srcPoints- 元の平面上の点の座標。型 CV_32FC2 の行列または vector<Point2f> 。dstPoints- Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or a vector<Point2f> .- 0 - すべての点を使用する通常の手法、すなわち最小二乗法
- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン(Least-Median)によるロバスト推定法
- REF: RHO - PROSACベースのロバスト推定法
- 戻り値:
- 自動生成
-
findHomography
public static Mat findHomography​(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, Mat mask, UsacParams params)
-
RQDecomp3x3
public static double[] RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ, Mat Qx, Mat Qy, Mat Qz)
Computes an RQ decomposition of 3x3 matrices.- 引数:
src- 3x3 の入力行列。mtxR- 出力される 3x3 の上三角行列。mtxQ- 出力される 3x3 の直交行列。Qx- 省略可能。出力される x 軸まわりの 3x3 回転行列。Qy- 省略可能。出力される y 軸まわりの 3x3 回転行列。Qz- 省略可能。出力される z 軸まわりの 3x3 回転行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。- 戻り値:
- 自動生成
-
RQDecomp3x3
public static double[] RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ, Mat Qx, Mat Qy)
Computes an RQ decomposition of 3x3 matrices.- 引数:
src- 3x3 の入力行列。mtxR- 出力される 3x3 の上三角行列。mtxQ- 出力される 3x3 の直交行列。Qx- 省略可能。出力される x 軸まわりの 3x3 回転行列。Qy- 省略可能。出力される y 軸まわりの 3x3 回転行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。- 戻り値:
- 自動生成
-
RQDecomp3x3
public static double[] RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ, Mat Qx)
Computes an RQ decomposition of 3x3 matrices.- 引数:
src- 3x3 の入力行列。mtxR- 出力される 3x3 の上三角行列。mtxQ- 出力される 3x3 の直交行列。Qx- 省略可能。出力される x 軸まわりの 3x3 回転行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。- 戻り値:
- 自動生成
-
RQDecomp3x3
public static double[] RQDecomp3x3​(Mat src, Mat mtxR, Mat mtxQ)
Computes an RQ decomposition of 3x3 matrices.- 引数:
src- 3x3 の入力行列。mtxR- 出力される 3x3 の上三角行列。mtxQ- 出力される 3x3 の直交行列。この関数は与えられた回転を用いて RQ 分解を計算する。この関数は #decomposeProjectionMatrix の内部で、射影行列の左側 3x3 部分行列をカメラ行列と回転行列に分解するために使用される。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる度単位の3つのオイラー角(戻り値として)を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。- 戻り値:
- 自動生成
-
decomposeProjectionMatrix
public static void decomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY, Mat rotMatrixZ, Mat eulerAngles)
Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.- 引数:
projMatrix- 3x4 の入力射影行列 P。cameraMatrix- 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。rotMatrix- 出力される 3x3 の外部回転行列 R。transVect- 出力される 4x1 の並進ベクトル T。rotMatrixX- 省略可能な x 軸まわりの 3x3 回転行列。rotMatrixY- 省略可能な y 軸まわりの 3x3 回転行列。rotMatrixZ- 省略可能な z 軸まわりの 3x3 回転行列。eulerAngles- 省略可能。度単位の3つの回転オイラー角を含む3要素ベクトル。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
-
decomposeProjectionMatrix
public static void decomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY, Mat rotMatrixZ)
Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.- 引数:
projMatrix- 3x4 の入力射影行列 P。cameraMatrix- 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。rotMatrix- 出力される 3x3 の外部回転行列 R。transVect- 出力される 4x1 の並進ベクトル T。rotMatrixX- 省略可能な x 軸まわりの 3x3 回転行列。rotMatrixY- 省略可能な y 軸まわりの 3x3 回転行列。rotMatrixZ- 省略可能な z 軸まわりの 3x3 回転行列。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
-
decomposeProjectionMatrix
public static void decomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX, Mat rotMatrixY)
Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.- 引数:
projMatrix- 3x4 の入力射影行列 P。cameraMatrix- 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。rotMatrix- 出力される 3x3 の外部回転行列 R。transVect- 出力される 4x1 の並進ベクトル T。rotMatrixX- 省略可能な x 軸まわりの 3x3 回転行列。rotMatrixY- 省略可能な y 軸まわりの 3x3 回転行列。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
-
decomposeProjectionMatrix
public static void decomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect, Mat rotMatrixX)
Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.- 引数:
projMatrix- 3x4 の入力射影行列 P。cameraMatrix- 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。rotMatrix- 出力される 3x3 の外部回転行列 R。transVect- 出力される 4x1 の並進ベクトル T。rotMatrixX- 省略可能な x 軸まわりの 3x3 回転行列。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
-
decomposeProjectionMatrix
public static void decomposeProjectionMatrix​(Mat projMatrix, Mat cameraMatrix, Mat rotMatrix, Mat transVect)
Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.- 引数:
projMatrix- 3x4 の入力射影行列 P。cameraMatrix- 出力される 3x3 のカメラ内部行列 \(\cameramatrix{A}\)。rotMatrix- 出力される 3x3 の外部回転行列 R。transVect- 出力される 4x1 の並進ベクトル T。度単位。この関数は射影行列をキャリブレーション行列と回転行列、およびカメラの位置に分解する。省略可能で、各軸につき1つずつ計3つの回転行列と、OpenGL で利用できる3つのオイラー角を返す。なお、3つの主軸まわりの回転の系列で、オブジェクトを同じ姿勢にするものは常に複数存在することに注意せよ。例えば CITE: Slabaugh を参照。返される3つの回転行列および対応する3つのオイラー角は、可能な解のうちの1つにすぎない。この関数は #RQDecomp3x3 に基づいている。
-
matMulDeriv
public static void matMulDeriv​(Mat A, Mat B, Mat dABdA, Mat dABdB)
Computes partial derivatives of the matrix product for each multiplied matrix.- 引数:
A- 乗算される第1の行列。B- 乗算される第2の行列。dABdA- 出力される第1の微分行列 d(A\*B)/dA。サイズは \(\texttt{A.rows*B.cols} \times {A.rows*A.cols}\)。dABdB- 出力される第2の微分行列 d(A\*B)/dB。サイズは \(\texttt{A.rows*B.cols} \times {B.rows*B.cols}\)。この関数は、行列積 \(A*B\) の各要素を、2つの入力行列それぞれの各要素について偏微分したものを計算する。この関数は #stereoCalibrate でヤコビ行列を計算するために使用されるが、同様の最適化関数であれば他のものにも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1, Mat dt3dr2, Mat dt3dt2)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力dr3dr2- 省略可能。rvec2 に関する rvec3 の微分の出力dr3dt2- 省略可能。tvec2 に関する rvec3 の微分の出力dt3dr1- 省略可能。rvec1 に関する tvec3 の微分の出力dt3dt1- 省略可能。tvec1 に関する tvec3 の微分の出力dt3dr2- 省略可能。rvec2 に関する tvec3 の微分の出力dt3dt2- 省略可能。tvec2 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1, Mat dt3dr2)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力dr3dr2- 省略可能。rvec2 に関する rvec3 の微分の出力dr3dt2- 省略可能。tvec2 に関する rvec3 の微分の出力dt3dr1- 省略可能。rvec1 に関する tvec3 の微分の出力dt3dt1- 省略可能。tvec1 に関する tvec3 の微分の出力dt3dr2- 省略可能。rvec2 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1, Mat dt3dt1)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力dr3dr2- 省略可能。rvec2 に関する rvec3 の微分の出力dr3dt2- 省略可能。tvec2 に関する rvec3 の微分の出力dt3dr1- 省略可能。rvec1 に関する tvec3 の微分の出力dt3dt1- 省略可能。tvec1 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2, Mat dt3dr1)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力dr3dr2- 省略可能。rvec2 に関する rvec3 の微分の出力dr3dt2- 省略可能。tvec2 に関する rvec3 の微分の出力dt3dr1- 省略可能。rvec1 に関する tvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2, Mat dr3dt2)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力dr3dr2- 省略可能。rvec2 に関する rvec3 の微分の出力dr3dt2- 省略可能。tvec2 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1, Mat dr3dr2)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力dr3dr2- 省略可能。rvec2 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1, Mat dr3dt1)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力dr3dt1- 省略可能。tvec1 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3, Mat dr3dr1)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。dr3dr1- 省略可能。rvec1 に関する rvec3 の微分の出力。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
composeRT
public static void composeRT​(Mat rvec1, Mat tvec1, Mat rvec2, Mat tvec2, Mat rvec3, Mat tvec3)
Combines two rotation-and-shift transformations.- 引数:
rvec1- 第1の回転ベクトル。tvec1- 第1の並進ベクトル。rvec2- 第2の回転ベクトル。tvec2- 第2の並進ベクトル。rvec3- 合成結果の出力回転ベクトル。tvec3- 合成結果の出力並進ベクトル。これらの関数は次を計算する: \(\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\) ここで \(\mathrm{rodrigues}\) は回転ベクトルから回転行列への変換を表し、\(\mathrm{rodrigues}^{-1}\) はその逆変換を表す。詳細は #Rodrigues を参照。また、これらの関数は出力ベクトルの入力ベクトルに関する微分を計算できる(#matMulDeriv を参照)。これらの関数は #stereoCalibrate の内部で使用されるが、行列乗算を含む関数を最適化するために Levenberg-Marquardt や他の勾配ベースのソルバを使用する独自のコードでも使用できる。
-
projectPoints
public static void projectPoints​(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints, Mat jacobian, double aspectRatio)
Projects 3D points to an image plane. The function computes the 2D 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 REF: calibrateCamera, REF: solvePnP, and REF: stereoCalibrate. The function itself can also be used to compute a re-projection error, given the current intrinsic and extrinsic parameters. 覚え書き: Coordinate Systems:- 入力 (
objectPoints): ワールド座標フレームにおける3D点。 - 出力 (
imagePoints): 歪みを適用した、画像平面のピクセル座標での2D投影。座標 \((u, v)\) は画像の左上隅からピクセル単位で測定される。
- 引数:
objectPoints- ワールド座標系で表されたオブジェクト点の配列。3xN/Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネル(あるいは vector<Point3f> )であり、N はそのビューにおける点の数。rvec- 回転ベクトル(REF: Rodrigues)。tvec とともに、ワールド座標系からカメラ座標系への基底変換を行う。詳細は REF: calibrateCamera を参照。tvec- 並進ベクトル。上記の引数説明を参照。cameraMatrix- カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが空の場合、歪み係数はすべてゼロと仮定される。imagePoints- ピクセル座標での画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。jacobian- 省略可能。出力される 2Nx(10+<numDistCoeffs>) のヤコビ行列で、画像点を、回転ベクトル・並進ベクトルの各成分、焦点距離、主点の座標、および歪み係数で微分したもの。旧インターフェースでは、ヤコビアンの各成分は異なる出力引数を介して返される。aspectRatio- 省略可能な「固定アスペクト比」パラメータ。このパラメータが0でない場合、関数はアスペクト比 (\(f_x / f_y\)) が固定されているものとみなし、それに応じてヤコビ行列を調整する。覚え書き: rvec = tvec = \([0, 0, 0]\) を設定する、cameraMatrix を3x3の単位行列に設定する、あるいはゼロの歪み係数を渡すことで、この関数のさまざまな有用な部分ケースを得られる。これは、疎な点の集合に対して歪んだ座標を計算したり、理想的な歪みゼロの設定で透視変換を適用(およびその導関数を計算)したりできることを意味する。
- 入力 (
-
projectPoints
public static void projectPoints​(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints, Mat jacobian)
Projects 3D points to an image plane. The function computes the 2D 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 REF: calibrateCamera, REF: solvePnP, and REF: stereoCalibrate. The function itself can also be used to compute a re-projection error, given the current intrinsic and extrinsic parameters. 覚え書き: Coordinate Systems:- 入力 (
objectPoints): ワールド座標フレームにおける3D点。 - 出力 (
imagePoints): 歪みを適用した、画像平面のピクセル座標での2D投影。座標 \((u, v)\) は画像の左上隅からピクセル単位で測定される。
- 引数:
objectPoints- ワールド座標系で表されたオブジェクト点の配列。3xN/Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネル(あるいは vector<Point3f> )であり、N はそのビューにおける点の数。rvec- 回転ベクトル(REF: Rodrigues)。tvec とともに、ワールド座標系からカメラ座標系への基底変換を行う。詳細は REF: calibrateCamera を参照。tvec- 並進ベクトル。上記の引数説明を参照。cameraMatrix- カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが空の場合、歪み係数はすべてゼロと仮定される。imagePoints- ピクセル座標での画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。jacobian- 省略可能な出力。回転ベクトル、並進ベクトル、焦点距離、主点の座標、歪み係数の各成分に関する画像点の導関数からなる 2Nx(10+<numDistCoeffs>) のヤコビ行列。旧インターフェースでは、ヤコビ行列の異なる成分は異なる出力パラメータを介して返される。関数はアスペクト比 (\(f_x / f_y\)) が固定されているものとみなし、それに応じてヤコビ行列を調整する。覚え書き: rvec = tvec = \([0, 0, 0]\) を設定する、cameraMatrix を3x3の単位行列に設定する、あるいはゼロの歪み係数を渡すことで、この関数のさまざまな有用な部分ケースを得られる。これは、疎な点の集合に対して歪んだ座標を計算したり、理想的な歪みゼロの設定で透視変換を適用(およびその導関数を計算)したりできることを意味する。
- 入力 (
-
projectPoints
public static void projectPoints​(MatOfPoint3f objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, MatOfDouble distCoeffs, MatOfPoint2f imagePoints)
Projects 3D points to an image plane. The function computes the 2D 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 REF: calibrateCamera, REF: solvePnP, and REF: stereoCalibrate. The function itself can also be used to compute a re-projection error, given the current intrinsic and extrinsic parameters. 覚え書き: Coordinate Systems:- 入力 (
objectPoints): ワールド座標フレームにおける3D点。 - 出力 (
imagePoints): 歪みを適用した、画像平面のピクセル座標での2D投影。座標 \((u, v)\) は画像の左上隅からピクセル単位で測定される。
- 引数:
objectPoints- ワールド座標系で表されたオブジェクト点の配列。3xN/Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネル(あるいは vector<Point3f> )であり、N はそのビューにおける点の数。rvec- 回転ベクトル(REF: Rodrigues)。tvec とともに、ワールド座標系からカメラ座標系への基底変換を行う。詳細は REF: calibrateCamera を参照。tvec- 並進ベクトル。上記の引数説明を参照。cameraMatrix- カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが空の場合、歪み係数はすべてゼロと仮定される。imagePoints- ピクセル座標での画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。回転ベクトル、並進ベクトル、焦点距離、主点の座標、歪み係数の各成分に関する点の導関数。旧インターフェースでは、ヤコビ行列の異なる成分は異なる出力パラメータを介して返される。関数はアスペクト比 (\(f_x / f_y\)) が固定されているものとみなし、それに応じてヤコビ行列を調整する。覚え書き: rvec = tvec = \([0, 0, 0]\) を設定する、cameraMatrix を3x3の単位行列に設定する、あるいはゼロの歪み係数を渡すことで、この関数のさまざまな有用な部分ケースを得られる。これは、疎な点の集合に対して歪んだ座標を計算したり、理想的な歪みゼロの設定で透視変換を適用(およびその導関数を計算)したりできることを意味する。
- 入力 (
-
projectPointsSepJ
public static void projectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc, Mat dpdk, Mat dpdo, double aspectRatio)
-
projectPointsSepJ
public static void projectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc, Mat dpdk, Mat dpdo)
-
projectPointsSepJ
public static void projectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc, Mat dpdk)
-
projectPointsSepJ
public static void projectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf, Mat dpdc)
-
projectPointsSepJ
public static void projectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt, Mat dpdf)
-
projectPointsSepJ
public static void projectPointsSepJ​(Mat objectPoints, Mat rvec, Mat tvec, Mat cameraMatrix, Mat distCoeffs, Mat imagePoints, Mat dpdr, Mat dpdt)
-
solvePnP
public static boolean solvePnP​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: { width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- Method for solving a PnP problem: see REF: calib3d_solvePnP_flags More information about Perspective-n-Points is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE 法で
useExtrinsicGuess=trueの場合、最小点数は3である(3点で姿勢を計算するには十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。何らかの解が見つかった場合、関数は true を返す。解の品質評価はユーザのコードの責任である。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
- 戻り値:
- 自動生成
-
-
solvePnP
public static boolean solvePnP​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: { width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。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. More information about Perspective-n-Points is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE 法で
useExtrinsicGuess=trueの場合、最小点数は3である(3点で姿勢を計算するには十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。何らかの解が見つかった場合、関数は true を返す。解の品質評価はユーザのコードの責任である。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
- 戻り値:
- 自動生成
-
-
solvePnP
public static boolean solvePnP​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences: { width=50% } SEE: REF: calib3d_solvePnP This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- Output translation vector. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. More information about Perspective-n-Points is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE 法で
useExtrinsicGuess=trueの場合、最小点数は3である(3点で姿勢を計算するには十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。何らかの解が見つかった場合、関数は true を返す。解の品質評価はユーザのコードの責任である。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- アルゴリズムが有用な結果を生成する確率。inliers- objectPoints と imagePoints 内のインライアのインデックスを格納する出力ベクトル。flags- Method for solving a PnP problem (see REF: solvePnP ). The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- アルゴリズムが有用な結果を生成する確率。inliers- Output vector that contains indices of inliers in objectPoints and imagePoints . The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- The probability that the algorithm produces a useful result. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。iterationsCount- 反復回数。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. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- REF: SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似値として使用し、さらにそれらを最適化する。iterationsCount- Number of iterations. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- Parameter used for REF: 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. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences using the RANSAC scheme to deal with bad matches. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- Output translation vector. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. is the maximum allowed distance between the observed and computed point projections to consider it an inlier. The function estimates an object pose given a set of object points, their corresponding image projections, as well as the camera intrinsic 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 REF: projectPoints ) objectPoints. The use of RANSAC makes the function resistant to outliers. 覚え書き:- オブジェクト検出に solvePnPRansac を使用する方法の例は REF: tutorial_real_time_pose を参照。
-
The default method used to estimate the camera pose for the Minimal Sample Sets step
is #SOLVEPNP_EPNP. Exceptions are:
- #SOLVEPNP_P3P または #SOLVEPNP_AP3P を選択した場合、これらのメソッドが使用される。
- 入力点の数が4に等しい場合、#SOLVEPNP_P3P が使用される。
- すべてのインライアを使用してカメラ姿勢を推定するために使用されるメソッドは、flags 引数によって定義される。ただし、flags が #SOLVEPNP_P3P または #SOLVEPNP_AP3P に等しい場合を除く。その場合は、代わりに #SOLVEPNP_EPNP メソッドが使用される。
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, Mat inliers, UsacParams params)
-
solvePnPRansac
public static boolean solvePnPRansac​(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, Mat inliers)
-
solveP3P
public static int solveP3P​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, int flags)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。3x3 1チャンネルまたは 1x3/3x1 3チャンネル。vector<Point3f> もここに渡すことができる。imagePoints- 対応する画像点の配列。3x2 1チャンネルまたは 1x3/3x1 2チャンネル。vector<Point2f> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。P3P問題には最大4つの解がある。tvecs- 出力並進ベクトル。flags- Method for solving a P3P problem:- REF: SOLVEPNP_P3P メソッドは、Ding, Y., Yang, J., Larsson, V., Olsson, C., & Åstrom, K. の論文 "Revisiting the P3P Problem" (CITE: ding2023revisiting) に基づく。
- REF: SOLVEPNP_AP3P メソッドは、T. Ke と S. Roumeliotis の論文 "An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (CITE: Ke17) に基づく。
- 戻り値:
- 自動生成
-
solvePnPRefineLM
public static void solvePnPRefineLM​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, TermCriteria criteria)
Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。tvec- 入力/出力並進ベクトル。入力値は初期解として使用される。criteria- Levenberg-Marquardt反復アルゴリズムを停止する基準。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、Levenberg-Marquardt反復最小化 CITE: Madsen04 CITE: Eade13 プロセスに従って、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
-
solvePnPRefineLM
public static void solvePnPRefineLM​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。tvec- 入力/出力並進ベクトル。入力値は初期解として使用される。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、Levenberg-Marquardt反復最小化 CITE: Madsen04 CITE: Eade13 プロセスに従って、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
-
solvePnPRefineVVS
public static void solvePnPRefineVVS​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, TermCriteria criteria, double VVSlambda)
Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。tvec- 入力/出力並進ベクトル。入力値は初期解として使用される。criteria- Levenberg-Marquardt反復アルゴリズムを停止する基準。VVSlambda- 仮想視覚サーボ制御則のゲイン。減衰ガウス・ニュートン定式化における \(\alpha\) ゲインに相当する。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、仮想視覚サーボ (VVS) CITE: Chaumette06 CITE: Marchand16 方式を用いて、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
-
solvePnPRefineVVS
public static void solvePnPRefineVVS​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, TermCriteria criteria)
Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。tvec- 入力/出力並進ベクトル。入力値は初期解として使用される。criteria- Levenberg-Marquardt反復アルゴリズムを停止する基準。減衰ガウス・ニュートン定式化におけるゲイン。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、仮想視覚サーボ (VVS) CITE: Chaumette06 CITE: Marchand16 方式を用いて、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
-
solvePnPRefineVVS
public static void solvePnPRefineVVS​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
Refine a pose (the translation and the rotation that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame) from a 3D-2D point correspondences and starting from an initial solution. SEE: REF: calib3d_solvePnP- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvec- 入力/出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。入力値は初期解として使用される。tvec- 入力/出力並進ベクトル。入力値は初期解として使用される。減衰ガウス・ニュートン定式化におけるゲイン。この関数は、少なくとも3つのオブジェクト点、それらに対応する画像投影、回転ベクトルと並進ベクトルの初期解、ならびにカメラ内部行列と歪み係数が与えられたとき、オブジェクト姿勢を精緻化する。関数は、仮想視覚サーボ (VVS) CITE: Chaumette06 CITE: Marchand16 方式を用いて、回転ベクトルと並進ベクトルに関する投影誤差を最小化する。
-
solvePnPGeneric
public static int solvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags, Mat rvec, Mat tvec, Mat reprojectionError)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:- P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
- REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。tvecs- 出力並進ベクトルのベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照rvec- flag が REF: SOLVEPNP_ITERATIVE で useExtrinsicGuess が true に設定されている場合に、反復的なPnP精緻化アルゴリズムを初期化するために使用される回転ベクトル。tvec- flag が REF: SOLVEPNP_ITERATIVE で useExtrinsicGuess が true に設定されている場合に、反復的なPnP精緻化アルゴリズムを初期化するために使用される並進ベクトル。reprojectionError- Optional vector of reprojection error, that is the RMS error (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE メソッドかつ
useExtrinsicGuess=trueの場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
solvePnPGeneric
public static int solvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags, Mat rvec, Mat tvec)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:- P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
- REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。tvecs- 出力並進ベクトルのベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照rvec- flag が REF: SOLVEPNP_ITERATIVE で useExtrinsicGuess が true に設定されている場合に、反復的なPnP精緻化アルゴリズムを初期化するために使用される回転ベクトル。tvec- Translation vector used to initialize an iterative PnP refinement algorithm, when flag is REF: SOLVEPNP_ITERATIVE and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE メソッドかつ
useExtrinsicGuess=trueの場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
solvePnPGeneric
public static int solvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags, Mat rvec)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:- P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
- REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。tvecs- 出力並進ベクトルのベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照rvec- Rotation vector used to initialize an iterative PnP refinement algorithm, when flag is REF: SOLVEPNP_ITERATIVE and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE メソッドかつ
useExtrinsicGuess=trueの場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
solvePnPGeneric
public static int solvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess, int flags)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:- P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
- REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。tvecs- 出力並進ベクトルのベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- Method for solving a PnP problem: see REF: calib3d_solvePnP_flags and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE メソッドかつ
useExtrinsicGuess=trueの場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
solvePnPGeneric
public static int solvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs, boolean useExtrinsicGuess)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:- P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
- REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。tvecs- 出力並進ベクトルのベクトル。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. and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE メソッドかつ
useExtrinsicGuess=trueの場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
solvePnPGeneric
public static int solvePnPGeneric​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, java.util.List<Mat> rvecs, java.util.List<Mat> tvecs)
Finds an object pose \( {}^{c}\mathbf{T}_o \) from 3D-2D point correspondences. { width=50% } SEE: REF: calib3d_solvePnP This function returns a list of all the possible solutions (a solution is a <rotation vector, translation vector> couple), depending on the number of input points and the chosen method:- P3Pメソッド(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 入力点は3または4。入力点が3の場合、返される解の数は0から4の間になりうる。
- REF: SOLVEPNP_IPPE 入力点は >= 4 でなければならず、オブジェクト点は同一平面上になければならない。2つの解を返す。
-
REF: SOLVEPNP_IPPE_SQUARE Special case suitable for marker pose estimation.
Number of input points must be 4 and 2 solutions are returned. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- その他すべてのフラグでは、入力点の数は4個以上でなければならず、オブジェクト点は任意の配置でよい。返される解は1つだけである。
- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。rvecs- 出力回転ベクトルのベクトル(REF: Rodrigues を参照)。tvecs とともに、点をモデル座標系からカメラ座標系へ変換する。tvecs- Vector of output translation vectors. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. and useExtrinsicGuess is set to true. and useExtrinsicGuess is set to true. (\( \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} \)) between the input image points and the 3D object points projected with the estimated pose. More information is described in REF: calib3d_solvePnP 覚え書き:- 平面拡張現実に solvePnP を使用する方法の例は opencv_source_code/samples/python/plane_ar.py にある。
-
If you are using Python:
- Numpy配列のスライスは入力として機能しない。solvePnP は連続した配列を必要とするためである(modules/3d/src/solvepnp.cpp バージョン2.4.9 の55行目付近で cv::Mat::checkVector() を用いたアサーションにより強制される)
- P3Pアルゴリズムは、#undistortPoints の呼び出し(modules/3d/src/solvepnp.cpp バージョン2.4.9 の75行目付近)が2チャンネル情報を必要とするため、画像点が形状 (N,1,2) の配列であることを要求する。
- したがって、D.shape = (N,M) であるデータ D = np.array(...) が与えられたとき、その一部を例えば imagePoints として使用するには、新しい配列にコピーする必要が実質的にある: imagePoints = np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
- 一般的な場合の最小点数は4である。REF: SOLVEPNP_P3P および REF: SOLVEPNP_AP3P 法の場合は、正確に4点を使用する必要がある(最初の3点は P3P 問題のすべての解を推定するために使用され、最後の1点は再投影誤差を最小化する最良の解を選び出すために使用される)。
- REF: SOLVEPNP_ITERATIVE メソッドかつ
useExtrinsicGuess=trueの場合、点の最小数は3である(姿勢を計算するには3点で十分だが、最大4つの解が存在する)。収束させるには、初期解がグローバル解に近い必要がある。 - REF: SOLVEPNP_IPPE では、入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
-
With REF: SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation.
Number of input points must be 4. Object points must be defined in the following order:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- REF: SOLVEPNP_SQPNP では、入力点は3以上でなければならない
-
convertPointsToHomogeneous
public static void convertPointsToHomogeneous​(Mat src, Mat dst, int dtype)
Converts points from Euclidean to homogeneous space.- 引数:
src- N次元の点の入力ベクトル。dst- N+1次元の点の出力ベクトル。dtype- 出力配列の希望するビット深度(現在サポートされているのは CV_32F または CV_64F のいずれか)。-1 の場合は、入力のビット深度に応じて CV_32F または CV_64F に自動的に設定される。この関数は、点座標のタプルに1を追加することで、点をユークリッド空間から同次空間に変換する。すなわち、各点 (x1, x2, ..., xn) は (x1, x2, ..., xn, 1) に変換される。
-
convertPointsToHomogeneous
public static void convertPointsToHomogeneous​(Mat src, Mat dst)
Converts points from Euclidean to homogeneous space.- 引数:
src- N次元の点の入力ベクトル。dst- N+1次元の点の出力ベクトル。-1 の場合は、入力のビット深度に応じて CV_32F または CV_64F に自動的に設定される。この関数は、点座標のタプルに1を追加することで、点をユークリッド空間から同次空間に変換する。すなわち、各点 (x1, x2, ..., xn) は (x1, x2, ..., xn, 1) に変換される。
-
convertPointsFromHomogeneous
public static void convertPointsFromHomogeneous​(Mat src, Mat dst, int dtype)
Converts points from homogeneous to Euclidean space.- 引数:
src- N次元の点の入力ベクトル。dst- N-1次元の点の出力ベクトル。dtype- 出力配列の希望するビット深度(現在サポートされているのは CV_32F または CV_64F のいずれか)。-1 の場合は、入力のビット深度に応じて CV_32F または CV_64F に自動的に設定される。この関数は、透視投影を用いて点を同次空間からユークリッド空間に変換する。すなわち、各点 (x1, x2, ... x(n-1), xn) は (x1/xn, x2/xn, ..., x(n-1)/xn) に変換される。xn=0 のとき、出力点の座標は (0,0,0,...) となる。
-
convertPointsFromHomogeneous
public static void convertPointsFromHomogeneous​(Mat src, Mat dst)
Converts points from homogeneous to Euclidean space.- 引数:
src- N次元の点の入力ベクトル。dst- N-1次元の点の出力ベクトル。-1 の場合は、入力のビット深度に応じて CV_32F または CV_64F に自動的に設定される。この関数は、透視投影を用いて点を同次空間からユークリッド空間に変換する。すなわち、各点 (x1, x2, ... x(n-1), xn) は (x1/xn, x2/xn, ..., x(n-1)/xn) に変換される。xn=0 のとき、出力点の座標は (0,0,0,...) となる。
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence, int maxIters, Mat mask)
Calculates a fundamental matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個の点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。method- Method for computing a fundamental matrix.- REF: FM_7POINT は7点アルゴリズム。 \(N = 7\)
- REF: FM_8POINT は8点アルゴリズム。 \(N \ge 8\)
- REF: FM_RANSAC はRANSACアルゴリズム。 \(N \ge 8\)
- REF: FM_LMEDS はLMedSアルゴリズム。 \(N \ge 8\)
ransacReprojThreshold- RANSACでのみ使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。confidence- RANSACおよびLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。mask- 省略可能な出力マスクmaxIters- ロバスト手法の最大反復回数。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T F [p_1; 1] = 0\) ここで \(F\) は基礎行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数は上記の4つの手法のいずれかを用いて基礎行列を計算し、求めた基礎行列を返す。通常は1つの行列のみが求まる。ただし7点アルゴリズムの場合、この関数は最大3つの解を返すことがある(3つの行列を順に格納した \(9 \times 3\) 行列)。計算された基礎行列は、指定した点に対応するエピポーラ線を求める #computeCorrespondEpilines にさらに渡すことができる。また、平行化変換を計算する #stereoRectifyUncalibrated に渡すこともできる。 :// 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);- 戻り値:
- 自動生成
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence, int maxIters)
Calculates a fundamental matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個の点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。method- Method for computing a fundamental matrix.- REF: FM_7POINT は7点アルゴリズム。 \(N = 7\)
- REF: FM_8POINT は8点アルゴリズム。 \(N \ge 8\)
- REF: FM_RANSAC はRANSACアルゴリズム。 \(N \ge 8\)
- REF: FM_LMEDS はLMedSアルゴリズム。 \(N \ge 8\)
ransacReprojThreshold- RANSACでのみ使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。confidence- RANSACおよびLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。maxIters- ロバスト手法の最大反復回数。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T F [p_1; 1] = 0\) ここで \(F\) は基礎行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数は上記の4つの手法のいずれかを用いて基礎行列を計算し、求めた基礎行列を返す。通常は1つの行列のみが求まる。ただし7点アルゴリズムの場合、この関数は最大3つの解を返すことがある(3つの行列を順に格納した \(9 \times 3\) 行列)。計算された基礎行列は、指定した点に対応するエピポーラ線を求める #computeCorrespondEpilines にさらに渡すことができる。また、平行化変換を計算する #stereoRectifyUncalibrated に渡すこともできる。 :// 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);- 戻り値:
- 自動生成
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence, Mat mask)
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold, double confidence)
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method, double ransacReprojThreshold)
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, int method)
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2)
-
findFundamentalMat
public static Mat findFundamentalMat​(MatOfPoint2f points1, MatOfPoint2f points2, Mat mask, UsacParams params)
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold, int maxIters, Mat mask)
Calculates an essential matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについてP = cv::NoArray()を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。mask- N個の要素からなる出力配列。各要素は外れ値に対して0、それ以外の点に対して1が設定される。この配列はRANSACおよびLMedS法でのみ計算される。maxIters- ロバスト手法の最大反復回数。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold, int maxIters)
Calculates an essential matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについてP = cv::NoArray()を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。maxIters- ロバスト手法の最大反復回数。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob, double threshold)
Calculates an essential matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについてP = cv::NoArray()を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method, double prob)
Calculates an essential matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについてP = cv::NoArray()を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix, int method)
Calculates an essential matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。この前提が利用ケースに当てはまらない場合は、別のオーバーロード関数を使うか、両カメラについてP = cv::NoArray()を指定した #undistortPoints を使って画像点を正規化画像座標へ変換する。正規化画像座標は単位カメラ内部パラメータ行列に対して有効である。これらの座標を渡す場合は、この引数には単位行列を渡すこと。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix)
Calculates an essential matrix from the corresponding points in two images.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- Camera intrinsic matrix \(\cameramatrix{A}\) . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera intrinsic matrix. If this assumption does not hold for your use case, use another function overload or #undistortPoints withP = cv::NoArray()for both cameras to transform image points to normalized image coordinates, which are valid for the identity camera intrinsic matrix. When passing these coordinates, pass the identity matrix for this parameter.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold, int maxIters, Mat mask)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。method- Method for computing a fundamental matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。mask- N個の要素からなる出力配列。各要素は外れ値に対して0、それ以外の点に対して1が設定される。この配列はRANSACおよびLMedS法でのみ計算される。maxIters- ロバスト手法の最大反復回数。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold, int maxIters)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。method- Method for computing a fundamental matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。maxIters- ロバスト手法の最大反復回数。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob, double threshold)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。method- Method for computing a fundamental matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method, double prob)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。method- Method for computing a fundamental matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal, Point pp, int method)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。method- Method for computing a fundamental matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal, Point pp)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- principal point of the camera.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, double focal)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。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.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2)
- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- Array of the second image points of the same size and format as points1 . are feature points from cameras with same focal length and principal point.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method, double prob, double threshold, Mat mask)
Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。cameraMatrix2- 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs1- 1台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。distCoeffs2- 2台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。mask- N個の要素からなる出力配列。各要素は外れ値に対して0、それ以外の点に対して1が設定される。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method, double prob, double threshold)
Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。cameraMatrix2- 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs1- 1台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。distCoeffs2- 2台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method, double prob)
Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。cameraMatrix2- 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs1- 1台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。distCoeffs2- 2台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。それ以外の点について。この配列はRANSACおよびLMedS法でのみ計算される。この関数は CITE: Nister03 の5点アルゴリズムソルバに基づいて基本行列を推定する。 CITE: SteweniusCFS も関連がある。エピポーラ幾何は次の式で記述される: \([p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\) ここで \(E\) は基本行列、 \(p_1\) と \(p_2\) はそれぞれ1枚目と2枚目の画像における対応点である。この関数の結果は、カメラ間の相対姿勢を復元する #decomposeEssentialMat または #recoverPose にさらに渡すことができる。- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, int method)
Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。cameraMatrix2- 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs1- 1台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。distCoeffs2- 2台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2)
Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.- 引数:
points1- 1枚目の画像のN個(N >= 5)の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。cameraMatrix2- 2台目のカメラのカメラ行列 \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs1- 1台目のカメラの歪み係数の入力ベクトル \((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]]]])\) で、4個、5個、8個、12個、または14個の要素を持つ。ベクトルがNULL/空の場合、歪み係数はゼロとみなされる。distCoeffs2- Input vector of distortion coefficients for the second camera \((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]]]])\) of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
- 戻り値:
- 自動生成
-
findEssentialMat
public static Mat findEssentialMat​(Mat points1, Mat points2, Mat cameraMatrix1, Mat cameraMatrix2, Mat dist_coeff1, Mat dist_coeff2, Mat mask, UsacParams params)
-
decomposeEssentialMat
public static void decomposeEssentialMat​(Mat E, Mat R1, Mat R2, Mat t)
Decompose an essential matrix to possible rotations and translation.- 引数:
E- 入力の基本行列。R1- 可能な回転行列の1つ。R2- もう1つの可能な回転行列。t- 可能な並進の1つ。この関数は、SVD分解 CITE: HartleyZ00 を用いて基本行列 E を分解する。一般に、E の分解には4つの可能な姿勢が存在する。それらは \([R_1, t]\), \([R_1, -t]\), \([R_2, t]\), \([R_2, -t]\) である。E が1枚目の画像内の画像点 \(p_1\) と2枚目の画像内の \(p_2\) の間にエピポーラ制約 \([p_2; 1]^T A^{-T} E A^{-1} [p_1; 1] = 0\) を与える場合、組 \([R_1, t]\), \([R_1, -t]\), \([R_2, t]\), \([R_2, -t]\) のいずれかが1台目のカメラ座標系から2台目のカメラ座標系への基底変換となる。ただし、E を分解しても並進の方向しか得られない。このため、並進 t は単位長で返される。
-
recoverPose
public static int recoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method, double prob, double threshold, Mat mask)
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 inliers that pass the check.- 引数:
points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs1- 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。cameraMatrix2- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs2- 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。E- 出力の基本行列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACで使用される引数。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の位置特定の精度、画像の解像度、画像のノイズに応じて、1〜3程度に設定するとよい。mask- points1 および points2 におけるインライアの入出力マスク。空でない場合、与えられた基本行列 E に対する points1 と points2 のインライアを示す。これらのインライアのみが姿勢復元に使用される。出力マスクでは、カイラリティチェックを通過したインライアのみが残る。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、カイラリティチェックを行うことで可能な姿勢の仮説を検証する。カイラリティチェックとは、三角測量された3D点が正の深度を持つべきであるということを意味する。詳細は CITE: Nister03 にある。この関数は REF: findEssentialMat の出力である E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は findEssentialMat と同じ入力である。:// 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] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method, double prob, double threshold)
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 inliers that pass the check.- 引数:
points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs1- 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。cameraMatrix2- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs2- 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。E- 出力の基本行列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS法でのみ使用される引数。推定された行列が正しいことの望ましい信頼度(確率)を指定する。threshold- RANSACに使用されるパラメータ。点からエピポーラ線までの最大距離(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の局在化の精度、画像解像度、画像ノイズに応じて1〜3程度に設定できる。与えられた基本行列 E に対する points1 と points2 のインライア。これらのインライアのみが姿勢復元に使用される。出力マスクでは、カイラリティチェックを通過したインライアのみが残る。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、カイラリティチェックを行うことで可能な姿勢の仮説を検証する。カイラリティチェックとは、三角測量された3D点が正の深度を持つべきであるということを意味する。詳細は CITE: Nister03 にある。この関数は REF: findEssentialMat の出力である E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は findEssentialMat と同じ入力である。:// 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] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method, double prob)
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 inliers that pass the check.- 引数:
points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs1- 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。cameraMatrix2- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs2- 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。E- 出力の基本行列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
prob- RANSACまたはLMedS手法でのみ使用されるパラメータ。推定された行列が正しいという望ましい信頼水準(確率)を指定する。線(ピクセル単位)であり、これを超える点は外れ値とみなされ、最終的な基礎行列の計算には使用されない。点の局在化の精度、画像解像度、画像ノイズに応じて1〜3程度に設定できる。与えられた基本行列 E に対する points1 と points2 のインライア。これらのインライアのみが姿勢復元に使用される。出力マスクでは、カイラリティチェックを通過したインライアのみが残る。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、カイラリティチェックを行うことで可能な姿勢の仮説を検証する。カイラリティチェックとは、三角測量された3D点が正の深度を持つべきであるということを意味する。詳細は CITE: Nister03 にある。この関数は REF: findEssentialMat の出力である E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は findEssentialMat と同じ入力である。:// 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] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t, int method)
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 inliers that pass the check.- 引数:
points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs1- 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。cameraMatrix2- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs2- 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。E- 出力の基本行列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。method- Method for computing an essential matrix.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
// 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] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat points1, Mat points2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat E, Mat R, Mat t)
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 inliers that pass the check.- 引数:
points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix1- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs1- 歪み係数の入出力ベクトル。REF: calibrateCamera と同じ。cameraMatrix2- 1台目のカメラの入出力カメラ行列で、 REF: calibrateCamera と同じ。さらに、ステレオの場合は追加のフラグを使用できる(後述参照)。distCoeffs2- 歪み係数の入出力ベクトルで、 REF: calibrateCamera と同じ。E- 出力の基本行列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- Output translation vector. This vector is obtained by REF: decomposeEssentialMat and therefore is only known up to scale, i.e. t is the direction of the translation vector and has unit length.- REF: RANSAC はRANSACアルゴリズム。
- REF: LMEDS はLMedSアルゴリズム。
// 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] = ...; } // Input: camera calibration of both cameras, for example using intrinsic chessboard calibration. Mat cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2; // Output: Essential matrix, relative rotation and relative translation. Mat E, R, t, mask; recoverPose(points1, points2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, E, R, t, mask);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, Mat mask)
Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check. Returns the number of inliers that pass the check.- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。mask- points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality(可視性)チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、chirality チェックを行うことで可能な姿勢の仮説を検証する。chirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は #findEssentialMat に対する入力と同じである :// 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);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t)
Recovers the relative camera rotation and the translation from an estimated essential matrix and the corresponding points in two images, using chirality check. Returns the number of inliers that pass the check.- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記で説明する引数を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は REF: decomposeEssentialMat を用いて基本行列を分解し、chirality チェックを行うことで可能な姿勢の仮説を検証する。chirality チェックとは、三角測量された3D点のビット深度が正である必要があることを意味する。詳細は CITE: Nister03 を参照。この関数は、 REF: findEssentialMat の出力 E と mask を処理するために使用できる。このシナリオでは、points1 と points2 は #findEssentialMat に対する入力と同じである :// 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);- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp, Mat mask)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。mask- points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal, Point pp)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。pp- カメラの主点。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t, double focal)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。focal- カメラの焦点距離。この関数は points1 と points2 が同じ焦点距離と主点を持つカメラからの特徴点であることを前提としている点に注意。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat R, Mat t)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。同じ焦点距離と主点を持つカメラからの特徴点である。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、焦点距離と主点からカメラ内部パラメータ行列を計算する点で前述の関数と異なる: \(A = \begin{bmatrix} f & 0 & x_{pp} \\ 0 & f & y_{pp} \\ 0 & 0 & 1 \end{bmatrix}\)- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh, Mat mask, Mat triangulatedPoints)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。distanceThresh- 遠方の点(すなわち無限遠の点)を除外するために使用されるしきい値距離。mask- points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。triangulatedPoints- 三角測量によって再構成された3D点。この関数は、chirality チェックに使用される三角測量された3D点を出力する点で前述の関数と異なる。- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh, Mat mask)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。distanceThresh- 遠方の点(すなわち無限遠の点)を除外するために使用されるしきい値距離。mask- points1 と points2 における内点(インライア)の入出力マスク。空でない場合、与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、chirality チェックに使用される三角測量された3D点を出力する点で前述の関数と異なる。- 戻り値:
- 自動生成
-
recoverPose
public static int recoverPose​(Mat E, Mat points1, Mat points2, Mat cameraMatrix, Mat R, Mat t, double distanceThresh)
- 引数:
E- 入力の基本行列。points1- 1枚目の画像のN個の2D点の配列。点の座標は浮動小数点数(単精度または倍精度)である必要がある。points2- points1 と同じサイズ・同じ形式の2枚目の画像の点の配列。cameraMatrix- カメラ内部パラメータ行列 \(\cameramatrix{A}\) 。この関数は points1 と points2 が同じカメラ内部パラメータ行列を持つカメラからの特徴点であることを前提としている点に注意。R- 出力の回転行列。並進ベクトルと合わせて、この行列は1台目のカメラ座標系から2台目のカメラ座標系への基底変換を行う組を構成する。一般に、t はこの組には使用できない点に注意。下記の引数の説明を参照。t- 出力の並進ベクトル。このベクトルは REF: decomposeEssentialMat によって得られるため、スケールを除いてのみ既知である。すなわち、t は並進ベクトルの方向であり、単位長を持つ。distanceThresh- 遠方の点(すなわち無限遠の点)を除外するために使用されるしきい値距離。与えられた基本行列 E に対して points1 と points2 の内点を示す。これらの内点のみが姿勢復元に使用される。出力マスクには、chirality チェックを通過した内点のみが含まれる。この関数は、chirality チェックに使用される三角測量された3D点を出力する点で前述の関数と異なる。- 戻り値:
- 自動生成
-
computeCorrespondEpilines
public static void computeCorrespondEpilines​(Mat points, int whichImage, Mat F, Mat lines)
For points in an image of a stereo pair, computes the corresponding epilines in the other image.- 引数:
points- 入力点。CV_32FC2型または vector<Point2f> の \(N \times 1\) または \(1 \times N\) 行列。whichImage- 点を含む画像(1または2)のインデックス。F- #findFundamentalMat または #stereoRectify を使って推定できる基礎行列。lines- もう一方の画像内の点に対応するエピポーラ線の出力ベクトル。各線 \(ax + by + c=0\) は3つの数 \((a, b, c)\) で符号化される。ステレオペアの2枚の画像のうち一方の画像内の各点について、この関数はもう一方の画像内の対応するエピポーラ線の方程式を求める。基礎行列の定義(#findFundamentalMat を参照)から、1枚目の画像内の点 \(p^{(1)}_i\) に対する2枚目の画像内の線 \(l^{(2)}_i\) は(whichImage=1 のとき)次のように計算される: \(l^{(2)}_i = F p^{(1)}_i\) 逆に、whichImage=2 のとき、 \(l^{(1)}_i\) は \(p^{(2)}_i\) から次のように計算される: \(l^{(1)}_i = F^T p^{(2)}_i\) 線の係数はスケールを除いて定義される。それらは \(a_i^2+b_i^2=1\) となるように正規化される。
-
triangulatePoints
public static void triangulatePoints​(Mat projMatr1, Mat projMatr2, Mat projPoints1, Mat projPoints2, Mat points4D)
This function reconstructs 3-dimensional points (in homogeneous coordinates) by using their observations with a stereo camera.- 引数:
projMatr1- 1台目のカメラの3x4射影行列。すなわち、この行列はワールド座標系で与えられた3D点を1枚目の画像へ射影する。projMatr2- 2台目のカメラの3x4射影行列。すなわち、この行列はワールド座標系で与えられた3D点を2枚目の画像へ射影する。projPoints1- 1枚目の画像内の特徴点の2xN配列。C++版の場合、特徴点のベクトルや、サイズ1xNまたはNx1の2チャンネル行列とすることもできる。projPoints2- 2枚目の画像内の対応点の2xN配列。C++版の場合、特徴点のベクトルや、サイズ1xNまたはNx1の2チャンネル行列とすることもできる。points4D- 同次座標で再構成された点の4xN配列。これらの点はワールド座標系で返される。注意: この関数が動作するためには、すべての入力データが浮動小数点型である必要がある点に留意すること。注意: REF: stereoRectify の射影行列を使用した場合、返される点は1台目のカメラの平行化された座標系で表現される。SEE: reprojectImageTo3D
-
correctMatches
public static void correctMatches​(Mat F, Mat points1, Mat points2, Mat newPoints1, Mat newPoints2)
Refines coordinates of corresponding points.- 引数:
F- 3x3の基礎行列。points1- 1番目の点群を含む1xN配列。points2- 2番目の点群を含む1xN配列。newPoints1- 最適化された points1。newPoints2- 最適化された points2。この関数は最適三角測量法(Optimal Triangulation Method)を実装している(詳細は Multiple View Geometry CITE: HartleyZ00 を参照)。与えられた各点対応 points1[i] <-> points2[i] と基礎行列 F に対して、エピポーラ制約 \(newPoints2^T \cdot F \cdot newPoints1 = 0\) を満たしつつ、幾何誤差 \(d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2\) (ここで \(d(a,b)\) は点 \(a\) と \(b\) 間の幾何距離)を最小化する補正された対応 newPoints1[i] <-> newPoints2[i] を計算する。
-
sampsonDistance
public static double sampsonDistance​(Mat pt1, Mat pt2, Mat F)
Calculates the Sampson Distance between two points. The function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as: \( 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} \) The fundamental matrix may be calculated using the #findFundamentalMat function. See CITE: HartleyZ00 11.4.3 for details.- 引数:
pt1- 1つ目の同次2次元点pt2- 2つ目の同次2次元点F- 基礎行列- 戻り値:
- 計算されたサンプソン距離。
-
estimateAffine3D
public static boolean estimateAffine3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold, double confidence)
Computes an optimal affine transformation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)- 引数:
src- \((X,Y,Z)\) を含む1つ目の入力3次元点集合。dst- \((x,y,z)\) を含む2つ目の入力3次元点集合。out- 次の形式をとる出力3次元アフィン変換行列 \(3 \times 4\)。 \( \begin{bmatrix} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\ \end{bmatrix} \)inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。ransacThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。- 戻り値:
- 解が見つかったかどうか。この関数は、RANSACアルゴリズムを用いて2つの3D点集合間の最適な3Dアフィン変換を推定する。
-
estimateAffine3D
public static boolean estimateAffine3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold)
Computes an optimal affine transformation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)- 引数:
src- \((X,Y,Z)\) を含む1つ目の入力3次元点集合。dst- \((x,y,z)\) を含む2つ目の入力3次元点集合。out- 次の形式をとる出力3次元アフィン変換行列 \(3 \times 4\)。 \( \begin{bmatrix} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\ \end{bmatrix} \)inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。ransacThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。通常0.95〜0.99の間で十分である。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤った変換が推定される結果になる可能性がある。- 戻り値:
- 解が見つかったかどうか。この関数は、RANSACアルゴリズムを用いて2つの3D点集合間の最適な3Dアフィン変換を推定する。
-
estimateAffine3D
public static boolean estimateAffine3D​(Mat src, Mat dst, Mat out, Mat inliers)
Computes an optimal affine transformation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)- 引数:
src- \((X,Y,Z)\) を含む1つ目の入力3次元点集合。dst- \((x,y,z)\) を含む2つ目の入力3次元点集合。out- 次の形式をとる出力3次元アフィン変換行列 \(3 \times 4\)。 \( \begin{bmatrix} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\ \end{bmatrix} \)inliers- どの点がインライアであるか(1-インライア、0-外れ値)を示す出力ベクトル。インライア。通常0.95〜0.99の間で十分である。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤った変換が推定される結果になる可能性がある。- 戻り値:
- 解が見つかったかどうか。この関数は、RANSACアルゴリズムを用いて2つの3D点集合間の最適な3Dアフィン変換を推定する。
-
estimateAffine3D
public static Mat estimateAffine3D​(Mat src, Mat dst, double[] scale, boolean force_rotation)
Computes an optimal affine transformation between two 3D point sets. It computes \(R,s,t\) minimizing \(\sum{i} dst_i - c \cdot R \cdot src_i \) where \(R\) is a 3x3 rotation matrix, \(t\) is a 3x1 translation vector and \(s\) is a scalar size value. This is an implementation of the algorithm by Umeyama \cite umeyama1991least . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.- 引数:
src- 1つ目の入力3次元点集合。dst- 2つ目の入力3次元点集合。scale- nullが渡された場合、スケール引数cは1.0とみなされる。それ以外の場合、指し示す変数に最適なスケールが設定される。force_rotation- trueの場合、返される回転は決して鏡映にならない。これは、例えば右手系と左手系の座標系間の変換を最適化する場合などには望ましくないことがある。- 戻り値:
- 次の形式をとる3次元アフィン変換行列 \(3 \times 4\)。 \(T = \begin{bmatrix} R & t\\ \end{bmatrix} \)
-
estimateAffine3D
public static Mat estimateAffine3D​(Mat src, Mat dst, double[] scale)
Computes an optimal affine transformation between two 3D point sets. It computes \(R,s,t\) minimizing \(\sum{i} dst_i - c \cdot R \cdot src_i \) where \(R\) is a 3x3 rotation matrix, \(t\) is a 3x1 translation vector and \(s\) is a scalar size value. This is an implementation of the algorithm by Umeyama \cite umeyama1991least . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.- 引数:
src- 1つ目の入力3次元点集合。dst- 2つ目の入力3次元点集合。scale- nullが渡された場合、スケール引数cは1.0とみなされる。それ以外の場合、指し示す変数に最適なスケールが設定される。これは、例えば右手系と左手系の座標系間の変換を最適化する場合などには望ましくないことがある。- 戻り値:
- 次の形式をとる3次元アフィン変換行列 \(3 \times 4\)。 \(T = \begin{bmatrix} R & t\\ \end{bmatrix} \)
-
estimateAffine3D
public static Mat estimateAffine3D​(Mat src, Mat dst)
Computes an optimal affine transformation between two 3D point sets. It computes \(R,s,t\) minimizing \(\sum{i} dst_i - c \cdot R \cdot src_i \) where \(R\) is a 3x3 rotation matrix, \(t\) is a 3x1 translation vector and \(s\) is a scalar size value. This is an implementation of the algorithm by Umeyama \cite umeyama1991least . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.- 引数:
src- 1つ目の入力3次元点集合。dst- 2つ目の入力3次元点集合。それ以外の場合、指し示す変数に最適なスケールが設定される。これは、例えば右手系と左手系の座標系間の変換を最適化する場合などには望ましくないことがある。- 戻り値:
- 次の形式をとる3次元アフィン変換行列 \(3 \times 4\)。 \(T = \begin{bmatrix} R & t\\ \end{bmatrix} \)
-
estimateTranslation3D
public static boolean estimateTranslation3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold, double confidence)
Computes an optimal translation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)- 引数:
src- \((X,Y,Z)\) を含む1つ目の入力3次元点集合。dst- \((x,y,z)\) を含む2つ目の入力3次元点集合。out- 次の形式をとる出力3次元並進ベクトル \(3 \times 1\)。 \( \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} \)inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。ransacThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。- 戻り値:
- 並進が見つかったかどうか。この関数は、RANSACアルゴリズムを用いて2つの3D点集合間の最適な3D並進を推定する。
-
estimateTranslation3D
public static boolean estimateTranslation3D​(Mat src, Mat dst, Mat out, Mat inliers, double ransacThreshold)
Computes an optimal translation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)- 引数:
src- \((X,Y,Z)\) を含む1つ目の入力3次元点集合。dst- \((x,y,z)\) を含む2つ目の入力3次元点集合。out- 次の形式をとる出力3次元並進ベクトル \(3 \times 1\)。 \( \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} \)inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。ransacThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。通常0.95〜0.99の間で十分である。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤った変換が推定される結果になる可能性がある。- 戻り値:
- 並進が見つかったかどうか。この関数は、RANSACアルゴリズムを用いて2つの3D点集合間の最適な3D並進を推定する。
-
estimateTranslation3D
public static boolean estimateTranslation3D​(Mat src, Mat dst, Mat out, Mat inliers)
Computes an optimal translation between two 3D point sets. It computes \( \begin{bmatrix} x\\ y\\ z\\ \end{bmatrix} = \begin{bmatrix} X\\ Y\\ Z\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ b_3\\ \end{bmatrix} \)- 引数:
src- \((X,Y,Z)\) を含む1つ目の入力3次元点集合。dst- \((x,y,z)\) を含む2つ目の入力3次元点集合。out- 次の形式をとる出力3次元並進ベクトル \(3 \times 1\)。 \( \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix} \)inliers- どの点がインライアであるか(1-インライア、0-外れ値)を示す出力ベクトル。インライア。通常0.95〜0.99の間で十分である。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤った変換が推定される結果になる可能性がある。- 戻り値:
- 並進が見つかったかどうか。この関数は、RANSACアルゴリズムを用いて2つの3D点集合間の最適な3D並進を推定する。
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。refineIters- 改良アルゴリズム(Levenberg-Marquardt法)の最大反復回数。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to, Mat inliers, int method)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to, Mat inliers)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- Output vector indicating which points are inliers (1-inlier, 0-outlier).- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat from, Mat to)
Computes an optimal affine transformation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y\\ \end{bmatrix} = \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{bmatrix} \begin{bmatrix} X\\ Y\\ \end{bmatrix} + \begin{bmatrix} b_1\\ b_2\\ \end{bmatrix} \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- Second input 2D point set containing \((x,y)\).- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
- 出力2次元アフィン変換行列 \(2 \times 3\)、または変換が推定できなかった場合は空の行列。返される行列は次の形式をとる: \( \begin{bmatrix} a_{11} & a_{12} & b_1\\ a_{21} & a_{22} & b_2\\ \end{bmatrix} \) この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の最適な2次元アフィン変換を推定する。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffinePartial2D, getAffineTransform
-
estimateAffine2D
public static Mat estimateAffine2D​(Mat pts1, Mat pts2, Mat inliers, UsacParams params)
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- 2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。refineIters- 改良アルゴリズム(Levenberg-Marquardt法)の最大反復回数。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- 2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- 2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- 2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。0を渡すと改良が無効になり、出力行列はロバスト手法の出力となる。- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to, Mat inliers, int method)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- 2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル。method- Robust method used to compute transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to, Mat inliers)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- 2つ目の入力2次元点集合。inliers- Output vector indicating which points are inliers.- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateAffinePartial2D
public static Mat estimateAffinePartial2D​(Mat from, Mat to)
Computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.- 引数:
from- 1つ目の入力2次元点集合。to- Second input 2D point set.- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
- 出力2次元アフィン変換行列(自由度4)\(2 \times 3\)、または変換が推定できなかった場合は空の行列。この関数は、並進・回転・等方スケーリングの組み合わせに限定された自由度4の最適な2次元アフィン変換を推定する。ロバスト推定には選択したアルゴリズムを用いる。計算された変換は、その後Levenberg-Marquardt法を用いて(インライアのみを使って)さらに改良され、再投影誤差をさらに低減する。推定される変換行列は次のとおり: \( \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y \end{bmatrix} \) ここで \( \theta \) は回転角、\( s \) はスケーリング係数、\( t_x, t_y \) はそれぞれ \( x, y \) 軸方向の並進である。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence, long refineIters)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute the transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。refineIters- 改良アルゴリズムの最大反復回数。純粋な並進の場合、インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters, double confidence)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute the transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。confidence- 推定された変換に対する0から1の間の信頼度。通常は0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold, long maxIters)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute the transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。maxIters- ロバスト手法の最大反復回数。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method, double ransacReprojThreshold)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute the transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
ransacReprojThreshold- 点をインライアとみなすための、RANSACアルゴリズムにおける最大再投影誤差。RANSACにのみ適用される。0.95から0.99の間であれば十分。1に近すぎる値は推定を著しく遅くする可能性がある。0.8〜0.9より低い値は、誤って推定された変換になる可能性がある。インライア上の最小二乗解は閉形式で求まるため、0を渡すことが推奨される(追加の改良なし)。- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to, Mat inliers, int method)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- どの点がインライアかを示す出力ベクトル(1=インライア、0=アウトライア)。method- Robust method used to compute the transformation. The following methods are possible:- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to, Mat inliers)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- \((x,y)\) を含む2つ目の入力2次元点集合。inliers- Output vector indicating which points are inliers (1-inlier, 0-outlier).- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
estimateTranslation2D
public static double[] estimateTranslation2D​(Mat from, Mat to)
Computes a pure 2D translation between two 2D point sets. It computes \( \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} \begin{bmatrix} X\\ Y \end{bmatrix} + \begin{bmatrix} t_x\\ t_y \end{bmatrix}. \)- 引数:
from- \((X,Y)\) を含む1つ目の入力2次元点集合。to- Second input 2D point set containing \((x,y)\).- REF: RANSAC - RANSACベースのロバスト推定法
- REF: LMEDS - 最小メディアン法によるロバスト手法。RANSACがデフォルトの手法である。
- 戻り値:
cv::Vec2dとしての2次元並進ベクトル \([t_x, t_y]^T\)。並進が推定できなかった場合、両成分はNaNに設定され、inliersが指定されていればマスクはゼロで埋められる。 \par 2x3変換行列への変換: \( \begin{bmatrix} 1 & 0 & t_x\\ 0 & 1 & t_y \end{bmatrix} \)cv::Vec2d t = cv::estimateTranslation2D(from, to, inliers); cv::Mat T = (cv::Mat_<double>(2,3) << 1,0,t[0], 0,1,t[1]);この関数は、選択したロバストアルゴリズムを用いて、2つの2次元点集合間の純粋な2次元並進を推定する。インライアは再投影誤差のしきい値によって決定される。注: RANSAC法は事実上どのような割合のアウトライアでも扱えるが、インライアとアウトライアを区別するためにしきい値が必要である。LMeDS法はしきい値を一切必要としないが、インライアが50%を超える場合にのみ正しく動作する。SEE: estimateAffine2D, estimateAffinePartial2D, getAffineTransform
-
decomposeHomographyMat
public static int decomposeHomographyMat​(Mat H, Mat K, java.util.List<Mat> rotations, java.util.List<Mat> translations, java.util.List<Mat> normals)
Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).- 引数:
H- 2枚の画像間の入力ホモグラフィ行列。K- 入力カメラ内部パラメータ行列。rotations- 回転行列の配列。translations- 並進行列の配列。normals- 平面法線行列の配列。この関数は、平面物体の2つの視点間の相対的なカメラ運動を抽出し、回転・並進・平面法線の数学的な解の組を最大4つ返す。ホモグラフィ行列Hの分解については、CITE: Malis2007 に詳しく記述されている。平面によって誘導されるホモグラフィHが、ソース画像上の点 \(p_i\) とデスティネーション画像上の点 \(p'_i\) について制約 \(s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\) を与える場合、rotations[k] と translations[k] の組は、ソースカメラの座標系からデスティネーションカメラの座標系への基底変換となる。ただし、Hを分解することによって得られるのは、(一般に未知の)シーンの奥行きで正規化された並進、すなわちその方向だけであり、長さは正規化されている。点対応が利用可能であれば、正の奥行き制約を適用することにより、すなわちすべての点がカメラの前方になければならないという条件により、少なくとも2つの解をさらに無効化できる。- 戻り値:
- 自動生成
-
filterHomographyDecompByVisibleRefpoints
public static void filterHomographyDecompByVisibleRefpoints​(java.util.List<Mat> rotations, java.util.List<Mat> normals, Mat beforePoints, Mat afterPoints, Mat possibleSolutions, Mat pointsMask)
Filters homography decompositions based on additional information.- 引数:
rotations- 回転行列のベクトル。normals- 平面法線行列のベクトル。beforePoints- ホモグラフィ適用前の(平行化済みの)可視な参照点のベクトルafterPoints- ホモグラフィ適用後の(平行化済みの)可視な参照点のベクトルpossibleSolutions- フィルタリング後の実行可能な解集合を表すintインデックスのベクトルpointsMask- 省略可能な CV_8U、CV_8S または CV_Bool 型の Mat/Vector で、#findHomography 関数で与えられるインライアのマスクを表す。この関数は、CITE: Malis2007 に記載されている追加情報に基づいて #decomposeHomographyMat の出力をフィルタリングすることを目的とする。手法の概要: #decomposeHomographyMat 関数は2つの一意な解とそれらの「反対解」を返し、合計4つの解となる。ホモグラフィ変換が適用される前後でカメラフレーム内に見える点の集合にアクセスできれば、すべての可視の参照点がカメラの前にあることと整合するホモグラフィを検証することで、どれが真の潜在的な解であり、どれが反対解であるかを判定できる。入力は変更されず、フィルタリングされた解集合は既存の集合へのインデックスとして返される。
-
filterHomographyDecompByVisibleRefpoints
public static void filterHomographyDecompByVisibleRefpoints​(java.util.List<Mat> rotations, java.util.List<Mat> normals, Mat beforePoints, Mat afterPoints, Mat possibleSolutions)
Filters homography decompositions based on additional information.- 引数:
rotations- 回転行列のベクトル。normals- 平面法線行列のベクトル。beforePoints- ホモグラフィ適用前の(平行化済みの)可視な参照点のベクトルafterPoints- ホモグラフィ適用後の(平行化済みの)可視な参照点のベクトルpossibleSolutions- #findHomography 関数で与えられる、フィルタリング後の有効な解集合を表す int インデックスのベクトル。この関数は、CITE: Malis2007 に記載されている追加情報に基づいて #decomposeHomographyMat の出力をフィルタリングすることを目的とする。手法の概要: #decomposeHomographyMat 関数は2つの一意な解とそれらの「反対解」を返し、合計4つの解となる。ホモグラフィ変換が適用される前後でカメラフレーム内に見える点の集合にアクセスできれば、すべての可視の参照点がカメラの前にあることと整合するホモグラフィを検証することで、どれが真の潜在的な解であり、どれが反対解であるかを判定できる。入力は変更されず、フィルタリングされた解集合は既存の集合へのインデックスとして返される。
-
calibrationMatrixValues
public static void calibrationMatrixValues​(Mat cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double[] fovx, double[] fovy, double[] focalLength, Point principalPoint, double[] aspectRatio)
Computes useful camera characteristics from the camera intrinsic matrix.- 引数:
cameraMatrix- #calibrateCamera または #stereoCalibrate で推定可能なカメラ内部行列の入力。imageSize- ピクセル単位の入力画像サイズ。apertureWidth- センサの物理的な幅(mm)。apertureHeight- センサの物理的な高さ(mm)。fovx- センサの水平軸に沿った視野角(度)の出力。fovy- センサの垂直軸に沿った視野角(度)の出力。focalLength- レンズの焦点距離(mm)。principalPoint- 主点(mm)。aspectRatio- \(f_y/f_x\) この関数は、以前に推定されたカメラ行列からさまざまな有用なカメラ特性を計算する。注: 単位 'mm' は、チェスボードのピッチに対して選んだ任意の測定単位を表すことに留意すること(したがって任意の値でよい)。
-
getDefaultNewCameraMatrix
public static Mat getDefaultNewCameraMatrix​(Mat cameraMatrix, Size imgsize, boolean centerPrincipalPoint)
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: \(\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} ,\) where \(f_x\) and \(f_y\) are \((0,0)\) and \((1,1)\) 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.- 引数:
cameraMatrix- 入力カメラ行列。imgsize- カメラ視野画像のサイズ(ピクセル単位)。centerPrincipalPoint- 新しいカメラ行列における主点の位置。この引数は、この位置を画像中心にするかどうかを示す。- 戻り値:
- 自動生成
-
getDefaultNewCameraMatrix
public static Mat getDefaultNewCameraMatrix​(Mat cameraMatrix, Size imgsize)
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: \(\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} ,\) where \(f_x\) and \(f_y\) are \((0,0)\) and \((1,1)\) 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.- 引数:
cameraMatrix- 入力カメラ行列。imgsize- カメラ視野画像のサイズ(ピクセル単位)。この引数は、この位置を画像中心にするかどうかを示す。- 戻り値:
- 自動生成
-
getDefaultNewCameraMatrix
public static Mat getDefaultNewCameraMatrix​(Mat cameraMatrix)
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: \(\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} ,\) where \(f_x\) and \(f_y\) are \((0,0)\) and \((1,1)\) 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.- 引数:
cameraMatrix- 入力カメラ行列。この引数は、この位置を画像中心にするかどうかを示す。- 戻り値:
- 自動生成
-
getOptimalNewCameraMatrix
public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI, boolean centerPrincipalPoint)
Returns the new camera intrinsic matrix based on the free scaling parameter.- 引数:
cameraMatrix- 入力カメラ内部行列。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。imageSize- 元の画像サイズ。alpha- 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。newImgSize- 平行化後の画像サイズ。デフォルトでは imageSize に設定される。validPixROI- 歪み補正後の画像においてすべて良好なピクセルからなる領域を囲む省略可能な出力矩形。#stereoRectify の roi1、roi2 の説明を参照。centerPrincipalPoint- 新しいカメラ内部行列において主点を画像中心に置くかどうかを示す省略可能なフラグ。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。- 戻り値:
- new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
-
getOptimalNewCameraMatrix
public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI)
Returns the new camera intrinsic matrix based on the free scaling parameter.- 引数:
cameraMatrix- 入力カメラ内部行列。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。imageSize- 元の画像サイズ。alpha- 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。newImgSize- 平行化後の画像サイズ。デフォルトでは imageSize に設定される。validPixROI- 歪み補正後の画像においてすべて良好なピクセルからなる領域を囲む省略可能な出力矩形。#stereoRectify の roi1、roi2 の説明を参照。主点を画像中心に置くかどうか。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。- 戻り値:
- new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
-
getOptimalNewCameraMatrix
public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize)
Returns the new camera intrinsic matrix based on the free scaling parameter.- 引数:
cameraMatrix- 入力カメラ内部行列。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。imageSize- 元の画像サイズ。alpha- 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。newImgSize- 平行化後の画像サイズ。デフォルトでは imageSize に設定される。歪み補正後の画像。#stereoRectify の roi1、roi2 の説明を参照。主点を画像中心に置くかどうか。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。- 戻り値:
- new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
-
getOptimalNewCameraMatrix
public static Mat getOptimalNewCameraMatrix​(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha)
Returns the new camera intrinsic matrix based on the free scaling parameter.- 引数:
cameraMatrix- 入力カメラ内部行列。distCoeffs- 歪み係数の入力ベクトル \(\distcoeffs\)。ベクトルが NULL/空の場合、歪み係数はすべてゼロと仮定される。imageSize- 元の画像サイズ。alpha- 0(歪み補正後の画像のすべてのピクセルが有効となる場合)から1(元画像のすべてのピクセルが歪み補正後の画像に保持される場合)の間の自由スケーリングパラメータ。詳細は #stereoRectify を参照。歪み補正後の画像。#stereoRectify の roi1、roi2 の説明を参照。主点を画像中心に置くかどうか。デフォルトでは、主点は(alpha によって決まる)元画像の部分集合を補正後の画像に最もよく適合させるように選ばれる。- 戻り値:
- new_camera_matrix 出力される新しいカメラ内部行列。この関数は、自由スケーリングパラメータに基づいて最適な新しいカメラ内部行列を計算して返す。このパラメータを変化させることで、意味のあるピクセルのみを取得する alpha=0 、コーナーに価値ある情報がある場合に元画像のすべてのピクセルを保持する alpha=1 、あるいはその中間の結果を得ることができる。alpha>0 の場合、歪み補正後の結果には、撮影された歪み画像の外側にある「仮想」ピクセルに対応する黒いピクセルが含まれる可能性が高い。元のカメラ内部行列、歪み係数、計算された新しいカメラ内部行列、および newImageSize を #initUndistortRectifyMap に渡して、#remap 用のマップを生成すべきである。
-
undistortPoints
public static void undistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P, TermCriteria criteria)
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 \((u, v)\) the function computes: \( \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} \) 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). 覚え書き: Coordinate Systems:- 入力 (
src): 点は歪んだ画像のピクセル座標で与えられることが期待される。すなわち、画像の左上隅からピクセル単位で測定される座標 \((u, v)\)。 -
Output (
dst): The coordinate system of output points depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標("正規化画像座標"とも呼ばれる)となる。これはカメラの焦点面における無次元の座標 \((x, y)\) で、ピクセル座標とは \(x = (u - c_x) / f_x\) および \(y = (v - c_y) / f_y\) の関係にある。これらの正規化座標はカメラの内部パラメータに依存せず、3D復元やエピポーラ幾何に有用である。
- 引数:
src- 歪んだ画像のピクセル座標での観測された点座標。2xN/Nx2 の1チャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。dst- 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。cameraMatrix- カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs- 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((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]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。R- オブジェクト空間における平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡すことができる。行列が空の場合は、恒等変換が用いられる。P- 新しいカメラ行列(3x3)または新しい射影行列(3x4) \(\begin{bmatrix} {f'}_x & 0 & {c'}_x & t_x \\ 0 & {f'}_y & {c'}_y & t_y \\ 0 & 0 & 1 & t_z \end{bmatrix}\)。#stereoRectify で計算された P1 または P2 をここに渡せる。行列が空の場合は、単位の新しいカメラ行列が使用され、出力は正規化座標になる。criteria- 反復的な点の歪み補正アルゴリズムの終了基準
- 入力 (
-
undistortPoints
public static void undistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R, Mat P)
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 \((u, v)\) the function computes: \( \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} \) 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). 覚え書き: Coordinate Systems:- 入力 (
src): 点は歪んだ画像のピクセル座標で与えられることが期待される。すなわち、画像の左上隅からピクセル単位で測定される座標 \((u, v)\)。 -
Output (
dst): The coordinate system of output points depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標("正規化画像座標"とも呼ばれる)となる。これはカメラの焦点面における無次元の座標 \((x, y)\) で、ピクセル座標とは \(x = (u - c_x) / f_x\) および \(y = (v - c_y) / f_y\) の関係にある。これらの正規化座標はカメラの内部パラメータに依存せず、3D復元やエピポーラ幾何に有用である。
- 引数:
src- 歪んだ画像のピクセル座標での観測された点座標。2xN/Nx2 の1チャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。dst- 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。cameraMatrix- カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs- 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((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]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。R- オブジェクト空間における平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡すことができる。行列が空の場合は、恒等変換が用いられる。P- 新しいカメラ行列(3x3)または新しい射影行列(3x4) \(\begin{bmatrix} {f'}_x & 0 & {c'}_x & t_x \\ 0 & {f'}_y & {c'}_y & t_y \\ 0 & 0 & 1 & t_z \end{bmatrix}\)。#stereoRectify で計算された P1 または P2 をここに渡せる。行列が空の場合は、単位の新しいカメラ行列が使用され、出力は正規化座標になる。
- 入力 (
-
undistortPoints
public static void undistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs, Mat R)
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 \((u, v)\) the function computes: \( \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} \) 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). 覚え書き: Coordinate Systems:- 入力 (
src): 点は歪んだ画像のピクセル座標で与えられることが期待される。すなわち、画像の左上隅からピクセル単位で測定される座標 \((u, v)\)。 -
Output (
dst): The coordinate system of output points depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標("正規化画像座標"とも呼ばれる)となる。これはカメラの焦点面における無次元の座標 \((x, y)\) で、ピクセル座標とは \(x = (u - c_x) / f_x\) および \(y = (v - c_y) / f_y\) の関係にある。これらの正規化座標はカメラの内部パラメータに依存せず、3D復元やエピポーラ幾何に有用である。
- 引数:
src- 歪んだ画像のピクセル座標での観測された点座標。2xN/Nx2 の1チャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。dst- 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。cameraMatrix- カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs- 4個、5個、8個、12個または14個の要素からなる歪み係数の入力ベクトル \((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]]]])\) 。ベクトルがNULL/空の場合は、歪み係数を0と仮定する。R- オブジェクト空間における平行化変換(3x3行列)。#stereoRectify で計算された R1 または R2 をここに渡せる。行列が空の場合は、単位変換が使用される。#stereoRectify をここに渡せる。行列が空の場合は、単位の新しいカメラ行列が使用され、出力は正規化座標になる。
- 入力 (
-
undistortPoints
public static void undistortPoints​(MatOfPoint2f src, MatOfPoint2f dst, Mat cameraMatrix, Mat distCoeffs)
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 \((u, v)\) the function computes: \( \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} \) 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). 覚え書き: Coordinate Systems:- 入力 (
src): 点は歪んだ画像のピクセル座標で与えられることが期待される。すなわち、画像の左上隅からピクセル単位で測定される座標 \((u, v)\)。 -
Output (
dst): The coordinate system of output points depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標("正規化画像座標"とも呼ばれる)となる。これはカメラの焦点面における無次元の座標 \((x, y)\) で、ピクセル座標とは \(x = (u - c_x) / f_x\) および \(y = (v - c_y) / f_y\) の関係にある。これらの正規化座標はカメラの内部パラメータに依存せず、3D復元やエピポーラ幾何に有用である。
- 引数:
src- 歪んだ画像のピクセル座標での観測された点座標。2xN/Nx2 の1チャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。dst- 歪み補正および逆透視変換後の理想的な点の出力座標(1xN/Nx1 の2チャンネル、または vector<Point2f> )。行列 P が恒等行列または省略された場合、dst には正規化された点の座標が格納される。cameraMatrix- カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs- 4、5、8、12 または 14 個の要素からなる歪み係数 \((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]]]])\) の入力ベクトル。ベクトルが NULL/空 の場合は、ゼロの歪み係数とみなされる。#stereoRectify をここに渡せる。行列が空の場合は、単位変換が使用される。#stereoRectify をここに渡せる。行列が空の場合は、単位の新しいカメラ行列が使用され、出力は正規化座標になる。
- 入力 (
-
undistortImagePoints
public static void undistortImagePoints​(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, TermCriteria arg1)
Compute undistorted image points position- 引数:
src- 観測された点の位置。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。dst- 歪み補正後の点の出力位置(1xN/Nx1 の2チャンネル、または vector<Point2f> )。cameraMatrix- カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs- 歪み係数arg1- 自動生成
-
undistortImagePoints
public static void undistortImagePoints​(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs)
Compute undistorted image points position- 引数:
src- 観測された点の位置。2xN/Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネル(CV_32FC2 または CV_64FC2)(あるいは vector<Point2f> )。dst- 歪み補正後の点の出力位置(1xN/Nx1 の2チャンネル、または vector<Point2f> )。cameraMatrix- カメラ行列 \(\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) 。distCoeffs- 歪み係数
-
fisheye_projectPoints
public static void fisheye_projectPoints​(Mat objectPoints, Mat imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha, Mat jacobian)
-
fisheye_projectPoints
public static void fisheye_projectPoints​(Mat objectPoints, Mat imagePoints, Mat rvec, Mat tvec, Mat K, Mat D, double alpha)
-
fisheye_projectPoints
public static void fisheye_projectPoints​(Mat objectPoints, Mat imagePoints, Mat rvec, Mat tvec, Mat K, Mat D)
-
fisheye_distortPoints
public static void fisheye_distortPoints​(Mat undistorted, Mat distorted, Mat K, Mat D, double alpha)
Distorts 2D points using fisheye model.- 引数:
undistorted- オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。K- カメラ内部行列 \(cameramatrix{K}\)。D- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。alpha- スキュー係数。distorted- 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。なお、この関数は歪み補正後の点のカメラ内部行列を恒等行列と仮定する。つまり、画像点に歪みを加えたい場合は、それらに \(K^{-1}\) を掛けるか、別のオーバーロード関数を使用する必要がある。
-
fisheye_distortPoints
public static void fisheye_distortPoints​(Mat undistorted, Mat distorted, Mat K, Mat D)
Distorts 2D points using fisheye model.- 引数:
undistorted- オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。K- カメラ内部行列 \(cameramatrix{K}\)。D- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。distorted- 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。なお、この関数は歪み補正後の点のカメラ内部行列を恒等行列と仮定する。つまり、画像点に歪みを加えたい場合は、それらに \(K^{-1}\) を掛けるか、別のオーバーロード関数を使用する必要がある。
-
fisheye_distortPoints
public static void fisheye_distortPoints​(Mat undistorted, Mat distorted, Mat Kundistorted, Mat K, Mat D, double alpha)
Overload of distortPoints function to handle cases when undistorted points are got with non-identity camera matrix, e.g. output of #estimateNewCameraMatrixForUndistortRectify.- 引数:
undistorted- オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。Kundistorted- 歪み補正の新しいカメラ行列として用いられるカメラ内部行列。K- カメラ内部行列 \(cameramatrix{K}\)。D- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。alpha- スキュー係数。distorted- 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。SEE: estimateNewCameraMatrixForUndistortRectify
-
fisheye_distortPoints
public static void fisheye_distortPoints​(Mat undistorted, Mat distorted, Mat Kundistorted, Mat K, Mat D)
Overload of distortPoints function to handle cases when undistorted points are got with non-identity camera matrix, e.g. output of #estimateNewCameraMatrixForUndistortRectify.- 引数:
undistorted- オブジェクト点の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はビュー内の点の数。Kundistorted- 歪み補正の新しいカメラ行列として用いられるカメラ内部行列。K- カメラ内部行列 \(cameramatrix{K}\)。D- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。distorted- 画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。SEE: estimateNewCameraMatrixForUndistortRectify
-
fisheye_undistortPoints
public static void fisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R, Mat P, TermCriteria criteria)
Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints. The fisheye model is suitable for wide-angle cameras. The function transforms points from the distorted fisheye image to undistorted coordinates, optionally applying a rectification transformation (R) and projecting to a new image plane (P). 覚え書き: Coordinate Systems:- 入力 (
distorted): 点は歪んだ魚眼画像のピクセル座標、すなわち画像の左上隅からピクセル単位で測った座標で与えられることが期待される。 -
Output (
undistorted): The coordinate system depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標(正規化画像座標)になる。これは内部パラメータに依存しない、カメラの焦点面における無次元の座標である。
- 引数:
distorted- 魚眼画像のピクセル座標での歪んだ点座標の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はそのビューにおける点の数。K- 魚眼カメラのカメラ内部行列 \(\cameramatrix{K}\)。D- 魚眼歪み係数 \(\distcoeffsfisheye\) の入力ベクトル(正確に4つの係数を含む必要がある)。R- オブジェクト空間における平行化変換: 3x3 の1チャンネル、またはベクトル: 3x1/1x3 の1チャンネルか 1x1 の3チャンネル。空の場合は、単位変換が使用される。P- 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)。空または単位の場合、出力は正規化カメラ座標になる。criteria- 反復的な歪み補正アルゴリズムの終了基準。undistorted- 歪み補正された画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。座標系はパラメータ P に依存する(上記参照)。
- 入力 (
-
fisheye_undistortPoints
public static void fisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R, Mat P)
Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints. The fisheye model is suitable for wide-angle cameras. The function transforms points from the distorted fisheye image to undistorted coordinates, optionally applying a rectification transformation (R) and projecting to a new image plane (P). 覚え書き: Coordinate Systems:- 入力 (
distorted): 点は歪んだ魚眼画像のピクセル座標、すなわち画像の左上隅からピクセル単位で測った座標で与えられることが期待される。 -
Output (
undistorted): The coordinate system depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標(正規化画像座標)になる。これは内部パラメータに依存しない、カメラの焦点面における無次元の座標である。
- 引数:
distorted- 魚眼画像のピクセル座標での歪んだ点座標の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はそのビューにおける点の数。K- 魚眼カメラのカメラ内部行列 \(\cameramatrix{K}\)。D- 魚眼歪み係数 \(\distcoeffsfisheye\) の入力ベクトル(正確に4つの係数を含む必要がある)。R- オブジェクト空間における平行化変換: 3x3 の1チャンネル、またはベクトル: 3x1/1x3 の1チャンネルか 1x1 の3チャンネル。空の場合は、単位変換が使用される。P- 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)。空または単位の場合、出力は正規化カメラ座標になる。undistorted- 歪み補正された画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。座標系はパラメータ P に依存する(上記参照)。
- 入力 (
-
fisheye_undistortPoints
public static void fisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D, Mat R)
Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints. The fisheye model is suitable for wide-angle cameras. The function transforms points from the distorted fisheye image to undistorted coordinates, optionally applying a rectification transformation (R) and projecting to a new image plane (P). 覚え書き: Coordinate Systems:- 入力 (
distorted): 点は歪んだ魚眼画像のピクセル座標、すなわち画像の左上隅からピクセル単位で測った座標で与えられることが期待される。 -
Output (
undistorted): The coordinate system depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標(正規化画像座標)になる。これは内部パラメータに依存しない、カメラの焦点面における無次元の座標である。
- 引数:
distorted- 魚眼画像のピクセル座標での歪んだ点座標の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はそのビューにおける点の数。K- 魚眼カメラのカメラ内部行列 \(\cameramatrix{K}\)。D- 魚眼歪み係数 \(\distcoeffsfisheye\) の入力ベクトル(正確に4つの係数を含む必要がある)。R- オブジェクト空間における平行化変換: 3x3 の1チャンネル、またはベクトル: 3x1/1x3 の1チャンネルか 1x1 の3チャンネル。空の場合は、単位変換が使用される。出力は正規化カメラ座標になる。undistorted- 歪み補正された画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。座標系はパラメータ P に依存する(上記参照)。
- 入力 (
-
fisheye_undistortPoints
public static void fisheye_undistortPoints​(Mat distorted, Mat undistorted, Mat K, Mat D)
Undistorts 2D points using fisheye camera model This function performs undistortion for fisheye camera models, which use a different distortion model compared to the standard pinhole camera model used by #undistortPoints. The fisheye model is suitable for wide-angle cameras. The function transforms points from the distorted fisheye image to undistorted coordinates, optionally applying a rectification transformation (R) and projecting to a new image plane (P). 覚え書き: Coordinate Systems:- 入力 (
distorted): 点は歪んだ魚眼画像のピクセル座標、すなわち画像の左上隅からピクセル単位で測った座標で与えられることが期待される。 -
Output (
undistorted): The coordinate system depends on parameterP:Pが指定されている(空でない)場合: 出力点は、カメラ行列Pを用いた平行化/歪み除去後の画像平面のピクセル座標になる。Pが空または恒等の場合: 出力点は正規化カメラ座標(正規化画像座標)になる。これは内部パラメータに依存しない、カメラの焦点面における無次元の座標である。
- 引数:
distorted- 魚眼画像のピクセル座標での歪んだ点座標の配列。1xN/Nx1 の2チャンネル(または vector<Point2f> )。N はそのビューにおける点の数。K- 魚眼カメラのカメラ内部行列 \(\cameramatrix{K}\)。D- 魚眼歪み係数 \(\distcoeffsfisheye\) の入力ベクトル(正確に4つの係数を含む必要がある)。1チャンネルまたは 1x1 の3チャンネル。空の場合は、単位変換が使用される。出力は正規化カメラ座標になる。undistorted- 歪み補正された画像点の出力配列。1xN/Nx1 の2チャンネル、または vector<Point2f> 。座標系はパラメータ P に依存する(上記参照)。
- 入力 (
-
fisheye_estimateNewCameraMatrixForUndistortRectify
public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance, Size new_size, double fov_scale)
Estimates new camera intrinsic matrix for undistortion or rectification.- 引数:
K- カメラ内部行列 \(cameramatrix{K}\)。image_size- 画像のサイズD- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。R- オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネルP- 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)balance- 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。new_size- 新しいサイズfov_scale- 新しい焦点距離の除数。
-
fisheye_estimateNewCameraMatrixForUndistortRectify
public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance, Size new_size)
Estimates new camera intrinsic matrix for undistortion or rectification.- 引数:
K- カメラ内部行列 \(cameramatrix{K}\)。image_size- 画像のサイズD- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。R- オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネルP- 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)balance- 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。new_size- 新しいサイズ
-
fisheye_estimateNewCameraMatrixForUndistortRectify
public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P, double balance)
Estimates new camera intrinsic matrix for undistortion or rectification.- 引数:
K- カメラ内部行列 \(cameramatrix{K}\)。image_size- 画像のサイズD- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。R- オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネルP- 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)balance- 最小焦点距離と最大焦点距離の間の範囲で新しい焦点距離を設定する。balance は [0, 1] の範囲。
-
fisheye_estimateNewCameraMatrixForUndistortRectify
public static void fisheye_estimateNewCameraMatrixForUndistortRectify​(Mat K, Mat D, Size image_size, Mat R, Mat P)
Estimates new camera intrinsic matrix for undistortion or rectification.- 引数:
K- カメラ内部行列 \(cameramatrix{K}\)。image_size- 画像のサイズD- 歪み係数の入力ベクトル \(\distcoeffsfisheye\)。R- オブジェクト空間における平行化変換。3x3 のシングルチャンネル、またはベクトル: 3x1/1x3 のシングルチャンネルあるいは 1x1 の3チャンネルP- 新しいカメラ内部行列(3x3)または新しい射影行列(3x4)の焦点距離。balance は [0, 1] の範囲。
-
fisheye_solvePnP
public static boolean fisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags, TermCriteria criteria)
Finds an object pose from 3D-2D point correspondences for fisheye camera model.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- Method for solving a PnP problem: see REF: calib3d_solvePnP_flags This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
- REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
criteria- 内部の undistortPoints 呼び出しの終了基準。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。そちらを参照のこと。Perspective-n-Points については REF: calib3d_solvePnP で詳しく説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnP
public static boolean fisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int flags)
Finds an object pose from 3D-2D point correspondences for fisheye camera model.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。flags- Method for solving a PnP problem: see REF: calib3d_solvePnP_flags This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
- REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
- 戻り値:
- 自動生成
-
fisheye_solvePnP
public static boolean fisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)
Finds an object pose from 3D-2D point correspondences for fisheye camera model.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。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. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
- REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
- 戻り値:
- 自動生成
-
fisheye_solvePnP
public static boolean fisheye_solvePnP​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
Finds an object pose from 3D-2D point correspondences for fisheye camera model.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 1チャンネルまたは 1xN/Nx1 3チャンネル。N は点の数。vector<Point3d> もここに渡すことができる。imagePoints- 対応する画像点の配列。Nx2 1チャンネルまたは 1xN/Nx1 2チャンネル。N は点の数。vector<Point2d> もここに渡すことができる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- Output translation vector. the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. This function returns the rotation and the translation vectors that transform a 3D point expressed in the object coordinate frame to the camera coordinate frame, using different methods:- P3P 系手法(REF: SOLVEPNP_P3P, REF: SOLVEPNP_AP3P): 一意な解を返すには4つの入力点が必要。
- REF: SOLVEPNP_IPPE 入力点は4以上でなければならず、オブジェクト点は同一平面上にある必要がある。
- REF: SOLVEPNP_IPPE_SQUARE マーカー姿勢推定に適した特殊なケース。入力点の数は4でなければならない。オブジェクト点は次の順序で定義する必要がある:
- 点 0: [-squareLength / 2, squareLength / 2, 0]
- 点 1: [ squareLength / 2, squareLength / 2, 0]
- 点 2: [ squareLength / 2, -squareLength / 2, 0]
- 点 3: [-squareLength / 2, -squareLength / 2, 0]
- それ以外のすべてのフラグでは、入力点の数は >= 4 でなければならず、オブジェクト点は任意の配置でよい。
- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags, TermCriteria criteria)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- アルゴリズムが有用な結果を生成する確率。inliers- objectPoints と imagePoints 内のインライアのインデックスを格納する出力ベクトル。flags- PnP問題を解くためのメソッド: REF: calib3d_solvePnP_flags を参照criteria- 内部の undistortPoints 呼び出しの終了条件。関数は内部で REF: undistortPoints により点の歪みを除去し、REF: cv::solvePnP を呼び出すため、入力は非常に類似している。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP を参照。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- アルゴリズムが有用な結果を生成する確率。inliers- objectPoints と imagePoints 内のインライアのインデックスを格納する出力ベクトル。flags- PnP問題を解くための手法: REF: calib3d_solvePnP_flags を参照。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- アルゴリズムが有用な結果を生成する確率。inliers- objectPoints と imagePoints におけるインライアのインデックスを含む出力ベクトル。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。この引数の値は、観測された点の投影と計算された点の投影との間で、インライアとみなすために許容される最大距離である。confidence- アルゴリズムが有用な結果を生成する確率。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。iterationsCount- 反復回数。reprojectionError- RANSAC手続きで使用されるインライアのしきい値。このパラメータ値は、点をインライアとみなすための、観測された点投影と計算された点投影との間の最大許容距離である。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE で使用される引数。true (1) の場合、関数は与えられた rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、それらをさらに最適化する。iterationsCount- 反復回数。点をインライアとみなすための、観測された点投影と計算された点投影との間の最大許容距離である。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。useExtrinsicGuess- #SOLVEPNP_ITERATIVE に使用されるパラメータ。true (1) の場合、関数は提供された rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、さらにそれらを最適化する。点をインライアとみなすための、観測された点投影と計算された点投影との間の最大許容距離である。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
fisheye_solvePnPRansac
public static boolean fisheye_solvePnPRansac​(Mat objectPoints, Mat imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.- 引数:
objectPoints- オブジェクト座標空間におけるオブジェクト点の配列。Nx3 のシングルチャンネル、または 1xN/Nx1 の3チャンネルで、N は点の数。ここには vector<Point3d> を渡すこともできる。imagePoints- 対応する画像点の配列。Nx2 のシングルチャンネル、または 1xN/Nx1 の2チャンネルで、N は点の数。ここには vector<Point2d> を渡すこともできる。cameraMatrix- 入力カメラ内部行列 \(\cameramatrix{A}\)。distCoeffs- 歪み係数の入力ベクトル(4x1/1x4)。rvec- 出力回転ベクトル(REF: Rodrigues を参照)。tvec とともに、点をモデル座標系からカメラ座標系へ変換する。tvec- 出力並進ベクトル。提供された rvec と tvec の値をそれぞれ回転ベクトルと並進ベクトルの初期近似として使用し、さらにそれらを最適化する。点をインライアとみなすための、観測された点投影と計算された点投影との間の最大許容距離である。この関数は内部で REF: undistortPoints を用いて点の歪みを補正し、REF: cv::solvePnP を呼び出すため、入力は非常によく似ている。Perspective-n-Points に関する詳細は REF: calib3d_solvePnP で説明されている。- 戻り値:
- 自動生成
-
approxPolyDP
public static void approxPolyDP​(MatOfPoint2f curve, MatOfPoint2f approxCurve, double epsilon, boolean closed)
Approximates a polygonal curve(s) with the specified precision. T he function cv::approxPolyDP approximates a curve or a p*olygon with another curve/polygon with less vertices so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm <https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm>- 引数:
curve- std::vector または Mat に格納された2D点の入力ベクトルapproxCurve- 近似の結果。型は入力 curve の型と一致しなければならない。epsilon- 近似精度を指定する引数。元の曲線とその近似との間の最大距離である。closed- true の場合、近似された曲線は閉じている(最初と最後の頂点が接続される)。そうでない場合は閉じていない。
-
approxPolyN
public static void approxPolyN​(Mat curve, Mat approxCurve, int nsides, float epsilon_percentage, boolean ensure_convex)
Approximates a polygon with a convex hull with a specified accuracy and number of sides. T he cv::approxPolyN function approximates a polygon with *a convex hull so that the difference between the contour area of the original contour and the new polygon is minimal. It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal. Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered. Each vertex will lie either on the original contour or outside it. The algorithm based on the paper CITE: LowIlie2003 .- 引数:
curve- std::vector または Mat に格納された2D点群の入力ベクトル。点は float または整数でなければならない。approxCurve- 近似の結果。型は std::vector または Mat に格納された2D点(Point2f または Point)のベクトルである。nsides- 結果の多角形の辺の数を定義する引数。epsilon_percentage- 追加面積の最大値に対する割合を定義する。-1 の場合は使用されない。そうでない場合、追加面積が contourArea(_curve) * percentage より大きくなるとアルゴリズムは停止する。追加面積が上限を超えた場合、アルゴリズムは上限を超えた時点での頂点数をそのまま返す。ensure_convex- true の場合、アルゴリズムは入力輪郭の凸包を作成する。そうでない場合、入力ベクトルは凸である必要がある。
-
approxPolyN
public static void approxPolyN​(Mat curve, Mat approxCurve, int nsides, float epsilon_percentage)
Approximates a polygon with a convex hull with a specified accuracy and number of sides. T he cv::approxPolyN function approximates a polygon with *a convex hull so that the difference between the contour area of the original contour and the new polygon is minimal. It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal. Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered. Each vertex will lie either on the original contour or outside it. The algorithm based on the paper CITE: LowIlie2003 .- 引数:
curve- std::vector または Mat に格納された2D点群の入力ベクトル。点は float または整数でなければならない。approxCurve- 近似の結果。型は std::vector または Mat に格納された2D点(Point2f または Point)のベクトルである。nsides- 結果の多角形の辺の数を定義する引数。epsilon_percentage- 追加面積の最大値に対する割合を定義する。-1 の場合は使用されない。そうでない場合、追加面積が contourArea(_curve) * percentage より大きくなるとアルゴリズムは停止する。追加面積が上限を超えた場合、アルゴリズムは上限を超えた時点での頂点数をそのまま返す。
-
approxPolyN
public static void approxPolyN​(Mat curve, Mat approxCurve, int nsides)
Approximates a polygon with a convex hull with a specified accuracy and number of sides. T he cv::approxPolyN function approximates a polygon with *a convex hull so that the difference between the contour area of the original contour and the new polygon is minimal. It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal. Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered. Each vertex will lie either on the original contour or outside it. The algorithm based on the paper CITE: LowIlie2003 .- 引数:
curve- std::vector または Mat に格納された2D点群の入力ベクトル。点は float または整数でなければならない。approxCurve- 近似の結果。型は std::vector または Mat に格納された2D点(Point2f または Point)のベクトルである。nsides- 結果の多角形の辺の数を定義する引数。-1 の場合は使用されない。そうでない場合、追加面積が contourArea(_curve) * percentage より大きくなるとアルゴリズムは停止する。追加面積が上限を超えた場合、アルゴリズムは上限を超えた時点での頂点数をそのまま返す。
-
minAreaRect
public static RotatedRect minAreaRect​(MatOfPoint2f points)
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. The angle of rotation represents the angle between the line connecting the starting and ending points (based on the clockwise order with greatest index for the corner with greatest \(y\)) and the horizontal axis. This angle always falls between \([-90, 0)\) because, if the object rotates more than a rect angle, the next edge is used to measure the angle. The starting and ending points change as the object rotates.Developer should keep in mind that the returned RotatedRect can contain negative indices when data is close to the containing Mat element boundary.- 引数:
points- std::vector<> または Mat に格納された2D点の入力ベクトル- 戻り値:
- 自動生成
-
boxPoints
public static void boxPoints​(RotatedRect box, Mat points)
Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle. The function finds the four vertices of a rotated rectangle. The four vertices are returned in clockwise order starting from the point with greatest \(y\). If two points have the same \(y\) coordinate the rightmost is the starting point. This function is useful to draw the rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please visit the REF: tutorial_bounding_rotated_ellipses "tutorial on Creating Bounding rotated boxes and ellipses for contours" for more information.- 引数:
box- 入力の回転矩形。REF: minAreaRect の出力でもよい。points- 矩形の4つの頂点を格納する出力配列。
-
minEnclosingCircle
public static void minEnclosingCircle​(MatOfPoint2f points, Point center, float[] radius)
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.- 引数:
points- std::vector<> または Mat に格納された2D点の入力ベクトルcenter- 円の中心の出力。radius- 円の半径の出力。
-
minEnclosingTriangle
public static double minEnclosingTriangle​(Mat points, Mat triangle)
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 \(\theta(n)\) 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 \(O(n log(n))\) which is higher than \(\theta(n)\). Thus the overall complexity of the function is \(O(n log(n))\).- 引数:
points- ビット深度 CV_32S または CV_32F の2D点の入力ベクトル。std::vector<> または Mat に格納されるtriangle- 三角形の頂点を定義する3つの2D点の出力ベクトル。OutputArray のビット深度は CV_32F でなければならない。- 戻り値:
- 自動生成
-
minEnclosingConvexPolygon
public static double minEnclosingConvexPolygon​(Mat points, Mat polygon, int k)
Finds a convex polygon of minimum area enclosing a 2D point set and returns its area. This function takes a given set of 2D points and finds the enclosing polygon with k vertices and minimal area. It takes the set of points and the parameter k as input and returns the area of the minimal enclosing polygon. The Implementation is based on a paper by Aggarwal, Chang and Yap CITE: Aggarwal1985. They provide a \(\theta(n²log(n)log(k))\) algorithm for finding the minimal convex polygon with k vertices enclosing a 2D convex polygon with n vertices (k < n). Since the #minEnclosingConvexPolygon 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 \(O(n log(n))\) which is lower than \(\theta(n²log(n)log(k))\). Thus the overall complexity of the function is \(O(n²log(n)log(k))\).- 引数:
points- std::vector<> または Mat に格納された2D点の入力ベクトルpolygon- 包含多角形の頂点を定義する2D点の出力ベクトルk- 出力多角形の頂点数- 戻り値:
- 自動生成
-
moments
public static Moments moments​(Mat array, boolean binaryImage)
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.- 引数:
array- シングルチャンネルのラスター画像(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F)、または2D点(Point または Point2f)の配列( \(1 \times N\) または \(N \times 1\) )。binaryImage- true の場合、すべての非ゼロの画像ピクセルが1として扱われる。この引数は画像に対してのみ使用される。- 戻り値:
- モーメント。覚え書き: Pythonバインディングからの輪郭モーメント計算にのみ適用される。入力配列のnumpy型は np.int32 または np.float32 のいずれかでなければならない点に注意。覚え書き: 輪郭ベースのモーメントの場合、0次モーメント \c m00 は輪郭の面積を表す。入力された輪郭が退化している場合(例えば単一の点、またはすべての点が一直線上にある場合)、面積はゼロとなり、したがって \c m00 == 0 となる。この場合、重心座標(\c m10/m00, \c m01/m00)は未定義となり、呼び出し側が明示的に処理しなければならない。一般的な回避策としては、cv::boundingRect() を使うか、入力点を平均することで中心を計算する方法がある。SEE: contourArea, arcLength
-
moments
public static Moments moments​(Mat array)
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.- 引数:
array- シングルチャンネルのラスター画像(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F)、または2D点(Point または Point2f)の配列( \(1 \times N\) または \(N \times 1\) )。画像にのみ使用される。- 戻り値:
- モーメント。覚え書き: Pythonバインディングからの輪郭モーメント計算にのみ適用される。入力配列のnumpy型は np.int32 または np.float32 のいずれかでなければならない点に注意。覚え書き: 輪郭ベースのモーメントの場合、0次モーメント \c m00 は輪郭の面積を表す。入力された輪郭が退化している場合(例えば単一の点、またはすべての点が一直線上にある場合)、面積はゼロとなり、したがって \c m00 == 0 となる。この場合、重心座標(\c m10/m00, \c m01/m00)は未定義となり、呼び出し側が明示的に処理しなければならない。一般的な回避策としては、cv::boundingRect() を使うか、入力点を平均することで中心を計算する方法がある。SEE: contourArea, arcLength
-
matchShapes
public static double matchShapes​(Mat contour1, Mat contour2, int method, double parameter)
Compares two shapes. The function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)- 引数:
contour1- 1つ目の輪郭またはグレースケール画像。contour2- 2つ目の輪郭またはグレースケール画像。method- 比較方法。#ShapeMatchModes を参照。parameter- 方法固有の引数(現在はサポートされていない)。- 戻り値:
- 自動生成
-
convexHull
public static void convexHull​(MatOfPoint points, MatOfInt hull, boolean clockwise)
Finds the convex hull of a point set. The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm CITE: Sklansky82 that has *O(N logN)* complexity in the current implementation.- 引数:
points- std::vector または Mat に格納された入力2D点集合。hull- 出力される凸包。インデックスの整数ベクトルまたは点のベクトルのいずれかである。前者の場合、凸包の要素は元の配列における凸包の点の0始まりのインデックスである(凸包の点の集合は元の点集合の部分集合であるため)。後者の場合、凸包の要素は凸包の点そのものである。clockwise- 向きを示すフラグ。true の場合、出力される凸包は時計回りに向き付けされる。そうでない場合は反時計回りに向き付けされる。想定する座標系は、X軸が右を、Y軸が上を向く。凸包の点を返す。そうでない場合は凸包の点のインデックスを返す。出力配列が std::vector の場合、このフラグは無視され、出力はベクトルの型に依存する。std::vector<int> は returnPoints=false を意味し、std::vector<Point> は returnPoints=true を意味する。覚え書き:pointsとhullは異なる配列であるべきであり、インプレース処理はサポートされていない。詳細は REF: tutorial_hull "対応するチュートリアル" を参照。役立つリンク: https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
-
convexHull
public static void convexHull​(MatOfPoint points, MatOfInt hull)
Finds the convex hull of a point set. The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm CITE: Sklansky82 that has *O(N logN)* complexity in the current implementation.- 引数:
points- std::vector または Mat に格納された入力2D点集合。hull- 出力される凸包。インデックスの整数ベクトルまたは点のベクトルのいずれかである。前者の場合、凸包の要素は元の配列における凸包の点の0始まりのインデックスである(凸包の点の集合は元の点集合の部分集合であるため)。後者の場合、凸包の要素は凸包の点そのものである。そうでない場合は反時計回りに向き付けされる。想定する座標系は、X軸が右を、Y軸が上を向く。凸包の点を返す。そうでない場合は凸包の点のインデックスを返す。出力配列が std::vector の場合、このフラグは無視され、出力はベクトルの型に依存する。std::vector<int> は returnPoints=false を意味し、std::vector<Point> は returnPoints=true を意味する。覚え書き:pointsとhullは異なる配列であるべきであり、インプレース処理はサポートされていない。詳細は REF: tutorial_hull "対応するチュートリアル" を参照。役立つリンク: https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
-
convexityDefects
public static void convexityDefects​(MatOfPoint contour, MatOfInt convexhull, MatOfInt4 convexityDefects)
Finds the convexity defects of a contour. The figure below displays convexity defects of a hand contour: - 引数:
contour- 入力輪郭。convexhull- convexHull を使って得られる凸包。凸包を構成する輪郭点のインデックスを含む必要がある。convexityDefects- 凸性欠陥の出力ベクトル。C++ および新しい Python/Java インターフェースでは、各凸性欠陥は4要素の整数ベクトル(別名 #Vec4i)として表現される: (start_index, end_index, farthest_pt_index, fixpt_depth)。ここでインデックスは凸性欠陥の開始点、終了点、最遠点の、元の輪郭における0始まりのインデックスであり、fixpt_depth は最遠の輪郭点と凸包との間の距離の固定小数点近似(小数部8ビット)である。すなわち、ビット深度の浮動小数点値を得るには fixpt_depth/256.0 とする。
-
isContourConvex
public static boolean isContourConvex​(MatOfPoint contour)
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.- 引数:
contour- std::vector<> または Mat に格納された2D点の入力ベクトル- 戻り値:
- 自動生成
-
intersectConvexConvex
public static float intersectConvexConvex​(Mat p1, Mat p2, Mat p12, boolean handleNested)
Finds intersection of two convex polygons- 引数:
p1- 1つ目の多角形p2- 2つ目の多角形p12- 交差領域を表す出力多角形handleNested- true の場合、一方の多角形がもう一方に完全に包含されているときに交差が検出される。false の場合、交差は検出されない。多角形が辺を共有している場合、または一方の多角形の頂点がもう一方の辺上にある場合は、入れ子とはみなされず、handleNested の値にかかわらず交差が検出される。- 戻り値:
- 交差多角形の面積。アルゴリズムが収束していない場合(例: 非凸な入力)は負になることがある。覚え書き: intersectConvexConvex は両方の多角形が凸であることを確認しないため、凸でない場合は不正な結果を返す。
-
intersectConvexConvex
public static float intersectConvexConvex​(Mat p1, Mat p2, Mat p12)
Finds intersection of two convex polygons- 引数:
p1- 1つ目の多角形p2- 2つ目の多角形p12- 交差領域を表す出力多角形。false の場合、交差は検出されない。多角形が辺を共有している場合、または一方の多角形の頂点がもう一方の辺上にある場合は、入れ子とはみなされず、handleNested の値にかかわらず交差が検出される。- 戻り値:
- 交差多角形の面積。アルゴリズムが収束していない場合(例: 非凸な入力)は負になることがある。覚え書き: intersectConvexConvex は両方の多角形が凸であることを確認しないため、凸でない場合は不正な結果を返す。
-
fitEllipse
public static RotatedRect fitEllipse​(MatOfPoint2f points)
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.- 引数:
points- std::vector<> または Mat に格納された入力2D点集合 覚え書き: 入力点の型は REF: Point2i または REF: Point2f であり、少なくとも5点が必要である。覚え書き: 楕円フィッティング誤差の計算には REF: getClosestEllipsePoints 関数を使用できる。- 戻り値:
- 自動生成
-
fitEllipseAMS
public static RotatedRect fitEllipseAMS​(Mat points)
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 \( \chi= \left(x^2, x y, y^2, x, y, 1\right) \), which is a set of six free coefficients \( A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} \). However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \( (a,b) \), the position \( (x_0,y_0) \), and the orientation \( \theta \). 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 \( A^T ( D_x^T D_x + D_y^T D_y) A = 1 \) where the matrices \( Dx \) and \( Dy \) are the partial derivatives of the design matrix \( D \) with respect to x and y. The matrices are formed row by row applying the following to each of the points in the set: \(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\} \) The AMS method minimizes the cost function \(equation*}{ \epsilon ^2=\frac{ A^T D^T D A }{ A^T (D_x^T D_x + D_y^T D_y) A^T } \) The minimum cost is found by solving the generalized eigenvalue problem. \(equation*}{ D^T D A = \lambda \left( D_x^T D_x + D_y^T D_y\right) A \)- 引数:
points- std::vector<> または Mat に格納された入力2D点集合 覚え書き: 入力点の型は REF: Point2i または REF: Point2f であり、少なくとも5点が必要である。覚え書き: 楕円フィッティング誤差の計算には REF: getClosestEllipsePoints 関数を使用できる。- 戻り値:
- 自動生成
-
fitEllipseDirect
public static RotatedRect fitEllipseDirect​(Mat points)
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: oy1998NumericallySD is used. For an ellipse, this basis set is \( \chi= \left(x^2, x y, y^2, x, y, 1\right) \), which is a set of six free coefficients \( A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} \). However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \( (a,b) \), the position \( (x_0,y_0) \), and the orientation \( \theta \). 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 \( 4 A_{xx} A_{yy}- A_{xy}^2 > 0 \). The condition imposed is that \( 4 A_{xx} A_{yy}- A_{xy}^2=1 \) which satisfies the inequality and as the coefficients can be arbitrarily scaled is not overly restrictive. \(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) \) The minimum cost is found by solving the generalized eigenvalue problem. \(equation*}{ D^T D A = \lambda \left( C\right) A \) The system produces only one positive eigenvalue \( \lambda\) which is chosen as the solution with its eigenvector \(\mathbf{u}\). These are used to find the coefficients \(equation*}{ A = \sqrt{\frac{1}{\mathbf{u}^T C \mathbf{u}}} \mathbf{u} \) The scaling factor guarantees that \(A^T C A =1\).- 引数:
points- std::vector<> または Mat に格納された入力2D点集合 覚え書き: 入力点の型は REF: Point2i または REF: Point2f であり、少なくとも5点が必要である。覚え書き: 楕円フィッティング誤差の計算には REF: getClosestEllipsePoints 関数を使用できる。- 戻り値:
- 自動生成
-
getClosestEllipsePoints
public static void getClosestEllipsePoints​(RotatedRect ellipse_params, Mat points, Mat closest_pts)
Compute for each 2d point the nearest 2d point located on a given ellipse. The function computes the nearest 2d location on a given ellipse for a vector of 2d points and is based on CITE: Chatfield2017 code. This function can be used to compute for instance the ellipse fitting error.- 引数:
ellipse_params- 楕円の引数points- 入力2D点closest_pts- 各2D点について、与えられた楕円上に位置する対応する最も近い2D点 覚え書き: 入力点の型は REF: Point2i または REF: Point2f である SEE: fitEllipse, fitEllipseAMS, fitEllipseDirect
-
fitLine
public static void fitLine​(Mat points, Mat line, int distType, double param, double reps, double aeps)
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 \(\sum_i \rho(r_i)\) where \(r_i\) is a distance between the \(i^{th}\) point, the line and \(\rho(r)\) is a distance function, one of the following: - DIST_L2 \(\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}\) - DIST_L1 \(\rho (r) = r\) - DIST_L12 \(\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)\) - DIST_FAIR \(\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\) - DIST_WELSCH \(\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\) - DIST_HUBER \(\rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345\) The algorithm is based on the M-estimator ( <https://en.wikipedia.org/wiki/M-estimator> ) technique that iteratively fits the line using the weighted least-squares algorithm. After each iteration the weights \(w_i\) are adjusted to be inversely proportional to \(\rho(r_i)\) .- 引数:
points- std::vector<> または Mat に格納された2Dまたは3D点の入力ベクトル。line- 出力される直線の引数。2Dフィッティングの場合、4要素のベクトル(Vec4f のような) - (vx, vy, x0, y0) であるべきで、(vx, vy) は直線に共線な正規化ベクトル、(x0, y0) は直線上の点である。3Dフィッティングの場合、6要素のベクトル(Vec6f のような) - (vx, vy, vz, x0, y0, z0) であるべきで、(vx, vy, vz) は直線に共線な正規化ベクトル、(x0, y0, z0) は直線上の点である。distType- M推定量で使用される距離。#DistanceTypes を参照。param- 一部の距離の種類における数値引数 ( C )。0 の場合は最適値が選択される。reps- 半径(座標原点と直線との間の距離)に対する十分な精度。aeps- 角度に対する十分な精度。reps と aeps には 0.01 が適切なデフォルト値である。
-
pointPolygonTest
public static double pointPolygonTest​(MatOfPoint2f contour, Point pt, boolean measureDist)
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: - 引数:
contour- 入力輪郭。pt- 輪郭に対して判定される点。measureDist- true の場合、関数は点から最も近い輪郭エッジまでの符号付き距離を推定する。そうでない場合、関数は点が輪郭の内部にあるかどうかのみを確認する。- 戻り値:
- 自動生成
-
rotatedRectangleIntersection
public static int rotatedRectangleIntersection​(RotatedRect rect1, RotatedRect rect2, Mat intersectingRegion)
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. - 引数:
rect1- 1つ目の矩形rect2- 2つ目の矩形intersectingRegion- 交差領域の頂点を格納する出力配列。最大8個の頂点を返す。std::vector<cv::Point2f> または CV_32FC2 型の Mx1 の cv::Mat として格納される。- 戻り値:
- #RectanglesIntersectTypes のいずれか
-
arcLength
public static double arcLength​(MatOfPoint2f curve, boolean closed)
Calculates a contour perimeter or a curve length. The function computes a curve length or a closed contour perimeter.- 引数:
curve- std::vector または Mat に格納された2D点の入力ベクトル。closed- 曲線が閉じているかどうかを示すフラグ。- 戻り値:
- 自動生成
-
contourArea
public static double contourArea​(Mat contour, boolean oriented)
Calculates a contour area. The function computes a contour area. Similarly to moments , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong results for contours with self-intersections. Example:vector<Point> contour; contour.push_back(Point2f(0, 0)); contour.push_back(Point2f(10, 0)); contour.push_back(Point2f(10, 10)); contour.push_back(Point2f(5, 4)); double area0 = contourArea(contour); vector<Point> approx; approxPolyDP(contour, approx, 5, true); double area1 = contourArea(approx); cout << "area0 =" << area0 << endl << "area1 =" << area1 << endl << "approx poly vertices" << approx.size() << endl;- 引数:
contour- std::vector または Mat に格納された2D点(輪郭頂点)の入力ベクトル。oriented- 符号付き面積フラグ。true の場合、関数は輪郭の向き(時計回りまたは反時計回り)に応じた符号付きの面積値を返す。この機能を使えば、面積の符号から輪郭の向きを判定できる。デフォルトでは引数は false であり、絶対値が返されることを意味する。- 戻り値:
- 自動生成
-
contourArea
public static double contourArea​(Mat contour)
Calculates a contour area. The function computes a contour area. Similarly to moments , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong results for contours with self-intersections. Example:vector<Point> contour; contour.push_back(Point2f(0, 0)); contour.push_back(Point2f(10, 0)); contour.push_back(Point2f(10, 10)); contour.push_back(Point2f(5, 4)); double area0 = contourArea(contour); vector<Point> approx; approxPolyDP(contour, approx, 5, true); double area1 = contourArea(approx); cout << "area0 =" << area0 << endl << "area1 =" << area1 << endl << "approx poly vertices" << approx.size() << endl;- 引数:
contour- std::vector または Mat に格納された2D点(輪郭頂点)の入力ベクトル。輪郭の向き(時計回りまたは反時計回り)に応じる。この機能を使えば、面積の符号から輪郭の向きを判定できる。デフォルトでは引数は false であり、絶対値が返されることを意味する。- 戻り値:
- 自動生成
-
boundingRect
public static Rect boundingRect​(Mat array)
Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image. The function calculates and returns the minimal up-right bounding rectangle for the specified point set or non-zero pixels of gray-scale image.- 引数:
array- std::vector または Mat に格納された入力グレースケール画像または2D点集合。- 戻り値:
- 自動生成
-
getRotationMatrix2D
public static Mat getRotationMatrix2D​(Point center, double angle, double scale)
Calculates an affine matrix of 2D rotation. The function calculates the following matrix: \(\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}\) where \(\begin{array}{l} \alpha = \texttt{scale} \cdot \cos \texttt{angle} , \\ \beta = \texttt{scale} \cdot \sin \texttt{angle} \end{array}\) The transformation maps the rotation center to itself. If this is not the target, adjust the shift.- 引数:
center- 入力画像における回転の中心。angle- 回転角度(度)。正の値は反時計回りの回転を意味する(座標原点は左上隅にあると仮定する)。scale- 等方的な拡大縮小係数。 SEE: getAffineTransform, warpAffine, transform- 戻り値:
- 自動生成
-
invertAffineTransform
public static void invertAffineTransform​(Mat M, Mat iM)
Inverts an affine transformation. The function computes an inverse affine transformation represented by \(2 \times 3\) matrix M: \(\begin{bmatrix} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \end{bmatrix}\) The result is also a \(2 \times 3\) matrix of the same type as M.- 引数:
M- 元のアフィン変換。iM- 出力される逆アフィン変換。
-
getPerspectiveTransform
public static Mat getPerspectiveTransform​(Mat src, Mat dst, int solveMethod)
Calculates a perspective transform from four pairs of the corresponding points. The function calculates the \(3 \times 3\) matrix of a perspective transform so that: \(\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}\) where \(dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\)- 引数:
src- 入力画像における四角形の頂点の座標。dst- 出力画像における対応する四辺形の頂点の座標。solveMethod- cv::solve に渡される手法 (#DecompTypes) SEE: findHomography, warpPerspective, perspectiveTransform- 戻り値:
- 自動生成
-
getPerspectiveTransform
public static Mat getPerspectiveTransform​(Mat src, Mat dst)
Calculates a perspective transform from four pairs of the corresponding points. The function calculates the \(3 \times 3\) matrix of a perspective transform so that: \(\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}\) where \(dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\)- 引数:
src- 入力画像における四角形の頂点の座標。dst- 出力画像における対応する四辺形の頂点の座標。 SEE: findHomography, warpPerspective, perspectiveTransform- 戻り値:
- 自動生成
-
getAffineTransform
public static Mat getAffineTransform​(MatOfPoint2f src, MatOfPoint2f dst)