I am developing a small webcam application with Logitech C920 and OpenCV.
I can actually get images from camera without any problem with given resolution. But except for frame width and height, I can't access any setting in the camera. I have following code. As you can guess, the code produced all zero lines except for the first two.
Am I doing something wrong? or Is this another proprietary BS from Logitech? If this is limitation of OpenCV, is there any other option to develop an application for this webcam in Windows OS?
m_cam.open(0);
if(!m_cam.isOpened() ) // check if we succeeded
{
std::cerr << "ERROR: Could not open cameras." << std::endl;
return;
}
int ex = static_cast<int>(m_cam.get(CV_CAP_PROP_FOURCC));
char EXT[] = {ex & 0XFF , (ex & 0XFF00) >> 8,(ex & 0XFF0000) >> 16,(ex & 0XFF000000) >> 24, 0};
m_cam.set(CV_CAP_PROP_FOURCC,CV_FOURCC('H','2','6','4'));
m_cam.set(CV_CAP_PROP_FRAME_WIDTH,1280);//2304);//1829//1200//800
m_cam.set(CV_CAP_PROP_FRAME_HEIGHT,720);//1536); //1080//800//600
m_cam.set(CV_CAP_PROP_FPS, 30);
//m_cam.set(CV_CAP_PROP_EXPOSURE,0);
std::cout<< m_cam.get(CV_CAP_PROP_FRAME_WIDTH) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_FRAME_HEIGHT) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_FPS) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_EXPOSURE) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_FORMAT) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_CONTRAST) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_BRIGHTNESS) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_SATURATION) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_HUE) << std::endl;
std::cout<< m_cam.get(CV_CAP_PROP_POS_FRAMES) << std::endl;