改写为matlab代码: for floder in floders: print(floder) imgname = floder.split('_')[0] idx = tinydict[imgname] value.append(idx) value.append( floder ) sum=0 imgname=floder.split('_')[0] imgs = os.listdir(floderPath+floder) for img in imgs: brisq.get_feature(floderPath+floder+'/'+img) score = brisq.get_score(floderPath+floder+'/'+img) print(score) sum = sum + score value.append(sum/frames) print(sum/frames) s = pd.Series(value, index=df.columns) df = df.append(s, ignore_index=True) value = [] df.to_excel(outpath)
时间: 2024-04-17 19:29:12 浏览: 141
value = [];
for i = 1:length(folders)
folder = folders(i).name;
disp(folder);
imgname = strsplit(folder, '_');
imgname = imgname{1};
idx = tinydict(imgname);
value(end+1) = idx;
value(end+1) = folder;
sum = 0;
imgs = dir(fullfile(folderPath, folder));
for j = 1:length(imgs)
img = imgs(j).name;
brisq.get_feature(fullfile(folderPath, folder, img));
score = brisq.get_score(fullfile(folderPath, folder, img));
disp(score);
sum = sum + score;
end
value(end+1) = sum/frames;
disp(sum/frames);
s = pd.Series(value, 'index', df.columns);
df = df.append(s, 'ignoreindex', true);
value = [];
end
writetable(df, outpath);
阅读全文