opencv icon indicating copy to clipboard operation
opencv copied to clipboard

Error: Null pointer (NULL window: 'Test Program') in cvGetPropWindowAutoSize_W32

Open wwzh2015 opened this issue 3 years ago • 0 comments

System information (version)
  • OpenCV => 4.5
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2017
Detailed description

When I take WindowPropertyFlags that no work after opencv 4.5, but is normal work in opencv4.4.

Tips:Error: Null pointer (NULL window: 'Test Program') in cvGetPropWindowAutoSize_W32

Example Code:

#include <opencv2/opencv.hpp>
#include <iostream>
#include <opencv2/highgui/highgui_c.h>

using namespace cv;
using namespace std;

int main()
{
	VideoCapture capture(0);   

	while(1)
    {
		Mat frame;
		capture >> frame;
		if(frame.empty())
			break;
        namedWindow("Test Program",WINDOW_AUTOSIZE); 
		imshow("Test Program",frame);   
		waitKey(30); 

        if( getWindowProperty("Test Program",WND_PROP_AUTOSIZE) != 1)
            break;
     }
    capture.release();
    destroyAllWindows();
    return 0;
}

wwzh2015 avatar Jul 18 '22 22:07 wwzh2015