imshow and plot not displaying when using opticalFlow
古いコメントを表示
Hi, Following the optical flow examples, the code below is behaving in an odd way. If I only use imshow on the image it will refresh in real-time (i.e comment out the plot command), however if I try to plot the optical flow vectors, I will only get the very last frame displayed once the loop has completed. Could anyone shed any light on this?
vidDevice = imaq.VideoDevice('winvideo', 1);
optical = opticalFlowHS;
nFrames = 0;
while (nFrames<100)
nFrames = nFrames + 1;
rgbData = step(vidDevice);
grey = rgb2gray(rgbData);
optFlow = estimateFlow(optical,grey);
imshow(rgbData);
hold on
plot(optFlow, 'DecimationFactor',[5 5],'ScaleFactor',25);
hold off
end
release(vidDevice);
Many thanks
採用された回答
その他の回答 (1 件)
Issa Al-Hmoud
2019 年 8 月 20 日
0 投票
try the pause command after the hold off
pause(0.1)
カテゴリ
ヘルプ センター および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!