MATLAB Answers


Buttondownfcn callback on live video data (preview)

Asked by Sam
on 16 Nov 2012


I am currently trying to initiate a callback routine when the user presses on an axis that contains a live video stream, i.e.

frame = getsnapshot(handles.vidObj);
axes = imshow(frame, 'Parent', handles.axes_stream); 
preview(handles.vidObj, axes); % assign vidObj to axes

However, I have not yet been able to achieve this despite looking at various discussions. I presume it is because the displayed video is stopping my mouse button being registered and the callback routine is not working.

Any help would be appreciated.

  1 Comment

on 18 Nov 2012

Anyone? I'm starting to think that maybe it's not possible.


No products are associated with this question.

1 Answer

Answer by Sean de Wolski
on 16 Nov 2012

I am guessing that preview is nullifying your ButtonDownFcn (just an educated guess though). Thus you would need to reinstate your ButtonDownFcn on the axes after calling preview.


Sean de Wolski
on 26 Nov 2012

Sam, if your license's SMS is current, please contact Technical Support.

Image Analyst
on 26 Nov 2012

I haven't tried clicking on the live video axes. Would clicking on a button be an acceptable workaround? Because I know I can click on buttons while I have a live image in an axes, and it does the callback operations just fine.

on 26 Nov 2012

I will contact Technical Support and see what they have to say and report back. For now, I will use buttons to provide the necessary functionality.

Cheers everyone!

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!