Skip to content

Strange problem - most of returned lines from getComponents from recognized texts prefixed with a character #138

@zbyszek-matuszewski

Description

@zbyszek-matuszewski

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

2016-10-03 19_05_43-clipboard

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.

Activity

liuyl

liuyl commented on Oct 5, 2016

@liuyl
Contributor

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

huangxuhui commented on Jun 2, 2017

@huangxuhui

After you get the all_lines from
for (Text t: texts) all_lines.add(t);
How you add to the mGraphicOverlay?

zbyszek-matuszewski

zbyszek-matuszewski commented on Jun 2, 2017

@zbyszek-matuszewski
Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zbyszek-matuszewski@liuyl@pchx-zz@huangxuhui

        Issue actions

          Strange problem - most of returned lines from getComponents from recognized texts prefixed with a character · Issue #138 · googlesamples/android-vision