搭載 Android 9 以上版本的裝置可支援單色相機。Android 10 額外支援 Y8 串流格式、單色和近紅外線 (NIR) 濾色陣列靜態中繼資料,以及單色相機的 DngCreator
函式。
有了這項功能,裝置製造商就能實作單色或近紅外線攝影機裝置,並使用 Y8 串流格式來減少記憶體用量。單色相機可做為邏輯多重相機裝置的基礎實體相機,以提升低光源雜訊特性。
實作
硬體需求
如要實作這項功能,裝置必須具備單色相機感應器和影像訊號處理器 (ISP),才能處理感應器輸出內容。
實作單色攝影機
如要將攝影機裝置宣傳為單色攝影機,Camera HAL 必須符合下列規定:
android.sensor.info.colorFilterArray
設為MONO
或NIR
。- 系統支援
BACKWARD_COMPATIBLE
必要金鑰,但不支援MANUAL_POST_PROCESSING
。 android.control.awbAvailableModes
只包含AUTO
,而android.control.awbState
則視android.control.awbLock
而定,為CONVERTED
或LOCKED
。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_ARRANGEMENT_MONO
- SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR
- 單色相機功能 (Android 9 推出)
如要進一步瞭解 Camera HAL,請參閱 docs.html。如要進一步瞭解相關公開 API,請參閱「ImageFormat」、「CameraCharacteristics」、「CaptureRequest」和「CaptureResult」。
驗證
如要驗證單色相機的實作情形,請執行下列 CTS 和 VTS 測試。
CTS 測試
testMonochromeCharacteristics
CaptureRequestTest
CaptureResultTest
StillCaptureTest
DngCreatorTest
VTS 測試
getCameraCharacteristics
processMultiCaptureRequestPreview