Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include "opencv2/opencv.hpp"
  2. #include <cstdlib>
  3. #include "params_parser.h"
  4. #include <libv4l2.h>
  5. #include <linux/videodev2.h>
  6. #include <sys/ioctl.h>
  7. #include <fcntl.h>
  8. #include <iostream>
  9. #include <sstream>
  10. #include "Cube.h"
  11. using namespace cv;
  12.  
  13.  
  14.  
  15. int main(int argc, char **argv) {
  16.   int descriptor = v4l2_open(/dev/video0, O_RDWR);
  17.   v4l2_control c;
  18.   c.id = V4L2_CID_EXPOSURE_AUTO;
  19.   c.value = 1; 
  20.   if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &c) == 0)
  21.     std::cout << "success";
  22.   /*c.id = V4L2_CID_EXPOSURE_AUTO_PRIORITY;
  23.   c.value = 0;
  24.   if (v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &c) == 0)
  25.     std::cout << "success";*/
  26.  
  27.   c.id = V4L2_CID_EXPOSURE_ABSOLUTE;
  28.   c.value = 158;
  29.   if (v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &c) == 0)
  30.     std::cout << "success";
  31.   cv::VideoCapture capture(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement