Hello, I bought a new web cam and I made this little program that takes one frame and saves it to a file passed to the parameter.
I have only one problem, the camera is 8 MP but the picture I take is of low resolution: 640x480
How do I tell it to use a higher resolution?
Thank you
My code
#include "opencv2/opencv.hpp"
using namespace cv;
int main(int argc, char** argv)
{
VideoCapture cap;
if(!cap.open(0))
{
return 0;
}else
{
Mat frame;
cap >> frame;
if( frame.empty() )
{
}else
{
imwrite( argv[1], frame );
}
}
return 0;
}
↧