If after snapsnot, keeps us take 2 start and end frames to axes2 (original image) and axes3 (final image) to perform data so Uitable 1 (from the original image data) 2 (final image). That is how like the image below?

 Accepted Answer

Marquel - suppose you have a cell array of frames or images. If you wish to put the first frame in axes2 and the last frame in axes3, then you could do something like
image(myFrames{1},'Parent',handles.axes2);
image(myFrames{end},'Parent',handles.axes3);
The above two lines would be added to the callback for your Snapshot button.
You would then do any needed processing to create values that you would then store in your table.
EDIT replaced the cell array accessing with braces as per Image Analyst's below comment.

4 Comments

% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global cam;
axes(handles.axes1);
cam = videoinput('winvideo',1);
set(cam,'ReturnedColorSpace','rgb');
camRes = get(cam,'VideoResolution');
imWidth = camRes(1);
imHeight = camRes(2);
nBands = get(cam,'NumberOfBands');
hImage = image(zeros(imHeight, imWidth, nBands));
preview(cam,hImage);
% --- Executes on button press in Snapshot.
function Snapshot_Callback(hObject, eventdata, handles)
% hObject handle to Snapshot (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global cam;
global image;
image (myFrames {1}, 'Parent', handles.axes2);
image (myFrames {end}, 'Parent', handles.axes3);
%axes(handles.axes2);
imshow(image);
Why is error? Error in
@(hObject,eventdata)TESTSTS('Snapshot_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Marquez - please copy and paste the full error message. I suspect that there may be more to it than what you have pasted above.
To copy the complete error message, go to the command window when it is showing, highlight the whole message (everything in red) with your mouse, use your windows copy sequence, control-C, come over here, click to Comment, click on Control-V to paste. Then select everything that you just pasted in and click on the button marked "{} Code".

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!