OpenCV中的Reg Break功能 [英] Reg break function in opencv

查看:96
本文介绍了OpenCV中的Reg Break功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我为mousecallback函数编写了代码.

Hi
I wrote code for mousecallback function.

while(1)  
{  
    myShowImageScroll("Image", image, width, height);  
    int KEY = cvWaitKey(10);  
    if( (char) KEY == 27 ) 
    {
        cvWaitKey();
        break;
    }
}


在不使用虚拟键的情况下如何停止程序.


Here how can I stop the program without using virtual keys.

推荐答案

我对OpenCV不熟悉,但cvWaitKey()只会对事件做出反应从您的 key 面板上?如果这是鼠标回调代码,那么为什么还要查询键盘?

更不用说您永远不应该调用依赖事件处理程序内部事件的函数(如果这是一个)-您会招致死锁!我希望解决事件处理所需的任何信息都将作为参数传递给事件处理函数.您的鼠标回调不是这种情况吗?如果是这样,那么您还缺少什么?
I''m not familiar with OpenCV, but wouldn''t cvWaitKey() only react to events from your keyboard? If this is mouse callback code, why then do you query the keyboard?

Not to mention that you never should call functions that rely on events inside an event handler (if this is one) - you''d be provoking deadlocks! I''d expect that any information required to resolve event handling would be passed as parameters to the event handler function. Is this not the case for your mouse callback? If so, what are you missing?


实际上,我需要在不使用ESC键的情况下停止该程序.
Actually, I need to stop the program without using ESC key.


这篇关于OpenCV中的Reg Break功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆