App Designer: How to use a camera in different Callbacks
Show older comments
Hello everybody,
I am using App Designer and try to implement a camera into my application.
I have one Callback in which I open a live stream from a camera, when a Button is pushed. To realise this, I use the following Code:
app.vid = videoinput('gentl', 1,'Mono8');
hImage = image(app.UIAxes,zeros(1024,1280,3));
app.UIAxes.XLim = [0,1280];
app.UIAxes.YLim = [0,1024];
app.UIAxes.XTick = [];
app.UIAxes.YTick = [];
pbaspect(app.UIAxes,[1280,1024,1]);
preview(app.vid,hImage);
Now, in a different Callback, I want to gather an image from the actual live picture. Right now i am using the following Code:
asd= getdata(app.vid);
save('path','asd');
Unfortunately get the following Error when calling:
Error using imaqdevice/getdata (line 154) OBJ is not running and no frames are available.
Can somebody help me to solve my problem?
Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!