Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scanning image and take text from it android

Tags:

android

ocr

I have seen some applications that scan image and give back text. Is there any library for this or not? I mean either scanning text or taking a picture of it and identify characters?

I have searched for OCR but I have not found material so as to read. Can you help me with this?

like image 887
qwerty_gr Avatar asked May 19 '12 17:05

qwerty_gr


People also ask

How do I extract text from a scanned image?

Extract text from PDF/Images with Optical Character Recognition(OCR) OCR technology helps scan a document, regardless of whether it is made of text or images, for signs of text. It uses pattern recognition algorithms to recognize whether any part of a document might be an alphabet, number, or character.

Can I take a picture of a document and turn it into text?

There are many apps for Android that let you convert images to text. Not only that, but you can also scan text on the go as all Android phones have built-in cameras. Text Scanner is my favorite Android OCR app as it lets you extract text from images offline.

Is there a way to copy text from an image?

By using the Lens technology by Google, you can easily get text from images without much effort. Google Lens, Keep, and Photos can be used to copy text from image and essentially work the same way. These applications are available on Android, iOS, macOS, and Windows.

How do you scan from camera to text on Android?

How to digitize text using an Android phone. Open your Camera app and point the phone at a document. As you do this, the phone will recognize it's a document – like a contract or a business card – and add highlighted borders in yellow, along with a “Scan” icon on the right side of the screen.


2 Answers

Have a look at a library called Tesseract. Here's a tutorial.

like image 164
Tony the Pony Avatar answered Oct 27 '22 10:10

Tony the Pony


Yes you can use google vision library for convert image to text, it will give better output from image. Add below library in 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
    }
like image 20
user7176550 Avatar answered Oct 27 '22 09:10

user7176550