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