You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
About a month ago I had a problem with Google Android Vision OCR when text detector returned items which after getting lines by getComponents() method of TextBlock had a "(' character added at the beginning. It wasn't the case for all the lines though.
Now I have very similar problem but now it is "8". It happens to about 1/3 - 1/2 of recognized lines.
How to approach such problem?
I get texts like that in receiveDetections method:
SparseArray<TextBlock> items = detections.getDetectedItems();
List<Text> all_lines = new ArrayList<>();
for (int i = 0; i < items.size(); ++i) {
TextBlock item = items.valueAt(i);
List<? extends Text> texts = item.getComponents();
for (Text t: texts) all_lines.add(t);
}
This is example how it looks
It is on Samsung Galaxy J5. On other phones it is ok though. It was also ok few hours ago.
Recompiling the app from clean build, reinstaling it, turning off and on again didn't work.
I'm currently not able to find that version of code that produced the
result with mGraphicOverlay.
But mGraphicOverlay was not important as the same was happening when I
logged that value to Log.d(...) and the same results was a problem for our
processing in app (which didn't show those text values by mGraphicOverlay
but did post-ocr text processing).
We've taken String values from t.getValue() where t is an instance of Text
class.
Strange problem - most of returned lines from getComponents from recognized texts prefixed with a character · Issue #138 · googlesamples/android-vision
Activity
liuyl commentedon Oct 5, 2016
We didn't change the OCR code after release, so it seems a device specific issue.
I'll try to find a Galaxy J5 to test this, thanks for report.
huangxuhui commentedon Jun 2, 2017
After you get the all_lines from
for (Text t: texts) all_lines.add(t);
How you add to the mGraphicOverlay?
zbyszek-matuszewski commentedon Jun 2, 2017