vision.ImageDataTypeConverter System object

Package: vision

Convert and scale input image to specified output data type


The ImageDataTypeConverter object converts and scales an input image to a specified output data type. When converting between floating-point data types, the object casts the input into the output data type and clips values outside the range, to 0 or 1. When converting between all other data types, the object casts the input into the output data type. The object then scales the data type values into the dynamic range of the output data type. For double- and single-precision floating-point data types, the object sets the dynamic range between 0 and 1. For fixed-point data types, the object sets the dynamic range between the minimum and maximum values that the data type can represent.


H = vision.ImageDataTypeConverter returns a System object, H, that converts the input image to a single precision data type.

H = vision.ImageDataTypeConverter(Name,Value) returns an image data type conversion object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1, Value1,...,NameN,ValueN).

Code Generation Support
Supports MATLAB® Function block: Yes
System Objects in MATLAB Code Generation
Code Generation Support, Usage Notes, and Limitations.



Data type of output

Specify the data type of the output signal as one of double | single | int8 | uint8 | int16 | uint16 | boolean | Custom. The default is single.

 Fixed-Point Properties


cloneCreate image data type converter object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
release Allow property value and input characteristics changes
stepConvert data type of input image


Convert the image datatype from uint8 to single.

 x = imread('pout.tif');
 hidtypeconv = vision.ImageDataTypeConverter;
 y = step(hidtypeconv, x);
 whos y % Image has been converted from uint8 to single.


This object implements the algorithm, inputs, and outputs described on the Image Data Type Conversion block reference page. The object properties correspond to the block parameters.

Introduced in R2012a

Was this topic helpful?