projective_trans_image_sizeT_projective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSize (Operator)

Name

projective_trans_image_sizeT_projective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSize — Berechnen der projektive Transformation eines Bildes bei vorgegebener Zielgröße.

Signatur

projective_trans_image_size(Image : TransImage : HomMat2D, Interpolation, Width, Height, TransformDomain : )

Herror T_projective_trans_image_size(const Hobject Image, Hobject* TransImage, const Htuple HomMat2D, const Htuple Interpolation, const Htuple Width, const Htuple Height, const Htuple TransformDomain)

void ProjectiveTransImageSize(const HObject& Image, HObject* TransImage, const HTuple& HomMat2D, const HTuple& Interpolation, const HTuple& Width, const HTuple& Height, const HTuple& TransformDomain)

HImage HImage::ProjectiveTransImageSize(const HHomMat2D& HomMat2D, const HString& Interpolation, Hlong Width, Hlong Height, const HString& TransformDomain) const

HImage HImage::ProjectiveTransImageSize(const HHomMat2D& HomMat2D, const char* Interpolation, Hlong Width, Hlong Height, const char* TransformDomain) const

HImage HImage::ProjectiveTransImageSize(const HHomMat2D& HomMat2D, const wchar_t* Interpolation, Hlong Width, Hlong Height, const wchar_t* TransformDomain) const   (Nur Windows)

HImage HHomMat2D::ProjectiveTransImageSize(const HImage& Image, const HString& Interpolation, Hlong Width, Hlong Height, const HString& TransformDomain) const

HImage HHomMat2D::ProjectiveTransImageSize(const HImage& Image, const char* Interpolation, Hlong Width, Hlong Height, const char* TransformDomain) const

HImage HHomMat2D::ProjectiveTransImageSize(const HImage& Image, const wchar_t* Interpolation, Hlong Width, Hlong Height, const wchar_t* TransformDomain) const   (Nur Windows)

static void HOperatorSet.ProjectiveTransImageSize(HObject image, out HObject transImage, HTuple homMat2D, HTuple interpolation, HTuple width, HTuple height, HTuple transformDomain)

HImage HImage.ProjectiveTransImageSize(HHomMat2D homMat2D, string interpolation, int width, int height, string transformDomain)

HImage HHomMat2D.ProjectiveTransImageSize(HImage image, string interpolation, int width, int height, string transformDomain)

Beschreibung

projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSizeProjectiveTransImageSize wendet die durch die homogene Transformationsmatrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D beschriebene projektive Transformation (Homographie) auf das Eingabebild ImageImageImageImageimage an und speichert das Ergebnis in das Ausgabebild TransImageTransImageTransImageTransImagetransImage.

TransImageTransImageTransImageTransImagetransImage wird dabei auf die Zielgröße HeightHeightHeightHeightheightxWidthWidthWidthWidthwidth beschnitten. Ansonsten entspricht der Operator der Alternative projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImage.

Achtung

Der Transformation liegt das gleiche Koordinatensystem zugrunde, das auch bei dem Operator affine_trans_pixelaffine_trans_pixelAffineTransPixelAffineTransPixelAffineTransPixel verwendet wird. Das bedeutet, dass die Transformation nicht mit der Transformationsmatrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D, sondern mit einer modifizierte Version davon durchgeführt wird. Eine Transformation mit projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSizeProjectiveTransImageSize entspricht für jeden Punkt (Row_i, Col_i) des Bildes der folgenden Kette von Transformationen (Ein- und Ausgabekoordinaten als homogene Vektoren dargestellt):

Dies kann zu unerwarteten Ergebnissen führen, wenn die Transformationsmatrix unter Verwendung von Koordinaten erstellt wurde, die von dem Bild mit Operatoren wie z.B. area_center_grayarea_center_grayAreaCenterGrayAreaCenterGrayAreaCenterGray abgeleitet wurden. Wenn z.B. ein rotationssymmetrisches Bild unter Verwendung von hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotateHomMat2dRotate um seinen mit area_center_grayarea_center_grayAreaCenterGrayAreaCenterGrayAreaCenterGray bestimmten Schwerpunkt rotiert wird, so liegt das transformierte Bild nicht auf dem Originalbild. Dieser Effekt kann dadurch kompensiert werden, dass vor dem Aufruf von projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSizeProjectiveTransImageSize die Transformationsmatrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D durch die beiden folgenden Translationen modifiziert wird:

hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp) hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) projective_trans_image_size(Image, TransImage, HomMat2DAdapted, 'bilinear', Width, Height, 'false')

Ein Überblick zu den verschiedenen in HALCON verwendeten 2D Koordinatensystemen ist in der Einleitung zum Kapitel Transformationen / 2D-Transformationen gegeben.

projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSizeProjectiveTransImageSize kann auf OpenCL Geräten ausgeführt werden, wenn das Eingangsbild die maximale Größe für Bildobjekte des ausgewählten Gerätes nicht überschreitet und der Parameter TransformDomainTransformDomainTransformDomainTransformDomaintransformDomain auf 'false'"false""false""false""false" gesetzt wird. Das Ergebnis kann dabei geringfügig von dem auf der CPU berechneten abweichen.

Ausführungsinformationen

Parameter

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHobject (byte* / uint2* / real*) *erlaubt für Compute Devices

Eingabebild.

TransImageTransImageTransImageTransImagetransImage (output_object)  (multichannel-)image(-array) objectHImageHImageHobject * (byte / uint2 / real)

Ergebnisbild.

HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D (input_control)  hom_mat2d HHomMat2D, HTupleHTupleHtuple (real) (double) (double) (double)

Homogene projektive Transformationsmatrix.

InterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Interpolationsmethode für die Transformation.

Defaultwert: 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear"

Werteliste: 'bilinear'"bilinear""bilinear""bilinear""bilinear", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor"

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Ausgabebildes.

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Ausgabebildes.

TransformDomainTransformDomainTransformDomainTransformDomaintransformDomain (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Soll die Region des Eingabebildes auch transformiert werden?

Defaultwert: 'false' "false" "false" "false" "false"

Werteliste: 'false'"false""false""false""false", 'true'"true""true""true""true"

Werteliste (für Compute Devices): 'false'"false""false""false""false"

Vorgänger

vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2dVectorToProjHomMat2d, hom_vector_to_proj_hom_mat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2d, proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansacProjMatchPointsRansac, proj_match_points_ransac_guidedproj_match_points_ransac_guidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuided, hom_mat3d_projecthom_mat3d_projectHomMat3dProjectHomMat3dProjectHomMat3dProject

Siehe auch

projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImage, projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldProjectiveTransContourXld, projective_trans_regionprojective_trans_regionProjectiveTransRegionProjectiveTransRegionProjectiveTransRegion, projective_trans_point_2dprojective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2dProjectiveTransPoint2d, projective_trans_pixelprojective_trans_pixelProjectiveTransPixelProjectiveTransPixelProjectiveTransPixel

Modul

Foundation