connect@howdiyworld.com
|

OCR (optical character recognition)

BLOCK DIAGRAM

Procedure

  1. USB camera
  2. Connections
  3. Program
  4. output

Procedure

USB Camera

A USB webcam is a camera that connects to a computer, usually through plugging it in to a USB port on the machine. The video is fed to the computer where a software application lets you view the pictures and also transfer them to the Internet.

Connections

  • Connect USB Camera to Raspberry Pi USB.

Python Program

import pytesseract

from PIL import Image

import cv2

img = cv2.imread(‘Path_to_img_file’,cv2.IMREAD_COLOR) #Open the image from which charectors has to be recognized

#img = cv2.resize(img, (620,480) ) #resize the image if required

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #convert to grey to reduce detials

gray = cv2.bilateralFilter(gray, 11, 17, 17) #Blur to reduce noise

original = pytesseract.image_to_string(gray, config=’-l eng –oem 3 –psm 12′)

#test = (pytesseract.image_to_data(gray, lang=None, config=", nice=0) ) #get confidence level if required

#print(pytesseract.image_to_boxes(gray))

print (original)

Output

Write something on the paper and place it in front of the camera, the camera will capture its image, If we press the scan button in HowDIY the text that you wrote will be shown in HowDIY Screen.

Social media & sharing icons powered by UltimatelySocial
Facebook
Twitter
YouTube
LinkedIn
Instagram