Convert and scale input image to specified output data type
Conversions
visionconversions
The Image Data Type Conversion block changes the data type of the input to the user-specified data type and scales the values to the new data type's dynamic range. To convert between data types without scaling, use the Simulink® Data Type Conversion (Simulink) block.
When converting between floating-point data types, the block casts the input into the output data type and clips values outside the range to 0 or 1. When converting to the Boolean data type, the block maps 0 values to 0 and all other values to one. When converting to or between all other data types, the block casts the input into the output data type and scales the data type values into the dynamic range of the output data type. For double- and single-precision floating-point data types, the dynamic range is between 0 and 1. For fixed-point data types, the dynamic range is between the minimum and maximum values that can be represented by the data type.
Note
This block supports intensity and color images on its ports.
Port | Input/Output | Supported Data Types | Complex Values Supported |
---|---|---|---|
Input | M-by-N matrix of intensity values or an M-by-N-by-P color video signal where P is the number of color planes |
| No |
Output | M-by-N matrix of intensity values or an M-by-N-by-P color video signal where P is the number of color planes | Same as Input port | No |
The dimensions, complexity, and frame status of the input and output signals are the same.
Use the Output data type parameter to specify the data type of your output signal values.
Use this parameter to specify the data type of your output signal.
Select this check box if you want the output fixed-point data to be
signed. This parameter is visible if, for the Output data
type parameter, you choose
Fixed-point
.
Use this parameter to specify the word length of your fixed-point output.
This parameter is visible if, for the Output data type
parameter, you choose Fixed-point
.
Use this parameter to specify the fraction length of your fixed-point
output. This parameter is visible if, for the Output data
type parameter, you choose
Fixed-point
.
Computer Vision Toolbox™ software |