Matlabを使用してオブジェクトの速度を確認しようとしているので、このコードを思いつきました
reader = vision.VideoFileReader ('C:\folder1\objectsandflow.avi');
viewer = vision.DeployableVideoPlayer;
optical = vision.OpticalFlow;
optical.OutputValue = 'Horizontal and vertical components in complex form';
videoPlayer = vision.VideoPlayer('Name','Motion Vector');
while isDone (reader)
I = step(reader);
of = step (optical, rgb2gray(I));
y = of .* conj(of);
step(viewThresh,y>mean(y(:)));
step(videoPlayer)
end
release(videoPlayer);
release(reader);
問題は、フローの値 (いくつかのオブジェクトの速度を探していて、Matlab を使用できますか?) もビデオも表示できないことです。
同時に、このコードができない場合にオブジェクトのすべての速度を計算するためにこれが機能するかどうかはわかりません.Matlabで複数の速度を計算するにはどうすればよいですか?