computer vision - Extract the points that generate the vectors x and y in the video -


this code example of computer vision system toolbox, generates motion vectors of optical flow. curious extract each video frame array [x, y] coordinate points make these vectors.

videoreader=vision.videofilereader('videoname','imagecolorspace','intensity',... 'videooutputdatatype','uint8');  converter = vision.imagedatatypeconverter; opticalflow = vision.opticalflow('referenceframedelay', 1); opticalflow.outputvalue = 'horizontal , vertical components in complex form'; shapeinserter = vision.shapeinserter('shape', 'lines', 'bordercolor',... 'custom','custombordercolor', 255); videoplayer = vision.videoplayer('name','motion vector');  videoinfo    = info(videoreader); videoplayer  = vision.videoplayer('position',... [100 100 videoinfo.videosize(1:2)+30]);  while ~isdone(videoreader) frame = step(videoreader); im = step(converter, frame); of = step(opticalflow, im); lines = videooptflowlines(of, 20); if ~isempty(lines)    out = step(shapeinserter, im, lines);     step(videoplayer, out); end end  release(videoplayer); release(videoreader); 

so googled lines videooptflowlines = function (f, 20); generates coordinate points of lines of optical flow. tried put 'lines' in command window waiting me return array data, apparently not expected array. against matrix?

the motion vectors stored in of, 2-d array of complex numbers. real part contains x-coordinates , imaginary part contains y-coordinates.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -