Ask Your Question
0

Point Grey camera interface with opencv

asked 2017-07-25 18:51:20 -0600

BhanuKiran gravatar image

updated 2017-07-25 18:53:22 -0600

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.

edit retag flag offensive close merge delete

Comments

What error did you get when you execute this code ? Are using Windows or Ubuntu ?

bvbdort gravatar imagebvbdort ( 2017-07-26 06:30:48 -0600 )edit

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.

Pedro Batista gravatar imagePedro Batista ( 2017-07-26 07:48:40 -0600 )edit

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.

BhanuKiran gravatar imageBhanuKiran ( 2017-07-26 13:26:02 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-07-26 07:52:29 -0600

kbarni gravatar image

The industrial cameras have their proprietary drivers, they don't use the standard video interfaces of the OS. This is normal, as these cameras are quite complex and they are generally used in more complex situations, where you need a full control over the camera.

You have to download the camera's SDK from the Point Grey site (https://www.ptgrey.com/support/downloads) and implement the capturing yourself.

Then you can transform the captured buffer into an OpenCV Mat.

uchar *data;
//...capture the image to the data buffer using the SDK...
Mat image(width,height,CV_8UC3,data); //don't forget to define the image width, height and type
//...process the image
edit flag offensive delete link more

Comments

Hi , Thanks for response. I was doing the way you mentioned before. But for the purpose of calibration using opencv, i want to choose video as an input. In the file "in_VID5.xml"

<Input>"1"</Input>

is not working. I am wondering if there is way i can input point grey camera video as an input for the camera calibration.

BhanuKiran gravatar imageBhanuKiran ( 2017-07-26 13:20:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-07-25 18:51:20 -0600

Seen: 1,855 times

Last updated: Jul 26 '17