00001 /* 00002 * Copyright 2015 Aldebaran 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 */ 00017 00018 /* 00019 * You can also find this document at the following location: 00020 * http://doc.aldebaran.com/2-1/ref/libalvision/a00012_source.html 00021 */ 00022 00023 #pragma once 00024 #ifndef _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_ 00025 #define _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_ 00026 00027 namespace AL 00028 { 00029 #define TORAD 3.14f/180.0f 00030 00031 const int kOV7670 = 1; 00032 const int kMT9M114 = 2; 00033 const int kOV5640 = 3; 00034 const int kXTION = 4; 00035 00036 const int kTopCamera = 0; 00037 const int kBottomCamera = 1; 00038 const int kDepthCamera = 2; 00039 const int kInfraredOrStereoCamera = 3; 00040 00041 const float kApertureH_OV7670 = 47.8f; 00042 const float kApertureV_OV7670 = 36.8f; 00043 const float kApertureH_MT9M114 = 60.9f; 00044 const float kApertureV_MT9M114 = 47.6f; 00045 00046 const int kQQVGA = 0; // 160*120 00047 const int kQVGA = 1; // 320*240 00048 const int kVGA = 2; // 640*480 00049 const int k4VGA = 3; //1280*960 00050 const int k960p = k4VGA; //deprecated 00051 const int k16VGA = 4; //2560*1920 00052 const int k1920p = k16VGA; //2560*1920 00053 const int k720p = 5; //1280*720 00054 const int kQ720p = 9; //640*360 00055 const int kQQ720p = 10; //320*180 00056 const int kQQQ720p = 11; //160*90 00057 const int kQQQQ720p = 12; //80*45 00058 const int k720px2 = 13; //2560*720 00059 const int kQ720px2 = 14; //1280*360 00060 const int kQQ720px2 = 15; //640*180 00061 const int kQQQ720px2 = 16; //320*90 00062 const int kQQQQ720px2 = 17; //160*45 00063 const int k1080p = 6; //1920*1080 00064 const int kQQQVGA = 7; // 80*60 00065 const int kQQQQVGA = 8; // 40*30 00066 00067 const int kYuvColorSpace = 0; 00068 const int kyUvColorSpace = 1; 00069 const int kyuVColorSpace = 2; 00070 const int kRgbColorSpace = 3; 00071 const int krGbColorSpace = 4; 00072 const int krgBColorSpace = 5; 00073 const int kHsyColorSpace = 6; 00074 const int khSyColorSpace = 7; 00075 const int khsYColorSpace = 8; 00076 const int kYUV422InterlacedColorSpace = 9; // deprecated 00077 const int kYUV422ColorSpace = 9; 00078 const int kYUVColorSpace = 10; 00079 const int kRGBColorSpace = 11; 00080 const int kHSYColorSpace = 12; 00081 const int kBGRColorSpace = 13; // for opencv ease of use 00082 const int kYYCbCrColorSpace = 14; // for tiff io implementation 00083 const int kH2RGBColorSpace = 15; // H from HSY to RGB in fake colors 00084 const int kHSMixedColorSpace = 16; // HS and (H +S)/2 00085 const int kDepthColorSpace = 17; 00086 const int kARGBColorSpace = 18; 00087 const int kXYZColorSpace = 19; 00088 const int kInfraredColorSpace = 20; 00089 const int kDistanceColorSpace = 21; 00090 const int kRawDepthColorSpace = 23; 00091 00092 const int kCameraBrightnessID = 0; 00093 const int kCameraContrastID = 1; 00094 const int kCameraSaturationID = 2; 00095 const int kCameraHueID = 3; 00096 const int kCameraRedChromaID = 4; 00097 const int kCameraBlueChromaID = 5; 00098 const int kCameraGainID = 6; 00099 const int kCameraHFlipID = 7; 00100 const int kCameraVFlipID = 8; 00101 const int kCameraLensXID = 9; 00102 const int kCameraLensYID = 10; 00103 const int kCameraAutoExpositionID = 11; 00104 const int kCameraAutoWhiteBalanceID = 12; 00105 const int kCameraAutoGainID = 13; 00106 const int kCameraResolutionID = 14; 00107 const int kCameraFrameRateID = 15; 00108 const int kCameraBufferSizeID = 16; 00109 const int kCameraExposureID = 17; 00110 const int kCameraSelectID = 18; 00111 const int kCameraSetDefaultParamsID = 19; 00112 const int kCameraColorSpaceID = 20; 00113 const int kCameraExposureCorrectionID = 21; 00114 const int kCameraExposureAlgorithmID = 22; 00115 const int kCameraAecAlgorithmID = kCameraExposureAlgorithmID; // deprecated 00116 const int kCameraFastSwitchID = 23; 00117 const int kCameraSharpnessID = 24; 00118 const int kCameraAwbGreenGainID = 25; 00119 const int kCameraAblcID = 26; 00120 const int kCameraAblcTargetID = 27; 00121 const int kCameraAblcStableRangeID = 28; 00122 const int kCameraBlcBlueID = 29; 00123 const int kCameraBlcRedID = 30; 00124 const int kCameraBlcGbID = 31; 00125 const int kCameraBlcGrID = 32; 00126 const int kCameraWhiteBalanceID = 33; 00127 const int kCameraBacklightCompensationID = 34; 00128 const int kCameraKeepAliveID = 35; 00129 const int kCameraDepthConfidenceThresholdID = 36; 00130 const int kCameraDepthFastFilterID = 37; 00131 const int kCameraTemperatureID = 38; 00132 const int kCameraAverageLuminanceID = 39; 00133 const int kCameraAutoFocusID = 40; 00134 00135 bool isResolutionValid(const int resIndex); 00136 00137 void setSizeFromResolution(const int resIndex, int& outWidth, int& outHeight); 00138 00139 int getResolutionFromSize(const int width, const int height); 00140 00141 bool isColorSpaceValid(const int colorspace); 00142 00143 int getNumLayersInColorSpace(const int colorSpace); 00144 00145 inline float convertAngleValToNormalizedImgVal(const float& radValue, 00146 const float& imageRadMin, 00147 const float& imageRadMax) 00148 { return ( radValue / (imageRadMax-imageRadMin)); } 00149 00150 inline float convertAnglePosToNormalizedImgPos(const float& radPosition, 00151 const float& imageRadMin, 00152 const float& imageRadMax) 00153 { return ((radPosition-imageRadMin) / (imageRadMax-imageRadMin)); } 00154 } // namespace AL 00155 00156 00157 #endif // _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_