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?
2 ビュー (過去 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 件のコメント
Image Analyst
2017 年 8 月 30 日
hog_feature_vector is a 1-d vector. How do you want it to be in a matrix? Like, how many rows and columns, and why?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Computer Vision Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!