我正在尝试创建一个在Raspberry Pi上全屏的OpenCV应用程序(在C ++中)。我还没能让我的应用程序全屏显示。我尝试过以下方法:
namedWindow("Image");
setWindowProperty("Image", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);
// Create black empty images
Mat image = Mat::zeros(400, 400, CV_8UC3);
// Draw a circle
circle(image, Point(200, 200), 32.0, Scalar(0, 0, 255), 1, 8);
imshow("Image", image);
waitKey(0);
return(0);
但是,这只给了我一个400乘400的窗口。我引用了这篇文章Why does a full screen window resolution in OpenCV (@ Banana Pi, Raspbian) slow down the camera footage and let it lag?,但它没有帮助。如果有人有任何想法,我很乐意听到他们。谢谢,特拉维斯
答案 0 :(得分:2)
尝试:
namedWindow("Image", WINDOW_NORMAL);
因为默认的WINDOW_AUTOSIZE标志won't let you resize the window
另外,为了清楚起见,请使用:
namedWindow("Image", WINDOW_NORMAL);
setWindowProperty("Image", CV_WND_PROP_FULLSCREEN, 1); //( on or off)
或:
namedWindow("Image", WINDOW_NORMAL | WINDOW_FULLSCREEN );