Opening 720p webcam with OpenCV 2.4.5 (and unicap)

asked 2013-07-02 12:46:20 -0500

NikolasE gravatar image

Hello

I just reinstalled OpenCV to activate TBB and also added the unicap option during cmake. So far, I used a webcam that can provide 1280x720 images. So far, I used

  cap = VideoCapture(1);
  cap.set(CV_CAP_PROP_FRAME_HEIGHT,720);
  cap.set(CV_CAP_PROP_FRAME_WIDTH,1280);

to connect to the camera which worked perfectly. If I now try to open the stream as before, no Image is read (cap.read(rgb) does not return). If I uncomment the cap.set lines, I get a 720p image, but only the upper left 640*480 pixels contain the full image and the rest is just black.

I am not sure if unicap has something to do with it, so it's just a guess. Has anyone experienced this problem before?

Cheers, Nikolas

edit retag flag offensive close merge delete

Comments

Could you try using: Mat rgb; cap >> rgb;

to see if this solves the problem. Using this all formatting is done correctly and automatic with preset properties. It works for me.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-03 06:52:09 -0500 )edit

no, same behavior. (I just get a VGA image)

NikolasE gravatar imageNikolasE ( 2013-07-03 09:54:11 -0500 )edit