現在の画像のピクセルごとの輝度から、ひとつ前の画像のピクセルごとの輝度を引き算する方法
6 views (last 30 days)
Show older comments
jpegFiles = dir('*.jpg');
numfiles = ; % フォルダ内のファイルの数
mydata = cell(1, numfiles);
for k = 1:numfiles
mydata{k} = imread(jpegFiles(k).name);
RGB = imread(jpegFiles(k).name);
T{k} = rgb2gray(RGB);
end
T{1}
上のコードで画像のピクセルごとの輝度を求めているのですが、求めた輝度から、ひとつ前の画像のピクセルごとの輝度を引き算するコードを教えていただきたいです。
0 Comments
Answers (1)
Atsushi Ueno
on 3 Feb 2024
[filepath,name,ext] = fileparts(which('office_1.jpg'));
jpegFiles = dir([filepath,filesep,'office_*.jpg']);
numfiles = size(jpegFiles, 1); % フォルダ内のファイルの数
mydata = cell(1, numfiles);
for k = 1:numfiles
mydata{k} = imread(jpegFiles(k).name);
RGB = imread(jpegFiles(k).name);
T{k} = rgb2gray(RGB);
if k > 1
diff = T{k} - T{k-1}; % ひとつ前の画像のピクセルごとの輝度を引き算する
end
end
1 Comment
See Also
Categories
Find more on イメージ算術 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!