Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First disable auto exposure mode and then manually set the exposure to the desired value. you can use this following snippet for your purpose

VideoCapturer cap(id) struct v4l2_control ctrl; cap.read(image);

// ctrl.id = V4L2_CID_EXPOSURE_AUTO; // ctrl.value = V4L2_EXPOSURE_MANUAL; // if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl)) // std::cout << "Error disabling auto exposure\n";

// ctrl.id = V4L2_CID_EXPOSURE_ABSOLUTE; // ctrl.value = 400; // if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl)) // cout << "Error setting exposure\n";

First disable auto exposure mode and then manually set the exposure to the desired value. you can use this following snippet for your purpose

VideoCapturer cap(id)
 cap(id);
Mat src;
struct v4l2_control ctrl;
   cap.read(image);

// cap.read(src); ctrl.id = V4L2_CID_EXPOSURE_AUTO; // ctrl.value = V4L2_EXPOSURE_MANUAL; // if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl)) // std::cout << "Error disabling auto exposure\n";

// exposure\n"; ctrl.id = V4L2_CID_EXPOSURE_ABSOLUTE; ctrl.value = 100; if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl)) ctrl.id = V4L2_CID_EXPOSURE_ABSOLUTE; // ctrl.value = 400; // if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl)) // cout std::cout << "Error setting exposure\n";

exposure\n";

First disable auto exposure mode and then manually set the exposure to the desired value. you can use this following snippet for your purpose

VideoCapturer VideoCapture cap(id);
Mat src;
struct v4l2_control ctrl;
cap.read(src);
ctrl.id = V4L2_CID_EXPOSURE_AUTO;
ctrl.value = V4L2_EXPOSURE_MANUAL;
if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl))
    std::cout << "Error disabling auto exposure\n";
ctrl.id = V4L2_CID_EXPOSURE_ABSOLUTE;
ctrl.value = 100;
if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl))
    std::cout << "Error setting exposure\n";

First disable auto exposure mode and then manually set the exposure to the desired value. you can use this following snippet for your purpose

VideoCapture cap(id);
Mat src;
struct v4l2_control ctrl;
cap.read(src);
ctrl.id = V4L2_CID_EXPOSURE_AUTO;
ctrl.value = V4L2_EXPOSURE_MANUAL;
if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl))
    std::cout << "Error disabling auto exposure\n";
ctrl.id = V4L2_CID_EXPOSURE_ABSOLUTE;
ctrl.value = 100;
if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &ctrl))
    std::cout << "Error setting exposure\n";