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

Zoom an image by a given factor.

zoom_image_factor scales the image Image by a factor of ScaleWidth in width and a factor ScaleHeight in height. The parameter Interpolation determines the type of interpolation used (see affine_trans_image).


Attention

If the system parameter 'int_zooming' is set to 'true', the internally used integer arithmetic may lead to errors in the following two cases: First, if zoom_image_factor 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 Interpolation is set to a value other than 'none', 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' to 'false' via the operator set_system.


Parameters

Image (input_object)
(multichannel-)image(-array) -> object : byte / int2 / uint2 / real
Input image.

ImageZoomed (output_object)
(multichannel-)image(-array) -> object : byte / int2 / uint2 / real
Scaled image.

ScaleWidth (input_control)
extent.x -> real
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 <= 10.0
Minimum increment: 0.001
Recommended increment: 0.1

ScaleHeight (input_control)
extent.y -> real
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 <= 10.0
Minimum increment: 0.001
Recommended increment: 0.1

Interpolation (input_control)
string -> string
Type of interpolation.
Default value: 'constant'
List of values: 'none', 'constant', 'weighted'


Example
read_image(Image,'affe') 
disp_image(Image,WindowHandle) 
zoom_image_factor(Image,ZooImage,0,0.5,0.5).
disp_image(ZooImage,WindowHandle) 

Parallelization Information

zoom_image_factor is reentrant and automatically parallelized (on tuple level, channel level).


Alternatives

zoom_image_size, affine_trans_image, hom_mat2d_scale


See also

hom_mat2d_scale, affine_trans_image


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH