I am trying to make a simple full-screen application to display camera output using Open CV. I already have more developed code, I'm just trying to make it in a full-screen window accordingly. I reviewed the basic base code as follows (taken from the OpenCV website):
#include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> int main ( int argc, char **argv ) { cvNamedWindow( "My Window", 1 ); IplImage *img = cvCreateImage( cvSize( 1920, 1200 ), IPL_DEPTH_8U, 1 ); CvFont font; double hScale = 1.0; double vScale = 1.0; int lineWidth = 3; cvInitFont( &font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC, hScale, vScale, 0, lineWidth ); cvPutText( img, "Hello World!", cvPoint( 200, 400 ), &font, cvScalar( 255, 255, 0 ) ); cvSetWindowProperty( "My Window", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN ); cvShowImage( "My Window", img ); cvWaitKey(); return 0; }
When I run this, the window is created at the requested resolution of 1920x1200, but it is not full-screen, it is just a normal HighGUI window. I could swear it worked for me before, but Ubuntu has been destroyed and reinstalled since then, and I have the feeling that I might have forgotten something.
c ++ ubuntu opencv
Ocularprogrammer
source share