OpenCV: can't set resolution of video capture

后端 未结 4 2096
离开以前
离开以前 2020-12-14 22:20

I am using OpenCV 2.4.5 on Ubuntu 12.04 64-bit. I would like to be able to set the resolution of the input from my Logitech C310 webcam. The camera supports up to 1280x960 a

4条回答
  •  一向
    一向 (楼主)
    2020-12-14 22:42

    Maybe you can try this, but I am not sure if this is what you want:

    #include 
    
    Display* disp = XOpenDisplay(NULL);
    Screen*  scrn = DefaultScreenOfDisplay(disp);
    int height = scrn->height;
    int width  = scrn->width;
    
    //Create window for the ip cam video
    cv::namedWindow("Front", CV_WINDOW_NORMAL);
    
    cvSetWindowProperty( "Front", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN );
    
    //Position of the screen where the video is shows
    cvMoveWindow("Front", 0, 0);
    cvResizeWindow( "Front", width, height );
    

    Like this you get the full screen for any screen.

提交回复
热议问题