As google vision api text detection previews full screen to scan text. I want a small rectangle for text detection and display the recognized text below in a textbox
You can control the size of the preview widget. Change this line https://github.com/googlesamples/android-vision/blob/master/visionSamples/ocr-reader/app/src/main/res/layout/ocr_capture.xml#L12 to whatever you want.
This is the Android documentation about the possible values you can use for layout_width
and layout_height
properties https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With