Google vision ocr : vertical and horizontal lines text recognition

蹲街弑〆低调 提交于 2019-12-06 01:27:11
Tendi Firmansyah

I think that's a limitation of the Google Vision API. I've searched on how to do that too, and eventually used this solution. But if you need just one of them vertical or horizontal like I did, you can use client side rotate (please see here on how to crop and rotate before upload).

I know it is late response, maybe somebody will benefit from it in the future... you can force the detector to recognize ONLY vertical text by doing a frame rotation before applying the detector on like this: in setRotation() method in the CameraSource. write:

outputFrame = new Frame.Builder()
                        .setImageData(mPendingFrameData, 
                          mPreviewSize.getWidth(),
                                mPreviewSize.getHeight(), 
                         ImageFormat.NV21)
                        .setId(mPendingFrameId)
                        .setTimestampMillis(mPendingTimeMillis)
                        .setRotation(mRotation)
                        .build();
mRotation = 2; (for vertical text direction from bottom to top)
mRotation = 1; (for vertical text direction from top to bottom)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!