Point Grey camera interface with opencv
I have a point grey camera USB3 type and connect it to my computer using USB 3.0 port.
I came across this code recently. But not sure how to use.
#include "opencv2\opencv.hpp"
#include <stdint.h>
using namespace cv;
using namespace std;
const int fps = 20;
int main(int argv, char** argc) {
Mat frame;
VideoCapture vid(0);
if (!vid.isOpened()) {
return -1;
}
while (vid.read(frame)) {
imshow("Webcam", frame);
if (waitKey(1000 / fps) >= 0)
break;
}
return 1;
}
I am not sure how to use this code with my camera. Please help.
What error did you get when you execute this code ? Are using Windows or Ubuntu ?
If the Point Grey camera is using USB, OpenCV should be able to interface with it, though this is not guaranteed. First, plug-in the camera and try to use some software to show camera image (skype, custom software from vendor, or whatever). If it is working, it means you have the correct driver for the camera installed on your computer.
This means opencv should be able to use it too. Compile that code and run it. If there is no image, or if the camera is not opening, then get back to us with the problem.
I am using windows. There is no error after compiling the code but no windows is showing up and code is terminating instantly.
Its working well with point grey software. I also interfaced with opencv C++ following their tutorial. Actually, i want to input video for camera calibration.