"Major ver = 6" return from console
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:
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
opencv / os version ?
that selection box looks like it is from (super outdated) VFW driver.
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.
still, you might try
VideoCapture(0, CAP_DSHOW);
(orCAP_MSMF
), maybe you get different / better resultsYou mean like
VideoCapture capture(0, CAP_DSHOW);
?