projective_trans_regionT_projective_trans_regionProjectiveTransRegionProjectiveTransRegion (Operator)

Name

projective_trans_regionT_projective_trans_regionProjectiveTransRegionProjectiveTransRegion — Anwenden einer projektiven Transformation auf eine Region.

Signatur

projective_trans_region(Regions : TransRegions : HomMat2D, Interpolation : )

Herror T_projective_trans_region(const Hobject Regions, Hobject* TransRegions, const Htuple HomMat2D, const Htuple Interpolation)

void ProjectiveTransRegion(const HObject& Regions, HObject* TransRegions, const HTuple& HomMat2D, const HTuple& Interpolation)

HRegion HRegion::ProjectiveTransRegion(const HHomMat2D& HomMat2D, const HString& Interpolation) const

HRegion HRegion::ProjectiveTransRegion(const HHomMat2D& HomMat2D, const char* Interpolation) const

HRegion HRegion::ProjectiveTransRegion(const HHomMat2D& HomMat2D, const wchar_t* Interpolation) const   (Nur Windows)

HRegion HHomMat2D::ProjectiveTransRegion(const HRegion& Regions, const HString& Interpolation) const

HRegion HHomMat2D::ProjectiveTransRegion(const HRegion& Regions, const char* Interpolation) const

HRegion HHomMat2D::ProjectiveTransRegion(const HRegion& Regions, const wchar_t* Interpolation) const   (Nur Windows)

static void HOperatorSet.ProjectiveTransRegion(HObject regions, out HObject transRegions, HTuple homMat2D, HTuple interpolation)

HRegion HRegion.ProjectiveTransRegion(HHomMat2D homMat2D, string interpolation)

HRegion HHomMat2D.ProjectiveTransRegion(HRegion regions, string interpolation)

Beschreibung

projective_trans_regionprojective_trans_regionProjectiveTransRegionProjectiveTransRegionProjectiveTransRegion wendet die durch die homogene Matrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2D beschriebene projektive Transformation auf die Regionen in RegionsRegionsRegionsRegionsregions an und liefert die Ergebnisregionen in TransRegionsTransRegionsTransRegionsTransRegionstransRegions zurück.

Zur Berechnung und Interpretation der Matrix siehe projective_trans_imageprojective_trans_imageProjectiveTransImageProjectiveTransImageProjectiveTransImage.

Wird 'clip_region'"clip_region""clip_region""clip_region""clip_region" durch set_system('clip_region', 'true')set_system("clip_region", "true")SetSystem("clip_region", "true")SetSystem("clip_region", "true")SetSystem("clip_region", "true") auf seinen Grundzustand 'true'"true""true""true""true" gesetzt, oder ist die Transformation entartet, erzeugt also unendlich große Regionen, so wird die Ausgaberegion durch das Rechteck mit linker oberer Ecke (0, 0) und rechter unterer Ecke ('width'"width""width""width""width", 'height'"height""height""height""height") beschnitten, wobei 'width'"width""width""width""width" und 'height'"height""height""height""height" Systemvariablen sind (siehe get_systemget_systemGetSystemGetSystemGetSystem). Falls 'clip_region'"clip_region""clip_region""clip_region""clip_region" auf 'false'"false""false""false""false" gesetzt wird, so wird die Ausgaberegion nur durch die maximale unterstützte Koordinatengröße 'MAX_FORMAT'"MAX_FORMAT""MAX_FORMAT""MAX_FORMAT""MAX_FORMAT" beschränkt. Dies kann zu sehr speicher- und zeitintensiven Berechnungen führen, ist also mit Vorsicht zu benutzen.

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_regionprojective_trans_regionProjectiveTransRegionProjectiveTransRegionProjectiveTransRegion entspricht für jeden Punkt (Row_i, Col_i) der Region 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 der Region mit Operatoren wie z.B. area_centerarea_centerAreaCenterAreaCenterAreaCenter abgeleitet wurden. Wenn z.B. eine rotationssymmetrische Region unter Verwendung von hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotateHomMat2dRotate um ihren mit area_centerarea_centerAreaCenterAreaCenterAreaCenter bestimmten Schwerpunkt rotiert wird, so liegt die transformierte Region nicht auf der Originalregion. Dieser Effekt kann dadurch kompensiert werden, dass vor dem Aufruf von projective_trans_regionprojective_trans_regionProjectiveTransRegionProjectiveTransRegionProjectiveTransRegion 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_region(Region, TransRegion, HomMat2DAdapted, 'bilinear')

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

Ausführungsinformationen

Parameter

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHobject

Eingaberegionen.

TransRegionsTransRegionsTransRegionsTransRegionstransRegions (output_object)  region(-array) objectHRegionHRegionHobject *

Ergebnisregionen.

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"

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_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSizeProjectiveTransImageSize, projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXldProjectiveTransContourXld, projective_trans_point_2dprojective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2dProjectiveTransPoint2d, projective_trans_pixelprojective_trans_pixelProjectiveTransPixelProjectiveTransPixelProjectiveTransPixel

Modul

Foundation