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