画像の輝度を0~256で表すコード
显示 更早的评论
jpegFiles = dir('*.jpg');
numfiles = 300; %フォルダ内のファイルの数
mydata = cell(1, numfiles);
T = table((1:numfiles)', zeros(numfiles,1), 'VariableNames', {'Serial_No.', 'meanLuminance'})%表作成
for k = 1:numfiles
mydata{k} = imread(jpegFiles(k).name);
RGB = imread(jpegFiles(k).name);
graying = rgb2gray(RGB);%グレースケール化
meanLuminance = mean(graying,"all")%平均輝度値を求める
T{k,2} = meanLuminance
end
現在、上のコードで複数枚の画像の一枚ずつの平均輝度を求めているのですが、このコードで計算された結果は、0~256の値で表されていますか。
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!