How do I set the interval of my snapshot in GUI in real time?
1 view (last 30 days)
Show older comments
I am counting dots per snapshot, how do I set the interval of the camera on snapshot? as well as how do I set it when the GUI detect the dots that is the time he will do the snapshot? refer code below ty for your help
% --- Executes on button press in snap_shot.
function start_snap_Callback(hObject, eventdata, handles)
% hObject handle to snap_shot (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.ss,'string','start');
set(handles.stop_snap,'enable','on');
while strcmp(get(handles.ss,'string'),'start') == 1
wa = getsnapshot(vid);
axes(handles.snap_shot);
imshow(wa);
verybest; % image processing takes
set(handles.pres,'String',Ndots);
0 Comments
Answers (2)
Image Analyst
on 3 Feb 2013
You can insert a pause(numberOfSeconds) in your while loop to have it wait whatever length of time you want. After some number of snaps, you'll probably want to do
set(handles.ss,'string', 'Stop');
to get your while loop to exit, otherwise you'll be in that loop forever. I'm also not sure how verybest() gets its data.
1 Comment
Image Analyst
on 4 Feb 2013
Regarding your "Answer" you posted below (instead of a comment to my Answer like you should have)...
You're not assigning the Ndots string, so that line will fail. Plus you have no way to ever exit the loop like I mentioned above.
michael Longard
on 3 Feb 2013
2 Comments
Image Analyst
on 3 Feb 2013
In your main program, call it like this:
Neggs = verybest(wa); % Do image processing on this snapshot.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!