"Major ver = 6" return from console

asked 2019-06-20 22:38:32 -0600

Vizier87 gravatar image

Hi guys,

I'm initiating a simple connection with an in-built camera in a system. It seems to be an old model (Avermedia 7231 Analog Capture).

I'm attempting at just seeing whether the video feed works. When I ran my code (below):

#include <opencv2\highgui.hpp>
#include <opencv2\videoio.hpp>
#include <opencv2\imgcodecs.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/opencv.hpp>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <math.h>
//#include <stdafx.h>


//ADD this to disable OpenCL explicitly
#include <opencv2\core\ocl.hpp>

// make sure you use the OpenCV namespace
using namespace cv;
using namespace std;

int main()
{
    // Disable OpenCL explicitly here
    ocl::setUseOpenCL(false);
    VideoCapture capture(0);
    Mat current_frame;


    capture >> current_frame;

    while (1) {
        capture >> current_frame;
        if (current_frame.empty()) break;
        imshow("Normal", current_frame);
        int key = waitKey(33) && 0xFF;
        if (key == 27) break;
    }
    return 0;

}

The console return a funny response "Major ver 6" and prompted a "select camera" window like below:

image description

I think it might be about the right driver issue, but a camera I had previously did not require any installation and it worked fine. I'm avoiding any attempts of installing any dodgy camera software if I could hence this seemingly unnecessary step.

Any thoughts?

Thanks. Vizier87

edit retag flag offensive close merge delete

Comments

opencv / os version ?

that selection box looks like it is from (super outdated) VFW driver.

berak gravatar imageberak ( 2019-06-21 01:00:27 -0600 )edit

OpenCV 3.0.0 and my OS: Windows 7 Home Edition.

I know.. I haven't updated with OpenCV v4 but this works still fine for me.

Vizier87 gravatar imageVizier87 ( 2019-06-21 02:10:31 -0600 )edit

still, you might try VideoCapture(0, CAP_DSHOW); (or CAP_MSMF), maybe you get different / better results

berak gravatar imageberak ( 2019-06-21 03:38:48 -0600 )edit

You mean like VideoCapture capture(0, CAP_DSHOW);?

Vizier87 gravatar imageVizier87 ( 2019-06-23 21:45:30 -0600 )edit