How to use Extract interest point descriptors in videos of folders

2 ビュー (過去 30 日間)
Kong
Kong 2020 年 3 月 24 日
コメント済み: Kong 2020 年 4 月 17 日
Hello.
I want to classify videos after feature extraction.
I tested this link using a image.
Could you give some ideas to use videos using for loop? I want to convert videos to gray images and use feature extraction. (use for loop)
Finally, I want to save the feature as matrix.
I am beginner at Matlab.
clear all
close all
I = imread('bend_shot.png');
I = rgb2gray(I);
points = detectSURFFeatures(I);
[features, valid_points] = extractFeatures(I, points);
figure; imshow(I); hold on;
plot(valid_points.selectStrongest(10),'showOrientation',true);

採用された回答

Prabhan Purwar
Prabhan Purwar 2020 年 3 月 27 日
Hello,
I am assuming that you are making use of a Neural Network for classification purpose.
In order to train Network using video, extract all the frames from each video and create an imageset for all frames. You may make use of HOG or SURF features from the frames and fitcecoc can be used to classify the frames using the description of each imageset as a label.
Following code may be implemented to make a row-wise matrix for frames using SURF features as descriptors.
for i=1:length(frames)
st=strcat('D:\test\chair\000',num2str(i,'%02d'),'.png'); %%Directory to image set
I = imread(st);
I = rgb2gray(I);
points = detectSURFFeatures(I);
[features, valid_points] = extractFeatures(I, points);
[s1,s2]=size(features);
S=s1*s2;
ftr=reshape(features,1,S);
F(i,:)=ftr;
end
Please refer to the following links:
Hope it helps!!
  1 件のコメント
Kong
Kong 2020 年 4 月 17 日
Thank you so much!
Your comment is so useful for me.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by