cannot show full image in folder
古いコメントを表示
Hi everyone !
Ask permission. why can't it show all the pictures in one folder. The results displayed in excel are only 1 image.
this is my code :

image_folder ='E:\coba11gambar';
filenames = dir (fullfile(image_folder,'*.jpeg'));
total_images = numel(filenames);
for n= 1:total_images;
f= fullfile(image_folder, filenames(n).name)
our_images= imread (f);
% CONTRAST STRECHING
s = imadjust (our_images,stretchlim(our_images,[0.01 0.99]),[]); %menentukan nilai maksimum dan minimum untuk peregangan
% SEGMENTASI DETEKSI TEPI CANNY
g=edge(s,'canny')
% GLCM
offsets = [0 1; -1 1; -1 0; -1 -1];
glcm=graycomatrix(g,'Offset',[0 1]);%sudut 0
% mmengambil properti yang ada dalam matriks kookurensi
stats=graycoprops(glcm,{'Contrast','Energy','Correlation','Homogeneity'});
% membaca fitur glcm
rata=mean(mean(glcm));
standar=std(std(double(glcm)));
energi=stats.Energy;
entropi=entropy(glcm);
kontras=stats.Contrast;
korelasi=stats.Correlation;
homog=stats.Homogeneity;
vari=var(var(double(glcm)));
training= [energi;entropi;kontras;korelasi;homog;vari;rata;standar]';
cd('..');
xlswrite('Cobaaaa1.xls',training) %menyimpan file dalam bentuk excel
end;
%%
disp 'done'
採用された回答
その他の回答 (2 件)
Walter Roberson
2022 年 5 月 30 日
xlswrite('Cobaaaa1.xls',training) %menyimpan file dalam bentuk excel
That is asking to write to the same file and same sheet and same range each time.
Unfortunately in your release you cannot use the more modern writematrix(), and the writetable() in your release did not support 'WriteMode' 'append'
I suggest you specify a range, such as
sheet = 1;
range = sprintf('A%d', i);
xlswrite('Cobaaaa1.xls', sheet, range, training);
Note: you need to specify the sheet in order to be able to use a range that just specifies a starting corner without an ending corner.
1 件のコメント
Walter Roberson
2022 年 5 月 30 日
sheet = 1;
range = sprintf('A%d', n);
xlswrite('Cobaaaa1.xls', sheet, range, training);
カテゴリ
ヘルプ センター および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
