Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Reduce the size of camera source in mobile vision API text detection

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

like image 894
Mab121994 Avatar asked Sep 11 '16 18:09

Mab121994


1 Answers

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

like image 186
liuyl Avatar answered Oct 26 '22 06:10

liuyl