Azzera filtri
Azzera filtri

Read and edit image frames saved in a fodler

1 visualizzazione (ultimi 30 giorni)
Below is the code i used but it is only changing one image and i want them all changed and saved in a sepereate folder
thanks
close all; clear all; clc;
dname_open = ('C:frames'); dname_save = ('C:frames_edit');
test = 0;
top_file = [dname_open '001.png']; ls_top_file = ls(top_file); c = cellstr(ls_top_file); cc = c(3:length(c)); S = size(cc); a = 1;
while a <= S(1) close all
imagename = ('file_name');
file2read = [dname_open '/' '001.png'] ;
index = 0;
I = imread(file2read);
for T=188 index=index+1; j=(rgb2gray(I));
k=zeros(size(j));
m=find(j>T);
k(m)=1;
figure(1); subplot(1,1,index);
pcolor(k); shading interp;
set(gca,'YDir','reverse');
saveas (gca, [dname_save '/' 'z_' imagename ], 'png');
end
end

Risposta accettata

Image Analyst
Image Analyst il 7 Feb 2016
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F In the loop, use sprintf() and fullfile() to create both input and output filenames.

Più risposte (0)

Categorie

Scopri di più su Images 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!

Translated by