我正在尝试在 matlab 中检索一组“tif”图像的亮度分量。代码如下:
function [defaultImages] = readImgLum(nFiles)
% readImgLum reads a specified number of images in 'tif' format
% and retrieves the luminance component
narginchk(1, 1);
defaultImages = cell(nFiles, 1); % store all images in a vector
for i = 1 : nFiles
imagePreffix = int2str(i);
imageFullName = strcat(imagePreffix, '.tif');
image = imread(imageFullName);
imageYCbCr = rgb2ycbcr(image);
defaultImages{i} = squeeze(imageYCbCr(:,:,1));
end
我是否正确提取了亮度分量?