Feature extraction surf, storing points

5 ビュー (過去 30 日間)
Ömer Faruk Kurular
Ömer Faruk Kurular 2019 年 10 月 20 日
コメント済み: Turlough Hughes 2019 年 10 月 21 日
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 日
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 月 21 日
編集済み: Ömer Faruk Kurular 2019 年 10 月 21 日
It would be so good if I could store structure array persistently.
Turlough Hughes
Turlough Hughes 2019 年 10 月 21 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by