ClassesClassesClassesClasses | | | | Operators

vector_to_proj_hom_mat2d_distortionT_vector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionVectorToProjHomMat2dDistortion (Operator)

Name

vector_to_proj_hom_mat2d_distortionT_vector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionVectorToProjHomMat2dDistortion — Compute a projective transformation matrix and the radial distortion coefficient using given image point correspondences.

Signature

vector_to_proj_hom_mat2d_distortion( : : Points1Row, Points1Col, Points2Row, Points2Col, CovRR1, CovRC1, CovCC1, CovRR2, CovRC2, CovCC2, ImageWidth, ImageHeight, Method : HomMat2D, Kappa, Error)

Herror T_vector_to_proj_hom_mat2d_distortion(const Htuple Points1Row, const Htuple Points1Col, const Htuple Points2Row, const Htuple Points2Col, const Htuple CovRR1, const Htuple CovRC1, const Htuple CovCC1, const Htuple CovRR2, const Htuple CovRC2, const Htuple CovCC2, const Htuple ImageWidth, const Htuple ImageHeight, const Htuple Method, Htuple* HomMat2D, Htuple* Kappa, Htuple* Error)

Herror vector_to_proj_hom_mat2d_distortion(const HTuple& Points1Row, const HTuple& Points1Col, const HTuple& Points2Row, const HTuple& Points2Col, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& Method, HTuple* HomMat2D, HTuple* Kappa, HTuple* Error)

void VectorToProjHomMat2dDistortion(const HTuple& Points1Row, const HTuple& Points1Col, const HTuple& Points2Row, const HTuple& Points2Col, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& Method, HTuple* HomMat2D, HTuple* Kappa, HTuple* Error)

double HHomMat2D::VectorToProjHomMat2dDistortion(const HTuple& Points1Row, const HTuple& Points1Col, const HTuple& Points2Row, const HTuple& Points2Col, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, Hlong ImageWidth, Hlong ImageHeight, const HString& Method, double* Error)

double HHomMat2D::VectorToProjHomMat2dDistortion(const HTuple& Points1Row, const HTuple& Points1Col, const HTuple& Points2Row, const HTuple& Points2Col, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, Hlong ImageWidth, Hlong ImageHeight, const char* Method, double* Error)

void HOperatorSetX.VectorToProjHomMat2dDistortion(
[in] VARIANT Points1Row, [in] VARIANT Points1Col, [in] VARIANT Points2Row, [in] VARIANT Points2Col, [in] VARIANT CovRR1, [in] VARIANT CovRC1, [in] VARIANT CovCC1, [in] VARIANT CovRR2, [in] VARIANT CovRC2, [in] VARIANT CovCC2, [in] VARIANT ImageWidth, [in] VARIANT ImageHeight, [in] VARIANT Method, [out] VARIANT* HomMat2d, [out] VARIANT* Kappa, [out] VARIANT* Error)

double HHomMat2DX.VectorToProjHomMat2dDistortion(
[in] VARIANT Points1Row, [in] VARIANT Points1Col, [in] VARIANT Points2Row, [in] VARIANT Points2Col, [in] VARIANT CovRR1, [in] VARIANT CovRC1, [in] VARIANT CovCC1, [in] VARIANT CovRR2, [in] VARIANT CovRC2, [in] VARIANT CovCC2, [in] Hlong ImageWidth, [in] Hlong ImageHeight, [in] BSTR Method, [out] double* Error)

static void HOperatorSet.VectorToProjHomMat2dDistortion(HTuple points1Row, HTuple points1Col, HTuple points2Row, HTuple points2Col, HTuple covRR1, HTuple covRC1, HTuple covCC1, HTuple covRR2, HTuple covRC2, HTuple covCC2, HTuple imageWidth, HTuple imageHeight, HTuple method, out HTuple homMat2D, out HTuple kappa, out HTuple error)

double HHomMat2D.VectorToProjHomMat2dDistortion(HTuple points1Row, HTuple points1Col, HTuple points2Row, HTuple points2Col, HTuple covRR1, HTuple covRC1, HTuple covCC1, HTuple covRR2, HTuple covRC2, HTuple covCC2, int imageWidth, int imageHeight, string method, out double error)

Description

vector_to_proj_hom_mat2d_distortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionVectorToProjHomMat2dDistortion determines the projective transformation matrix HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D and the radial distortion coefficient KappaKappaKappaKappaKappakappa from given point correspondences (Points1RowPoints1RowPoints1RowPoints1RowPoints1Rowpoints1Row,Points1ColPoints1ColPoints1ColPoints1ColPoints1Colpoints1Col), (Points2RowPoints2RowPoints2RowPoints2RowPoints2Rowpoints2Row,Points2ColPoints2ColPoints2ColPoints2ColPoints2Colpoints2Col) that optimally fulfill the following equation:

Here, denote image points that are obtained by undistorting the input image points with the division model (see calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras):
Here, denote the distorted image points, specified relative to the image center. Thus, vector_to_proj_hom_mat2d_distortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionVectorToProjHomMat2dDistortion assumes that the principal point of the camera, i.e., the center of the radial distortions, lies at the center of the image. Note that the images from which the points (Points1RowPoints1RowPoints1RowPoints1RowPoints1Rowpoints1Row,Points1ColPoints1ColPoints1ColPoints1ColPoints1Colpoints1Col) and (Points2RowPoints2RowPoints2RowPoints2RowPoints2Rowpoints2Row,Points2ColPoints2ColPoints2ColPoints2ColPoints2Colpoints2Col) are extracted, have to be obtained with the same camera.

The returned KappaKappaKappaKappaKappakappa can be used to construct camera parameters that can be used to rectify images or points (see change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamPar, change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImage, and change_radial_distortion_pointschange_radial_distortion_pointsChangeRadialDistortionPointschange_radial_distortion_pointsChangeRadialDistortionPointsChangeRadialDistortionPoints):

The minimum number of required point correspondences is five. vector_to_proj_hom_mat2d_distortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionvector_to_proj_hom_mat2d_distortionVectorToProjHomMat2dDistortionVectorToProjHomMat2dDistortion seeks to minimize the transformation error between the point correspondences based on the above equations. To achieve such a minimization, two different algorithms are available. The algorithm to use can be chosen using the parameter MethodMethodMethodMethodMethodmethod. For MethodMethodMethodMethodMethodmethod = 'linear'"linear""linear""linear""linear""linear", a linear algorithm that minimizes an algebraic error based on the above equations is used. This algorithm is very fast and returns accurate results for small to moderate noise of the point coordinates and for most distortions (except for small distortions). For MethodMethodMethodMethodMethodmethod = 'gold_standard'"gold_standard""gold_standard""gold_standard""gold_standard""gold_standard", a mathematically optimal but slower optimization is used, which minimizes the geometric reprojection error. In general, it is preferable to use MethodMethodMethodMethodMethodmethod = 'gold_standard'"gold_standard""gold_standard""gold_standard""gold_standard""gold_standard".

If 'gold_standard'"gold_standard""gold_standard""gold_standard""gold_standard""gold_standard" is used, the covariances of the image points (CovRR1CovRR1CovRR1CovRR1CovRR1covRR1, CovRC1CovRC1CovRC1CovRC1CovRC1covRC1, CovCC1CovCC1CovCC1CovCC1CovCC1covCC1, CovRR2CovRR2CovRR2CovRR2CovRR2covRR2, CovRC2CovRC2CovRC2CovRC2CovRC2covRC2, CovCC2CovCC2CovCC2CovCC2CovCC2covCC2) can be incorporated into the computation. They can be provided, for example, by the operator points_foerstnerpoints_foerstnerPointsFoerstnerpoints_foerstnerPointsFoerstnerPointsFoerstner. If the point covariances are unknown, which is the default, empty tuples are passed. In this case, the optimization algorithm internally assumes uniform and equal covariances for all points. If 'linear'"linear""linear""linear""linear""linear" is used, the covariances are ignored and the covariance parameters can be left empty.

The value ErrorErrorErrorErrorErrorerror indicates the overall quality of the optimization procedure and is the mean symmetric euclidian distance in pixels between the points and their corresponding transformed points.

If the correspondence between the points has not been determined, proj_match_points_distortion_ransacproj_match_points_distortion_ransacProjMatchPointsDistortionRansacproj_match_points_distortion_ransacProjMatchPointsDistortionRansacProjMatchPointsDistortionRansac or proj_match_points_distortion_ransac_guidedproj_match_points_distortion_ransac_guidedProjMatchPointsDistortionRansacGuidedproj_match_points_distortion_ransac_guidedProjMatchPointsDistortionRansacGuidedProjMatchPointsDistortionRansacGuided should be used to determine the correspondence as well as the transformation.

Attention

It should be noted that if a homogeneous transformation matrix is used to transform images, regions, XLD contours, or any other data that has been extracted from images, it is assumed that the origin of the coordinate system of the homogeneous transformation matrix lies in the upper left corner of a pixel. The image processing operators that return point coordinates, however, assume a coordinate system in which the origin lies in the center of a pixel. Therefore, to obtain a consistent homogeneous transformation matrix, 0.5 must be added to the point coordinates before computing the transformation.

Parallelization

Parameters

Points1RowPoints1RowPoints1RowPoints1RowPoints1Rowpoints1Row (input_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Input points in image 1 (row coordinate).

Restriction: length(Points1Row) >= 5

Points1ColPoints1ColPoints1ColPoints1ColPoints1Colpoints1Col (input_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Input points in image 1 (column coordinate).

Restriction: length(Points1Col) == length(Points1Row)

Points2RowPoints2RowPoints2RowPoints2RowPoints2Rowpoints2Row (input_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Input points in image 2 (row coordinate).

Restriction: length(Points2Row) == length(Points1Row)

Points2ColPoints2ColPoints2ColPoints2ColPoints2Colpoints2Col (input_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Input points in image 2 (column coordinate).

Restriction: length(Points2Col) == length(Points1Row)

CovRR1CovRR1CovRR1CovRR1CovRR1covRR1 (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate variance of the points in image 1.

Default value: []

CovRC1CovRC1CovRC1CovRC1CovRC1covRC1 (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Covariance of the points in image 1.

Default value: []

CovCC1CovCC1CovCC1CovCC1CovCC1covCC1 (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate variance of the points in image 1.

Default value: []

CovRR2CovRR2CovRR2CovRR2CovRR2covRR2 (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate variance of the points in image 2.

Default value: []

CovRC2CovRC2CovRC2CovRC2CovRC2covRC2 (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Covariance of the points in image 2.

Default value: []

CovCC2CovCC2CovCC2CovCC2CovCC2covCC2 (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate variance of the points in image 2.

Default value: []

ImageWidthImageWidthImageWidthImageWidthImageWidthimageWidth (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of the images from which the points were extracted.

Restriction: ImageWidth > 0

ImageHeightImageHeightImageHeightImageHeightImageHeightimageHeight (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of the images from which the points were extracted.

Restriction: ImageHeight > 0

MethodMethodMethodMethodMethodmethod (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Estimation algorithm.

Default value: 'gold_standard' "gold_standard" "gold_standard" "gold_standard" "gold_standard" "gold_standard"

List of values: 'gold_standard'"gold_standard""gold_standard""gold_standard""gold_standard""gold_standard", 'linear'"linear""linear""linear""linear""linear"

HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D (output_control)  hom_mat2d HHomMat2D, HTupleHTupleHTupleHHomMat2DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

Homogeneous projective transformation matrix.

KappaKappaKappaKappaKappakappa (output_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Computed radial distortion coefficient.

ErrorErrorErrorErrorErrorerror (output_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Root-Mean-Square transformation error.

Possible Predecessors

proj_match_points_distortion_ransacproj_match_points_distortion_ransacProjMatchPointsDistortionRansacproj_match_points_distortion_ransacProjMatchPointsDistortionRansacProjMatchPointsDistortionRansac, proj_match_points_distortion_ransac_guidedproj_match_points_distortion_ransac_guidedProjMatchPointsDistortionRansacGuidedproj_match_points_distortion_ransac_guidedProjMatchPointsDistortionRansacGuidedProjMatchPointsDistortionRansacGuided, points_foerstnerpoints_foerstnerPointsFoerstnerpoints_foerstnerPointsFoerstnerPointsFoerstner, points_harrispoints_harrisPointsHarrispoints_harrisPointsHarrisPointsHarris

Possible Successors

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamPar, change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImage, change_radial_distortion_pointschange_radial_distortion_pointsChangeRadialDistortionPointschange_radial_distortion_pointsChangeRadialDistortionPointsChangeRadialDistortionPoints, projective_trans_imageprojective_trans_imageProjectiveTransImageprojective_trans_imageProjectiveTransImageProjectiveTransImage, projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSize, projective_trans_regionprojective_trans_regionProjectiveTransRegionprojective_trans_regionProjectiveTransRegionProjectiveTransRegion, projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXld, projective_trans_point_2dprojective_trans_point_2dProjectiveTransPoint2dprojective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2d, projective_trans_pixelprojective_trans_pixelProjectiveTransPixelprojective_trans_pixelProjectiveTransPixelProjectiveTransPixel

Alternatives

vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2d, hom_vector_to_proj_hom_mat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2d

See also

calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras

References

Richard Hartley, Andrew Zisserman: “Multiple View Geometry in Computer Vision”; Cambridge University Press, Cambridge; 2003.
Olivier Faugeras, Quang-Tuan Luong: “The Geometry of Multiple Images: The Laws That Govern the Formation of Multiple Images of a Scene and Some of Their Applications”; MIT Press, Cambridge, MA; 2001.

Module

Calibration


ClassesClassesClassesClasses | | | | Operators