opt_nm33_camera.h
Go to the documentation of this file.
00001 /*                                                            */
00002 /* This code is based on luvcview_wr_100823 from Opt corp.    */
00003 /*                                                            */
00004 /*                  2010/09/15    k-okada@jsk.t.u-tokyo.ac.jp */
00005 
00006 #include "opt_nm33_uvc.h"
00007 
00008 #include <opencv/cv.h>
00009 #include <opencv/highgui.h>
00010 
00011 class OptNM3xCamera
00012 {
00013 private:
00014   struct buffer {
00015     void *start;
00016     size_t length;
00017   } *buffers;
00018   unsigned int n_buffers;
00019   IplImage *frame, *frame_omni, *frame_wide, *frame_middle, *frame_narrow;
00020   int width, height;
00021   int fd;
00022 
00023   bool v4l2_set_ioctl(int selector, int value);
00024   int v4l2_get_ioctl(int selector);
00025 
00026   bool getXuValue(int selector, const char *str);
00027   bool getXuValue(int selector, short *value);
00028   bool setXuValue(int selector, char value);
00029   bool setXuValue(int selector, short v1, short v2);
00030   bool setXuValue(int selector, short v1, short v2, short v3, short v4, short v5);
00031   bool xu_ioctl(int selector, int ctrl, void* value);
00032 
00033 public:
00034   OptNM3xCamera(int camera_index);
00035   ~OptNM3xCamera();
00036 
00037   void device_open(int camera_index);
00038   void device_close();
00039   IplImage *read_frame();
00040 
00041   // obtaining images
00042   IplImage *queryFrame ();
00043   IplImage *queryOmniFrame ();
00044   IplImage *queryWideFrame ();
00045   IplImage *queryMiddleFrame ();
00046   IplImage *queryNarrowFrame ();
00047 
00048   void getOmniImage (IplImage *frame, CvMat &subframe);
00049   void getWideImage (IplImage *frame, CvMat &subframe);
00050   void getMiddleImage (IplImage *frame, CvMat &subframe);
00051   void getNarrowImage (IplImage *frame, CvMat &subframe);
00052 
00053   // set commands
00054   bool setMode (int mode);
00055 
00056   // ct command
00057   bool setAutoExposure(bool mode);
00058   bool setExposure (int value);
00059   bool setIris(int value);
00060   bool setBrightness(int value);
00061   bool setSharpness(int value);
00062   bool setWhitebalance(int value);
00063   bool setAutoWhitebalance(bool mode);
00064   bool setPanAbsolute(double value);
00065   bool setTiltAbsolute(double value);
00066   bool setRollAbsolute(double value);
00067   bool setZoomAbsolute(double value);
00068   bool setPanAbsolute(int value);
00069   bool setTiltAbsolute(int value);
00070   bool setRollAbsolute(int value);
00071   bool setZoomAbsolute(int value);
00072 
00073   // xu command
00074   std::string getFirmwareVersion();
00075   bool setFlipScreen(char value);
00076   bool setSmallHemisphere(char value);
00077   bool setMedianFilter(bool mode);
00078   bool setJpegQuality(char value);
00079   std::string getSerialID();
00080   bool setInfoDisplay(bool mode);
00081   bool setCaptureFPS(short value);
00082   short getActualFPS();
00083   bool setLensType(char value);
00084   bool setPanAbsolute(int no, int value);
00085   bool setTiltAbsolute(int no, int value);
00086   bool setRollAbsolute(int no, int value);
00087   bool setZoomAbsolute(int no, int value);
00088   bool setLocationAbsolute(int no, int pan, int tilt, int roll, int zoom);
00089   //
00090 };


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