s egmentation for h andwritten d ocuments omar alaql fab. 20, 2014

42
SEGMENTATION FOR HANDWRITTEN DOCUMENTS Omar Alaql Fab. 20, 2014

Upload: hector-carroll

Post on 12-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

SEGMENTATION FOR HANDWRITTEN DOCUMENTS

Omar Alaql

Fab. 20, 2014

Page 2: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Outline

• Optical Character Recognition (OCR).• OCR for the Historical Documents.• Text Lines Segmentation Approaches.

Profile Projection. Hough Transform. Level Set Method. Affinity Propagation. Steerable Directional Technique.

Page 3: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Optical Character Recognition (OCR)

• The electronic translation of images into machine-editable text.

Input Image Text

Page 4: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Optical Character Recognition (OCR)

• There are four major stages which must be done in any optical characters recognition:

1) Preprocessing.2) Segmentation.3) Feature extraction.4) Recognition.

Page 5: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Optical Character Recognition (OCR)

• Preprocessing:– Noise reduction.– Binarization or Gray scale image. – Compression in the amount of data to be analyzed.

Page 6: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• Segmentation:– The isolation of various writing units, such as paragraphs,

sentences, words, or letters.

Optical Character Recognition (OCR)

Text Lines Segmentation

Page 7: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• Representation:– Extracts the most relevant information from the text

image which helps the recognition stage to recognize the text.

– This information is the features of each symbol that is needed to distinguish it from other symbols.

Optical Character Recognition (OCR)

Page 8: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• Recognition:– Recognition stage is the last and the main decision

making stage. – It is a classification process that identifies each unknown

symbol and assigns it into a predefined class. – This classification is based on the extracted features

which are the output of the previous stage.

Optical Character Recognition (OCR)

Page 9: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• Historical documents processing is a challenging task for various reasons:1) Lack of standard alphabets and presence of unknown fonts.2) Low quality.

OCR for the Historical Documents

Page 10: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

OCR for the Historical Documents3) The lack of constraints on page layout.

Page 11: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

OCR for the Historical Documents4) The complexity of handwriting.5) The variability of skew between the different text-lines and within the same text-line.

Page 12: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

6) Spaces between lines are narrow and variable.7) The existence of small components.

8) Distinguishing noise from text.

OCR for the Historical Documents

Narrow lines

Small Components

Noise

Page 13: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Text Lines Segmentation Approaches

• There are many techniques for text lines segmentation: Profile Projection. Hough Transform. Level Set Method. Affinity Propagation. Steerable Directional Technique.

Page 14: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Projection Profile

• Summing pixel values along the horizontal axis for each y value.

Horizontal Projection

Page 15: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Projection Profile

• Example: Input image.

Page 16: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Projection Profile

• Example: Skew Correction.

Page 17: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Projection Profile

• Example: Horizontal Projection.

Page 18: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Projection Profile

• Example: Peaks detection

Page 19: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• Example: Positions for segmentation.

Projection Profile

Page 20: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• Example: Image for each text line.

Projection Profile

Page 21: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• For skewed or fluctuating text lines, the image may be divided into vertical strips .

• Subdivision the page into columns. • Determination of the minimal values of the

histograms resulting from horizontal projections for all the columns.

• Drawing horizontal stroke by means of each minimal value inside a column.

• The link between these strokes allows the separation of two adjacent lines.

Projection Profile

Page 22: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Partial Projection Method

Projection Profile

Page 23: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Hough Transform

• The Hough transform is used for locating straight lines in images.

• Text line is best align matches the black pixels.• Any black pixel has an infinite number of lines that

could pass through this pixel.

Page 24: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• There are two ways to represent the lines :– y = mx + c– x cos θ + y sin θ = ρ

Each line has a unique value (m , c) or (ρ, θ) which is called accumulator.

There is a vote for the accumulator when the line passes through a black pixel.

The text line is the line that has the maximum accumulator.

Hough Transform

Page 25: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Level-set Method• Instead of directly segmenting on a binary image, it is converted

to a probability map, where each element represents the probability of this pixel belonging to a text line.

Input image Probability Map

Page 26: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Level-set Method• The probability map is analyzed using the level set method to

segment text lines by determining the boundary of neighboring text lines.

• The zero value for the boundary, automatically grows, merges, and stops to the final text line boundary.

Initial estimate of text lines Result after 10 iterations

By Level Set, text lines are

horizontally elongated

Page 27: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Connected Components Clustering

• Grouping many connected components in a cluster by using grouping algorithms, each cluster represents a separate text line.

Connected Components

Page 28: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Affinity Propagation

• The algorithm first estimates local orientation at each primary component of a word to build a sparse similarity graph.

At each point, the region is divided into five regions.

The Breadth-First Search algorithm is applied to find disjoint sets in the similarity graph.

There exist a path from each element to every other element in the set.

Page 29: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Steerable Directional Local Profile Technique

• One of the connected components based approaches is steerable directional technique.

• Adaptive local connectivity map (ALCM) is generated using a steerable directional filter.

Page 30: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Steerable Directional Local Profile Technique

• Firstly, a steerable filter is used to determine foreground intensity along multiple directions at each pixel while generating the ALCM.

Text image ALCM

Steerable Filter

Page 31: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Steerable Directional Local Profile Technique

• The ALCM is then binarized using an adaptive thresholding algorithm to get a rough estimate of the location of the text lines.

ALCM Text Line Location

Binarization

Page 32: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• This approach has difficulties and limitations when it comes to the binarization of the ALCM images.

• Especially when text lines in the document are very close to each other.

Steerable Directional Technique

Page 33: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

• To solve the problem: 1) Steerable dynamic directional filter is applied. Angle value is taken instead of the density value.

Steerable Directional Technique

Input image

Text Direction Map

Page 34: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

2) apply a mode filter to extract each paragraph in the document and its orientation.

Steerable Directional Technique

Paragraph Map

Page 35: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Steerable Directional Technique

Input Image

Paragraph Map

Page 36: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Steerable Directional Technique

3) a steerable static directional filter is applied.- the direction of the kernel is taken from the paragraph map.

Page 37: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Steerable Directional Technique

4) Thresholding

Text lines patterns

Page 38: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Horizontal Projection Technique• To use Projection Technique:– First : paragraph segmentation.

Paragraph Map

Paragraphs Segmented

Page 39: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Horizontal Projection Technique• To use Projection Technique:– Second: Skew Correction.

After skew correction

Paragraphs Segmented

Page 40: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Horizontal Projection Technique• To use Projection Technique:– Third: Horizontal Projection.

Page 41: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Horizontal Projection Technique• To use Projection Technique:

– Fourth: Profile Analysis.• There are some drawbacks makes finding he maximum and the minimum

in the profile more complicated.

Short line will provide low peak that might be ignored

very narrow lines, or the lines that including many overlapping components will not produce significant peaks

Page 42: S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014

Horizontal Projection Technique• To use Projection Technique:– Fourth: Profile Analysis.• To solve this problem, the profile should be smoothed.