Hello.
I want to classify videos after extracting features.
When I use background substraction as extracting features, the result of classification is not good.
Could I get some ideas about feature extraction in videos?
This is code about background substraction. I want to use other methods for feature extraction
%// read the video:
list = dir('*.avi')% loop through the filenames in the list
for k = 1:length(list) reader = VideoReader(list(k).name); vid = {}; while hasFrame(reader) vid{end+1} = im2single(readFrame(reader)); end %// simple background estimation using mean:
bg = csvread('background.csv'); bg = reshape(bg, 144, 180, 3); %// estimate foreground as deviation from estimated background:
for i=1:25 fIdx(i) = i; %// do it for frame 1 ~ 60
fg{i} = sum( abs( vid{fIdx(i)} - bg ), 3 ); fgh{i} = imresize(fg{i}, 0.2); fg{i} = reshape(fgh{i},[],1); end X = cell2mat(fg);
Best Answer