how to write data into excel sheet

1 visualizzazione (ultimi 30 giorni)
close all
clear all
clc
image_folder='C:\Users\L111\Desktop\cube faces\gaussian distortion\image_bullock\left face\rating_1';
addpath(image_folder);
InputList=dir([image_folder '/*.jpg']);
for i=1:length(InputList)
Name=InputList(i,1).name;
Img=imread(Name);
dim = size(Img);
width = dim(2);
height = dim(1);
gfrgb = imfilter(Img, fspecial('gaussian', 3, 3), 'symmetric', 'conv');
cform = makecform('srgb2lab', 'AdaptedWhitePoint', whitepoint('d65'));
lab = applycform(gfrgb,cform);
l = double(lab(:,:,1));
a = double(lab(:,:,2));
b = double(lab(:,:,3));
li = cumsum(cumsum(l,2));
ai = cumsum(cumsum(a,2));
bi = cumsum(cumsum(b,2));
sm = zeros(height, width);
sm2 = zeros(height, width);
for j = 1:height
yo = min(j, height-j);
y1 = max(1,j-yo); y2 = min(j+yo,height);
for k = 1:width
xo = min(k,width-k);
x1 = max(1,k-xo); x2 = min(k+xo,width);
invarea = 1.0/((y2-y1+1)*(x2-x1+1));
lm = iisum(li,x1,y1,x2,y2)*invarea;
am = iisum(ai,x1,y1,x2,y2)*invarea;
bm = iisum(bi,x1,y1,x2,y2)*invarea;
%---------------------------------------------------------
% Compute the saliency map
%---------------------------------------------------------
sm(j,k) = (l(j,k)-lm).^2 + (a(j,k)-am).^2 + (b(j,k)-bm).^2;
end
end
imwrite(sm,'C:\Users\L111\Desktop.jpg')
%figure()
%imshow(sm,[]);
c(i)=entropy(sm);
end
c
the input folder is having six faces and finally the entropy values are stored in an excel sheet , like these i have six images and i need to store them in the same sheet
please help me in these regard

Risposta accettata

KALYAN ACHARJYA
KALYAN ACHARJYA il 18 Feb 2021
Modify accordingly: Save all result files in different excel sheet
for i=1:length(files)
data_file=.......% To save in excel
xlswrite('file_name.xlsx',data_file,['Sheet',num2str(i)]);
end

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by