画像の輝度を0~256で表すコード
Show older comments
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の値で表されていますか。
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!