帮助中心帮助中心
读取整个 TIFF 图像
imageData = read(t)
[Y,Cb,Cr] = read(t)
示例
imageData = read(t) 从与 Tiff 对象 t 关联的 TIFF 文件的当前图像文件目录 (IFD) 中读取图像数据。
imageData
t
Tiff
[Y,Cb,Cr] = read(t) 从 TIFF 文件的当前图像文件目录中读取 YCbCr 分量数据。仅对具有 YCbCr 光度解释的图像使用此语法。
Y
Cb
Cr
根据 YCbCrSubSampling 标记的值,Cb 和 Cr 分量的大小可能与 Y 分量不同。
YCbCrSubSampling
全部折叠
创建一个 Tiff 对象并从 TIFF 文件中读取数据。
t = Tiff('peppers_RGB_tiled.tif','r'); imageData = read(t);
显示图像。
imshow(imageData); title('Peppers Image (RGB)')
关闭 Tiff 对象。
close(t);
为文件创建一个 Tiff 对象,获取图像数据并显示该图像。
t = Tiff('peppers_YCbCr_tiled.tif','r'); [Y,Cb,Cr] = read(t);
显示图像的 Y 分量。
imshow(Y); title('Peppers Image (Y Component)');
代表 TIFF 文件的 Tiff 对象。使用 Tiff 函数创建该对象。
图像数据,以数值数组形式返回。以一个 RGB 图像为例,其 imageData 是 M×N×3 数组。其中 M 和 N 分别是图像的高度和宽度。
M
N
3
图像数据的 Luma 分量,以二维数值数组形式返回。
图像数据的蓝差色度分量,以二维数值数组形式返回。
图像数据的红差色度分量,以二维数值数组形式返回。
read 仅将 SVS 文件中的图像数据作为 RGB 数据返回,对于具有 YCbCr 光度解释的 SVS 文件也是如此。
read
在 R2009b 中推出
write | imread
write
imread
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office