问题
we are using google vision ocr for gathering text from receipts. In some cases the receipt have some text written in vertical , like vat information and some other.
The question is that google vision read efficiently only the text in the main orientation (horizontal by example) and discards all the text written in the same receipt in vertical orientation instead in horizontal. Is there a parameter to set up for tell google vision to acquire also the text in vertical orientation?
I have put online an example with an image with text in two orientations .
https://drive.google.com/file/d/0B8kZz-q27lGGSUl5V3RjXzBLNnc/view?usp=sharing
Text recognized from g-vision : Horizontal text line
Text I've expected to be recognized: Horizontal text line Vertical text line
回答1:
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).
回答2:
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)
来源:https://stackoverflow.com/questions/45455138/google-vision-ocr-vertical-and-horizontal-lines-text-recognition