polar_trans_image_ext polar_trans_image_ext PolarTransImageExt PolarTransImageExt polar_trans_image_ext (Operator)
Name
polar_trans_image_ext polar_trans_image_ext PolarTransImageExt PolarTransImageExt polar_trans_image_ext
— Transform an annular arc in an image to polar coordinates.
Signature
Herror polar_trans_image_ext (const Hobject Image , Hobject* PolarTransImage , double Row , double Column , double AngleStart , double AngleEnd , double RadiusStart , double RadiusEnd , const Hlong Width , const Hlong Height , const char* Interpolation )
Herror T_polar_trans_image_ext (const Hobject Image , Hobject* PolarTransImage , const Htuple Row , const Htuple Column , const Htuple AngleStart , const Htuple AngleEnd , const Htuple RadiusStart , const Htuple RadiusEnd , const Htuple Width , const Htuple Height , const Htuple Interpolation )
void PolarTransImageExt (const HObject& Image , HObject* PolarTransImage , const HTuple& Row , const HTuple& Column , const HTuple& AngleStart , const HTuple& AngleEnd , const HTuple& RadiusStart , const HTuple& RadiusEnd , const HTuple& Width , const HTuple& Height , const HTuple& Interpolation )
HImage HImage ::PolarTransImageExt (const HTuple& Row , const HTuple& Column , double AngleStart , double AngleEnd , const HTuple& RadiusStart , const HTuple& RadiusEnd , Hlong Width , Hlong Height , const HString& Interpolation ) const
HImage HImage ::PolarTransImageExt (double Row , double Column , double AngleStart , double AngleEnd , double RadiusStart , double RadiusEnd , Hlong Width , Hlong Height , const HString& Interpolation ) const
HImage HImage ::PolarTransImageExt (double Row , double Column , double AngleStart , double AngleEnd , double RadiusStart , double RadiusEnd , Hlong Width , Hlong Height , const char* Interpolation ) const
HImage HImage ::PolarTransImageExt (double Row , double Column , double AngleStart , double AngleEnd , double RadiusStart , double RadiusEnd , Hlong Width , Hlong Height , const wchar_t* Interpolation ) const
(
Windows only)
static void HOperatorSet .PolarTransImageExt (HObject image , out HObject polarTransImage , HTuple row , HTuple column , HTuple angleStart , HTuple angleEnd , HTuple radiusStart , HTuple radiusEnd , HTuple width , HTuple height , HTuple interpolation )
HImage HImage .PolarTransImageExt (HTuple row , HTuple column , double angleStart , double angleEnd , HTuple radiusStart , HTuple radiusEnd , int width , int height , string interpolation )
HImage HImage .PolarTransImageExt (double row , double column , double angleStart , double angleEnd , double radiusStart , double radiusEnd , int width , int height , string interpolation )
def polar_trans_image_ext (image : 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 : int, height : int, interpolation : str) -> HObject
Description
polar_trans_image_ext polar_trans_image_ext PolarTransImageExt PolarTransImageExt polar_trans_image_ext
transforms the annular arc specified
by the center point (Row Row Row row row
, Column Column Column column column
), the radii
RadiusStart RadiusStart RadiusStart radiusStart radius_start
and RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
and the angles
AngleStart AngleStart AngleStart angleStart angle_start
and AngleEnd AngleEnd AngleEnd angleEnd angle_end
in the image
Image Image Image image image
to its polar coordinate version in the image
PolarTransImage PolarTransImage PolarTransImage polarTransImage polar_trans_image
of the dimensions Width Width Width width width
x Height Height Height height height
.
The upper left pixel in the output image always corresponds to the
point in the input image that is specified by RadiusStart RadiusStart RadiusStart radiusStart radius_start
and AngleStart AngleStart AngleStart angleStart angle_start
. Analogously, the lower right pixel in the
output image always corresponds to the point in the input image that
is specified by RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
and AngleEnd AngleEnd AngleEnd angleEnd angle_end
. In the
usual mode (AngleStart AngleStart AngleStart angleStart angle_start
< AngleEnd AngleEnd AngleEnd angleEnd angle_end
and
RadiusStart RadiusStart RadiusStart radiusStart radius_start
< RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
), the polar
transformation is performed in the mathematically positive
orientation (counterclockwise). Furthermore, points with smaller
radii lie in the upper part of the output image. By suitably
exchanging the values of these parameters (e.g., AngleStart AngleStart AngleStart angleStart angle_start
> AngleEnd AngleEnd AngleEnd angleEnd angle_end
or RadiusStart RadiusStart RadiusStart radiusStart radius_start
>
RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
), any desired orientation of the output image can
be achieved.
The parameter Interpolation Interpolation Interpolation interpolation interpolation
is used to select the
interpolation method 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" or
'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" . With 'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" , the
gray value of a pixel in the output image is determined by the gray
value of the closest pixel in the input image. With
'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" , the gray value of a pixel in the output image
is determined by bilinear interpolation of the gray values of the
four closest pixels in the input image. The mode
'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" results in images of better quality, but is
slower than the mode 'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" .
The angles can be chosen from all real numbers. Center point and
radii can be real as well. However, if they are both integers and
the difference of RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
and RadiusStart RadiusStart RadiusStart radiusStart radius_start
equals
the height Height Height Height height height
of the destination image, calculation
will be sped up through an optimized routine.
The radii and angles are inclusive, which means that the first row
of the target image contains the circle with radius
RadiusStart RadiusStart RadiusStart radiusStart radius_start
and the last row contains the circle with
radius RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
. For complete circles, where the
difference between AngleStart AngleStart AngleStart angleStart angle_start
and AngleEnd AngleEnd AngleEnd angleEnd angle_end
equals
(360 degrees), this also means that the first
column of the target image will be the same as the last.
To avoid this, do not make this difference
, but
degrees instead.
The call
polar_trans_image(Image, PolarTransImage, Row, Column, Width, Height) polar_trans_image(Image, PolarTransImage, Row, Column, Width, Height) PolarTransImage(Image, PolarTransImage, Row, Column, Width, Height) PolarTransImage(Image, PolarTransImage, Row, Column, Width, Height) polar_trans_image(Image, PolarTransImage, Row, Column, Width, Height)
produces the same result as the call
polar_trans_image_ext(Image, PolarTransImage, Row-0.5, Column-0.5, 6.2831853, 6.2831853/Width, 0, Height-1, Width, Height, 'nearest_neighbor') polar_trans_image_ext(Image, PolarTransImage, Row-0.5, Column-0.5, 6.2831853, 6.2831853/Width, 0, Height-1, Width, Height, "nearest_neighbor") PolarTransImageExt(Image, PolarTransImage, Row-0.5, Column-0.5, 6.2831853, 6.2831853/Width, 0, Height-1, Width, Height, "nearest_neighbor") PolarTransImageExt(Image, PolarTransImage, Row-0.5, Column-0.5, 6.2831853, 6.2831853/Width, 0, Height-1, Width, Height, "nearest_neighbor") polar_trans_image_ext(Image, PolarTransImage, Row-0.5, Column-0.5, 6.2831853, 6.2831853/Width, 0, Height-1, Width, Height, "nearest_neighbor")
.
The offset of 0.5 is necessary since polar_trans_image polar_trans_image PolarTransImage PolarTransImage polar_trans_image
does
not do exact nearest neighbor interpolation and the radii and angles
can be calculated using the information in the above paragraph and
knowing that polar_trans_image polar_trans_image PolarTransImage PolarTransImage polar_trans_image
does not handle its arguments
inclusively. The start angle is bigger than the end angle to make
polar_trans_image_ext polar_trans_image_ext PolarTransImageExt PolarTransImageExt polar_trans_image_ext
go clockwise, just like
polar_trans_image polar_trans_image PolarTransImage PolarTransImage polar_trans_image
does.
polar_trans_image_ext polar_trans_image_ext PolarTransImageExt PolarTransImageExt polar_trans_image_ext
can be executed on an OpenCL device if the
input image does not exceed the maximum size of image objects of the selected
device. Due to numerical reasons, there can be slight differences in
the output compared to the execution on the CPU.
Additionally, for images of type 'byte' "byte" "byte" "byte" "byte" , 'int2' "int2" "int2" "int2" "int2" or
'uint2' "uint2" "uint2" "uint2" "uint2" the system parameter 'int_zooming' "int_zooming" "int_zooming" "int_zooming" "int_zooming" selects between
fast calculation in fixed point arithmetics
('int_zooming' "int_zooming" "int_zooming" "int_zooming" "int_zooming" = 'true' "true" "true" "true" "true" )
and highly accurate calculation in floating point arithmetics
('int_zooming' "int_zooming" "int_zooming" "int_zooming" "int_zooming" = 'false' "false" "false" "false" "false" ). Fixed point calculation
can lead to minor gray value deviations and pixels with undefined gray
values.
Further Information
For an explanation of the different 2D coordinate systems
used in HALCON, see the introduction of chapter
Transformations / 2D Transformations .
Attention
For speed reasons, the domain of the input image is ignored. The
output image always has a complete rectangle as its domain.
Execution Information
Supports OpenCL compute devices.
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 channel level.
Automatically parallelized on internal data level.
Parameters
Image Image Image image image
(input_object) (multichannel-)image(-array) →
object HImage HObject HObject Hobject (byte* / int2* / uint2* / real*) *allowed for compute devices
Input image.
PolarTransImage PolarTransImage PolarTransImage polarTransImage polar_trans_image
(output_object) (multichannel-)image(-array) →
object HImage HObject HObject Hobject * (byte / int2 / uint2 / real)
Output image.
Row Row Row row row
(input_control) number →
HTuple Union[int, float] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the center of the arc.
Default:
256
Suggested values:
0, 16, 32, 64, 128, 240, 256, 480, 512
Column Column Column column column
(input_control) number →
HTuple Union[int, float] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the center of the arc.
Default:
256
Suggested values:
0, 16, 32, 64, 128, 256, 320, 512, 640
AngleStart AngleStart AngleStart angleStart angle_start
(input_control) angle.rad →
HTuple float HTuple Htuple (real) (double ) (double ) (double )
Angle of the ray to be mapped to the first
column of the output image.
Default:
0.0
Suggested values:
0.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853, 12.566370616
AngleEnd AngleEnd AngleEnd angleEnd angle_end
(input_control) angle.rad →
HTuple float HTuple Htuple (real) (double ) (double ) (double )
Angle of the ray to be mapped to the last
column of the output image.
Default:
6.2831853
Suggested values:
0.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853, 12.566370616
RadiusStart RadiusStart RadiusStart radiusStart radius_start
(input_control) number →
HTuple Union[int, float] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Radius of the circle to be mapped to the first
row of the output image.
Default:
0
Suggested values:
0, 16, 32, 64, 100, 128, 256, 512
Value range:
0
≤
RadiusStart
RadiusStart
RadiusStart
radiusStart
radius_start
RadiusEnd RadiusEnd RadiusEnd radiusEnd radius_end
(input_control) number →
HTuple Union[int, float] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Radius of the circle to be mapped to the last
row of the output image.
Default:
100
Suggested values:
0, 16, 32, 64, 100, 128, 256, 512
Value range:
0
≤
RadiusEnd
RadiusEnd
RadiusEnd
radiusEnd
radius_end
Width Width Width width width
(input_control) extent.x →
HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Width of the output image.
Default:
512
Suggested values:
256, 320, 512, 640, 800, 1024
Value range:
0
≤
Width
Width
Width
width
width
≤
32767
Height Height Height height height
(input_control) extent.y →
HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Height of the output image.
Default:
512
Suggested values:
240, 256, 480, 512, 600, 1024
Value range:
0
≤
Height
Height
Height
height
height
≤
32767
Interpolation Interpolation Interpolation interpolation interpolation
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Interpolation method for the transformation.
Default:
'nearest_neighbor'
"nearest_neighbor"
"nearest_neighbor"
"nearest_neighbor"
"nearest_neighbor"
List of values:
'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" , 'nearest_neighbor' "nearest_neighbor" "nearest_neighbor" "nearest_neighbor" "nearest_neighbor"
See also
polar_trans_image_inv polar_trans_image_inv PolarTransImageInv PolarTransImageInv polar_trans_image_inv
,
polar_trans_region polar_trans_region PolarTransRegion PolarTransRegion polar_trans_region
,
polar_trans_region_inv polar_trans_region_inv PolarTransRegionInv PolarTransRegionInv polar_trans_region_inv
,
polar_trans_contour_xld polar_trans_contour_xld PolarTransContourXld PolarTransContourXld polar_trans_contour_xld
,
polar_trans_contour_xld_inv polar_trans_contour_xld_inv PolarTransContourXldInv PolarTransContourXldInv polar_trans_contour_xld_inv
Module
Foundation