我将未签名的特征向量存储在名为data1.txt
的文本文件中。如何在下面的代码中使用textscan
来提取这些FV,因为维度过多(50行和262144列)并将它们存储在mat文件中?
clc;
clear all;
close all;
fileID = fopen('data1.txt','w');
for i=1:50
a=num2str(i);
I = imread(strcat(a,'.png'));
I=entropyfilt(I);% filtering 50 images
I = double(I)/255;
fv = hog_feature_vector(I); % extracting feature vectors of 50 images
fileID = fopen('data1.txt','a');% saving those FV in a specific format in text
fprintf(fileID,'\t');
fprintf(fileID,'%1.4f\t',fv);
fprintf(fileID,'\n');
end
fclose(fileID);