ClassesClassesClassesClasses | | | | Operators

zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor (Operator)

Name

zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor — Zoom an image by a given factor.

Signature

zoom_image_factor(Image : ImageZoomed : ScaleWidth, ScaleHeight, Interpolation : )

Herror zoom_image_factor(const Hobject Image, Hobject* ImageZoomed, double ScaleWidth, double ScaleHeight, const char* Interpolation)

Herror T_zoom_image_factor(const Hobject Image, Hobject* ImageZoomed, const Htuple ScaleWidth, const Htuple ScaleHeight, const Htuple Interpolation)

Herror zoom_image_factor(Hobject Image, Hobject* ImageZoomed, const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation)

HImage HImage::ZoomImageFactor(const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation) const

HImageArray HImageArray::ZoomImageFactor(const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation) const

void ZoomImageFactor(const HObject& Image, HObject* ImageZoomed, const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation)

HImage HImage::ZoomImageFactor(double ScaleWidth, double ScaleHeight, const HString& Interpolation) const

HImage HImage::ZoomImageFactor(double ScaleWidth, double ScaleHeight, const char* Interpolation) const

void HOperatorSetX.ZoomImageFactor(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageZoomed, [in] VARIANT ScaleWidth, [in] VARIANT ScaleHeight, [in] VARIANT Interpolation)

IHImageX* HImageX.ZoomImageFactor(
[in] double ScaleWidth, [in] double ScaleHeight, [in] BSTR Interpolation)

static void HOperatorSet.ZoomImageFactor(HObject image, out HObject imageZoomed, HTuple scaleWidth, HTuple scaleHeight, HTuple interpolation)

HImage HImage.ZoomImageFactor(double scaleWidth, double scaleHeight, string interpolation)

Description

zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor scales the image ImageImageImageImageImageimage by a factor of ScaleWidthScaleWidthScaleWidthScaleWidthScaleWidthscaleWidth in width and a factor ScaleHeightScaleHeightScaleHeightScaleHeightScaleHeightscaleHeight in height. The parameter InterpolationInterpolationInterpolationInterpolationInterpolationinterpolation determines the type of interpolation used (see affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage). The domain of the input image is ignored, i.e., assumed to be the full rectangle of the image.

Attention

If the system parameter 'int_zooming'"int_zooming""int_zooming""int_zooming""int_zooming""int_zooming" is set to 'true'"true""true""true""true""true", the internally used integer arithmetic may lead to errors in the following two cases: First, if zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor 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 smaller than 0.5, then the gray values of the output image may be erroneous. Second, if InterpolationInterpolationInterpolationInterpolationInterpolationinterpolation is set to a value other than 'nearest_neighbor'"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""int_zooming" to 'false'"false""false""false""false""false" via the operator set_systemset_systemSetSystemset_systemSetSystemSetSystem.

zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor is not parallelized internally if ScaleWidthScaleWidthScaleWidthScaleWidthScaleWidthscaleWidth = 0.5 and ScaleHeightScaleHeightScaleHeightScaleHeightScaleHeightscaleHeight = 0.5. Further zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor is not parallelized internally with InterpolationInterpolationInterpolationInterpolationInterpolationinterpolation='nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor".

zoom_image_factorzoom_image_factorZoomImageFactorzoom_image_factorZoomImageFactorZoomImageFactor 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

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

Input image.

ImageZoomedImageZoomedImageZoomedImageZoomedImageZoomedimageZoomed (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / int2 / uint2 / real)

Scaled image.

ScaleWidthScaleWidthScaleWidthScaleWidthScaleWidthscaleWidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Scale factor for the width of the image.

Default value: 0.5

Suggested values: 0.25, 0.5, 1.5, 2.0

Typical range of values: 0.001 ≤ ScaleWidth ScaleWidth ScaleWidth ScaleWidth ScaleWidth scaleWidth ≤ 10.0

Minimum increment: 0.001

Recommended increment: 0.1

ScaleHeightScaleHeightScaleHeightScaleHeightScaleHeightscaleHeight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Scale factor for the height of the image.

Default value: 0.5

Suggested values: 0.25, 0.5, 1.5, 2.0

Typical range of values: 0.001 ≤ ScaleHeight ScaleHeight ScaleHeight ScaleHeight ScaleHeight scaleHeight ≤ 10.0

Minimum increment: 0.001

Recommended increment: 0.1

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

Type of interpolation.

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

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

Example (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Example (C)

read_image(&Image,"monkey");
disp_image(Image,WindowHandle);
zoom_image_factor(Image,&ZooImage,0.25,0.25,"constant");
disp_image(ZooImage,WindowHandle);

Example (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Example (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Example (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Example (HDevelop)

read_image(Image,'monkey')
dev_display (Image)
zoom_image_factor (Image, ZoomImage, 0.25, 0.25, 'constant')
dev_display (ZoomImage)

Alternatives

zoom_image_sizezoom_image_sizeZoomImageSizezoom_image_sizeZoomImageSizeZoomImageSize, affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage, hom_mat2d_scalehom_mat2d_scaleHomMat2dScalehom_mat2d_scaleHomMat2dScaleHomMat2dScale

See also

hom_mat2d_scalehom_mat2d_scaleHomMat2dScalehom_mat2d_scaleHomMat2dScaleHomMat2dScale, affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators