Scan an image and take text from it

I saw some applications that scan an image and return text. Is there a library for this or not? I mean either scanning the text, or its image and identification of characters?

I searched OCR, but I did not find material to read. Can you help me?

+4
source share
3 answers

Take a look at the library called Tesseract . Here is the tutorial .

+5
source

Yes, you can use google's vision library to convert the image to text, this will give the best result from the image. Add the library below to build gradle:

compile 'com.google.android.gms:play-services-vision:10.0.0+' TextRecognizer textRecognizer = new TextRecognizer.Builder(getApplicationContext()).build(); Frame imageFrame = new Frame.Builder() .setBitmap(bitmap) // your image bitmap .build(); String imageText = ""; SparseArray<TextBlock> textBlocks = textRecognizer.detect(imageFrame); for (int i = 0; i < textBlocks.size(); i++) { TextBlock textBlock = textBlocks.get(textBlocks.keyAt(i)); imageText = textBlock.getValue(); // return string } 
+1
source

And this library too: Java OCR on sourceforge.

0
source

Source: https://habr.com/ru/post/1413336/


All Articles