首页 > 技术文章 > 图像显示

guantian 2018-09-29 10:00 原文

 显示图像失败,但是注销掉namedWindow("disp")就可以正常显示

void _stdcall RawCallBack(LPVOID lpParam, LPVOID lpUser)
{
    imshow("disp",img);   
    waitKey(1);     
}

int main()
{
    namedWindow("disp");
    return 0;
}

 

 

waitKey有两个作用:

1. It waits for x milliseconds for a key press. If a key was pressed during that time, it returns the key's ASCII code. Otherwise, it returns -1.

2It handles any windowing events, such as creating windows with cv::namedWindow(), or showing images with cv::imshow().

格式  waitKey(x)

第一个参数: 等待x ms,如果在此期间有按键按下,则立即结束并返回按下按键的

ASCII码,否则返回-1

如果x=0,那么无限等待下去,直到有按键按下

推荐阅读