Stop a webcam preview without closing window

4 ビュー (過去 30 日間)
Niraj Desai
Niraj Desai 2019 年 6 月 6 日
コメント済み: Niraj Desai 2019 年 6 月 29 日
I'm building a GUI using appdesigner (Matlab 2019a, Support Package for USB Webcams). I'd like to be able to preview my computer's webcam in one of the GUI's axes. I've been able to do it like this:
obj = webcam(1);
vidRes = strsplit(obj.Resolution, 'x');
hImage = image(app.UIAxes, zeros(str2double(vidRes(2)),str2double(vidRes(1)),3));
preview(obj, hImage)
However, I don't know how to stop the preview. Using closePreview(obj) closes the entire GUI window, which is not what I want.
The Image Acquisition Toolbox has a function stoppreview. Is there anything comparable -- or a workaround -- for the webcam support package?
Thanks,
Niraj
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 6 月 29 日
We do not know if anyone who works for the Mathworks has read your question.
This is not an official support channel. This resource has questions answered by volunteers, most of whom do not work for Mathworks.
There are on the order of 4000 new questions asked every month (over 5000 per month in late winter as university years finish), so it is easy for any one question to be overlooked by an occasional volunteer who happens to know the answer. Most answers come from the 50 or so most active volunteers, about 90% of whom do not work for Mathworks. It happens that the most active non-Mathworks volunteers seldom use App Designer.
I could answer with respect to the older style preview() function, but I do not have experience with App Designer so I did not respond.
Niraj Desai
Niraj Desai 2019 年 6 月 29 日
Thank you for the response.

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by