optical character recognition
DESCRIPTION
Power Point presentation on Project OCR based on MATLAB and ANDROID.TRANSCRIPT
22/04/2023 1
OPTICAL CHARACTER RECOGNITION (OCR)
Introduction
Stages in OCR
MATLAB Implementation
Steps in MATLAB Implementation
Android Implementation
Advantages
Applications
Conclusion
References2
Contents
22/04/2023 3
INTRODUCTION
OCR is the mechanical or electronic translation of images of handwritten, typewritten or printed text (usually captured by a scanner) into machine-editable text.
Motivation:-Text detection and recognition in general have quite a lot of relevant application for automatic indexing or information retrieval such document indexing, content-based image retrieval, and license car plate recognition which further opens up the possibility for more improved and advanced systems.OCR:-
4
Aims and Objectives
Segmentation -Separate the text region into its individual characters.
OCR
Recognition -Recognize each of the character in the detected text region using a suitable algorithm
The goal of Optical Character Recognition (OCR) is to classify optical patterns (often contained in a digital image) corresponding to alphanumeric or other characters.
22/04/2023 5
OCR
TRAINING
Pre - processing
Feature Extraction
Model Estimation
TESTINGPre - processing
Feature Extraction
Classification
STAGES IN OCR
22/04/2023 6
The raw data is subjected to a number of preliminary processing steps to make it usable in the descriptive stages of character analysis.
Pre-processing aims to produce data that are easy for the OCR systems to operate accurately.
The main objectives of pre-processing are :
PRE-PROCESSING
• Binarization• Noise reduction• Stroke width normalization• Skew correction• Slant removal
22/04/2023 7
Binarization (thresholding) refers to the conversion of a gray-scale image into a binary image.
Two categories of thresholding are: Global - picks one threshold value for the
entire document image which is often based on an estimation of the background level from the intensity histogram of the image.
Adaptive (local) - uses different values for each pixel according to the local area information
BINARIZATION
8
Noise reduction improves the quality of the document.
Normalization provides a tremendous reduction in data size, thinning extracts the shape information of the characters.
Two main approaches:
22/04/2023
Noise Reduction - Normalization
• Filtering (masks)• Morphological Operations (erosion, dilation, etc)
22/04/2023 9
In feature extraction stage each character is represented as a feature vector, which becomes its identity.
The major goal of feature extraction is to extract a set of features, which maximizes the recognition rate with the least amount of elements.
Due to the nature of handwriting with its high degree of variability and imprecision obtaining these features, is a difficult task.
FEATURE EXTRACTION
22/04/2023 10
Given labelled sets of features for many characters, where the labels correspond to the particular classes that the characters belong to, we wish to estimate a statistical model for each character class.
MODEL ESTIMATION
22/04/2023 11
According to Tou and Gonzalez, “The principal function of a pattern recognition system is to yield decisions concerning the class membership of the patterns with which it is confronted.”
In the context of an OCR system, the recognizer is confronted with a sequence feature patterns from which it must determine the character classes.
CLASSIFICATION
12
Flowchart:- MATLAB IMPLEMENTATION
Preprocess
Segmentation
Recognition
22/04/2023 13
Snapshot of MATLAB Application
22/04/2023 14
Make TemplateTo create templete.mat to be use for classification:
14
……36 images of characters
Size = 60 X 55
Matrix size 55 X 60 X 36 Saved as template.mat
22/04/2023 15
PreprocessRaw Image Noise Filter Binarize
ComplimentingBaundingResizing
Preprocessed Image
The segmentation character involves the following steps:
◦ Scan the image from left to right to find ‘on’ pixel.◦ If on pixel been found, all ‘on’ pixel connected to
the detected on pixel will be extracted segmented as a pixel.
◦ The process will be repeated until it reach end right of the image.
16
Segmentation – Connected Components
17
Corr2
Where is the mean of the input matrix i and is the mean of the input matrix j. 0 < r < 1 1 mean i and j is exactly same while 0
mean the i and j not same at all.
18
Source Image Template
image
allcorrs(j) 0.82011 0.57395 0.43850
Recognition - Template Correlations
temp = templates(:,:,j); in = chars(:,:,i); allCorrs(j) = corr2(temp, in);
22/04/2023 19
The same OCR application we build for Android devices named “MyOCR” using open source library “Tesseract” by Google.
Android Implementation
22/04/2023 20
Developed on HP-UX at HP between 1985 and 1994 to run in a desktop scanner. Came neck and neck with Caere and XIS in the 1995 UNLV test. Never used in an HP product. Open sourced in 2005. Now on: http://code.google.com/p/tesseract-ocr Highly portable.
Tesseract Background:-
22/04/2023 21
Tesseract OCR Architecture
22/04/2023 22
ADVANTAGE
Increase efficiency
Greater accessibility
Recover valuable
spaceEliminates
Retyping Need
OCR
22/04/2023 23
APPLICATION
• Page readers for text entry, mainly used in Office Automation
• Aid for blind• Automatic number-plate
readers
• Automatic address reading for mail sorting
• Document reading machines used for Banking Applications
Data entry Process automation
Text EntryOther Applications
22/04/2023 24
Variations in shape• Due to serifs and style variations.
Deformations• Caused by broken characters, smudged characters and
speckle.
Variations in spacing• Due to subscripts, superscripts, skew and variable spacing
Mixture of text and graphics
Typical errors in OCR
22/04/2023 25
Future needs
Need constrained OCR will be decreasing
Omni fontOCR Systems
Recognition of manually produced
documents
Recognition of entire words instead of individual
22/04/2023 26
http://www.uri.edu/~hansenj/projects/ele585/OCR/
J.T. Tou and R.C. Gonzalez, Pattern Recognition Principles, Addison-Wesley Publishing Company, Inc., Reading, Massachusetts, 1974
M. Szmurlo, Masters Thesis, Oslo, May 1995,(users.info.unicaen.fr/~szmurlo/papers/masters/master.thesis.ps.gz)
REFRENCES
22/04/2023 27
THANK YOUSpecial Thanks
To: Google.com Mathwoks.com