Thresholding of Text Documents Oliver A Nina William A Barrett - - PowerPoint PPT Presentation

thresholding of text documents
SMART_READER_LITE
LIVE PREVIEW

Thresholding of Text Documents Oliver A Nina William A Barrett - - PowerPoint PPT Presentation

Thresholding of Text Documents Oliver A Nina William A Barrett Thresholding or Binarization Simple method of image segmentation The image is separated in two parts: object of interest background Thresholding Important


slide-1
SLIDE 1

Thresholding of Text Documents

Oliver A Nina William A Barrett

slide-2
SLIDE 2

Thresholding or Binarization

  • Simple method of

image segmentation

  • The image is

separated in two parts: – object of interest – background

slide-3
SLIDE 3

(Left) Original scanned record (Right) After Thresholding, Enhancement, and Antialiasing

Thresholding

–Important for the processing of scanned microfilms and OCR (Optical Character Recognition)

slide-4
SLIDE 4

The Problem

  • Typical algorithms do a fairly well job on

isolating the targeted object (text) –However, it is harder when the text looks similar to the background, such as with lighter pen strokes –In many cases important pixels from the image are removed.

T

slide-5
SLIDE 5

Previous Work

  • Thresholding algorithm classification
  • 1. Global Thresholding

1.1 Bi-modal

  • 2. Adaptive or Local Thresholding

1.2 Multi-modal 1.3 Multi-spectral 2.1 Hierarchical data structures 2.2 Small window

slide-6
SLIDE 6

Thresholding Algorithms

  • Examples of thresholding algorithms
  • Mean or Median value
  • Iterative Method
  • K-means
  • Otsu
  • Niblack
  • Yanowitzand Bruckstein
slide-7
SLIDE 7

Related Work

  • By Cheriet, Said, and Suen (June 1998)
  • Used for bank checks
  • They use a training

set to learn the background ( S=95%)

  • It only works if the

targeted value is the darkest value in the image.

  • Another similar recursive approach
slide-8
SLIDE 8

Our Approach

“Rotsu”

  • 1. Background Estimation
  • 2. Background Subtraction (Hutchinson 2004)
  • 3. Apply Otsu Iteratively in different parts of the histogram

+ + = _ =

slide-9
SLIDE 9

Our Approach

  • 1. Estimation of Background
  • We apply a median filter with a kernel of radius ~21 or

bigger to the image

  • 2. Background subtraction
  • We subtract the original image from the background
  • We normalize the histogram in order to get rid of

negative values and be able to see remaining pixels

_ =

N

slide-10
SLIDE 10

Our Approach

  • 3. The Otsu Algorithm

T

Goal: Minimize within variance class

slide-11
SLIDE 11

Our Approach

  • 3. The Otsu Algorithm

T

Goal: Minimize within variance class

slide-12
SLIDE 12

Our Approach

  • 3. The Otsu Algorithm

Optimal Threshold

Goal: Minimize within variance class

slide-13
SLIDE 13

Otsu

  • Mathematically

σ2 Within(T) = nB(T)σ2B(T) + nO(T)σ2O(T)

T-1 nB(T) = Σ p(i) i=0 N-1 nO(T) = Σ p(i) i=T

σ2B(T) = the variance of the pixels in the background (below threshold) σ2O(T) = the variance of the pixels in the foreground (above threshold)

T

slide-14
SLIDE 14

Otsu

  • Calculating within-class variance is too expensive

σ2 = σ2 Within(T) + σ2 Between(T)

T

  • Another way is to maximize between-class variance
slide-15
SLIDE 15

Otsu

slide-16
SLIDE 16
  • tsu

R

Recursive Otsu

slide-17
SLIDE 17

The algorithm

threshold = Otsu(image) thresholdImage(image,thImg,threshold) While(threshold < 255) { // until no more to threshold excludePixels(image,thImg,excludedImage) threshold = Otsu(excludedImage) thresholdImage(excludedImage,thImg,threshold) saveAndDisplayImage(newImg) }

slide-18
SLIDE 18

The algorithm

T T T

slide-19
SLIDE 19

Results

slide-20
SLIDE 20

Original Image Original with background substracted

slide-21
SLIDE 21

Original Image First Set = S1

slide-22
SLIDE 22

Original Image Second Set =S2

slide-23
SLIDE 23

Original Image Third Set = S3

slide-24
SLIDE 24

Original Image Fourth Set = S4

slide-25
SLIDE 25

Original Image S1 + S2 + S3 + S4

slide-26
SLIDE 26

Original Image Original with background substracted (K=41)

slide-27
SLIDE 27

Original Image First Set =S1

slide-28
SLIDE 28

Original Image Second Set = S2

slide-29
SLIDE 29

Original Image Third Set = S3

slide-30
SLIDE 30

Original Image S 1+ S2 + S3

slide-31
SLIDE 31

Original Image Background Approximation

slide-32
SLIDE 32

Original Image First Threshold = T1

slide-33
SLIDE 33

Original Image Remaining Pixels

slide-34
SLIDE 34

Original Image Second Threshold = T2

slide-35
SLIDE 35

Original Image T1 + T2

slide-36
SLIDE 36

Original Image Background Subtracted

slide-37
SLIDE 37

Original Image S1

slide-38
SLIDE 38

Original Image S3

slide-39
SLIDE 39

Original Image S3

slide-40
SLIDE 40

Original Image S1 + S2 + S3

slide-41
SLIDE 41

Original Image S1

slide-42
SLIDE 42

Original Image Final Composite

JPG

slide-43
SLIDE 43

Conclusion

  • Although Rotsu is still a work in progress, it

definitely shows promising results –Rotsu allows us to save softer strokes that would be lost with conventional methods

  • therwise.

–Relatively easy to implement. –Opens up the door to new ideas on how to improve thresholding.

slide-44
SLIDE 44

Further Work

  • Determine a better background estimate.

–Automate the selection of kernel size for the median filter –Improve the criteria with which we decide to get rid of background pixels –Investigate to see if the combination of Rotsu with other techniques would be better

slide-45
SLIDE 45

Questions?