Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

how optical flow function in matlab work?

Asked by nadia naji on 3 Feb 2013

i don't write any code myself for optical flow i only use the demo in matlab r2012a to learn what optical flow work. this demo exist in help of vision.OpticalFlow the output of this demo are some matrices one of them is "of" which said in demo that is the optical flow for video.this matrix has the same size as video frame(for each frame)i need to know what is it? is it the velocity for each pixel and i need to consider vertical velocity. how can i do this. how can i find for example vertical velocity in this function of matlab for optical flow? what are these lines that shown in the output of demo?? they show the magnitude of velocity. i want to use optical flow for motion detection in fire video. i hope explain good! can you help me?

0 Comments

nadia naji

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 4 Feb 2013

Are you looking at http://www.mathworks.com/help/imaq/examples/live-motion-detection-using-optical-flow.html

If so then notice

Create a System object to estimate direction and speed of object motion from one video frame to another using optical flow.
optical = vision.OpticalFlow( ...
  'OutputValue', 'Horizontal and vertical components in complex form');

In particular that last parameter, "horizontal and vertical components in complex form". One output matrix that consists of complex numbers.

1 Comment

nadia naji on 4 Feb 2013

i appreciate your help

Walter Roberson

Contact us