opt_nm33_camera.cpp
Go to the documentation of this file.
1 /* */
2 /* This code is based on luvcview_wr_100823 from Opt corp. */
3 /* */
4 /* 2010/09/15 k-okada@jsk.t.u-tokyo.ac.jp */
5 
6 #include "opt_nm33_camera.h"
7 
8 #include <opencv/cv.h>
9 #include <opencv/highgui.h>
10 #include <opencv2/opencv.hpp>
11 
12 //
13 #include <fcntl.h>
14 #include <sys/mman.h>
15 #include <unistd.h>
16 #define CLEAR(x) memset (&(x), 0, sizeof (x))
17 
18 /* convert from mjpeg to rgb24 */
19 static bool
20 mjpeg_to_rgb24 (int width, int height,
21  unsigned char *src, int length,
22  unsigned char *dst)
23 {
24  cv::Mat temp=cv::imdecode(cv::Mat(std::vector<uchar>(src, src + length)), 1);
25  if( !temp.data || temp.cols != width || temp.rows != height )
26  return false;
27  memcpy(dst, temp.data, width*height*3);
28  return true;
29 }
30 
31 void OptNM3xCamera::device_open(int camera_index)
32 {
33  // open_device
34  char dev_name[128];
35  sprintf(dev_name, "/dev/video%1d", camera_index);
36  fprintf(stderr, "Opening device '%s'\n", dev_name);
37 
38  width = 640;
39  height = 480;
40 
41  try_again:
42  fd = open(dev_name, O_RDWR, 0);
43 
44  if (fd == -1) {
45  fprintf(stderr, "Cannot open '%s': %d, %s\n",
46  dev_name, errno, strerror(errno));
47  exit(EXIT_FAILURE);
48  }
49 
50  // init_device
51  struct v4l2_capability cap;
52  struct v4l2_format fmt;
53 
54  if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == -1) {
55  if (EINVAL == errno) {
56  fprintf(stderr, "%s is no V4L2 device\n", dev_name);
57  }
58  perror("VIDIOC_QUERYCAP");
59  exit(EXIT_FAILURE);
60  }
61 
62  if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
63  fprintf(stderr, "%s is no video capture device\n", dev_name);
64  exit(EXIT_FAILURE);
65  }
66 
67  if (!(cap.capabilities & V4L2_CAP_STREAMING)) {
68  fprintf(stderr, "%s does not support streaming i/o\n", dev_name);
69  exit(EXIT_FAILURE);
70  }
71 
72  CLEAR(fmt);
73 
74  fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
75  fmt.fmt.pix.width = width;
76  fmt.fmt.pix.height = height;
77  fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG;
78  fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
79 
80  if (ioctl(fd, VIDIOC_S_FMT, &fmt) == -1) {
81  perror("VIDIOC_S_FMT");
82  exit(EXIT_FAILURE);
83  }
84 
85  // init mmap
86  struct v4l2_requestbuffers req;
87 
88  CLEAR(req);
89 
90  req.count = 4;
91  req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
92  req.memory = V4L2_MEMORY_MMAP;
93 
94  if (ioctl(fd, VIDIOC_REQBUFS, &req) == -1) {
95  perror("VIDIOC_REQBUFS");
96  exit(EXIT_FAILURE);
97  }
98 
99  if (req.count < 2) {
100  fprintf(stderr, "Insufficient buffer memory on %s\n", dev_name);
101  exit(EXIT_FAILURE);
102  }
103 
104  buffers = (buffer *)calloc(req.count, sizeof(*buffers));
105 
106  if (!buffers) {
107  fprintf(stderr, "Out of memory\n");
108  exit(EXIT_FAILURE);
109  }
110 
111  for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
112  struct v4l2_buffer buf;
113 
114  CLEAR(buf);
115 
116  buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
117  buf.memory = V4L2_MEMORY_MMAP;
118  buf.index = n_buffers;
119 
120  if (ioctl(fd, VIDIOC_QUERYBUF, &buf) == -1) {
121  perror("VIDIOC_QUERYBUF");
122  exit(EXIT_FAILURE);
123  }
124 
125  buffers[n_buffers].length = buf.length;
126  buffers[n_buffers].start = mmap(NULL /* start anywhere */ ,
127  buf.length, PROT_READ | PROT_WRITE
128  /* required */ ,
129  MAP_SHARED /* recommended */ ,
130  fd, buf.m.offset);
131 
132  if (buffers[n_buffers].start == MAP_FAILED) {
133  perror("mmap");
134  exit(EXIT_FAILURE);
135  }
136  }
137 
138  // start capturing
139  unsigned int i;
140  enum v4l2_buf_type type;
141 
142  for (i = 0; i < n_buffers; ++i) {
143  struct v4l2_buffer buf;
144 
145  CLEAR(buf);
146 
147  buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
148  buf.memory = V4L2_MEMORY_MMAP;
149  buf.index = i;
150 
151  if (ioctl(fd, VIDIOC_QBUF, &buf) == -1) {
152  if ( width == 640 && height == 480 ) {
153  device_close();
154  width = 320; height = 240;
155  goto try_again;
156  }
157  perror("VIDIOC_QBUF");
158  exit(EXIT_FAILURE);
159  }
160  }
161 
162  type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
163 
164  if (ioctl(fd, VIDIOC_STREAMON, &type) == -1) {
165  if ( width == 640 && height == 480 ) {
166  device_close();
167  width = 320; height = 240;
168  goto try_again;
169  }
170  perror("VIDIOC_STREAMON");
171  exit(EXIT_FAILURE);
172  }
173  //
174  fprintf(stderr, "video capabilities\n");
175  fprintf(stderr, "cap.driver = %s\n", cap.driver);
176  fprintf(stderr, "cap.card = %s\n", cap.card);
177  fprintf(stderr, "cap.buf_info = %s\n", cap.bus_info);
178  fprintf(stderr, "cap.version = %d\n", cap.version);
179  fprintf(stderr, "cap.capabilities = 0x%08x ", cap.capabilities);
180  if (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)
181  fprintf(stderr, " VIDEO_CAPTURE");
182  if (cap.capabilities & V4L2_CAP_VIDEO_OUTPUT)
183  fprintf(stderr, " VIDEO_OUTPUT");
184  if (cap.capabilities & V4L2_CAP_VIDEO_OVERLAY)
185  fprintf(stderr, " VIDEO_OVERLAY");
186  if (cap.capabilities & V4L2_CAP_VBI_CAPTURE)
187  fprintf(stderr, " VBI_CAPTURE");
188  if (cap.capabilities & V4L2_CAP_VBI_OUTPUT)
189  fprintf(stderr, " VBI_OUTPUT");
190 #ifdef V4L2_CAP_SLICED_VBI_CAPTURE
191  if (cap.capabilities & V4L2_CAP_SLICED_VBI_CAPTURE)
192  fprintf(stderr, " SLICED_VBI_CAPTURE");
193 #endif
194 #ifdef V4L2_CAP_SLICED_VBI_OUTPUT
195  if (cap.capabilities & V4L2_CAP_SLICED_VBI_OUTPUT)
196  fprintf(stderr, " VBI_SLICED_OUTPUT");
197 #endif
198  if (cap.capabilities & V4L2_CAP_RDS_CAPTURE)
199  fprintf(stderr, " RDS_CAPTURE");
200 #if V4L2_CAP_VIDEO_OUTPUT_OVERLAY
201  if (cap.capabilities & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)
202  fprintf(stderr, " VIDEO_OUTPUT_OVERLAY");
203 #endif
204  if (cap.capabilities & V4L2_CAP_TUNER)
205  fprintf(stderr, " TUNER");
206  if (cap.capabilities & V4L2_CAP_AUDIO)
207  fprintf(stderr, " AUDIO");
208  if (cap.capabilities & V4L2_CAP_RADIO)
209  fprintf(stderr, " RADIO");
210  if (cap.capabilities & V4L2_CAP_READWRITE)
211  fprintf(stderr, " READWRITE");
212  if (cap.capabilities & V4L2_CAP_ASYNCIO)
213  fprintf(stderr, " ASYNCIO");
214  if (cap.capabilities & V4L2_CAP_STREAMING)
215  fprintf(stderr, " STREAMING");
216  fprintf(stderr, "\n");
217  fprintf(stderr, "cap.width = %d\n", width);
218  fprintf(stderr, "cap.height = %d\n", height);
219 
220  /* Set up Image data */
221  frame = (IplImage *)malloc(sizeof(IplImage));
222  cvInitImageHeader( frame,
223  cvSize( width, height ),
224  IPL_DEPTH_8U, 3, IPL_ORIGIN_TL, 4 );
225  /* Allocate space for RGBA data */
226  frame->imageData = (char *)cvAlloc(frame->imageSize);
227 }
228 
230 {
231  // stop capturing
232  enum v4l2_buf_type type;
233 
234  type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
235 
236  if (ioctl(fd, VIDIOC_STREAMOFF, &type) == -1) {
237  perror("VIDIOC_STREAMOFF");
238  exit(EXIT_FAILURE);
239  }
240 
241  // uninit_mmap
242  unsigned int i;
243 
244  for (i = 0; i < n_buffers; ++i) {
245  if (munmap(buffers[i].start, buffers[i].length) == -1) {
246  perror("munmap");
247  exit(EXIT_FAILURE);
248  }
249  }
250 
251  // uninit_device
252  free(buffers);
253 
254  // close_device
255  if (close(fd) == -1) {
256  perror("close");
257  exit(EXIT_FAILURE);
258  }
259  fd = -1;
260 }
261 
263 {
264  // read frame
265  struct v4l2_buffer buf;
266 
267  CLEAR(buf);
268 
269  buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
270  buf.memory = V4L2_MEMORY_MMAP;
271 
272  if (ioctl(fd, VIDIOC_DQBUF, &buf) == -1) {
273  perror("VIDIOC_DQBUF");
274  return NULL;
275  }
276  assert(buf.index < n_buffers);
277 
278  //process_image(buffers[buf.index].start);
280  (unsigned char*)(buffers[buf.index].start),
281  buffers[buf.index].length,
282  (unsigned char*)frame->imageData)) {
283  perror("mjpeg_to_rgb24");
284  return NULL;
285  }
286 
287  if (ioctl(fd, VIDIOC_QBUF, &buf) == -1) {
288  perror("VIDIOC_QBUF");
289  return NULL;
290  }
291 
292  return frame;
293 }
294 
296 {
297  device_open(camera_index);
298 
299  setMode(4);
300  if ( strcmp(getFirmwareVersion().c_str(), "") == 0 ) {
301  fprintf(stderr, "ERROR : try sudo -E ./bin/init_xu_register\n");
302  exit(1);
303  }
304  fprintf(stderr, "firmwareVersion -> %s\n", getFirmwareVersion().c_str());
305  fprintf(stderr, "serialId -> %s\n", getSerialID().c_str());
306 
308 }
309 
311 {
312  device_close();
313 }
314 
315 // obtaining images
317 {
318  if ( read_frame()==NULL ) {
319  fprintf(stderr, "ERROR : read_frame returns NULL\n");
320  return NULL;
321  }
322 
323 
324  int height = frame->height, width = frame->width;
325  if ( ! ( frame_omni && (frame_omni->width == height/2 &&
326  frame_omni->height == height/2 ) ) )
327  frame_omni = cvCreateImage(cvSize(height/2, height/2), frame->depth, frame->nChannels);
328  if ( ! ( frame_wide && (frame_wide->width == (width-height/2) &&
329  frame_wide->height == height/2 ) ) )
330  frame_wide = cvCreateImage(cvSize(width-height/2, height/2), frame->depth, frame->nChannels);
331  if ( ! ( frame_middle && (frame_middle->width == width/2 &&
332  frame_middle->height == height/2 ) ) )
333  frame_middle = cvCreateImage(cvSize(width/2, height/2), frame->depth, frame->nChannels);
334  if ( ! ( frame_narrow && (frame_narrow->width == width/2 &&
335  frame_narrow->height == height/2 ) ) )
336  frame_narrow = cvCreateImage(cvSize(width/2, height/2), frame->depth, frame->nChannels);
337  return frame;
338 }
339 
340 void OptNM3xCamera::getOmniImage (IplImage *frame, CvMat &subframe) {
341  int height = frame->height;
342  cvGetSubRect(frame, &subframe, cvRect(0, 0, height/2, height/2));
343 }
344 
345 void OptNM3xCamera::getWideImage (IplImage *frame, CvMat &subframe) {
346  int width = frame->width, height = frame->height;
347  cvGetSubRect(frame, &subframe, cvRect(height/2, 0, width-height/2, height/2));
348 }
349 
350 void OptNM3xCamera::getMiddleImage (IplImage *frame, CvMat &subframe) {
351  int width = frame->width, height = frame->height;
352  cvGetSubRect(frame, &subframe, cvRect(0, height/2, width/2, height/2));
353 }
354 
355 void OptNM3xCamera::getNarrowImage (IplImage *frame, CvMat &subframe) {
356  int width = frame->width, height = frame->height;
357  cvGetSubRect(frame, &subframe, cvRect(width/2, height/2, width/2, height/2));
358 }
359 
360 
362  int height = frame->height;
363  cvSetImageROI(frame, cvRect(0, 0, height/2, height/2));
364  cvCopy(frame, frame_omni);
365  cvResetImageROI(frame);
366  return frame_omni;
367 }
368 
370  int width = frame->width, height = frame->height;
371  cvSetImageROI(frame, cvRect(height/2, 0, width-height/2, height/2));
372  cvCopy(frame, frame_wide);
373  cvResetImageROI(frame);
374  return frame_wide;
375 }
376 
378  int width = frame->width, height = frame->height;
379  cvSetImageROI(frame, cvRect(0, height/2, width/2, height/2));
380  cvCopy(frame, frame_middle);
381  cvResetImageROI(frame);
382  return frame_middle;
383 }
384 
386  int width = frame->width, height = frame->height;
387  cvSetImageROI(frame, cvRect(width/2, height/2, width/2, height/2));
388  cvCopy(frame, frame_narrow);
389  cvResetImageROI(frame);
390  return frame_narrow;
391 }
392 
393 // set commands
394 bool OptNM3xCamera::setMode (int mode) {
395  return (ioctl(fd, VIDIOC_S_INPUT, &mode)==0);
396 }
397 
398 // ct command
400  v4l2_set_ioctl(V4L2_CID_EXPOSURE_AUTO, mode?1:2);
401  return true;
402 }
403 bool OptNM3xCamera::setExposure (int value) {
404  v4l2_set_ioctl(V4L2_CID_EXPOSURE_ABSOLUTE, value);
405  return true;
406 }
407 bool OptNM3xCamera::setIris(int value) {
409  return true;
410 }
412  v4l2_set_ioctl(V4L2_CID_BRIGHTNESS, value);
413  return true;
414 }
416  v4l2_set_ioctl(V4L2_CID_SHARPNESS, value);
417  return true;
418 }
420  v4l2_set_ioctl(V4L2_CID_WHITE_BALANCE_TEMPERATURE, value);
421  return true;
422 }
424  v4l2_set_ioctl(V4L2_CID_AUTO_WHITE_BALANCE, mode?1:0);
425  return true;
426 }
427 bool OptNM3xCamera::setPanAbsolute(double value) {
428  return v4l2_set_ioctl(V4L2_CID_PAN_ABSOLUTE, (int)(value*3600));
429 }
430 bool OptNM3xCamera::setTiltAbsolute(double value) {
431  return v4l2_set_ioctl(V4L2_CID_TILT_ABSOLUTE, (int)(value*3600));
432 }
433 bool OptNM3xCamera::setRollAbsolute(double value) {
434  return v4l2_set_ioctl(V4L2_CID_ROLL_ABSOLUTE, (int)(value*1));
435 }
436 bool OptNM3xCamera::setZoomAbsolute(double value) {
437  return v4l2_set_ioctl(V4L2_CID_ZOOM_ABSOLUTE, (int)value);
438 }
440  return v4l2_set_ioctl(V4L2_CID_PAN_ABSOLUTE, value);
441 }
443  return v4l2_set_ioctl(V4L2_CID_TILT_ABSOLUTE, value);
444 }
446  return v4l2_set_ioctl(V4L2_CID_ROLL_ABSOLUTE, value);
447 }
449  return v4l2_set_ioctl(V4L2_CID_ZOOM_ABSOLUTE, value);
450 }
451 
452 bool OptNM3xCamera::v4l2_set_ioctl(int selector, int value) {
453  v4l2_queryctrl q;
454  q.id = selector;
455  if ( ioctl(fd, VIDIOC_QUERYCTRL, &q) < 0 )
456  {
457  perror("unable to query control");
458  return false;
459  }
460 
461  v4l2_control c;
462  c.id = selector;
463  c.value = value;
464  fprintf(stderr, "VIDIOC_S_CTRL: sel = 0x%08x, data =0x%08x\n",
465  selector, value);
466  if (ioctl(fd, VIDIOC_S_CTRL, &c) < 0)
467  {
468  perror("unable to set control");
469  return false;
470  }
471  return true;
472 }
473 
474 int OptNM3xCamera::v4l2_get_ioctl(int selector) {
475  v4l2_control c;
476  c.id = selector;
477  fprintf(stderr, "VIDIOC_S_CTRL: sel = 0x%02x\n", selector);
478  if (ioctl(fd, VIDIOC_G_CTRL, &c) == 0)
479  {
480  perror("unable to get control");
481  return -1;
482  }
483  return c.value;
484 }
485 
486 // xu command
488 #ifdef NON_STD_UVC
489  std::string str(255,0);
490 #else
491  std::string str(32,0);
492 #endif
494  return str.substr(0,str.find_first_of('\0'));
495 }
497  return setXuValue(XU_FLIP_SCREEN_CONTROL,value);
498 }
501 }
503  return setXuValue(XU_MEDIAN_FILTER_CONTROL, (char)(mode?1:0));
504 }
506  return setXuValue(XU_JPEG_QUALITY_CONTROL,value);
507 }
509  std::string str(16,0);
510  getXuValue(XU_SERIAL_ID_CONTROL, str.c_str());
511  return str.substr(0,str.find_first_of('\0'));
512 }
514  return setXuValue(XU_INFO_DISPLAY_CONTROL, mode?1:0);
515 }
516 bool OptNM3xCamera::setCaptureFPS(short value) {
517  return setXuValue(XU_CAPTURE_FPS_CONTROL,value);
518 }
520  short value;
522  return value;
523 }
524 bool OptNM3xCamera::setLensType(char value) {
525  return setXuValue(XU_LENS_TYPE_CONTROL,value);
526 }
527 bool OptNM3xCamera::setPanAbsolute(int no, int value) {
528  return setXuValue(XU_PAN_ABSOLUTE_CONTROL, no, value);
529 }
530 bool OptNM3xCamera::setTiltAbsolute(int no, int value) {
531  return setXuValue(XU_TILT_ABSOLUTE_CONTROL, no, value);
532 }
533 bool OptNM3xCamera::setRollAbsolute(int no, int value) {
534  return setXuValue(XU_ROLL_ABSOLUTE_CONTROL, no, value);
535 }
536 bool OptNM3xCamera::setZoomAbsolute(int no, int value) {
537  return setXuValue(XU_ZOOM_ABSOLUTE_CONTROL, no, value);
538 }
539 bool OptNM3xCamera::setLocationAbsolute(int no, int pan, int tilt, int roll, int zoom) {
540  return setXuValue(XU_LOCATION_ABSOLUTE_CONTROL, no, pan, tilt, roll, zoom);
541 }
542 //
543 bool OptNM3xCamera::getXuValue(int selector, const char *str) {
544  return xu_ioctl(selector, UVC_GET_CUR, (void *)str);
545 }
546 bool OptNM3xCamera::getXuValue(int selector, short *value) {
547  return xu_ioctl(selector, UVC_GET_CUR, (void *)value);
548 }
549 bool OptNM3xCamera::setXuValue(int selector, char value) {
550  return xu_ioctl(selector, UVC_SET_CUR, (void *)&value);
551 }
552 bool OptNM3xCamera::setXuValue(int selector, short v1, short v2) {
553  struct { short v1, v2;} value;
554  value.v1 = v1;
555  value.v2 = v2;
556  return xu_ioctl(selector, UVC_SET_CUR, (void *)&value);
557 }
558 bool OptNM3xCamera::setXuValue(int selector, short v1, short v2, short v3, short v4, short v5) {
559  struct { short v1, v2, v3, v4, v5;} value;
560  value.v1 = v1; value.v2 = v2; value.v3 = v3; value.v4 = v4; value.v5 = v5;
561  return xu_ioctl(selector, UVC_SET_CUR, (void *)&value);
562 }
563 
564 bool OptNM3xCamera::xu_ioctl(int selector, int ctrl, void* value) {
565  for (int i = 0; i < uvc_xu_tbl_cnt; i++) {
566  if (xu_control_tbl[i].selector == selector) {
567  struct uvc_xu_control_query xctrl;
568  xctrl.unit = 0x60;
569  xctrl.selector = xu_control_tbl[i].selector;
570  xctrl.size = xu_control_tbl[i].size;
571  xctrl.data = (__u8*)value;
572  xctrl.query = ctrl;
573  fprintf(stderr, "%s: name = %s, sel = 0x%02x, size = %d, data =",
574  (ctrl == UVC_SET_CUR) ? "UVC_SET_CUR" : "UVC_GET_CUR",
575  xu_control_tbl[i].name,
576  xctrl.selector,
577  xctrl.size);
578  if (ioctl(fd, UVCIOC_CTRL_QUERY, &xctrl) != 0) {
579  xctrl.data[0] = 0;
580  fprintf(stderr, "\nioctl error %s\n", strerror(errno));
581  return false;
582  } else {
583  for (int j = 0; j < xctrl.size; j++)
584  fprintf(stderr, " 0x%02x", *(xctrl.data + j));
585  fprintf(stderr, "\n");
586  if (xu_control_tbl[i].size == 255) xctrl.data[xctrl.size] = 0;
587  return true;
588  }
589  }
590  }
591  return false;
592 }
std::string getFirmwareVersion()
bool getXuValue(int selector, const char *str)
bool setTiltAbsolute(double value)
bool setXuValue(int selector, char value)
bool setRollAbsolute(double value)
bool setLensType(char value)
IplImage * queryFrame()
IplImage * queryOmniFrame()
IplImage * frame_omni
IplImage * queryWideFrame()
IplImage * read_frame()
int uvc_xu_tbl_cnt
bool xu_ioctl(int selector, int ctrl, void *value)
bool setWhitebalance(int value)
bool setBrightness(int value)
bool setFlipScreen(char value)
std::string getSerialID()
IplImage * queryNarrowFrame()
IplImage * frame_narrow
bool setCaptureFPS(short value)
#define XU_CAPTURE_FPS_CONTROL
Definition: uvcvideo.h:61
#define XU_ZOOM_ABSOLUTE_CONTROL
Definition: uvcvideo.h:67
#define XU_PAN_ABSOLUTE_CONTROL
Definition: uvcvideo.h:64
#define XU_FIRMWARE_VERSION_CONTROL
Definition: uvcvideo.h:49
bool setAutoExposure(bool mode)
bool setExposure(int value)
bool setMode(int mode)
void getOmniImage(IplImage *frame, CvMat &subframe)
#define XU_JPEG_QUALITY_CONTROL
Definition: uvcvideo.h:58
bool setSharpness(int value)
IplImage * frame
#define XU_TILT_ABSOLUTE_CONTROL
Definition: uvcvideo.h:65
int v4l2_get_ioctl(int selector)
void getNarrowImage(IplImage *frame, CvMat &subframe)
#define V4L2_CID_IRIS_ABSOLUTE
Definition: uvc_compat.h:186
bool setZoomAbsolute(double value)
void device_open(int camera_index)
bool setPanAbsolute(double value)
void getMiddleImage(IplImage *frame, CvMat &subframe)
IplImage * frame_middle
bool v4l2_set_ioctl(int selector, int value)
#define XU_SERIAL_ID_CONTROL
Definition: uvcvideo.h:59
#define XU_SMALL_HEMISPHERE_CONTROL
Definition: uvcvideo.h:52
uvc_xu_tbl_info xu_control_tbl[]
#define XU_ROLL_ABSOLUTE_CONTROL
Definition: uvcvideo.h:66
#define XU_LOCATION_ABSOLUTE_CONTROL
Definition: uvcvideo.h:68
bool setLocationAbsolute(int no, int pan, int tilt, int roll, int zoom)
bool setJpegQuality(char value)
#define XU_MEDIAN_FILTER_CONTROL
Definition: uvcvideo.h:54
#define XU_LENS_TYPE_CONTROL
Definition: uvcvideo.h:63
void getWideImage(IplImage *frame, CvMat &subframe)
bool setSmallHemisphere(char value)
#define CLEAR(x)
#define XU_INFO_DISPLAY_CONTROL
Definition: uvcvideo.h:60
struct OptNM3xCamera::buffer * buffers
bool setInfoDisplay(bool mode)
OptNM3xCamera(int camera_index)
IplImage * frame_wide
bool setIris(int value)
bool setMedianFilter(bool mode)
bool setAutoWhitebalance(bool mode)
#define V4L2_CID_ROLL_ABSOLUTE
Definition: uvc_compat.h:185
unsigned int n_buffers
IplImage * queryMiddleFrame()
static bool mjpeg_to_rgb24(int width, int height, unsigned char *src, int length, unsigned char *dst)
#define XU_FLIP_SCREEN_CONTROL
Definition: uvcvideo.h:51


opt_camera
Author(s): Kei Okada
autogenerated on Wed Jul 10 2019 03:47:11