필터 지우기
필터 지우기

How to make feature vector using optical Flow

조회 수: 2 (최근 30일)
Kong
Kong 2020년 4월 4일
편집: Kong 2020년 4월 6일
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개)

카테고리

Help CenterFile Exchange에서 Optics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by