store multiple values in one variable
Ältere Kommentare anzeigen
dataset_folder='D:\Project\resize\';
file_name=dir(fullfile(dataset_folder,'*.jpg'));
total_images=numel(file_name);
for n=1:total_images
original=fullfile(dataset_folder, file_name(n).name);
x=imread(original);
r=x(250,250,1);
g=x(250,250,2);
b=x(250,250,3);
ph_factor =(double(g)/double(b))/double(r);
ph=sprintf('Red-%d Green-%d Blue-%d ph factor-%f',r,g,b,ph_factor);
disp(ph);
end
when i see the value of r,g,b and ph_factor only the value of last image is stored.
how can i store the values of all images for every iteration in the corresponding same variable?
Please help me
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Image Arithmetic finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!