フィルターのクリア

Read and edit image frames saved in a fodler

2 ビュー (過去 30 日間)
Benjamin Dempsey
Benjamin Dempsey 2016 年 2 月 7 日
回答済み: Image Analyst 2016 年 2 月 7 日
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

採用された回答

Image Analyst
Image Analyst 2016 年 2 月 7 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by