Digit Recognition project based on Raspberry Pi
- Python 2.7.x
- Tesseract-OCR - http://code.google.com/p/tesseract-ocr/wiki/ReadMe
- Compilation details http://code.google.com/p/tesseract-ocr/wiki/Compiling
- OpenCV 2.4.3 - http://mitchtech.net/raspberry-pi-opencv/
- Pillow (Imaging Library) - https://pypi.python.org/pypi/Pillow/
of course Raspberry Pi with Debian or Raspbian latest updates.
- Download / Clone / Unpack
- Create dirs:
- ~mkdir capture
- ~touch data.txt
- ~cd capture
- ~mkdir crop
- ~mkdir clean
- Run : ./capture.sh
Changind sleep value in camera.sh you can manipulate with script running intervals in seconds.
- captureImage() - captures and image (352x288) with light gain value (0.1 .. 1)(Note: GAIN support by device)
- Captured image coverted to GRAY, threshhold applied, inverted and saved to /caputre/TIMESTAMP_capture.png;
- cropImage() - crops captured image with a specified box and saves to /caputre/crop/cropped_TIMESTAMP.png;
- cleanImage() - cleans black spaces between digits and saves to /caputre/clean/cleaned_TIMESTAMP.png (Note: use if needed);
- recognizeData() - recognizes data from each cleaned file, *.TXT results in /capture/clean/output_TIMESTAMP.txt
- Several verification steps:
- if valid string recognized -> added to dataList -> converted to INT -> added to numberList;
- if 10 not valid attempts -> break execution;
- if numberList not EMPTY -> mean value computed and checked with previous result;
- if mean value exists -> sent to TELECONTROL SERVER.
- Cleaning opperations performed, to clean /capture/ folder.