Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Camera Text Recognition: Incorrect Bounding Box Dimensions

58 views
Skip to first unread message
Assigned to scot...@google.com by me

Minh Huỳnh

unread,
Mar 4, 2025, 2:54:12 AMMar 4
to Android CameraX Discussion Group

I'm developing an application that reads text/barcodes from the camera and draws bounding boxes around the detected text/barcodes. I've referenced the GraphicOverlay.java class from the 'ML Kit Vision Quickstart Sample App'.

https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart

The issue I'm encountering is that the bounding boxes for barcodes are drawn very accurately, while the bounding boxes for text are missing a portion on the left side (please see the image below). This only occurs with images from the camera, and there are no issues with static images. The 'ML Kit Vision Quickstart Sample App' also exhibits this behavior.


Could someone please provide guidance on how to resolve this issue?

Minh Huỳnh

unread,
Mar 4, 2025, 2:57:08 AMMar 4
to Android CameraX Discussion Group, Minh Huỳnh
1000003951.png

Vào lúc 14:54:12 UTC+7 ngày Thứ Ba, 4 tháng 3, 2025, Minh Huỳnh đã viết:

Scott Nien

unread,
Mar 4, 2025, 4:32:13 AMMar 4
to Minh Huỳnh, Android CameraX Discussion Group
Thanks for reporting the issue!  
I can reproduce the issue using the sample app. 

I also found that if I rotate the device to landscape,  the issue is gone, so I think this is probably due to the fact that the sample code doesn't handle the cropped preview case well. (Landscape mode doesn't cropp the preview).  Also the same issue also happens on the LivePreviewActivity( using Camera2 APIs),  so I think this is probably not an issue in CameraX. 

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/7f951d54-d08c-485a-aed6-1ee8db252fc4n%40android.com.

Minh Huỳnh

unread,
Mar 4, 2025, 4:58:43 AMMar 4
to Android CameraX Discussion Group, scot...@google.com, Android CameraX Discussion Group, Minh Huỳnh

First, thank you for your response.

On my end, I've observed that the issue also occurs when rotating the phone to landscape orientation (please see the image below). 
1000003952.png

Is there a possibility that the transformation of points from ImageAnalysis to draw on GraphicOverlay is outdated or no longer accurate? Could you please take a look into this for me?

Vào lúc 16:32:13 UTC+7 ngày Thứ Ba, 4 tháng 3, 2025, scot...@google.com đã viết:
Reply all
Reply to author
Forward
0 new messages