画像の輝度を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!