HALCON Reference Manual 10.0.2
Table of Contents / Filters / Geometric Transformations ClassesClassesClasses | | | Operators

zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize (Operator)

Name

zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize — Zoom an image to a given size.

Signature

zoom_image_size(Image : ImageZoom : Width, Height, Interpolation : )

Herror zoom_image_size(const Hobject Image, Hobject* ImageZoom, const Hlong Width, const Hlong Height, const char* Interpolation)

Herror T_zoom_image_size(const Hobject Image, Hobject* ImageZoom, const Htuple Width, const Htuple Height, const Htuple Interpolation)

Herror zoom_image_size(Hobject Image, Hobject* ImageZoom, const HTuple& Width, const HTuple& Height, const HTuple& Interpolation)

HImage HImage::ZoomImageSize(const HTuple& Width, const HTuple& Height, const HTuple& Interpolation) const

HImageArray HImageArray::ZoomImageSize(const HTuple& Width, const HTuple& Height, const HTuple& Interpolation) const

void HOperatorSetX.ZoomImageSize(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageZoom, [in] VARIANT Width, [in] VARIANT Height, [in] VARIANT Interpolation)

IHImageX* HImageX.ZoomImageSize(
[in] Hlong Width, [in] Hlong Height, [in] BSTR Interpolation)

static void HOperatorSet.ZoomImageSize(HObject image, out HObject imageZoom, HTuple width, HTuple height, HTuple interpolation)

HImage HImage.ZoomImageSize(int width, int height, string interpolation)

Description

zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize scales the image ImageImageImageImageimage to the size given by WidthWidthWidthWidthwidth and HeightHeightHeightHeightheight. The parameter InterpolationInterpolationInterpolationInterpolationinterpolation determines the type of interpolation used (see affine_trans_imageaffine_trans_imageaffine_trans_imageAffineTransImageAffineTransImage).

Attention

If the system parameter 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming" is set to 'true'"true""true""true""true", the internally used integer arithmetic may lead to errors in the following two cases: First, if zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize is used on an uint2 or int2 image with high dynamics (i.e. images containing values close to the respective limits) in combination with scale factors (ratio of output to input image size) smaller than 0.5, then the gray values of the output image may be erroneous. Second, if InterpolationInterpolationInterpolationInterpolationinterpolation is set to a value other than 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor", a large scale factor is applied, and a large output image is obtained, then undefined gray values at the lower and at the right image border may result. The maximum width B_max of this border of undefined gray values can be estimated as B_max = 0.5 * S * I / 2^15, where S is the scale factor in one dimension and I is the size of the output image in the corresponding dimension. In both cases, it is recommended to set 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming" to 'false'"false""false""false""false" via the operator set_systemset_systemset_systemSetSystemSetSystem.

zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize is not parallelized internally if WidthWidthWidthWidthwidth and HeightHeightHeightHeightheight correspond to half the dimensions of ImageImageImageImageimage. Further zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize is not parallelized internally with InterpolationInterpolationInterpolationInterpolationinterpolation='nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor".

zoom_image_sizezoom_image_sizezoom_image_sizeZoomImageSizeZoomImageSize can be executed on OpenCL devices 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.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte* / int2* / uint2* / real*) *allowed for compute devices

Input image.

ImageZoomImageZoomImageZoomImageZoomimageZoom (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / int2 / uint2 / real)

Scaled image.

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of the resulting image.

Default value: 512

Suggested values: 128, 256, 512

Typical range of values: 2 ≤ Width Width Width Width width ≤ 512

Minimum increment: 1

Recommended increment: 10

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of the resulting image.

Default value: 512

Suggested values: 128, 256, 512

Typical range of values: 2 ≤ Height Height Height Height height ≤ 512

Minimum increment: 1

Recommended increment: 10

InterpolationInterpolationInterpolationInterpolationinterpolation (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of interpolation.

Default value: 'constant' "constant" "constant" "constant" "constant"

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

Example (HDevelop)

read_image(Image,'monkey')
disp_image(Image,WindowHandle)
zoom_image_size(Image,ZooImage,0,200,200)
disp_image(ZooImage,WindowHandle)

Example (C)

read_image(&Image,"monkey");
disp_image(Image,WindowHandle);
zoom_image_size(Image,&ZooImage,0,200,200);
disp_image(ZooImage,WindowHandle);

Example (HDevelop)

read_image(Image,'monkey')
disp_image(Image,WindowHandle)
zoom_image_size(Image,ZooImage,0,200,200)
disp_image(ZooImage,WindowHandle)

Example (HDevelop)

read_image(Image,'monkey')
disp_image(Image,WindowHandle)
zoom_image_size(Image,ZooImage,0,200,200)
disp_image(ZooImage,WindowHandle)

Example (HDevelop)

read_image(Image,'monkey')
disp_image(Image,WindowHandle)
zoom_image_size(Image,ZooImage,0,200,200)
disp_image(ZooImage,WindowHandle)

Alternatives

zoom_image_factorzoom_image_factorzoom_image_factorZoomImageFactorZoomImageFactor, affine_trans_imageaffine_trans_imageaffine_trans_imageAffineTransImageAffineTransImage, hom_mat2d_scalehom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScale

See also

hom_mat2d_scalehom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScale, affine_trans_imageaffine_trans_imageaffine_trans_imageAffineTransImageAffineTransImage

Module

Foundation


Table of Contents / Filters / Geometric Transformations ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH