Posts about api

OCR using the open Google Cloud Vision API

22 February 2016
Just create a new api key in the developer console, replace it in the code below and it should work. Then you can call "whatever_you_call_the_file.rb /Downloads/some_image_with_text.jpg" and google will OCR-it and the script will print out the recognized text.
require "base64"
require 'net/http'
require 'json'

# Base 64 the input image
b64_data = Base64.encode64(File.open(ARGV[0], "rb").read)

# Stuff we need
api_key = ""
content_type = "Content-Type: application/json"
url = "https://vision.g...
Displaying 1 post