Skip to content

projective_trans_pixelProjectiveTransPixelProjectiveTransPixelprojective_trans_pixelT_projective_trans_pixel🔗

Short description🔗

projective_trans_pixelProjectiveTransPixelProjectiveTransPixelprojective_trans_pixelT_projective_trans_pixel — Project pixel coordinates using a homogeneous projective transformation matrix.

Signature🔗

projective_trans_pixel( hom_mat2d HomMat2D, point.x Row, point.y Col, out point.x RowTrans, out point.y ColTrans )void ProjectiveTransPixel( const HTuple& HomMat2D, const HTuple& Row, const HTuple& Col, HTuple* RowTrans, HTuple* ColTrans )static void HOperatorSet.ProjectiveTransPixel( HTuple homMat2D, HTuple row, HTuple col, out HTuple rowTrans, out HTuple colTrans )def projective_trans_pixel( hom_mat_2d: Sequence[float], row: MaybeSequence[Union[float, int]], col: MaybeSequence[Union[float, int]] ) -> Tuple[Sequence[float], Sequence[float]]

def projective_trans_pixel_s( hom_mat_2d: Sequence[float], row: MaybeSequence[Union[float, int]], col: MaybeSequence[Union[float, int]] ) -> Tuple[float, float]Herror T_projective_trans_pixel( const Htuple HomMat2D, const Htuple Row, const Htuple Col, Htuple* RowTrans, Htuple* ColTrans )

void HHomMat2D::ProjectiveTransPixel( const HTuple& Row, const HTuple& Col, HTuple* RowTrans, HTuple* ColTrans ) const

void HHomMat2D::ProjectiveTransPixel( double Row, double Col, double* RowTrans, double* ColTrans ) const

void HHomMat2D.ProjectiveTransPixel( HTuple row, HTuple col, out HTuple rowTrans, out HTuple colTrans )

void HHomMat2D.ProjectiveTransPixel( double row, double col, out double rowTrans, out double colTrans )

Description🔗

projective_trans_pixelProjectiveTransPixel applies the homogeneous projective transformation matrix HomMat2DhomMat2Dhom_mat_2d to all input pixels (Rowrowrow,Colcolcol) and returns an array of output pixels (RowTransrowTransrow_trans,ColTranscolTranscol_trans). The transformation is described by the homogeneous transformation matrix given in HomMat2DhomMat2Dhom_mat_2d.

The difference between projective_trans_pixelProjectiveTransPixel and projective_trans_point_2dProjectiveTransPoint2d lies in the used coordinate system: projective_trans_pixelProjectiveTransPixel uses a coordinate system with origin in the upper left corner of the image, while projective_trans_point_2dProjectiveTransPoint2d uses the standard image coordinate system, whose origin lies in the middle of the upper left pixel and which is also used by operators like area_centerAreaCenter.

projective_trans_pixelProjectiveTransPixel corresponds to the following steps (input and output points as homogeneous vectors):

\[\begin{eqnarray*} \left( \begin{array}{c} \texttt{RTrans} \\ \texttt{CTrans} \\ \texttt{WTrans} \end{array} \right) & = & \textrm{HomMat2D} \cdot \left( \begin{array}{c} \textrm{Row} \\ \textrm{Col} \\ 1 \end{array} \right) \\ \left( \begin{array}{c} \textrm{RowTrans} \\ \textrm{ColTrans} \end{array} \right) & = & \left( \begin{array}{c} \frac{\texttt{RTrans}}{\texttt{WTrans}} \\ \frac{\texttt{CTrans}}{\texttt{WTrans}} \end{array} \right) \end{eqnarray*}\]

If a point at infinity (\(\texttt{WTrans} = 0\)) is created by the transformation, an error is returned.

Further Information🔗

For an explanation of the different 2D coordinate systems used in HALCON, see the introduction of chapter Transformations / 2D Transformations.

Execution information🔗

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.

Rowrowrow (input_control) point.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Input pixel(s) (row coordinate).

Default: 6464
Suggested values: 0, 16, 32, 64, 128, 256, 512, 10240, 16, 32, 64, 128, 256, 512, 1024

Colcolcol (input_control) point.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Input pixel(s) (column coordinate).

Default: 6464
Suggested values: 0, 16, 32, 64, 128, 256, 512, 10240, 16, 32, 64, 128, 256, 512, 1024

RowTransrowTransrow_trans (output_control) point.x(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Output pixel(s) (row coordinate).

ColTranscolTranscol_trans (output_control) point.y(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Output pixel(s) (column 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_point_2dProjectiveTransPoint2d

Module🔗

Foundation