clc; close all; %% workingDir='C\Preej_journal_j4\'; motiondirectionflow = motionFlowLKDoG('NoiseThreshold',0.0005); shuttleVideo = VideoReader('GS.avi'); h = figure; movegui(h); hViewPanel = uipanel(h,'Position',[0 0 1 1],'Title','Plot of motion direction flow Vectors'); hPlot = axes(hViewPanel); t=1; while hasFrame(shuttleVideo) frameRGB = readFrame(shuttleVideo); frameGray = rgb2gray(frameRGB); flow = estimateFlow(motiondirectionflow,frameGray); imshow(frameRGB) hold on plot(flow,'DecimationFactor',[5 5],'ScaleFactor',190,'Parent',hPlot); hold off pause(10^-3) w=flow.Vx; x=flow.Vy; y=flow.Orientation; z=flow.Magnitude; OPF1=cat(1,w,x,y,z); % matrix2D = reshape(flow,[1,2]); [a,idx]=sort(OPF1,'descend'); B = a.'; OPFV = B(1:100); % t=t+1; end %%