How to use Extract interest point descriptors in videos of folders

1 view (last 30 days)
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);

Accepted Answer

Prabhan Purwar
Prabhan Purwar on 27 Mar 2020
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!!

More Answers (0)

Community Treasure Hunt

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

Start Hunting!