HALCON Reference Manual 10.0.2
Table of Contents / Image / Type Conversion ClassesClassesClasses | | | Operators

convert_image_typeconvert_image_typeconvert_image_typeConvertImageTypeConvertImageType (Operator)

Name

convert_image_typeconvert_image_typeconvert_image_typeConvertImageTypeConvertImageType — Convert the type of an image.

Signature

convert_image_type(Image : ImageConverted : NewType : )

Herror convert_image_type(const Hobject Image, Hobject* ImageConverted, const char* NewType)

Herror T_convert_image_type(const Hobject Image, Hobject* ImageConverted, const Htuple NewType)

Herror convert_image_type(Hobject Image, Hobject* ImageConverted, const HTuple& NewType)

HImage HImage::ConvertImageType(const HTuple& NewType) const

HImageArray HImageArray::ConvertImageType(const HTuple& NewType) const

void HOperatorSetX.ConvertImageType(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageConverted, [in] VARIANT NewType)

IHImageX* HImageX.ConvertImageType([in] BSTR NewType)

static void HOperatorSet.ConvertImageType(HObject image, out HObject imageConverted, HTuple newType)

HImage HImage.ConvertImageType(string newType)

Description

convert_image_typeconvert_image_typeconvert_image_typeConvertImageTypeConvertImageType converts images of an arbitrary type into an arbitrary new image type. If the conversion is done from a larger to a smaller gray value range (e.g., from 'int4' to 'byte'), too large or too small values are simply “clipped.” It is therefore advisable to adapt the range of gray values by calling scale_imagescale_imagescale_imageScaleImageScaleImage before calling this operator. For images of type complex, only the real part is converted. The imaginary part is ignored. This facilitates an efficient conversion of images that have been transformed back from the frequency domain. Such images always have an imaginary part of 0.

Attention

The conversion to the 'int8' image format is only available on 64 bit systems! If the source and destination image type are identical, no new image matrix is allocated.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real* / complex*) *allowed for compute devices

Image whose image type is to be changed.

ImageConvertedImageConvertedImageConvertedImageConvertedimageConverted (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / int8 / real* / complex*) *allowed for compute devices

Converted image.

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

Desired image type (i.e., type of the gray values).

Default value: 'byte' "byte" "byte" "byte" "byte"

List of values: 'int1'"int1""int1""int1""int1", 'int2'"int2""int2""int2""int2", 'uint2'"uint2""uint2""uint2""uint2", 'int4'"int4""int4""int4""int4", 'int8'"int8""int8""int8""int8", 'byte'"byte""byte""byte""byte", 'real'"real""real""real""real", 'direction'"direction""direction""direction""direction", 'cyclic'"cyclic""cyclic""cyclic""cyclic", 'complex'"complex""complex""complex""complex"

List of values (for compute devices): 'int1'"int1""int1""int1""int1", 'int2'"int2""int2""int2""int2", 'uint2'"uint2""uint2""uint2""uint2", 'int4'"int4""int4""int4""int4", 'byte'"byte""byte""byte""byte", 'real'"real""real""real""real", 'direction'"direction""direction""direction""direction", 'cyclic'"cyclic""cyclic""cyclic""cyclic", 'complex'"complex""complex""complex""complex"

Result

convert_image_typeconvert_image_typeconvert_image_typeConvertImageTypeConvertImageType returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

scale_imagescale_imagescale_imageScaleImageScaleImage

See also

scale_imagescale_imagescale_imageScaleImageScaleImage, abs_imageabs_imageabs_imageAbsImageAbsImage

Module

Foundation


Table of Contents / Image / Type Conversion ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH