图像类型转换
在不同的图像类型(如 RGB(真彩色)、二值图像、灰度图像和索引图像)之间进行转换,并更改图像的数据类型
Image Processing Toolbox™ 支持二值、索引、灰度和真彩色图像类型。在每种图像类型中,像素以不同格式存储。例如,真彩色图像将像素表示为红、绿和蓝值的三元组,而灰度图像将一个像素表示为单个强度值。
不同图像类型的像素值可以以浮点、有符号和无符号整数或逻辑值数据类型存储。工具箱函数使您能够在图像类型和数据类型之间进行转换。
函数
主题
- Image Types in the Toolbox
Image types determine how MATLAB® interprets data matrix elements as pixel intensity values. The toolbox supports many image types including binary, grayscale, truecolor, multispectral, and label images.
- Convert Between Image Types
Certain image processing operations support only a subset of the image types. You can convert images between the image types to suit the operation.
- Convert Image Data Between Data Types
You can convert image data between data types using functions that automatically rescale and offset the original data.