destroyWindow
頭文件:opencv2/highgui/highgui.hpp
作用: 關閉指定窗口
函數原型:
void destroyWindow(const string& winname);
- 參數1 winname ,需要關閉的窗口的名稱
示例:
#include<iostream>
#include<opencv2/highgui/highgui.hpp>
using namespace std;
int main(int argc,char **argv){
cv::Mat image = cv::imread("C:/Users/Administrator/Desktop/2-1.jpg", cv::IMREAD_GRAYSCALE);
cv::imshow("窗口名", image);
cv::waitKey(5000); //等待5000ms
cv::destroyWindow("窗口名");
return 0;
}