projective_trans_image_size T_projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size (Operator)
Name
projective_trans_image_size T_projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
— Apply a projective transformation to an image and specify the output
image size.
Signature
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
(Windows only)
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
(Windows only)
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 )
Description
projective_trans_image_size projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
applies the projective
transformation (homography) determined by the homogeneous
transformation matrix HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
on the input image
Image Image Image Image image image
and stores the result into the output image
TransImage TransImage TransImage TransImage transImage trans_image
.
TransImage TransImage TransImage TransImage transImage trans_image
will be clipped at the output dimensions
Height Height Height Height height height
xWidth Width Width Width width width
. Apart from this,
projective_trans_image_size projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
is identical to its alternative
version projective_trans_image projective_trans_image ProjectiveTransImage ProjectiveTransImage ProjectiveTransImage projective_trans_image
.
Attention
The used coordinate system is the same as in
affine_trans_pixel affine_trans_pixel AffineTransPixel AffineTransPixel AffineTransPixel affine_trans_pixel
. This means that in fact not
HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
is applied but a modified version. Therefore,
applying projective_trans_image_size projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
corresponds to the following
chain of transformations, which is applied to each point
of the image (input and output
pixels as homogeneous vectors):
As an effect, you might get unexpected results when creating projective
transformations based on coordinates that are derived from the
image, e.g., by operators like area_center_gray area_center_gray AreaCenterGray AreaCenterGray AreaCenterGray area_center_gray
. For
example, if you use this operator to calculate the center of gravity
of a rotationally symmetric image and then rotate the image around
this point using hom_mat2d_rotate hom_mat2d_rotate HomMat2dRotate HomMat2dRotate HomMat2dRotate hom_mat2d_rotate
, the resulting image will
not lie on the original one. In such a case, you can compensate this
effect by applying the following translations to HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
before using it in projective_trans_image_size projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
:
hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp) hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp) HomMat2dTranslate(HomMat2D, 0.5, 0.5, HomMat2DTmp) HomMat2dTranslate(HomMat2D, 0.5, 0.5, HomMat2DTmp) HomMat2dTranslate(HomMat2D, 0.5, 0.5, HomMat2DTmp) hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp)
hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) HomMat2dTranslateLocal(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) HomMat2dTranslateLocal(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) HomMat2dTranslateLocal(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted)
projective_trans_image_size(Image, TransImage, HomMat2DAdapted, 'bilinear', Width, Height, 'false') projective_trans_image_size(Image, TransImage, HomMat2DAdapted, "bilinear", Width, Height, "false") ProjectiveTransImageSize(Image, TransImage, HomMat2DAdapted, "bilinear", Width, Height, "false") ProjectiveTransImageSize(Image, TransImage, HomMat2DAdapted, "bilinear", Width, Height, "false") ProjectiveTransImageSize(Image, TransImage, HomMat2DAdapted, "bilinear", Width, Height, "false") projective_trans_image_size(Image, TransImage, HomMat2DAdapted, "bilinear", Width, Height, "false")
For an explanation of the different 2D coordinate systems
used in HALCON, see the introduction of chapter
Transformations / 2D Transformations .
projective_trans_image_size projective_trans_image_size ProjectiveTransImageSize ProjectiveTransImageSize ProjectiveTransImageSize projective_trans_image_size
can be executed on OpenCL devices if
the input image does not exceed the maximum size of image objects of the
selected device and the parameter TransformDomain TransformDomain TransformDomain TransformDomain transformDomain transform_domain
is set to
'false' "false" "false" "false" "false" "false" .
The result can diverge slightly from that calculated on the CPU.
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 image
(input_object) (multichannel-)image(-array) →
object HImage HObject HImage Hobject (byte* / uint2* / real*) *allowed for compute devices
Input image.
TransImage TransImage TransImage TransImage transImage trans_image
(output_object) (multichannel-)image(-array) →
object HImage HObject HImage Hobject * (byte / uint2 / real)
Output image.
HomMat2D HomMat2D HomMat2D HomMat2D homMat2D hom_mat_2d
(input_control) hom_mat2d →
HHomMat2D , HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Homogeneous projective transformation matrix.
Interpolation Interpolation Interpolation Interpolation interpolation interpolation
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (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"
Width Width Width Width width width
(input_control) extent.x →
HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Output image width.
Height Height Height Height height height
(input_control) extent.y →
HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Output image height.
TransformDomain TransformDomain TransformDomain TransformDomain transformDomain transform_domain
(input_control) string →
HTuple str HTuple Htuple (string) (string ) (HString ) (char* )
Should the domain of the input image also be
transformed?
Default value:
'false'
"false"
"false"
"false"
"false"
"false"
List of values: 'false' "false" "false" "false" "false" "false" , 'true' "true" "true" "true" "true" "true"
List of values (for compute devices): 'false' "false" "false" "false" "false" "false"
Possible Predecessors
vector_to_proj_hom_mat2d vector_to_proj_hom_mat2d VectorToProjHomMat2d VectorToProjHomMat2d VectorToProjHomMat2d vector_to_proj_hom_mat2d
,
hom_vector_to_proj_hom_mat2d hom_vector_to_proj_hom_mat2d HomVectorToProjHomMat2d HomVectorToProjHomMat2d HomVectorToProjHomMat2d hom_vector_to_proj_hom_mat2d
,
proj_match_points_ransac proj_match_points_ransac ProjMatchPointsRansac ProjMatchPointsRansac ProjMatchPointsRansac proj_match_points_ransac
,
proj_match_points_ransac_guided proj_match_points_ransac_guided ProjMatchPointsRansacGuided ProjMatchPointsRansacGuided ProjMatchPointsRansacGuided proj_match_points_ransac_guided
,
hom_mat3d_project hom_mat3d_project HomMat3dProject HomMat3dProject HomMat3dProject hom_mat3d_project
See also
projective_trans_image projective_trans_image ProjectiveTransImage ProjectiveTransImage ProjectiveTransImage projective_trans_image
,
projective_trans_contour_xld projective_trans_contour_xld ProjectiveTransContourXld ProjectiveTransContourXld ProjectiveTransContourXld projective_trans_contour_xld
,
projective_trans_region projective_trans_region ProjectiveTransRegion ProjectiveTransRegion ProjectiveTransRegion projective_trans_region
,
projective_trans_point_2d projective_trans_point_2d ProjectiveTransPoint2d ProjectiveTransPoint2d ProjectiveTransPoint2d projective_trans_point_2d
,
projective_trans_pixel projective_trans_pixel ProjectiveTransPixel ProjectiveTransPixel ProjectiveTransPixel projective_trans_pixel
Module
Foundation