Google Vision Image recognition for Android

Google Vision Image recognition for Android

Recently Google announced new API for image recognition. It is one the most exiting solutions from Google and prices are quite affordable.
So, I decided to switch from CamFind API to Google’s, because the last one is much more efficient and faster. Camfind worked quite well, but it took time for upload of image and further recognition. So, the whole process took more than one minute. Google vision takes about 5 seconds at top.

1. Get Google Cloud API key.
Screenshot from 2016-05-03 16:34:34 You need to create a Key in Google Cloud Platform console.
Note: you need to create Server API Key and use it for all platforms. The following solution is Java-based and doesn’t work properly with Android Key.

2. Functions to get image from camera
Add the following functions to your activity in order to start and manipulate camera.

After you take the picture, you need to get it in ActivityResult

3. The most interesting part – Image recognition task.

As you in my case, I am trying to detect first Logo, then recognize OCR text and only then Labels. This allows me to be sure, that in any case, I will get some results from search.

And here are some results with this experiments:

The feature is in development currently, but soon will be available for “Is it kosher?” and “Is it gluten free?” projects.