libalvision  2.0.6.8
/home/opennao/work/master/sdk/libnaoqi/libalvision/alvision/alvisiondefinitions.h
Go to the documentation of this file.
00001 
00006 #pragma once
00007 #ifndef _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
00008 #define _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
00009 
00014 namespace AL
00015 {
00016   #define TORAD  3.14f/180.0f
00017 
00021   const int kOV7670  = 1;
00022   const int kMT9M114 = 2;
00023   const int kOV5640  = 3;
00024   const int kXTION   = 4;
00025 
00029   const int kTopCamera = 0;
00030   const int kBottomCamera = 1;
00031   const int kDepthCamera = 2;
00032 
00037   const float kApertureH_OV7670  = 47.8f; 
00038   const float kApertureV_OV7670  = 36.8f; 
00039   const float kApertureH_MT9M114 = 60.9f; 
00040   const float kApertureV_MT9M114 = 47.6f; 
00041 
00045   const int kQQVGA = 0;  // 160*120
00046   const int kQVGA  = 1;  // 320*240
00047   const int kVGA   = 2;  // 640*480
00048   const int k4VGA  = 3;  //1280*960
00049   const int k960p  = k4VGA;  //deprecated
00050   const int k16VGA = 4;  //2560*1920
00051   const int k1920p = k16VGA;  //2560*1920
00052   const int k720p = 5;  //1280*720
00053   const int k1080p = 6;  //1920*1080
00054   const int kQQQVGA = 7;  // 80*60
00055   const int kQQQQVGA = 8;  // 40*30
00056 
00060   const int kYuvColorSpace = 0;
00061   const int kyUvColorSpace = 1;
00062   const int kyuVColorSpace = 2;
00063   const int kRgbColorSpace = 3;
00064   const int krGbColorSpace = 4;
00065   const int krgBColorSpace = 5;
00066   const int kHsyColorSpace = 6;
00067   const int khSyColorSpace = 7;
00068   const int khsYColorSpace = 8;
00069   const int kYUV422ColorSpace = 9;
00070   const int kYUV422InterlacedColorSpace = kYUV422ColorSpace; // deprecated
00071   const int kYUVColorSpace = 10;
00072   const int kRGBColorSpace = 11;
00073   const int kHSYColorSpace = 12;
00074   const int kBGRColorSpace = 13;     // for opencv ease of use
00075   const int kYYCbCrColorSpace = 14;  // for tiff io implementation
00076   const int kH2RGBColorSpace = 15;   // H from HSY to RGB in fake colors
00077   const int kHSMixedColorSpace = 16; // HS and (H +S)/2
00078   const int kDepthColorSpace = 17;
00079   const int kARGBColorSpace = 18;
00080   const int kXYZColorSpace = 19;
00081   const int kInfraredColorSpace = 20;
00082   const int kDistanceColorSpace = 21; 
00083 
00087   const int kCameraBrightnessID       = 0;
00088   const int kCameraContrastID         = 1;
00089   const int kCameraSaturationID       = 2;
00090   const int kCameraHueID              = 3;
00091   const int kCameraRedChromaID        = 4;
00092   const int kCameraBlueChromaID       = 5;
00093   const int kCameraGainID             = 6;
00094   const int kCameraHFlipID            = 7;
00095   const int kCameraVFlipID            = 8;
00096   const int kCameraLensXID            = 9;
00097   const int kCameraLensYID            = 10;
00098   const int kCameraAutoExpositionID   = 11;
00099   const int kCameraAutoWhiteBalanceID = 12;
00100   const int kCameraAutoGainID         = 13;
00101   const int kCameraResolutionID       = 14;
00102   const int kCameraFrameRateID        = 15;
00103   const int kCameraBufferSizeID       = 16;
00104   const int kCameraExposureID         = 17;
00105   const int kCameraSelectID           = 18;
00106   const int kCameraSetDefaultParamsID = 19;
00107   const int kCameraColorSpaceID       = 20;
00108   const int kCameraExposureCorrectionID = 21;
00109   const int kCameraExposureAlgorithmID = 22;
00110   const int kCameraAecAlgorithmID     = kCameraExposureAlgorithmID; // deprecated
00111   const int kCameraFastSwitchID       = 23;
00112   const int kCameraSharpnessID        = 24;
00113   const int kCameraAwbGreenGainID     = 25;
00114   const int kCameraAblcID             = 26;
00115   const int kCameraAblcTargetID       = 27;
00116   const int kCameraAblcStableRangeID  = 28;
00117   const int kCameraBlcBlueID          = 29;
00118   const int kCameraBlcRedID           = 30;
00119   const int kCameraBlcGbID            = 31;
00120   const int kCameraBlcGrID            = 32;
00121   const int kCameraWhiteBalanceID     = 33;
00122   const int kCameraBacklightCompensationID = 34;
00123   const int kCameraKeepAliveID        = 35; 
00124   const int kCameraDepthConfidenceThresholdID = 36; 
00125   const int kCameraDepthFastFilterID  = 37; 
00126   const int kCameraTemperatureID      = 38; 
00127   const int kCameraAverageLuminanceID = 39; 
00128   const int kCameraAutoFocusID = 40; 
00129 
00132   bool isResolutionValid(const int resIndex);
00133 
00137   void setSizeFromResolution(const int resIndex, int& outWidth, int& outHeight);
00138 
00142   int getResolutionFromSize(const int width, const int height);
00143 
00146   bool isColorSpaceValid(const int colorspace);
00147 
00154   int getNumLayersInColorSpace(const int colorSpace);
00155 
00163   int getNumChannelsInColorSpace(const int colorSpace);
00164 
00165   inline float convertAngleValToNormalizedImgVal(const float& radValue,
00166                                                  const float& imageRadMin,
00167                                                  const float& imageRadMax)
00168     { return ( radValue / (imageRadMax-imageRadMin)); }
00169 
00170   inline float convertAnglePosToNormalizedImgPos(const float& radPosition,
00171                                                  const float& imageRadMin,
00172                                                  const float& imageRadMax)
00173     { return ((radPosition-imageRadMin) / (imageRadMax-imageRadMin)); }
00174 } // namespace AL
00175 
00176 
00177 #endif  // _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
 All Classes Namespaces Files Functions Variables Defines