필터 지우기
필터 지우기

How i can extract features from images and save them in one matrix and make groups (label) inside the matrix by matlab?

조회 수: 1 (최근 30일)
This is works, but i am not sure about my label t_label(1:21,1) is it same rows (From 1 to 21) in the matrix or not,
training_female = 'D:\DBs\jaffe\Train';
filenames = dir(fullfile(training_female, '*.TIFF'));
total_images = numel(filenames);
featureMatrix = [];
for n = 1:total_images
full_name= fullfile(training_female, filenames(n).name);
training_images = imread(full_name);
[featureVector, hogVisualization] = extractHOGFeatures(training_images);
featureMatrix = [featureMatrix; featureVector];
end
xx=imread('YM.SA3.57.TIFF');
[HOG_test, Visualization] = extractHOGFeatures(xx);
t_label = zeros(size(151,1),1);
t_label(1:21,1) = 1;% Angry;
t_label(22:41,1) = 2; %Disgusted;
t_label(42:63,1) = 3; %Fear;
t_label(64:85,1) = 4; %Happy;
t_label(86:106,1) = 5; %neutral;
t_label(107:128,1) = 6; %Sad;
t_label(129:151,1) = 7; %Surprised;
class=knnclassify(HOG_test,featureMatrix,t_label);
  댓글 수: 2
Image Analyst
Image Analyst 2016년 7월 23일
You might need to give people at least one image so they can try to reproduce your situation.
Goma Najah
Goma Najah 2016년 7월 27일
Thanks. I solve this by creating matrix for each folder and merge them in a big matrix.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2016년 7월 23일
It looks like rows 1-21 should all have the value 1. Do you know how to look in the workspace to check it? Or just put the cursor in the variable and type control-d.
Or you can just type the variable name in the command window.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by