修改摄像头参数

摄像头有一个可以修改的参数列表。

参数 最小值 最大值 摄像头ID名 ID值
Brightness(亮度) 0 255 kCameraBrightnessID 0
Contrast(对比度) 0 127 kCameraContrastID 1
Saturation(饱和度) 0 255 kCameraSaturationID 2
Hue(色相) -180 180 kCameraHueID 3
Red Chroma(红色色度) 0 255 kCameraRedChromaID 4
Blue Chroma(蓝色色度) 0 255 kCameraBlueChromaID 5
Gain(增益) 0 255 kCameraGainID 6
Horizontal Flip(水平翻转) 0 1 kCameraHFlipID 7
Vertical Flip(垂直翻转) 0 1 kCameraVFlipID 8
Correction Lens X(校正透镜X)(无效) 0 255 kCameraLensXID 9
Correction Lens Y(校正透镜Y)(无效) 0 255 kCameraLensYID 10
Auto Exposition(自动曝光) 0 1 kCameraAutoExpositionID 11
Auto White Balance(自动白平衡) 0 1 kCameraAutoWhiteBalanceID 12
Auto Gain(自动增益) 0 1 kCameraAutoGainID 13
Camera Resolution(摄像头分辨率) kQVGA kVGA kCameraResolutionID 14
Frames Per Second (帧每秒)(可在5、10、15和30之间选择)- 尚未投入使用 5 30 kCameraFrameRateID 15
Exposure(曝光)(时间为ms,= value x 33/510) 0 传感器的行数(480+30个覆盖行=510) kCameraExposureID 17
Camera Select(摄像头选择) 0 (顶部摄像头) 1 (底部摄像头) kCameraSelectID 18
Reset camera registers(重置摄像头寄存器)(RESERVED) kCameraSetDefaultParamsID 19
Exposure Correction(曝光校正)(= value/3 — 自动切换至基于平均值的AEC算法) -6 6 kCameraExposureCorrectionID 21
Auto Exposure Control Algorithm(自动曝光控制算法) 0 (基于平均值的算法) 1 (基于直方图的算法) kCameraAecAlgorithmID 22
Fast switch(快速切换)(两个摄像头必须以同样的模式运行) kCameraFastSwitchID 23
Camera Sharpness(摄像头清晰度) 0 31 kCameraSharpnessID 24

可以通过一些方法来获取和改变这些参数。以下为一个范例:

// First, get a proxy on the video input module if you haven't already done it. ALPtr<ALProxy> cameraProxy = getParentBroker()->getProxy( "ALVideoDevice" ); // Now you are able to get the value of any parameter. int BrightnessValue = ( cameraProxy->call<int>( "getParam", kCameraBrightnessID ) ); //You can change any parameter's value with the following method. cameraProxy->callVoid( "setParam", kCameraHueID, -130);





Copyright © 2010 Aldebaran-Robotics - 版权所有