170 likes | 243 Views
This project, led by Nathan Harmata in Period 5, focuses on improving character recognition in an OCR system. By developing heuristics such as GapVector and GCD, and creating generic character models, the aim is to enhance results and streamline code. The system processes input images into text blocks, lines, words, letters, and applies transformations for recognition. Using methods like SectorVector and GapParsing, it refines character attributes for accurate comparison and database output. Sealing gaps with innovative gap coverages and pixel locations, the system efficiently parses characters ensuring accuracy. By utilizing Java Reflections for attribute handling, the project targets a refined OCR system with noise removal and GUI functionality in the upcoming quarter.
E N D
Development of an OCR System Third Quarter Nathan Harmata Period 5
Recap of Goals for 3rd Quarter More heuristics for Character Recognition Make results more “spread out” Make results more “spread out” Minor goal: “generic character models”
Diagram of OCR System Input Image Blocks of Text Image Processing Lines Lines Lines Words Words Words Letter Letter Letter Transformations Transformations Character Recognition Character Model Comparison to GCDD and recognition
Image Processing Uses whitespace between lines and words
Character Recognition Developed new heuristic: GapVector Developed GCD (Generic Character Definitions) Character Models and Attributes
Attribute My two comparison heuristics, SectorVector and GapVector, are extensions of the Attribute class Attribute Description Comparison Scalar Data Method of comparison Uses specific comparison used by the overriding class Method of output to database Uses outputs of overriding class
Character Model Came up with idea during 2nd Quarter Way of organizing data and making code cleaner Character Model Attribute Attribute HashMap of Attributes Method of comparison Uses vector difference of Attribute Vectors Method of output to database Uses outputs of Attributes Method of hashing Uses hashcode of output
Sector Vector - SectorParsing Deals with the major flaw with SlopeField Parses the image into portions that pass the vertical line test. Each portion is then transformed into a SlopeField.
Sector Vector - SlopeField
Gap Vector - Theory Separates the different letters into groups Examples: n, m u, v Q, o, 0
Gap Vector - Gap Parsing First find the four corners of the letter Defined as the intersection of the two paths
Gap Vector - Gap Parsing First idea: relative gap coverages -coverage of pixels on the line that would exists if there were a gap Areas of pixel coverage Straight-line path
Gap Vector - Gap Parsing Second idea: locations of pixels relative to the gap This just ends up being a comparison of the area of the pixels in front of the straight line to the areas of the pixels behind the straight line -More pixels in front of gap -> no gap
Gap Vector - Gap Parsing
Putting everything together Example Character Model output: c SectorVector -2 3 GapVector R Do this for every letter of the alphabet for a lot of different fonts and average the results To recognize an individual image of a letter, find the best matches in the cache based using the “compareTo” method of the CharacterModel class
Character Model Cache a SectorVector -5 5 GapVector b GapVector SectorVector 4 3 c SectorVector -2 3 GapVector R d SectorVector -1 3 GapVector e SectorVector -2 3 GapVector f SectorVector 0 3 GapVector R g SectorVector -1 5 GapVector h SectorVector 0 1 GapVector i SectorVector 0 2 GapVector L j SectorVector 0 4 GapVector k SectorVector -2 3 GapVector R l SectorVector 0 1 GapVector m SectorVector -3 1 GapVector T n SectorVector -1 1 GapVector o SectorVector -3 3 GapVector p GapVector SectorVector 4 3 q SectorVector -1 3 GapVector r SectorVector 0 1 GapVector R s SectorVector -2 6 GapVector t SectorVector 0 3 GapVector u SectorVector 0 1 GapVector T v GapVector T SectorVector -2 1 w SectorVector -5 1 GapVector T x SectorVector -4 3 GapVector T L y SectorVector -2 3 GapVector T L z SectorVector 1 4 GapVector L ** Use Java Reflections for generic Attribute handling
Goals for 4th Quarter Get everything working together -almost done, haven’t tested it yet Think of another heuristic if the results are good enough Make GUI for OCR system Noise removal