I am having a base64 encoded image.
imageData = 'data:image/png;base64,iVBORw0rrfwfwHReger32QRQWr...'
How I should proceed for text detection with google cloud vision python library?
My Code looks like :
from google.cloud import vision
client = vision.Client()
imageData = 'data:image/png;base64,iVBORw0rrfwfwHReger32QRQWr...'
image = client.image(content=imageData)
texts = image.detect_text()
print texts[0].description
Use the Cloud Client library for Python vision as demonstrated here. The Cloud client library does all of the base64 encoding for you behind the scenes.
Initialize your folder with a virtualenv and the client library:
The following snippet does OCR on an image file,
base64 file.png
: