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
Asked
Active
Viewed 2,179 times
1 Answers
1
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

liuyl
- 165
- 7
-
2I have already done it. but the camera is still recognizing the text which is not in the preview area. – Mab121994 Sep 13 '16 at 15:38
-
i want to reduce the area of camerapreview and also i want to capture only the text within the area by the camera. – Mab121994 Sep 13 '16 at 15:39
-
i have reduced the camera preview area. but camera is capturing the full area and recognizing text..... I want only that text to be recognized which is within the preview – Mab121994 Sep 13 '16 at 15:41
-
You mean like a ROI(region of interest)? No vision API doesn't support that now. – liuyl Sep 27 '16 at 18:08