I am using Firebase ML kit to read QR codes. Currently, API detects every QR code visible in the camera view. I need the QR to be processed only when it is visible in a transparent rectangle in the center of the screen. Thank you.
Asked
Active
Viewed 1,243 times
1 Answers
-1
ML Kit itself does not provide the image cropping function. But if you are using Camera2 or CameraX, you could use the Image.cropRect() method to crop the image before sending to ML Kit.
If you are using Camera1, you could also convert it to bitmap, and crop the bitmap like this.

Shiyu
- 875
- 4
- 5