Optical Character Recognition Using the Ullman Algorithm for

  • Slides: 29
Download presentation
Optical Character Recognition: Using the Ullman Algorithm for Graphical Matching Iddo Aviram

Optical Character Recognition: Using the Ullman Algorithm for Graphical Matching Iddo Aviram

OCR- a Brief Review • Optical character recognition, usually abbreviated to OCR, is the

OCR- a Brief Review • Optical character recognition, usually abbreviated to OCR, is the mechanical or electronic translation of scanned images of handwritten, typewritten or printed text into machine-encoded text. • OCR is a task, and not a mathematically defined problem.

OCR- a Brief Review • People are using many disciplines for OCR. Fourier Transforms

OCR- a Brief Review • People are using many disciplines for OCR. Fourier Transforms Decision Making Topology Pattern Matching Machine Learning Expert Systems Neural Networks Optimization Problems Differential Geometry Computer Vision • We will show just a simple, not representative, approach to deal partly with the OCR task.

OCR- a Brief Review • The task can be very hard, and state-of-the-art algorithms

OCR- a Brief Review • The task can be very hard, and state-of-the-art algorithms might be not good enough for some practical purposes. In several cases, however, OCR tools can perform well and be useful. Easier Harder Printed Handwritten Block letters Cursive Scribe script Free handwritten Online Offline Non-connected writing Connected writing Well-preserved manuscripts Degraded manuscripts Restricted writing Non restricted writing

OCR- a Brief Review • The human brain does amazingly well with OCR tasks,

OCR- a Brief Review • The human brain does amazingly well with OCR tasks, so usually the computer results are evaluated by a comparison with a manually created ground truth data. • However, sometimes even humans are not capable of recognition.

OCR- a Brief Review • Can you read these scripts? : תקווה בפתח נדלן

OCR- a Brief Review • Can you read these scripts? : תקווה בפתח נדלן : )למעלה , yad 1. co. il מתוך 2012 : למטה " ה"חבצלת מתוך (1912

OCR- Motivation for Graphical Matching • Using graphical tools for object recognition. • A

OCR- Motivation for Graphical Matching • Using graphical tools for object recognition. • A possible scheme: – Binarization – Segmentation by connected components – Thinning – Graphical modeling – Graphical matching – Rule-Based Selection

OCR- Motivation for Graphical Matching • Binarization:

OCR- Motivation for Graphical Matching • Binarization:

OCR- Motivation for Graphical Matching • Segmentation-> Thinning-> Graphical modeling:

OCR- Motivation for Graphical Matching • Segmentation-> Thinning-> Graphical modeling:

OCR- Motivation for Graphical Matching • Given an historical manuscript, a blessing of Brit

OCR- Motivation for Graphical Matching • Given an historical manuscript, a blessing of Brit Milah:

OCR- Motivation for Graphical Matching • We’re interested in finding the occurrences of the

OCR- Motivation for Graphical Matching • We’re interested in finding the occurrences of the letter Mem (not final):

OCR- Motivation for Graphical Matching • By sub-graph matching we can find candidates: Graphical

OCR- Motivation for Graphical Matching • By sub-graph matching we can find candidates: Graphical modeling Graphical matching

Subgraph Isomorphism Problem • Given two graphs H and G as input, the problem

Subgraph Isomorphism Problem • Given two graphs H and G as input, the problem is whether H has a subgraph that is isomorphic to G. • In this example the answer is ‘yes’ since there’s an isomorphic correspondence: 1 G-1 H, 2 G-3 H, 3 G-2 H. (There additional isomorphic correspondences).

Subgraph Isomorphism Problem • Graph isomorphism – Graphs G(VG, EG) and H(VH, EH) are

Subgraph Isomorphism Problem • Graph isomorphism – Graphs G(VG, EG) and H(VH, EH) are isomorphic if |VG|=|VH| and there is an invertible function F from VG to VH such that for all nodes u and v in VG, (u, v)∈EG if and only if (F(u), F(v)) ∈EH. – Such a function F is said to be an isomorphic correspondence.

Subgraph Isomorphism Problem • The subgraph problem is NP-complete. • There is a very

Subgraph Isomorphism Problem • The subgraph problem is NP-complete. • There is a very simple reduction: CLIQUE ≤P Subgraph Isomorphism • However, for many specific types of practical problems (even with ‘big’ inputs), algorithms do answer fast.

The Ullman Algorithm • An Algorithm for Subgraph Isomorphism, J. R. Ullmann, Journal of

The Ullman Algorithm • An Algorithm for Subgraph Isomorphism, J. R. Ullmann, Journal of the ACM, 1976. • Although old, this algorithm is still very popular and having good results in practice.

The Ullman Algorithm • There algebraic formulations for graph isomorphism and subgraph isomorphism, that

The Ullman Algorithm • There algebraic formulations for graph isomorphism and subgraph isomorphism, that we will take use of. • The adjacency matrix AH of a graph H would be:

The Ullman Algorithm • We will use the notion of a permutation matrix. •

The Ullman Algorithm • We will use the notion of a permutation matrix. • Any permutation matrix is equivalent to an isomorphic correspondence. Isomorphic Correspondence Permutation Matrix F= M’= F~M’

The Ullman Algorithm • Isomorphic Correspondence F= M’= F~M’ ~ Permutation Matrix Isomorphism criterion:

The Ullman Algorithm • Isomorphic Correspondence F= M’= F~M’ ~ Permutation Matrix Isomorphism criterion:

The Ullman Algorithm • We can develop this equation that defines an isomorphism: Isomorphism

The Ullman Algorithm • We can develop this equation that defines an isomorphism: Isomorphism criterion:

The Ullman Algorithm • In a similar fashion (without proof) we have an algebraic

The Ullman Algorithm • In a similar fashion (without proof) we have an algebraic criterion for a subgraph isomorphism. Isomorphic Correspondence 1 G-1 H 2 -3 F= G H 3 G-2 H 4 G-φ ~ M’= Permutation Matrix Subgraph isomorphism criterion: iff G is subgraph isomorphic to H, with a correspondence F~rectangular M’.

The Ullman Algorithm •

The Ullman Algorithm •

The Ullman Algorithm • Ullmann’s algorithm I – Construction of another matrix M(0) with

The Ullman Algorithm • Ullmann’s algorithm I – Construction of another matrix M(0) with the same size of the M’-s: – Generation of all M’-s by setting to 0 all but one 1 in each row of M(0) – A subgraph isomorphism has been found if M implies: .

The Ullman Algorithm • Ullmann’s algorithm I – Example Root - M(0) Inner Nodes

The Ullman Algorithm • Ullmann’s algorithm I – Example Root - M(0) Inner Nodes – M-s Leaves – M’-s

The Ullman Algorithm

The Ullman Algorithm

The Ullman Algorithm

The Ullman Algorithm

The Ullman Algorithm •

The Ullman Algorithm •