I have interfaced webcam with matlab gui and able to take images. I have two push buttons Preview & Take Image. I want to take image with "Take Image" push button & my taken images to be stored with my desired names and folder as we do in imsave normally but here I am unable.Can anyone help me, the closest was below but it is introducing new push button.
function pbTP_Callback(hObject, eventdata, handles)vid = videoinput('winvideo', 1, 'YUY2_1024x768');vid.FramesPerTrigger = 1;vid.ReturnedColorspace = 'rgb';triggerconfig(vid, 'manual');vidRes = get(vid, 'VideoResolution');imWidth = vidRes(1);imHeight = vidRes(2);nBands = get(vid, 'NumberOfBands');hImage = image(zeros(imHeight, imWidth, nBands), 'parent', handles.axPreview)preview(vid, hImage);start(vid); pause(5); trigger(vid);stoppreview(vid);im1 = getdata(vid);imwrite(im1, 'myimage.jpg');
Best Answer