This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


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 (MATLAB Coder)
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


stepConvert data type of input image
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


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?