Skip to content

vector_to_hom_mat3dVectorToHomMat3dVectorToHomMat3dvector_to_hom_mat3dT_vector_to_hom_mat3d🔗

Short description🔗

vector_to_hom_mat3dVectorToHomMat3dVectorToHomMat3dvector_to_hom_mat3dT_vector_to_hom_mat3d — Approximate a 3D transformation from point correspondences.

Signature🔗

vector_to_hom_mat3d( string TransformationType, point3d.x Px, point3d.y Py, point3d.z Pz, point3d.x Qx, point3d.x Qy, point3d.z Qz, out hom_mat3d HomMat3D )void VectorToHomMat3d( const HTuple& TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz, HTuple* HomMat3D )static void HOperatorSet.VectorToHomMat3d( HTuple transformationType, HTuple px, HTuple py, HTuple pz, HTuple qx, HTuple qy, HTuple qz, out HTuple homMat3D )def vector_to_hom_mat3d( transformation_type: str, px: Sequence[float], py: Sequence[float], pz: Sequence[float], qx: Sequence[float], qy: Sequence[float], qz: Sequence[float] ) -> Sequence[float]

Herror T_vector_to_hom_mat3d( const Htuple TransformationType, const Htuple Px, const Htuple Py, const Htuple Pz, const Htuple Qx, const Htuple Qy, const Htuple Qz, Htuple* HomMat3D )

void HHomMat3D::VectorToHomMat3d( const HString& TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz )

void HHomMat3D::VectorToHomMat3d( const char* TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz )

void HHomMat3D::VectorToHomMat3d( const wchar_t* TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz ) (Windows only)

void HHomMat3D.VectorToHomMat3d( string transformationType, HTuple px, HTuple py, HTuple pz, HTuple qx, HTuple qy, HTuple qz )

Description🔗

vector_to_hom_mat3dVectorToHomMat3d approximates an affine or projective 3D transformation from point correspondences and returns it as the homogeneous transformation matrix HomMat3DhomMat3Dhom_mat_3d.

The type of the 3D transformation to compute is specified with TransformationTypetransformationTypetransformation_type. For TransformationTypetransformationTypetransformation_type \(=\) 'rigid'"rigid", a rigid 3D transformation (a rotation and a translation), for TransformationTypetransformationTypetransformation_type \(=\) 'similarity'"similarity", a 3D similarity transformation (a uniform scaling, a rotation, and a translation), for TransformationTypetransformationTypetransformation_type \(=\) 'affine'"affine" a general affine 3D transformation, and for TransformationTypetransformationTypetransformation_type \(=\) 'projective'"projective" a projective 3D transformation is computed.

The minimum required number of point correspondences is 3 for TransformationTypetransformationTypetransformation_type \(=\) 'rigid'"rigid", 3 for TransformationTypetransformationTypetransformation_type \(=\) 'similarity'"similarity", 4 for TransformationTypetransformationTypetransformation_type \(=\) 'affine'"affine", and 5 for TransformationTypetransformationTypetransformation_type \(=\) 'projective'"projective".

The point correspondences are passed in the tuples (Pxpxpx,Pypypy,Pzpzpz) and (Qxqxqx,Qyqyqy,Qzqzqz), where corresponding points must be at the same index positions in the tuples. If more than the minimum number of point correspondences are passed, the transformation is overdetermined. In this case, the returned transformation is the transformation that minimizes the distances between the transformed input points (Pxpxpx,Pypypy,Pzpzpz) and the points (Qxqxqx,Qyqyqy,Qzqzqz), as described in the following equation (points as homogeneous vectors):

\[\begin{eqnarray*} \sum_{i} \: \left\| \mvHomVectorThreeD{\textrm{Qx}[i]}{\textrm{Qy}[i]}{\textrm{Qz}[i]} - \textrm{HomMat3D} \cdot \mvHomVectorThreeD{\textrm{Px}[i]}{\textrm{Py}[i]}{\textrm{Pz}[i]} \right\|^{\mbox{2}} = \mbox{minimum} \end{eqnarray*}\]

HomMat3DhomMat3Dhom_mat_3d can be used directly with operators that transform 3D data using affine transformations, e.g., affine_trans_point_3dAffineTransPoint3d.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

TransformationTypetransformationTypetransformation_type (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Type of the transformation to compute.

Default: 'rigid'"rigid"
List of values: 'affine', 'projective', 'rigid', 'similarity'"affine", "projective", "rigid", "similarity"

Pxpxpx (input_control) point3d.x-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

X coordinates of the original points.

Pypypy (input_control) point3d.y-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Y coordinates of the original points.

Pzpzpz (input_control) point3d.z-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Z coordinates of the original points.

Qxqxqx (input_control) point3d.x-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

X coordinates of the transformed points.

Qyqyqy (input_control) point3d.x-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Y coordinates of the transformed points.

Qzqzqz (input_control) point3d.z-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Z coordinates of the transformed points.

HomMat3DhomMat3Dhom_mat_3d (output_control) hom_mat3d → (real)HTuple (double)HHomMat3D, HTuple (double)Sequence[float]Htuple (double)

Output transformation matrix.

Combinations with other operators🔗

Combinations

Possible successors

hom_mat3d_to_poseHomMat3dToPose, affine_trans_point_3dAffineTransPoint3d

See also

point_pluecker_line_to_hom_mat3dPointPlueckerLineToHomMat3d

Module🔗

Foundation