Feature extraction surf, storing points

I have some number of images that contains faces. First, I am collecting features from all images and need to store features for further purposes. What is the best way to store features? Later, I am gonna use them to match input images to detect face.
face = rgb2gray(imread('...'));
facePoints = detectSURFFeatures(face);
features = selectStrongest(facePoints, 100);

답변 (1개)

Turlough Hughes
Turlough Hughes 2019년 10월 20일
편집: Turlough Hughes 2019년 10월 20일

1 개 추천

One way is to store as a struct, for example
s(ii).features=features; %where ii would be incrementing as you iterate through each image (i.e. for loop)
You can access the features of a given image afterwards as:
features=s(ii).features;
This way of storing your data will be particularly useful if you have other information you wish you wish to store that relates to each image such as:
s(ii).ImageName=ImName;
s(ii).folder=folder;
s(ii).otherdata=otherdata;
If you are not very familiar with structures I recomend reading the following documentation and working through some of the examples.

댓글 수: 5

Ömer Faruk Kurular
Ömer Faruk Kurular 2019년 10월 20일
I want to store them persistently.
Image Analyst
Image Analyst 2019년 10월 20일
Do you mean like to disk in a .mat file by using the save() function?
Ömer Faruk Kurular
Ömer Faruk Kurular 2019년 10월 21일
anythin but persistently? I could store in txt file but would not be effective so looking for a neat way.
Ömer Faruk Kurular
Ömer Faruk Kurular 2019년 10월 21일
편집: Ömer Faruk Kurular 2019년 10월 21일
It would be so good if I could store structure array persistently.
Ah ok, you can save the struct as follows:
for ii=1:n_imgs
%load image
features= %etc
s(ii).features=features;
end
save('s.mat','s')
this will save the struct in your working directory as a file called s.mat.

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

카테고리

도움말 센터File Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

질문:

2019년 10월 20일

댓글:

2019년 10월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by