現在の画像のピクセルごとの輝度から、ひとつ前の画像のピクセルごとの輝度を引き算する方法
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Atsushi Ueno
il 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 Commento
Vedere anche
Categorie
Scopri di più su Read, Write, and Modify Image in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!