paint-brush
Upscaling a Blurry Text Image with Machine Learningby@lucadavis
21,441 reads
21,441 reads

Upscaling a Blurry Text Image with Machine Learning

by 1ucaDavisAugust 24th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The text image super-resolution service can zoom in on an image containing text to make it appear three times as big, dramatically improving text definition. It enlarges a text image up to three times its resolution, and works particularly well on JPG and downsampled images. The algorithm behind the service is built upon the deep neural network, fully utilizing the NPU of Huawei mobile phones to accelerate the neural network and deliver a speedup that is 10-fold. The service is ideal for identifying text from a blurry image.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Upscaling a Blurry Text Image with Machine Learning
1ucaDavis HackerNoon profile picture


Unreadable image text caused by motion blur, poor lighting, low image resolution, or distance can render an image useless. This issue can adversely affect user experience in many scenarios, for example:


A user takes a photo of a receipt and uploads the photo to an app, expecting the app to recognize the text on the receipt. However, the text is unclear (due to the receipt being out of focus or poor lighting) and cannot be recognized by the app.


A filer takes images of old documents and wants an app to automatically extract the text from them to create a digital archive. Unfortunately, some characters on the original documents have become so blurred that they cannot be identified by the app.


A user receives a funny meme containing text and reposts it on different apps. However, the text of the reposted meme has become unreadable because the meme was compressed by the apps when it was reposted.


As you can see, this issue spoils the user experience and prevents you from sharing fun things with others. I knew that machine learning technology can help deal with it, and the solution I got is the text image super-resolution service from HMS Core ML Kit.

What Is Text Image Super-Resolution

The text image super-resolution service can zoom in on an image containing text to make it appear three times as big, dramatically improving text definition.


Check out the images below to see the difference with your own eyes.


Before


After

Where Text Image Super-Resolution Can Be Used

This service is ideal for identifying text from a blurry image. For example:


In a fitness app: The service can enhance the image quality of a nutrition facts label so that fitness freaks can understand what exactly they are eating.


In a note-taking app: The service can fix blurry images taken of a book or writing on a whiteboard so that learners can digitally collate their notes.

What Text Image Super-Resolution Delivers

Remarkable enhancement result: It enlarges a text image up to three times its resolution, and works particularly well on JPG and downsampled images.


Fast process: The algorithm behind the service is built upon the deep neural network, fully utilizing the NPU of Huawei mobile phones to accelerate the neural network and delivering a speedup that is 10-fold.


Less development time and smaller app package size: The service is loaded with an API that is easy to integrate and saves ROM that is occupied by the algorithm model.

What Text Image Super-Resolution Requires

  • An input bitmap in ARGB format, which is also the output format of the service.
  • A compressed JPG image or a downsampled image, which is the optimal image format for the service. If the resolution of the input image is already high, the after-effect of the service may not be distinctly noticeable.
  • The maximum dimensions of the input image are 800 x 800 px. The long edge of the input image should contain at least 64 pixels.


And this concludes the service. If you want to know more about how to integrate the service, you can check out the walkthrough here.