how to execute stop(vid) when i close the imshow figure while running a while loop?
3 ビュー (過去 30 日間)
古いコメントを表示
i am capturing images from a camera in real time and displaying the processed image in a while loop. As soon as I close the figure window, an error pops up. I want to execute stop(vid) after i close the figure and don't want the error to exist.
the error is as given below
Error using matlab.ui.Figure/set Invalid or deleted object.
Error in imshow (line 343) set(fig_handle, 'NextPlot', 'replacechildren')
Error in LiveDetector (line 40) imshow(imgOut);toc;
5 件のコメント
zhuang Xu
2019 年 1 月 12 日
So have you solved this problem,bro ? How did you achieve that ?
Walter Roberson
2019 年 1 月 12 日
use the close request callback that I linked to . That is exactly the kind of purpose the callback was designed for.
回答 (1 件)
Walter Roberson
2018 年 12 月 11 日
https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html#buiwuyk-1-CloseRequestFcn
use a callback to detect the close attempt .use it to stop the video before deleting the figure.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!