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