projective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2dprojective_trans_point_2dT_projective_trans_point_2d
Short description
projective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2dprojective_trans_point_2dT_projective_trans_point_2d — Project a homogeneous 2D point using a projective transformation
matrix.
Signature
projective_trans_point_2d( hom_mat2d HomMat2D, number Px, number Py, number Pw, out number Qx, out number Qy, out number Qw )void ProjectiveTransPoint2d( const HTuple& HomMat2D, const HTuple& Px, const HTuple& Py, const HTuple& Pw, HTuple* Qx, HTuple* Qy, HTuple* Qw )static void HOperatorSet.ProjectiveTransPoint2d( HTuple homMat2D, HTuple px, HTuple py, HTuple pw, out HTuple qx, out HTuple qy, out HTuple qw )def projective_trans_point_2d( hom_mat_2d: Sequence[float], px: MaybeSequence[Union[float, int]], py: MaybeSequence[Union[float, int]], pw: MaybeSequence[Union[float, int]] ) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]
def projective_trans_point_2d_s( hom_mat_2d: Sequence[float], px: MaybeSequence[Union[float, int]], py: MaybeSequence[Union[float, int]], pw: MaybeSequence[Union[float, int]] ) -> Tuple[float, float, float]Herror T_projective_trans_point_2d( const Htuple HomMat2D, const Htuple Px, const Htuple Py, const Htuple Pw, Htuple* Qx, Htuple* Qy, Htuple* Qw )
HTuple HHomMat2D::ProjectiveTransPoint2d( const HTuple& Px, const HTuple& Py, const HTuple& Pw, HTuple* Qy, HTuple* Qw ) const
double HHomMat2D::ProjectiveTransPoint2d( double Px, double Py, double Pw, double* Qy, double* Qw ) const
HTuple HHomMat2D.ProjectiveTransPoint2d( HTuple px, HTuple py, HTuple pw, out HTuple qy, out HTuple qw )
double HHomMat2D.ProjectiveTransPoint2d( double px, double py, double pw, out double qy, out double qw )
Description
projective_trans_point_2dProjectiveTransPoint2d applies the homogeneous projective
transformation matrix HomMat2DhomMat2Dhom_mat_2d to all homogeneous input
points (Pxpxpx,Pypypy,Pwpwpw) and returns an array of
homogeneous output points (Qxqxqx,Qyqyqy,Qwqwqw). The
transformation is described by the homogeneous transformation matrix
given in HomMat2DhomMat2Dhom_mat_2d. This corresponds to the following
equation (input and output points as homogeneous vectors):
\[\begin{eqnarray*}
\left( \begin{array}{c}
\textrm{Qx} \\
\textrm{Qy} \\
\textrm{Qw}
\end{array} \right) =
\textrm{HomMat2D} \cdot
\left( \begin{array}{c}
\textrm{Px} \\
\textrm{Py} \\
\textrm{Pw}
\end{array} \right)
\end{eqnarray*}\]
To transform the homogeneous coordinates to Euclidean coordinates,
they have to be divided by Qwqwqw:
\[\begin{eqnarray*}
\left( \begin{array}{c}
Ex \\
Ey
\end{array} \right) =
\left( \begin{array}{c}
\frac{Qx}{Qw} \\
\frac{Qy}{Qw}
\end{array} \right)
\end{eqnarray*}\]
If the points to transform are specified in standard image
coordinates, their row coordinates must be passed in
Pxpxpx and their column coordinates in Pypypy. This
is necessary to obtain a right-handed coordinate system for the
image. In particular, this assures that rotations are performed in
the correct direction. Note that the (\(x\),\(y\)) order of the
matrices quite naturally corresponds to the usual (row,column) order
for coordinates in the image.
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Automatically parallelized on internal data level.
Parameters
HomMat2DhomMat2Dhom_mat_2d (input_control) hom_mat2d → (real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)
Homogeneous projective transformation matrix.
Pxpxpx (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)
Input point (x coordinate).
Pypypy (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)
Input point (y coordinate).
Pwpwpw (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)
Input point (w coordinate).
Qxqxqx (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Output point (x coordinate).
Qyqyqy (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Output point (y coordinate).
Qwqwqw (output_control) number(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Output point (w coordinate).
Combinations with other operators
Combinations
Possible predecessors
vector_to_proj_hom_mat2dVectorToProjHomMat2d, hom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2d, proj_match_points_ransacProjMatchPointsRansac, proj_match_points_ransac_guidedProjMatchPointsRansacGuided, hom_mat3d_projectHomMat3dProject
See also
projective_trans_imageProjectiveTransImage, projective_trans_image_sizeProjectiveTransImageSize, projective_trans_regionProjectiveTransRegion, projective_trans_contour_xldProjectiveTransContourXld, projective_trans_pixelProjectiveTransPixel
Module
Foundation