Building Business Cards Reader using android vision Text OCR

时间秒杀一切 提交于 2019-12-05 14:51:27

I can help with some of these.

a-) How to use Text Lines instead of text blocks?

List<Line> lines = (List<Line>) textBlock.getComponents();

You may need to iterate over the TextBlock SparseArray to get each blocks lines. Additionally this approach works to get each Element from each line too. The getComponents() method is in the Text interface that all text items implement.

b-) I am using Timer Task in the Graphic class how to kill it when it's done or should i use some other approach?

You could count the number of detections received in your OcrDetectorProcessor, and kill it when it has received a set amount.

f-) Can at some point,we can stop the OCR library from detecting any further text after all the flags have gone true. or just any way?

You can stop the pipeline from detecting by stopping the CameraSource. In the CodeLabs example in OcrCaptureActivity this is being done in onPause and onDestroy. By stopping and releasing mPreview, the app stops and cleans up the hooks to the camera.

I hope this helps.

Meraj Ali

for point a)- you can also use :

 List<Line> lines = (List<Line>) text.getComponents();
        for(Line elements : lines){
            Log.i("current lines ", ": " + elements.getValue());
        }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!