運行 Android 9 或更高版本的裝置可以支援單色相機。 Android 10 提供了對 Y8 流格式、單色和近紅外線 (NIR) 濾色器陣列靜態元資料以及單色相機的DngCreator
功能的額外支援。
借助此功能,設備製造商可以實現單色或 NIR 相機設備,並透過使用 Y8 流格式減少記憶體使用。單色相機可以作為邏輯多相機設備的底層實體相機,以實現更好的低光雜訊特性。
執行
硬體需求
要實現此功能,您的裝置必須具有單色相機感測器和影像訊號處理器 (ISP) 來處理感測器輸出。
實現單色相機
要將相機設備宣傳為單色相機,相機 HAL必須符合以下要求:
-
android.sensor.info.colorFilterArray
設定為MONO
或NIR
。 - 支援
BACKWARD_COMPATIBLE
必需的金鑰,但不支援MANUAL_POST_PROCESSING
。 -
android.control.awbAvailableModes
僅包含AUTO
,且android.control.awbState
是CONVERTED
還是LOCKED
取決於android.control.awbLock
。 -
android.colorCorrection.mode
、android.colorCorrection.transform
和android.colorCorrection.gains
不在可用的請求和結果鍵中。因此,相機設備是LIMITED
。 以下與顏色相關的靜態元資料鍵不存在:
-
android.sensor.referenceIlluminant*
-
android.sensor.calibrationTransform*
-
android.sensor.colorTransform*
-
android.sensor.forwardMatrix*
-
android.sensor.neutralColorPoint
-
android.sensor.greenSplit
-
對於以下元資料鍵,所有顏色通道都具有相同的值:
-
android.sensor.blackLevelPattern
-
android.sensor.dynamicBlackLevel
-
android.statistics.lensShadingMap
-
android.tonemap.curve
-
android.sensor.noiseProfile
只有一種顏色通道。
對於支援 Y8 流格式的單色設備,Camera HAL 必須支援將強制流組合(包括重新處理)中的YUV_420_888
格式與 Y8 格式交換。
此功能使用以下公共 API:
- Y8影像格式
- SENSOR_INFO_COLOR_FILTER_ARRANGMENT_MONO
- SENSOR_INFO_COLOR_FILTER_ARRANGMENT_NIR
- 單色相機功能(在 Android 9 中引入)
有關相機 HAL 的更多詳細信息,請參閱docs.html 。有關相關公共 API 的更多信息,請參閱ImageFormat 、 CameraCharacteristics 、 CaptureRequest和CaptureResult 。
驗證
若要驗證單色相機的實現,請執行以下 CTS 和 VTS 測試。
CTS測試
testMonochromeCharacteristics
-
CaptureRequestTest
-
CaptureResultTest
-
StillCaptureTest
-
DngCreatorTest
VTS 測試
getCameraCharacteristics
-
processMultiCaptureRequestPreview