Nova Patents
EP1382004A2

Method and apparatus for text detection

Abstract

This record has no abstract on file.

Term

Term ended

Projected expiry passed 8 March 2022, 4.5 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

47 claims: 2 independent, 45 dependent

  1. 1
    Claims of equivalent WO 02101637 A2 CLAIMS 1. A method having scanned intensity information as input for detecting text in a scanned page by observing a very strong contrast in a localized region between a dark side and a light side, the method comprising:pre-processing for stroke width determination;and contrast-based text detection processing;wherein said localized region comprises a substantially sharp edge between said dark side and said light side;and whereby any of black text on white background, black text on color background, and white or light text on a dark background are detected.
  2. 2
    The method of Claim 1, further comprising measuring a color saturation value and using said value to improve detection accuracy, wherein said color saturation value of said dark side is required to be small.
  3. 3
    The method of Claim 2, further comprising preliminarily single pixel processing to estimate said color saturation value using prior color information provided by said scanner.
  4. 4
    The method of Claim 1, furthering comprising detecting the presence of half-tone pixels by using a local indicator to improve detection accuracy.
  5. 5
    The method of Claim 4, wherein said half-tone detection is obtained through an algorithm for half-tone detection.
  6. 6
    The method of Claim 1, wherein said pre-processing further comprises:detecting a local ramp;identifying an intensity trough;and determining a stroke width.
  7. 7
    The method of Claim 1, wherein said contrast-based text detection processing further comprises:detecting text preliminarily based on local contrast and stroke width;and consistency checking.
  8. 8
    The method of Claim 1, wherein said observing a strong contrast further comprises:detecting text preliminarily based on local contrast;and consistency checking.
  9. 9
    The method of Claim 6, further comprising:detecting a local ramp;identifying an intensity trough;determining a stroke width;detecting text preliminarily based on contrast and stroke width;and consistency checking.
  10. 10
    The method of Claim 6, wherein the local ramp detection further comprises:using a threshold value and nine 3x3 high-pass filters to obtain nine filtered values per pixel;and determining therefrom any of a vertical ramp detection value, a horizontal ramp detection value, a diagonal ramp in vertical direction detection value, and a diagonal ramp in horizontal direction detection value.
  11. 11
    The method of Claim 10, wherein nine kernels of said nine filters are:vl((-l,l,0),(-l,l,0),(-l,l,0));v2((-l,l,0),(0,-l,l),(-l,l,0));v3((0,-l,l),(-l,l,0),(0,-l,l));hl((-l,-l,-l),(l,l,l),(0,0,0));h2((-l,0,-l),(l,-l,l),(0,l,0));h3((0,-l,0),(-l,l,-l),(l,0,l));dvl((l,0,0),(-l,l,0),(-l,l,l));dv2((-l,-l,l),(-l,l,0),(l,0,0));and dhl((l,-l,-l),(0,l,-l),(0,0,l));wherein dh2 = dv2.
  12. 12
    The method of Claim 10, wherein determining vertical ramp detection further comprises:comparing three associated filtered values for vertical ramp detection, said three associated values from said nine filtered values, to said threshold value;and selecting one of said three associated filtered values, wherein said selected filtered value is larger than said threshold value.
  13. 13
    The method of Claim 10, wherein determining horizontal ramp detection further comprises:comparing three associated filtered values for horizontal ramp detection, said three associated values from said 9 filtered values, to said threshold value;and selecting one of said three associated filtered values, wherein said selected filtered value is larger than said threshold value.
  14. 14
    The method of Claim 10, wherein determining diagonal ramp detection in vertical direction further comprises:comparing two associated filtered values for diagonal ramp detection in vertical direction, said two associated values from said nine filtered values, to said threshold value;and selecting one of said two associated filtered values, wherein said selected filtered value is larger than said threshold value.
  15. 15
    The method of Claim 10, wherein determining diagonal ramp detection in horizontal direction further comprises:comparing two associated filtered values for diagonal ramp detection in horizontal direction, said two associated values from said nine filtered values, to said threshold value;and selecting one of said two associated filtered values, wherein said selected filtered value is larger than said threshold value.
  16. 16
    The method of Claim 9, further comprising:using a sign value from said detection value;using a magnitude value, said magnitude value quantized in units of one- third of said threshold value;and providing a ramp strength output value comprising said sign value and said magnitude value.
  17. 17
    The method of Claim 6, wherein identifying an intensity trough uses a finite state machine algorithm, said algorithm having a sweeping procedure.
  18. 18
    The method of Claim 17, said sweeping procedure further comprising:sweeping said scanned page from left to right for detecting vertical troughs;and sweeping said scanned page from top to bottom for detecting horizontal troughs.
  19. 19
    The method of Claim 18, said finite state machine having a set of five states, and said left to right sweeping procedure further comprising:for each row in said scanned page having a plurality of pixels, and wherein said sweeping procedure sweeps a current pixel of said plurality of pixels one pixel at a time: starting at a first state of said five states at a leftmost pixel as said current pixel in said row of said plurality of pixels;using a signed ramp strength as input, wherein said signed ramp strength is a vertical ramp strength or a diagonal ramp strength in a vertical direction;processing said input by following a set of predetermined rules using said set of five states;and assigning a new state from said set of five states to said current pixel.
  20. 20
    The method of Claim 19, wherein said five states of said set of five states comprise:default, for indicating non-text;going downhill, for indicating negative ramping in intensity;bottom of trough, for indicating a body of text stroke;going uphill, for indicating positive ramping in intensity;and end of uphill, for indicating a reset.
  21. 21
    The method of Claim 19, further comprising:determining a cumulative ramp strength;determining a cumulative duration of stay in a particular state;and determining a total duration of stay in a third state before switching to a fourth state or fifth state, said third, fourth, and fifth states from said set of five states;wherein each determining step uses any of: an edge threshold value, wherein said threshold value is a cumulative ramp strength value required for identifying a high-contrast edge;a maximum ramp strength value, wherein said value is a maximum ramping value allowed;and a maximum width value, wherein said value is an upper limit to a number of detected stroke widths.
  22. 22
    The method of Claim 21, further comprising providing as input to said stroke width determination step, said assigned state of each of said current pixels, said associated cumulative duration of stay in said particular state, and, when said current pixel is in said fifth state, said total duration of stay in said third state before switching to said fourth state or fifth state.
  23. 23
    The method of Claim 20, wherein said determined cumulative ramp strength is in units of one third of said ramp threshold value, and said determined cumulative duration is in units of pixels of stay in a particular state.
  24. 24
    The method of Claim 19, wherein said input is either:a minimum value of any of said signed ramp strengths for said current pixel, said pixel above said current pixel, and said pixel below said current pixel, when said current pixel is in said first, second or fifth state;or a maximum value of any of said signed ramp strengths for said current pixel, said pixel above said current pixel, and said pixel below said current pixel, when said current pixel is in said third or fourth state.
  25. 25
    The method of Claim 19, further comprising adjustments for performing said top to bottom sweeping procedure.
  26. 26
    The method of Claim 6, wherein said stroke width determination step further comprises:determining a width and a skeleton, wherein said width is a distance value and said skeleton is a skeletal line;and detecting closely touching text strokes.
  27. 27
    The method of Claim 26, wherein said width and skeleton determining step further comprises:setting the width value to the smaller of a vertical distance and a horizontal distance between two edges of said stroke;and determining said skeletal line as a roughly equidistant line from said edges.
  28. 28
    The method of Claim 27, wherein said setting width value step further comprises:determining said vertical distance from an associated algorithm by using vertical trough information as input in an N x 1 window beginning at a current pixel;and determining said horizontal distance and said skeletal line from an associated algorithm by using horizontal trough information as input in a 1 x N window beginning at a current pixel.
  29. 29
    The method of Claim 28, wherein N = 9.
  30. 30
    The method of Claim 26, wherein said detecting closely touching text strokes further comprises:detecting a pattern of dark-light-dark (DLD) in a horizontal or a vertical direction within a very small window.
  31. 31
    The method of Claim 30, wherein said detecting a DLD pattern in said vertical direction further comprises:providing an N X M window over a set of pixels and centered at a current pixel;for each column of said N X M window: dividing said set of pixels into three disjoint groups, wherein said groups are a top group, a middle group, and a bottom group, respectively;and detecting a column DLD pattern in said column when a difference between a darkest pixel in said top group and a lightest pixel in said middle group, and a difference between a darkest pixel in said bottom group and said lightest pixel in said middle group are both bigger than a DLD threshold value;counting a number of detected DLD columns within said N X M window;and turning on a DLD flag associated with said current pixel, when said counted number is bigger than a predetermined counting threshold.
  32. 32
    The method of Claim 31, wherein:N = 7 and M = 5;said top group includes two pixels, said middle group includes three pixels, said bottom group includes two pixels;and said predetermined threshold is equal to two.
  33. 33
    The method of Claim 31, further comprising adjustments for said detecting a DLD pattern in said horizontal direction, and using an M x N window.
  34. 34
    The method of Claim 31, further comprising:turning said DLD flag, when either a horizontal or a vertical DLD pattern is detected;wherein said flag is passable to another module to be used to ensure that enhanced text strokes will be cleanly separated from one another.
  35. 35
    The method of Claim 7, wherein said detecting text further comprises:deciding whether a current pixel is a text pixel by using said local contrast present in an N x N window having a center over a set of pixels and centered at said current pixel, and stroke width at said current pixel.
  36. 36
    The method of Claim 35, wherein N = 9.
  37. 37
    The method of Claim 35, wherein numerous statistics of said pixels within said N x N window are collected by using a set of thresholds.
  38. 38
    The method of Claim 37, wherein said set of thresholds comprises any of:a first minimum intensity level for text background;a maximum intensity level of text to be detected;a second minimum intensity level for text background around crowded text strokes, wherein said second minimum intensity level is smaller than said first minimum intensity level;a medium threshold value, wherein said medium threshold value is around 50% intensity;a first maximum width of a stroke, wherein said first width is considered thin;and a second maximum width of a stroke, wherein said second width is considered very thin;and wherein said numerous statistics comprise any of: a number of pixels that are thin;a number of pixels in the center of a 3 X 3 window that are thin;a number of pixels on a skeleton, wherein said skeleton pixels are very thin;a minimum width among pixels of said center 3 X 3 pixels;a second smallest width among said pixels of said center 3 X 3 pixels, wherein said second smallest width is equal to said minimum width among pixels of said center 3 X 3 pixels if more than 1 pixel has said minimum width;a highest intensity present in said N X N window;a number of light pixels;a number of non-light pixels;a number of non-light pixels detected as half-toned from a half-tone detection module;a number of dark and neutral pixels;a number of dark and colored pixels;a number of colored pixels with medium intensity;a number of dark and neutral pixels after boosting;a number of pixels in said center 3 X 3 window, wherein said pixels are dark to medium in intensity;a thin flag set to 1 if said stroke is thin, or set to zero otherwise;and a background flag set to 1 if said center 3 X 3 pixels are all light, or set to zero otherwise.
  39. 39
    The method of Claim 37, further comprising:determining if said current pixel is in a category of a set of predetermined categories using an associated algorithm and said set of thresholds, wherein said thresholds are chosen empirically.
  40. 40
    The method of Claim 39, wherein said predetermined set of categories comprises:Text Outline;Text Body;Background;and Non-text.
  41. 41
    The method of Claim 39, further comprising:moving said center of said N X N window by J pixels to obtain a subsampled text tag.
  42. 42
    The method of Claim 41, wherein J = 3.
  43. 43
    The method of Claim 7, wherein said consistency checking further comprises:accumulating a set of statistics using an N x N window of text tags and a set of thresholds;and deciding by using said set of statistics if each of said text tags is any of: Text Outline;Text Body;Background;and Non-text.
  44. 44
    The method of Claim 43, wherein said N x N window further comprises N x N blocks, each block representing J x J pixels.
  45. 45
    The method of Claim 44, wherein N = 5 and J = 3.
  46. 46
    The method of Claim 43, wherein set said of thresholds comprises a maximum number of Non-text blocks threshold.
  47. 47
    An apparatus for receiving scanned intensity information as input for detecting text in a scanned page by observing a very strong contrast in a localized region between a dark side and a light side, the apparatus comprising:a module for pre-processing for stroke width determination;and a module for contrast-based text detection processing;wherein said localized region comprises a substantially sharp edge between said dark side and said light side;and whereby any of black text on white background, black text on color background, and white or light text on a dark background are detected.
Independent claims47