1

I have a 1280x1024 video input device, I wrote a small opencv project to capture images from it, but I get only a 640x480 images ?? any body has idea why I get that , here is my code :

 #include <opencv2\highgui\highgui.hpp>
 #include <opencv2\core\core.hpp>
 #include <opencv2\opencv.hpp>

using namespace std;

 int main(){
cv::VideoCapture cap(2);
cv::Mat  frame;
int key = 0;
while(key != 27){
    cap.read(frame);


    cv::imshow("test",frame);
    key = cv::waitKey(10);
}
return 0 ;}

thanks in advance for your help

Engine
  • 5,360
  • 18
  • 84
  • 162
  • you can have a look at here: http://stackoverflow.com/questions/14287/increasing-camera-capture-resolution-in-opencv – fatihk Apr 11 '13 at 12:18

1 Answers1

1

As of the last version of OpenCV:

cap.set(CV_CAP_PROP_FRAME_WIDTH, 1280);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 1024);
zakinster
  • 10,508
  • 1
  • 41
  • 52