What is Aave and why should I care?

Aave is a decentralized lending system. Aave stands out from its competitors (MakerDAO, Compound, etc..) due to flash loans and stable interest rates. DeFi continues to explode in popularity and…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Making a simple Optical Character Recognition in 12 lines of code.

Optical character recognition is the recognition of typed, handwritten or printed text and converting them into text. OCR can be used to automate various task involving humans, like in banking, OCR is being used to process checks without human involvement, generating content of documents from their scanned images, it can also be helpful for visually impaired people, etc.

For this OCR we’ll be using Microsoft’s Computer Vision API. We’ll do a post request in python and in response, we’ll get output in JSON format.

To get started you are required to have a Microsoft account, and after that, you can get a free subscription to computer vision API for 30 days. You have to acquire your secret subscription key which looks similar to this 98f714r6vb2e193018b28fg1u9b3b0d7e7.

Microsoft OCR API is quite flexible and we can define many parameters depending upon our use cases, here we defining two parameters, the language which is English in our case (defined by ‘unk’) and whether to detect the orientation of text or not, which is defined as true in our case. We also need URL of the image on which we want to run our OCR (we can also upload a local image for OCR), so we’ll define url of the image.

Following is the image at above link

The JSON output of the above script contains data about bounding box coordinates, orientation and text angle, for each word line by line. Here’s the output.

Enjoy!

P.S: Just in case if you need any clarification do post a comment.

Add a comment

Related posts:

The Power of Solitude

When was the last time you were alone? Not “away from other people” alone, but more like “without constant intrusion of other people’s minds into yours” alone. In other words, I’m not talking about…

Blue Sky Ideation

My warm up game involved creativity and warming up for sketching! I had everyone start with a piece of paper and draw whatever type of shoe they wanted, then we passed them around the circle and…

Why We Should All Aspire to be Like Chefs

It occurred to me whilst watching an episode of my favourite Netflix show ‘Chefs Table’ that everybody, regardless of profession should aspire to be like chefs. Let me explain. From many angles…