Updating Image within axes on GUI
Show older comments
Hi, I have a live video feed in axes1. I'm trying to crop a box from present frame each 1ms and put it in axes 2 so axis two is simulating showing a video of the cropped area. A timer is supposed to control the update. For some reason, after the first iteration of the timer function, it gives an error:
< Error while evaluating TimerFcn for timer 'timer-1'
Reference to non-existent field 'axes2'. >
My timer updating function is
function user_timer_update(src,evt, fig_handle,vid)
global gy;
Rec_Size = [640,360,1000,1000];
handles = guihandles(fig_handle);
axes(handles.axes2);
J = getsnapshot(vid);
J = imcrop(J,Rec_Size);
imshow(J,'Parent',handles.axes2);
gy = gy + 1;
disp(gy);
Please how do I rectify this?? Thanks for the help. I already tried changing the "NextPlot" value to "replace children" and it works but it drastically slows down the live feed in the first axes.
Accepted Answer
More Answers (0)
Categories
Find more on Image Preview and Device Configuration 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!