Capture the frame from iDS uEye camera.

asked 2019-03-22 09:13:22 -0500

vps gravatar image

updated 2019-03-22 09:14:09 -0500

Dear all, I am using the USB 3.0 iDS uEye UI-3241LE-MGL model. I am trying to get the camera frames in OpenCv. I have used @StevenPuttemans 's code link text but I am getting the blank frames asoutput. Does anyone have any idea about this?

edit retag flag offensive close merge delete

Comments

1

Probably there are several things to change in that code to adapt it to your case (he used an Ethernet camera, yours is USB; it has hard-coded image size, etc). Here's what I recommend to do:

  • install the uEye SDK
  • run the provided application to see if the camera is OK and you can capture images.
  • Try some example code from the SDK and see if you can grab the images correctly
  • Modify that example for your need:

    //get the image size from the camera: W*H
    Mat img(H,W,CV_8U);
    //grab the image from the camera: *camImgPtr
    memcpy(img.ptr(), camImgPtr, W*H);
    imshow("Captured",img);
    
kbarni gravatar imagekbarni ( 2019-03-25 11:39:58 -0500 )edit

Yeah, I kept the maximum height and width of the image and it is working.

vps gravatar imagevps ( 2019-03-26 09:27:51 -0500 )edit