I See You (INTEL IOT USING INTEL EDISON)
by leoC5 in Circuits > Remote Control
944 Views, 12 Favorites, 0 Comments
I See You (INTEL IOT USING INTEL EDISON)
Project ICU (INTEL IOT) USING INTEL EDISON
https://github.com/makerspaze/intel_iot_leoCj
Project ICU is a smart iot device which can see and identify the physical world with the help of Intel Edison Board and cloud connectivity.This project aims to help blind people to read and identify text,label,landmarks,face,emotions and more from the real world !!
Tech Project ICU
uses a number of latest technologies to work properly: [Intel Edison Board] - To view the real world and communicate with the blind man![Google Cloud Service & API] - for object detection and manipulation
Installation You need a latest python version which (includes pip) and a windows PC recommend.
Setup Intel Edison
Connect Intel Edison to your computer using two USB cables .
Am using a Windows machine.Download and Install PuTTY http://www.putty.org/
for more info go to this link https://software.intel.com/en-us/setting-up-serial...
Also install WinSCP https://winscp.net/eng/download.php you can use this as a file manager for Intel Edison.
for more info go to this link https://cdn.sparkfun.com/assets/learn_tutorials/3/...
Mount the Base shield as shown here http://i1.wp.com/rexstjohn.com/wp-content/uploads/...
http://i2.wp.com/rexstjohn.com/wp-content/uploads/...
then connect touch sensor to any GPIO pin
Programming
We are using python language for programming , before that create a google cloud console account https://console.cloud.google.com then make a project and enable cloud vision API for that project.
DETAIL INSTRUCTIONS ARE AVAILABLE HERE https://cloud.google.com/vision/docs/quickstart
Google Cloud Vision API Client Library for Python using putty ternminal
pip install --upgrade google-api-python-client
https://developers.google.com/api-client-library/p...
make a python file inside intel edison and write this code
https://github.com/GoogleCloudPlatform/cloud-visio...
also add touch sensor code available here
https://software.intel.com/en-us/iot/hardware/sens...
for connecting camera you can use this tutorial https://www.instructables.com/id/Intel-Edison-IP-We...
following code is a simple python script that feed input from touch sensor and convert an image content into text with the help of google vision API
import base64
import os import re import sys
from googleapiclient import discovery
from googleapiclient import errors
import nltk
from nltk.stem.snowball
import EnglishStemmer from oauth2client.client
import GoogleCredentials
import redis
DISCOVERY_URL = 'https://{api}.googleapis.com/$discovery/rest?version={apiVersion}' # noqa
BATCH_SIZE = 10
import time
import pyupm_ttp223 as ttp223
touch = ttp223.TTP223(0)
while 1:
if touch.isPressed():
class VisionApi:
"""Construct and use the Google Vision API service."""
def __init__(self, api_discovery_file='vision_api.json'):
self.credentials = GoogleCredentials.get_application_default() self.service = discovery.build( 'vision', 'v1', credentials=self.credentials, discoveryServiceUrl=DISCOVERY_URL)
def detect_text(self, input_filenames, num_retries=3, max_results=6): """Uses the Vision API to detect text in the given file. """ images = {} for filename in input_filenames: with open(filename, 'rb') as image_file: images[filename] = image_file.read()
batch_request = [] for filename in images: batch_request.append({ 'image': { 'content': base64.b64encode( images[filename]).decode('UTF-8') }, 'features': [{ 'type': 'TEXT_DETECTION', 'maxResults': max_results, }] }) request = self.service.images().annotate( body={'requests': batch_request})
try: responses = request.execute(num_retries=num_retries) if 'responses' not in responses: return {} text_response = {} for filename, response in zip(images, responses['responses']): if 'error' in response: print("API Error for %s: %s" % ( filename, response['error']['message'] if 'message' in response['error'] else '')) continue if 'textAnnotations' in response: text_response[filename] = response['textAnnotations'] else: text_response[filename] = [] return text_response except errors.HttpError as e: print("Http Error for %s: %s" % (filename, e)) except KeyError as e2: print("Key error: %s" % e2)
for more information regarding code goto https://github.com/GoogleCloudPlatform/cloud-visi...