How to make feature vector using optical Flow
1 回表示 (過去 30 日間)
古いコメントを表示
Hello.
I want to get a feature vector using the optical Flow Farneback function.
When I used this code, I got a "flow cell".
How can I make a feature vector using this?
Is it a reasonable feature vector? Which one is better as a feature vector?
I want to use this feature for classification.
% use only flow{i}.Vx
optical_vector{i} = [flow{i}.Vx];
% use all flow values
optical_vector{i} = [flow{i}.Vx, flow{i}.Vy, flow{i}.Orientation, flow{i}.Magnitude];

clear all
close all
%// read the video:
list = dir('*.avi')
% loop through the filenames in the list
opticFlow = opticalFlowFarneback
for k = 1:length(list)
reader = VideoReader(list(k).name);
vid = {};
while hasFrame(reader)
vid{end+1} = readFrame(reader);
end
for i=1:25
fIdx(i) = i; %// do it for frame 1 ~ 60
frameGray{i} = rgb2gray(vid{fIdx(i)});
flow{i} = estimateFlow(opticFlow,frameGray{i});
optical_vector{i} = [flow{i}.Vx];
end
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Optics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!