Start a Project

Android Text Recognizer Using Camera and Firebase ML Kit

In this blog, we will learn about implementing a Text Recognizer Using Camera and Firebase ML Kit.

With the updated firebase release, the developers have released new powers to image processing in a very easy and resource-friendly way.

Now, If you want you can use image processing and machine learning techniques in your application very easily using Firebase ML kit.

ML Kit is a mobile SDK that brings Google’s machine learning expertise to Android and iOS apps in a powerful yet easy-to-use package. Whether you’re new or experienced in machine learning, you can implement the functionality you need in just a few lines of code. There’s no need to have deep knowledge of neural networks or model optimization to get started. On the other hand, if you are an experienced ML developer, ML Kit provides convenient APIs that help you use your custom TensorFlow Lite models in your mobile apps.

— Firebase Developer Guide

Well, the firebase ML kit contains 5 options currently, which are :

  1. Recognize Text
  2. Face Detection
  3. Barcode Scanning
  4. Label images
  5. Recognize Landmarks

We will currently focus on how we can recognize the text using the camera of an Android device.

Just a precap of what you will be able to do after reading this blog :

Things you need to get started :

  1. Android Studio 3.1(or a newer version).
  2. Google Account to link firebase.

With these, you are good to go.

Before you start coding :

After these initial steps, you are good to start writing code for the text recognizer.

APPROACH

CODE

I have named my Activity as LauncherActivity.

Xml File :->

Java Class File( LauncherActivity ) : ->

TextRecognitionProcessor : –>

ResultAdapter :–>

camera_result_item (Xml File) : –>

Some other demos :

Sources :

https://firebase.google.com/docs/ml-kit/android/recognize-text

https://github.com/firebase/quickstart-android/tree/master/mlkit/

Keep coding and Keep Sharing 🙂

Exit mobile version