Eugene B
unread,Feb 26, 2025, 11:41:17 AMFeb 26Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android CameraX Discussion Group
Hello. I am developing a camera application using the CameraX API. On the vendor's tablet, face detection is implemented at the HAL level. Currently, I am trying to resolve an issue where I receive negative coordinates for detected faces when zoom is applied. I debugged the HAL pipeline and confirmed that when zoom is enabled, the coordinates are correctly passed to CameraMetadata* resultMetadata. However, in onCaptureCompleted, result.get(TotalCaptureResult.STATISTICS_FACES) returns a list of detected faces with negative coordinates.
val imageAnalysisExtender = Camera2Interop.Extender(builder)
val captureCallbackAnalysis = object : CameraCaptureSession.CaptureCallback() {
override fun onCaptureCompleted(
session: CameraCaptureSession,
request: CaptureRequest,
result: TotalCaptureResult
) {
// ...
}
To set the zoom ratio, we are using camera.cameraControl.setZoomRatio(ratio). I tried manually setting the crop region using:
imageAnalysisExtender.setCaptureRequestOption(
CaptureRequest.SCALER_CROP_REGION,
cropRegion
)
This worked, and the coordinates started coming in with correct positive values. However, when I changed the zoom to a different value, the coordinates started coming in as negative again.
Are there any recommendations on how to properly initialize zoom to avoid incorrect coordinate transformation?