ClassesClassesClassesClasses | | | | Operators

projective_trans_regionT_projective_trans_regionProjectiveTransRegionprojective_trans_regionProjectiveTransRegionProjectiveTransRegion (Operator)

Name

projective_trans_regionT_projective_trans_regionProjectiveTransRegionprojective_trans_regionProjectiveTransRegionProjectiveTransRegion — Apply a projective transformation to a region.

Signature

projective_trans_region(Regions : TransRegions : HomMat2D, Interpolation : )

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

Herror projective_trans_region(Hobject Regions, Hobject* TransRegions, const HTuple& HomMat2D, const HTuple& Interpolation)

HRegion HRegion::ProjectiveTransRegion(const HTuple& HomMat2D, const HTuple& Interpolation) const

HRegionArray HRegionArray::ProjectiveTransRegion(const HTuple& HomMat2D, const HTuple& Interpolation) const

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 HHomMat2D::ProjectiveTransRegion(const HRegion& Regions, const HString& Interpolation) const

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

void HOperatorSetX.ProjectiveTransRegion(
[in] IHUntypedObjectX* Regions, [out] IHUntypedObjectX*TransRegions, [in] VARIANT HomMat2d, [in] VARIANT Interpolation)

IHRegionX* HRegionX.ProjectiveTransRegion(
[in] IHHomMat2DX* HomMat2d, [in] BSTR Interpolation)

IHRegionX* HHomMat2DX.ProjectiveTransRegion(
[in] IHRegionX* Regions, [in] BSTR Interpolation)

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)

Description

projective_trans_regionprojective_trans_regionProjectiveTransRegionprojective_trans_regionProjectiveTransRegionProjectiveTransRegion applies the projective transformation specified by the homogeneous matrix HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D on the regions in RegionsRegionsRegionsRegionsRegionsregions and returns the transformed regions in TransRegionsTransRegionsTransRegionsTransRegionsTransRegionstransRegions.

For creation and interpretation details of this matrix see also projective_trans_imageprojective_trans_imageProjectiveTransImageprojective_trans_imageProjectiveTransImageProjectiveTransImage.

If 'clip_region'"clip_region""clip_region""clip_region""clip_region""clip_region" is set to its default value 'true'"true""true""true""true""true" by set_system('clip_region', 'true')set_system("clip_region", "true")SetSystem("clip_region", "true")set_system("clip_region", "true")SetSystem("clip_region", "true")SetSystem("clip_region", "true") or if the transformation is degenerated and thus produces infinite regions, the output region is clipped by the rectangle with upper left corner (0, 0) and lower right corner ('width'"width""width""width""width""width", 'height'"height""height""height""height""height"), where 'width'"width""width""width""width""width" and 'height'"height""height""height""height""height" are system variables (see also get_systemget_systemGetSystemget_systemGetSystemGetSystem). If 'clip_region'"clip_region""clip_region""clip_region""clip_region""clip_region" is 'false'"false""false""false""false""false", the output region is not clipped except by the maximum supported coordinate size 'MAX_FORMAT'"MAX_FORMAT""MAX_FORMAT""MAX_FORMAT""MAX_FORMAT""MAX_FORMAT". This may result in extremely memory and time intensive computations, so use with care.

Attention

The used coordinate system is the same as in affine_trans_pixelaffine_trans_pixelAffineTransPixelaffine_trans_pixelAffineTransPixelAffineTransPixel. This means that in fact not HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D is applied but a modified version. Therefore, applying projective_trans_regionprojective_trans_regionProjectiveTransRegionprojective_trans_regionProjectiveTransRegionProjectiveTransRegion corresponds to the following chain of transformations, which is applied to each point (Row_i, Col_i) of the region (input and output pixels as homogeneous vectors):

  / RowTrans_i \   / 1 0 -0.5 \              / 1 0 +0.5 \   / Row_i \
  | ColTrans_i | = | 0 1 -0.5 | * HomMat2D * | 0 1 +0.5 | * | Col_i |
  \    1       /   \ 0 0   1  /              \ 0 0   1  /   \  1    /

As an effect, you might get unexpected results when creating projective transformations based on coordinates that are derived from the region, e.g., by operators like area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter. For example, if you use this operator to calculate the center of gravity of a rotationally symmetric region and then rotate the region around this point using hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotate, the resulting region will not lie on the original one. In such a case, you can compensate this effect by applying the following translations to HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D before using it in projective_trans_regionprojective_trans_regionProjectiveTransRegionprojective_trans_regionProjectiveTransRegionProjectiveTransRegion:

  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')

Parallelization

Parameters

RegionsRegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Input regions.

TransRegionsTransRegionsTransRegionsTransRegionsTransRegionstransRegions (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Output regions.

HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D (input_control)  hom_mat2d HHomMat2D, HTupleHTupleHTupleHHomMat2DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

Homogeneous projective transformation matrix.

InterpolationInterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Interpolation method for the transformation.

Default value: 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear"

List of values: 'bilinear'"bilinear""bilinear""bilinear""bilinear""bilinear", 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor"

Possible Predecessors

vector_to_proj_hom_mat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dvector_to_proj_hom_mat2dVectorToProjHomMat2dVectorToProjHomMat2d, hom_vector_to_proj_hom_mat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dhom_vector_to_proj_hom_mat2dHomVectorToProjHomMat2dHomVectorToProjHomMat2d, proj_match_points_ransacproj_match_points_ransacProjMatchPointsRansacproj_match_points_ransacProjMatchPointsRansacProjMatchPointsRansac, proj_match_points_ransac_guidedproj_match_points_ransac_guidedProjMatchPointsRansacGuidedproj_match_points_ransac_guidedProjMatchPointsRansacGuidedProjMatchPointsRansacGuided, hom_mat3d_projecthom_mat3d_projectHomMat3dProjecthom_mat3d_projectHomMat3dProjectHomMat3dProject

See also

projective_trans_imageprojective_trans_imageProjectiveTransImageprojective_trans_imageProjectiveTransImageProjectiveTransImage, projective_trans_image_sizeprojective_trans_image_sizeProjectiveTransImageSizeprojective_trans_image_sizeProjectiveTransImageSizeProjectiveTransImageSize, projective_trans_contour_xldprojective_trans_contour_xldProjectiveTransContourXldprojective_trans_contour_xldProjectiveTransContourXldProjectiveTransContourXld, projective_trans_point_2dprojective_trans_point_2dProjectiveTransPoint2dprojective_trans_point_2dProjectiveTransPoint2dProjectiveTransPoint2d, projective_trans_pixelprojective_trans_pixelProjectiveTransPixelprojective_trans_pixelProjectiveTransPixelProjectiveTransPixel

Module

Foundation


ClassesClassesClassesClasses | | | | Operators