I am using HOG for feature extraction that consist 1×n vector features. I have to print all training image feature into one text file in matrix form. I have tried write matlab code. Can anyone help me?

1 次查看(过去 30 天)
objects={'apple','bat','beetle'}; trimgs=10;
for i=1:length(objects) for j=1:trimgs imgpath=['.\images\' objects{i} '\img (' int2str(j) ').gif'];
I=imread(imgpath);
J = imresize(I,[256,256]);
fid=fopen('feature_vector.txt','a');
fprintf(fid,'%i\t',hog_feature_vector(J));
fprintf(fid,'\n');
fclose(fid);
end
end
%this code print feature vector in the text file. but not matrix form.
  2 个评论
bamini thavarajah
bamini thavarajah 2017-11-8
编辑:bamini thavarajah 2017-11-8
  • I want to classify image using HOG feature.
  • I have 10 classes, 20 images per class, for training I have selected 10 images per class(100 images).
  • I resized images to 256×256
  • I need 100×34596 size matrix.
  • row indicates images, column indicates HOG features
  • I have to lable the matrix with class no in the last column.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by