Skip to content

polar_trans_region_invpolar_trans_region_invPolarTransRegionInvPolarTransRegionInvpolar_trans_region_invpolar_trans_region_inv🔗

Short description🔗

polar_trans_region_invpolar_trans_region_invPolarTransRegionInvPolarTransRegionInvpolar_trans_region_invpolar_trans_region_inv — Transform a region in polar coordinates back to Cartesian coordinates.

Signature🔗

polar_trans_region_inv( region PolarRegion, out region XYTransRegion, number Row, number Column, angle.rad AngleStart, angle.rad AngleEnd, number RadiusStart, number RadiusEnd, extent.x WidthIn, extent.y HeightIn, extent.x Width, extent.y Height, string Interpolation )polar_trans_region_inv( PolarRegion : XYTransRegion : Row, Column, AngleStart, AngleEnd, RadiusStart, RadiusEnd, WidthIn, HeightIn, Width, Height, Interpolation : )void PolarTransRegionInv( const HObject& PolarRegion, HObject* XYTransRegion, const HTuple& Row, const HTuple& Column, const HTuple& AngleStart, const HTuple& AngleEnd, const HTuple& RadiusStart, const HTuple& RadiusEnd, const HTuple& WidthIn, const HTuple& HeightIn, const HTuple& Width, const HTuple& Height, const HTuple& Interpolation )static void HOperatorSet.PolarTransRegionInv( HObject polarRegion, out HObject XYTransRegion, HTuple row, HTuple column, HTuple angleStart, HTuple angleEnd, HTuple radiusStart, HTuple radiusEnd, HTuple widthIn, HTuple heightIn, HTuple width, HTuple height, HTuple interpolation )def polar_trans_region_inv( polar_region: HObject, row: Union[int, float], column: Union[int, float], angle_start: float, angle_end: float, radius_start: Union[int, float], radius_end: Union[int, float], width_in: int, height_in: int, width: int, height: int, interpolation: str ) -> HObject

Herror polar_trans_region_inv( const Hobject PolarRegion, Hobject* XYTransRegion, double Row, double Column, double AngleStart, double AngleEnd, double RadiusStart, double RadiusEnd, const Hlong WidthIn, const Hlong HeightIn, const Hlong Width, const Hlong Height, const char* Interpolation )

Herror T_polar_trans_region_inv( const Hobject PolarRegion, Hobject* XYTransRegion, const Htuple Row, const Htuple Column, const Htuple AngleStart, const Htuple AngleEnd, const Htuple RadiusStart, const Htuple RadiusEnd, const Htuple WidthIn, const Htuple HeightIn, const Htuple Width, const Htuple Height, const Htuple Interpolation )

HRegion HRegion::PolarTransRegionInv( const HTuple& Row, const HTuple& Column, double AngleStart, double AngleEnd, const HTuple& RadiusStart, const HTuple& RadiusEnd, Hlong WidthIn, Hlong HeightIn, Hlong Width, Hlong Height, const HString& Interpolation ) const

HRegion HRegion::PolarTransRegionInv( double Row, double Column, double AngleStart, double AngleEnd, double RadiusStart, double RadiusEnd, Hlong WidthIn, Hlong HeightIn, Hlong Width, Hlong Height, const HString& Interpolation ) const

HRegion HRegion::PolarTransRegionInv( double Row, double Column, double AngleStart, double AngleEnd, double RadiusStart, double RadiusEnd, Hlong WidthIn, Hlong HeightIn, Hlong Width, Hlong Height, const char* Interpolation ) const

HRegion HRegion::PolarTransRegionInv( double Row, double Column, double AngleStart, double AngleEnd, double RadiusStart, double RadiusEnd, Hlong WidthIn, Hlong HeightIn, Hlong Width, Hlong Height, const wchar_t* Interpolation ) const (Windows only)

HRegion HRegion.PolarTransRegionInv( HTuple row, HTuple column, double angleStart, double angleEnd, HTuple radiusStart, HTuple radiusEnd, int widthIn, int heightIn, int width, int height, string interpolation )

HRegion HRegion.PolarTransRegionInv( double row, double column, double angleStart, double angleEnd, double radiusStart, double radiusEnd, int widthIn, int heightIn, int width, int height, string interpolation )

Description🔗

polar_trans_region_invPolarTransRegionInv transforms the polar coordinate representation of a region, stored in PolarRegionpolarRegionpolar_region, back onto an annular arc in Cartesian coordinates, described by the radii RadiusStartradiusStartradius_start and RadiusEndradiusEndradius_end and the angles AngleStartangleStartangle_start and AngleEndangleEndangle_end with the center point located at (Rowrowrow, Columncolumncolumn). All of these values can be chosen as real numbers. In addition, the dimensions of the virtual image containing the region PolarRegionpolarRegionpolar_region must be given in WidthInwidthInwidth_in and HeightInheightInheight_in. \(\textrm{WidthIn}-1\) is the column coordinate corresponding to AngleEndangleEndangle_end and \(\textrm{HeightIn}-1\) is the row coordinate corresponding to RadiusEndradiusEndradius_end. AngleStartangleStartangle_start and RadiusStartradiusStartradius_start correspond to column and row coordinate 00. Furthermore, the dimensions Widthwidthwidth and Heightheightheight of the virtual output image containing the transformed region XYTransRegionXYTransRegionxytrans_region are required.

The angles and radii are inclusive, which means that the row coordinate 00 in PolarRegionpolarRegionpolar_region will be mapped onto a a circle with a distance of RadiusStartradiusStartradius_start pixels from the specified center and the row with the coordinate \(\textrm{HeightIn}-1\) will be mapped onto a circle of radius RadiusEndradiusEndradius_end. This applies to AngleStartangleStartangle_start, AngleEndangleEndangle_end, and WidthInwidthInwidth_in in an analogous way.

The parameter Interpolationinterpolationinterpolation is used to select the interpolation method 'bilinear'"bilinear" or 'nearest_neighbor'"nearest_neighbor". Setting Interpolationinterpolationinterpolation to 'bilinear'"bilinear" leads to smoother region boundaries, especially if regions are enlarged. However, the runtime increases significantly.

polar_trans_region_invPolarTransRegionInv is the inverse function of polar_trans_regionPolarTransRegion.

The call sequence:

 
polar_trans_region(Region, PolarRegion, Row, Column, rad(360), 0, 0 Radius, Width, Height, 'nearest_neighbor')
polar_trans_region_inv(PolarRegion, XYTransRegion, Row, Column, rad(360), 0, 0, Radius, Width, Height, Width, Height, 'nearest_neighbor')

returns the region Regionregionregion, restricted to the circle around (Rowrowrow, Columncolumncolumn) with radius Radiusradiusradius, as its output region XYTransRegionXYTransRegionxytrans_region.

If more than one region is passed in PolarRegionpolarRegionpolar_region, their Cartesian transformations are computed individually and stored as a tuple in XYTransRegionXYTransRegionxytrans_region. Please note that the indices of an input region and its transformation only correspond if the system variable 'store_empty_regions'"store_empty_regions" is set to 'false'"false" (see set_systemSetSystem). Otherwise empty output regions are discarded and the length of the input tuple PolarRegionpolarRegionpolar_region is most likely not equal to the length of the output tuple XYTransRegionXYTransRegionxytrans_region.

Further Information🔗

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

Attention🔗

If Widthwidthwidth or Heightheightheight are chosen greater than the dimensions of the current image, the system variable 'clip_region'"clip_region" should be set to 'false'"false" (see set_systemSetSystem). Otherwise, an output region that does not lie within the dimensions of the current image can produce an error message.

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 tuple level.

  • Automatically parallelized on internal data level.

Parameters🔗

PolarRegionpolarRegionpolar_region (input_object) region(-array) → objectobjectHObjectHRegionHObjectHobject

Input region.

XYTransRegionXYTransRegionxytrans_region (output_object) region(-array) → objectobjectHObjectHRegionHObjectHobject *

Output region.

Rowrowrow (input_control) number → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Row coordinate of the center of the arc.

Default: 256256
Suggested values: 0, 16, 32, 64, 128, 240, 256, 480, 5120, 16, 32, 64, 128, 240, 256, 480, 512
Value range: -131068 ≤ Row ≤ 131068

Columncolumncolumn (input_control) number → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Column coordinate of the center of the arc.

Default: 256256
Suggested values: 0, 16, 32, 64, 128, 256, 320, 512, 6400, 16, 32, 64, 128, 256, 320, 512, 640
Value range: -131068 ≤ Column ≤ 131068

AngleStartangleStartangle_start (input_control) angle.rad → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Angle of the ray to map the column coordinate 00 of PolarRegionpolarRegionpolar_region to.

Default: 0.00.0
Suggested values: 0.0, 0.78539816, 1.57079632, 3.141592654, 6.28318530.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853
Value range: -6.2831853 ≤ AngleStart ≤ 6.2831853

AngleEndangleEndangle_end (input_control) angle.rad → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Angle of the ray to map the column coordinate \(\textrm{WidthIn}-1\) of PolarRegionpolarRegionpolar_region to.

Default: 6.28318536.2831853
Suggested values: 0.0, 0.78539816, 1.57079632, 3.141592654, 6.28318530.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853
Value range: -6.2831853 ≤ AngleEnd ≤ 6.2831853

RadiusStartradiusStartradius_start (input_control) number → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Radius of the circle to map the row coordinate 00 of PolarRegionpolarRegionpolar_region to.

Default: 00
Suggested values: 0, 16, 32, 64, 100, 128, 256, 5120, 16, 32, 64, 100, 128, 256, 512
Value range: 0 ≤ RadiusStart ≤ 32767

RadiusEndradiusEndradius_end (input_control) number → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Radius of the circle to map the row coordinate \(\textrm{HeightIn}-1\) of PolarRegionpolarRegionpolar_region to.

Default: 100100
Suggested values: 0, 16, 32, 64, 100, 128, 256, 5120, 16, 32, 64, 100, 128, 256, 512
Value range: 0 ≤ RadiusEnd ≤ 32767

WidthInwidthInwidth_in (input_control) extent.x → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the virtual input image.

Default: 512512
Suggested values: 256, 320, 512, 640, 800, 1024256, 320, 512, 640, 800, 1024
Value range: 2 ≤ WidthIn ≤ 32767

HeightInheightInheight_in (input_control) extent.y → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the virtual input image.

Default: 512512
Suggested values: 240, 256, 480, 512, 600, 1024240, 256, 480, 512, 600, 1024
Value range: 2 ≤ HeightIn ≤ 32767

Widthwidthwidth (input_control) extent.x → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the virtual output image.

Default: 512512
Suggested values: 256, 320, 512, 640, 800, 1024256, 320, 512, 640, 800, 1024
Value range: 1 ≤ Width ≤ 32767

Heightheightheight (input_control) extent.y → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the virtual output image.

Default: 512512
Suggested values: 240, 256, 480, 512, 600, 1024240, 256, 480, 512, 600, 1024
Value range: 1 ≤ Height ≤ 32767

Interpolationinterpolationinterpolation (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Interpolation method for the transformation.

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

Combinations with other operators🔗

Combinations

See also

polar_trans_image_extPolarTransImageExt, polar_trans_image_invPolarTransImageInv, polar_trans_regionPolarTransRegion, polar_trans_contour_xldPolarTransContourXld, polar_trans_contour_xld_invPolarTransContourXldInv

Module🔗

Foundation