I need to capture a picture from my webcam, but I want to do it with an external trigger. The preferred trigger is the webcam button, but I'm open for other suggestions.
I know how to open the preview window and use the getsnapshot to get a snapshot.
The code is as follows:
vid = videoinput('winvideo', 1, 'RGB24_320x240');
data = getsnapshot(vid);
What I want to do is substitute the getsnapshot(vid) with an endless loop that checks if I pressed the button. When that condition is satisfied, the loop breaks, and I continue with proccessing my image.