每当imshow显示的窗口关闭时,关闭应用程序主窗口吗?

时间:2019-01-09 00:13:24

标签: opencv

每当imshow所示的窗口关闭时,如何关闭应用程序主窗口?

#include <iostream>
#include <opencv2/opencv.hpp>

using namespace cv;
using namespace std;

main()
{
    Mat m(1000, 1000, CV_8UC3, Scalar(255, 0, 0));
    const string nameWnd = "nameWnd";
    namedWindow(nameWnd, WINDOW_NORMAL);
    imshow(nameWnd, m);

    waitKey(0);
}

0 个答案:

没有答案