naoqidriver
alvisiondefinitions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 /*
19  * You can also find this document at the following location:
20  * http://doc.aldebaran.com/2-1/ref/libalvision/a00012_source.html
21 */
22 
23 #pragma once
24 #ifndef _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
25 #define _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
26 
27 namespace AL
28 {
29  #define TORAD 3.14f/180.0f
30 
31  const int kOV7670 = 1;
32  const int kMT9M114 = 2;
33  const int kOV5640 = 3;
34  const int kXTION = 4;
35 
36  const int kTopCamera = 0;
37  const int kBottomCamera = 1;
38  const int kDepthCamera = 2;
39  const int kInfraredCamera = 3;
40 
41  const float kApertureH_OV7670 = 47.8f;
42  const float kApertureV_OV7670 = 36.8f;
43  const float kApertureH_MT9M114 = 60.9f;
44  const float kApertureV_MT9M114 = 47.6f;
45 
46  const int kQQVGA = 0; // 160*120
47  const int kQVGA = 1; // 320*240
48  const int kVGA = 2; // 640*480
49  const int k4VGA = 3; //1280*960
50  const int k960p = k4VGA; //deprecated
51  const int k16VGA = 4; //2560*1920
52  const int k1920p = k16VGA; //2560*1920
53  const int k720p = 5; //1280*720
54  const int k1080p = 6; //1920*1080
55  const int kQQQVGA = 7; // 80*60
56  const int kQQQQVGA = 8; // 40*30
57 
58  const int kYuvColorSpace = 0;
59  const int kyUvColorSpace = 1;
60  const int kyuVColorSpace = 2;
61  const int kRgbColorSpace = 3;
62  const int krGbColorSpace = 4;
63  const int krgBColorSpace = 5;
64  const int kHsyColorSpace = 6;
65  const int khSyColorSpace = 7;
66  const int khsYColorSpace = 8;
67  const int kYUV422InterlacedColorSpace = 9; // deprecated
68  const int kYUV422ColorSpace = 9;
69  const int kYUVColorSpace = 10;
70  const int kRGBColorSpace = 11;
71  const int kHSYColorSpace = 12;
72  const int kBGRColorSpace = 13; // for opencv ease of use
73  const int kYYCbCrColorSpace = 14; // for tiff io implementation
74  const int kH2RGBColorSpace = 15; // H from HSY to RGB in fake colors
75  const int kHSMixedColorSpace = 16; // HS and (H +S)/2
76  const int kDepthColorSpace = 17;
77  const int kARGBColorSpace = 18;
78  const int kXYZColorSpace = 19;
79  const int kInfraredColorSpace = 20;
80  const int kDistanceColorSpace = 21;
81 
82  const int kCameraBrightnessID = 0;
83  const int kCameraContrastID = 1;
84  const int kCameraSaturationID = 2;
85  const int kCameraHueID = 3;
86  const int kCameraRedChromaID = 4;
87  const int kCameraBlueChromaID = 5;
88  const int kCameraGainID = 6;
89  const int kCameraHFlipID = 7;
90  const int kCameraVFlipID = 8;
91  const int kCameraLensXID = 9;
92  const int kCameraLensYID = 10;
93  const int kCameraAutoExpositionID = 11;
94  const int kCameraAutoWhiteBalanceID = 12;
95  const int kCameraAutoGainID = 13;
96  const int kCameraResolutionID = 14;
97  const int kCameraFrameRateID = 15;
98  const int kCameraBufferSizeID = 16;
99  const int kCameraExposureID = 17;
100  const int kCameraSelectID = 18;
102  const int kCameraColorSpaceID = 20;
106  const int kCameraFastSwitchID = 23;
107  const int kCameraSharpnessID = 24;
108  const int kCameraAwbGreenGainID = 25;
109  const int kCameraAblcID = 26;
110  const int kCameraAblcTargetID = 27;
111  const int kCameraAblcStableRangeID = 28;
112  const int kCameraBlcBlueID = 29;
113  const int kCameraBlcRedID = 30;
114  const int kCameraBlcGbID = 31;
115  const int kCameraBlcGrID = 32;
116  const int kCameraWhiteBalanceID = 33;
118  const int kCameraKeepAliveID = 35;
120  const int kCameraDepthFastFilterID = 37;
121  const int kCameraTemperatureID = 38;
123  const int kCameraAutoFocusID = 40;
124 
125  bool isResolutionValid(const int resIndex);
126 
127  void setSizeFromResolution(const int resIndex, int& outWidth, int& outHeight);
128 
129  int getResolutionFromSize(const int width, const int height);
130 
131  bool isColorSpaceValid(const int colorspace);
132 
133  int getNumLayersInColorSpace(const int colorSpace);
134 
135  inline float convertAngleValToNormalizedImgVal(const float& radValue,
136  const float& imageRadMin,
137  const float& imageRadMax)
138  { return ( radValue / (imageRadMax-imageRadMin)); }
139 
140  inline float convertAnglePosToNormalizedImgPos(const float& radPosition,
141  const float& imageRadMin,
142  const float& imageRadMax)
143  { return ((radPosition-imageRadMin) / (imageRadMax-imageRadMin)); }
144 } // namespace AL
145 
146 
147 #endif // _LIBALVISION_ALVISION_ALVISIONDEFINITIONS_H_
const int kARGBColorSpace
Definition: alvisiondefinitions.h:77
int getNumLayersInColorSpace(const int colorSpace)
const int kyUvColorSpace
Definition: alvisiondefinitions.h:59
const int kCameraLensYID
Definition: alvisiondefinitions.h:92
const int kBottomCamera
Definition: alvisiondefinitions.h:37
const int kCameraGainID
Definition: alvisiondefinitions.h:88
void setSizeFromResolution(const int resIndex, int &outWidth, int &outHeight)
const int kBGRColorSpace
Definition: alvisiondefinitions.h:72
const int kRGBColorSpace
Definition: alvisiondefinitions.h:70
const int kCameraHueID
Definition: alvisiondefinitions.h:85
const int kCameraAblcTargetID
Definition: alvisiondefinitions.h:110
const int kCameraAutoWhiteBalanceID
Definition: alvisiondefinitions.h:94
const int kCameraContrastID
Definition: alvisiondefinitions.h:83
const int kCameraFastSwitchID
Definition: alvisiondefinitions.h:106
const int kCameraExposureCorrectionID
Definition: alvisiondefinitions.h:103
const int kCameraAblcStableRangeID
Definition: alvisiondefinitions.h:111
const int khsYColorSpace
Definition: alvisiondefinitions.h:66
int getResolutionFromSize(const int width, const int height)
const int kCameraTemperatureID
Definition: alvisiondefinitions.h:121
const int kRgbColorSpace
Definition: alvisiondefinitions.h:61
const int kCameraDepthFastFilterID
Definition: alvisiondefinitions.h:120
const int k720p
Definition: alvisiondefinitions.h:53
const int kyuVColorSpace
Definition: alvisiondefinitions.h:60
const int kCameraAutoGainID
Definition: alvisiondefinitions.h:95
const int kDepthColorSpace
Definition: alvisiondefinitions.h:76
const int khSyColorSpace
Definition: alvisiondefinitions.h:65
const float kApertureH_OV7670
Definition: alvisiondefinitions.h:41
const int kCameraLensXID
Definition: alvisiondefinitions.h:91
const int kCameraBlcGrID
Definition: alvisiondefinitions.h:115
const int kCameraBlcBlueID
Definition: alvisiondefinitions.h:112
const int kQVGA
Definition: alvisiondefinitions.h:47
const int kCameraKeepAliveID
Definition: alvisiondefinitions.h:118
const int kDistanceColorSpace
Definition: alvisiondefinitions.h:80
float convertAngleValToNormalizedImgVal(const float &radValue, const float &imageRadMin, const float &imageRadMax)
Definition: alvisiondefinitions.h:135
Definition: alvisiondefinitions.h:27
const int kQQQQVGA
Definition: alvisiondefinitions.h:56
const int kHSMixedColorSpace
Definition: alvisiondefinitions.h:75
const int kYYCbCrColorSpace
Definition: alvisiondefinitions.h:73
const int kCameraFrameRateID
Definition: alvisiondefinitions.h:97
const int kVGA
Definition: alvisiondefinitions.h:48
const int kCameraAutoExpositionID
Definition: alvisiondefinitions.h:93
const int k4VGA
Definition: alvisiondefinitions.h:49
const int kCameraResolutionID
Definition: alvisiondefinitions.h:96
const int kDepthCamera
Definition: alvisiondefinitions.h:38
const float kApertureH_MT9M114
Definition: alvisiondefinitions.h:43
const int kH2RGBColorSpace
Definition: alvisiondefinitions.h:74
const int kYuvColorSpace
Definition: alvisiondefinitions.h:58
const int kCameraWhiteBalanceID
Definition: alvisiondefinitions.h:116
const int kCameraBlcRedID
Definition: alvisiondefinitions.h:113
const int kCameraAblcID
Definition: alvisiondefinitions.h:109
bool isColorSpaceValid(const int colorspace)
const int kYUV422ColorSpace
Definition: alvisiondefinitions.h:68
const int kCameraExposureAlgorithmID
Definition: alvisiondefinitions.h:104
const int kCameraDepthConfidenceThresholdID
Definition: alvisiondefinitions.h:119
const int kCameraRedChromaID
Definition: alvisiondefinitions.h:86
float convertAnglePosToNormalizedImgPos(const float &radPosition, const float &imageRadMin, const float &imageRadMax)
Definition: alvisiondefinitions.h:140
const int kYUV422InterlacedColorSpace
Definition: alvisiondefinitions.h:67
const int k1080p
Definition: alvisiondefinitions.h:54
const int kCameraBufferSizeID
Definition: alvisiondefinitions.h:98
const int kCameraVFlipID
Definition: alvisiondefinitions.h:90
const int kHSYColorSpace
Definition: alvisiondefinitions.h:71
const int krgBColorSpace
Definition: alvisiondefinitions.h:63
const int kCameraAecAlgorithmID
Definition: alvisiondefinitions.h:105
const int kInfraredCamera
Definition: alvisiondefinitions.h:39
const int kCameraBacklightCompensationID
Definition: alvisiondefinitions.h:117
const int kQQQVGA
Definition: alvisiondefinitions.h:55
const float kApertureV_MT9M114
Definition: alvisiondefinitions.h:44
const int kCameraAutoFocusID
Definition: alvisiondefinitions.h:123
const int kTopCamera
Definition: alvisiondefinitions.h:36
const int kCameraExposureID
Definition: alvisiondefinitions.h:99
const int kCameraBrightnessID
Definition: alvisiondefinitions.h:82
const int kCameraHFlipID
Definition: alvisiondefinitions.h:89
const int k960p
Definition: alvisiondefinitions.h:50
const int kOV5640
Definition: alvisiondefinitions.h:33
const int kMT9M114
Definition: alvisiondefinitions.h:32
const int k1920p
Definition: alvisiondefinitions.h:52
const int kOV7670
Definition: alvisiondefinitions.h:31
const int kCameraBlueChromaID
Definition: alvisiondefinitions.h:87
const int kCameraSelectID
Definition: alvisiondefinitions.h:100
const int k16VGA
Definition: alvisiondefinitions.h:51
const int kInfraredColorSpace
Definition: alvisiondefinitions.h:79
bool isResolutionValid(const int resIndex)
const int kCameraAwbGreenGainID
Definition: alvisiondefinitions.h:108
const int kCameraBlcGbID
Definition: alvisiondefinitions.h:114
const int kCameraSetDefaultParamsID
Definition: alvisiondefinitions.h:101
const int kXYZColorSpace
Definition: alvisiondefinitions.h:78
const int kCameraAverageLuminanceID
Definition: alvisiondefinitions.h:122
const float kApertureV_OV7670
Definition: alvisiondefinitions.h:42
const int kQQVGA
Definition: alvisiondefinitions.h:46
const int kXTION
Definition: alvisiondefinitions.h:34
const int krGbColorSpace
Definition: alvisiondefinitions.h:62
const int kYUVColorSpace
Definition: alvisiondefinitions.h:69
const int kCameraSaturationID
Definition: alvisiondefinitions.h:84
const int kHsyColorSpace
Definition: alvisiondefinitions.h:64
const int kCameraColorSpaceID
Definition: alvisiondefinitions.h:102
const int kCameraSharpnessID
Definition: alvisiondefinitions.h:107