Buttondownfcn callback on live video data (preview)
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello,
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 件のコメント
Sam
2012 年 11 月 18 日
回答 (1 件)
Sean de Wolski
2012 年 11 月 16 日
0 投票
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.
8 件のコメント
Sam
2012 年 11 月 16 日
Sean de Wolski
2012 年 11 月 16 日
Is the axes' 'Hittest' turned off?
You may want to check this.
get(ax,'hittest');
And look in the documentation for axes properties for a more thorough explanation of why.
Sam
2012 年 11 月 17 日
Sean de Wolski
2012 年 11 月 19 日
Well I would guess that is the issue - you want the 'HitTest' to be on :).
If the axes can't become the current object, it's ButtonDownFcn will never fire...
Sam
2012 年 11 月 22 日
Sean de Wolski
2012 年 11 月 26 日
Sam, if your license's SMS is current, please contact Technical Support.
Image Analyst
2012 年 11 月 26 日
編集済み: Image Analyst
2012 年 11 月 26 日
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.
Sam
2012 年 11 月 26 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!