Segmentation of heterogeneous document images : an ... - Tel

Segmentation of heterogeneous document images : an ... - Tel Segmentation of heterogeneous document images : an ... - Tel

tel.archives.ouvertes.fr
from tel.archives.ouvertes.fr More from this publisher
14.01.2014 Views

• N, the number of states in the model. In the application for text-gap correction, we have two states: text and gap. Typically, the states are interconnected in a way that any state can be reached from any other state. With our two-states model, a text state may remain in text state at each region, or it may transit to a gap state. The same statement is also true for a gap state. tel-00912566, version 1 - 2 Dec 2013 • M, the number of distinct observations per state. Generally, observations are used to train a model and estimate transition and emission probability matrices. In other words, transition and emission probabilities are estimated during the training phase based on training sequences and then during inference the observations are used to find the optimal sequence of states. However, in the method proposed by [75] the HMM model calculates transition and emission probabilities continuously on-the-fly based on the height of each region and the mean of pixels’ intensities, covered by the region. • The state transition probability matrix A(k) for k th region of the vertical strip is modeled by exponential distributions as follows: A(k) = ⎛ ( ⎝ exp 1 − exp ) − h m k 0 ( ) − h k m 1 ( 1 − exp − h k ( ) exp − h k m 1 m 0 ) where h k denotes the height of the k th region and m j , j ∈ {0, 1} is the mean height of all regions of the whole document image in the initial state j. A state transition occurs with high probability for regions that have a height close to the mean height. • The emission probability matrix B(k) for k th region of the vertical strip is modeled by a log-normal distribution of the foreground (text) pixels density for all regions. The emission matrix is defined by the following: ⎞ ⎠ ⎛ B(k) = ⎝ 1 √ x k σ 0 2π exp 1√ x k σ 1 2π exp (− (ln x k−µ 0) 2 2σ0 (− 2 (ln x k−µ 1) 2 2σ 2 1 ) ) ⎞ ⎠ where x k is the foreground pixel density for the k th region. µ j and σ 2 j denote the mean and variance of the logarithm of foreground pixels’ density for all region in the initial state j. This formulation indicates that the two states may be distinguished by considering two log-normal distributions. For estimation of the parameters of the HMM, regions with reasonable heights, over one fifth of the mean height of all CCs, are used. • π j , j ∈ {0, 1}, the initial state probabilities are set to be equal. 92

Having specified the model, a vertical zone can be seen as a succession of initial text and gaps that form observations of the model. The corresponding state sequence that characterizes the respective regions as text or gap, results with the application of Viterbi algorithm for maximization of the sequence probability. As mentioned before, separators of the text lines are drawn in the middle of each resulting gap region. Figure 5.4 shows the initial text and gap regions and the resulting regions after applying the Viterbi algorithm for the two images in figures 5.1 and 5.2. 5.3 Connecting separators across vertical zones tel-00912566, version 1 - 2 Dec 2013 Up to this point, text line separators are found in vertical zones. But these separators are line fragments that do not always meet end-to-end across different vertical zones. The objective of a connecting algorithm is to correct the location of line fragments, connect separators from adjacent vertical zones and extend them until they isolate text lines. Our connecting algorithm is slightly different from the one introduced in the original work. The steps are as follows: • The first step of our connecting algorithm is to perturb the location of each separator parallel to the x-axis by either moving it up or down until it stays clear of any connected components or text characters. This step is overlooked in the original algorithm. The reason for this perturbation is that although the Viterbi algorithm does a good job on clearing many false separators, it introduces some other false separators over text characters that have a considerably larger height than the average height of CCs. • The second step is to remove any separator that is located partially or completely outside of any text region detected in the previous chapter. • The third step is to connect separators across vertical zones to one another. All separators that are not connected from the right side to any separator should search for the closest separator on the vertical zone to their right. The new founded separator should be within half the height of averaged CCs in vertical direction from the main separator, otherwise two separators that separate different text lines may be connected incorrectly. Another search should be performed likewise to connect open-ended separators to their left counterparts. If a search is unsuccessful, the separator should be left open-ended. • The fourth step is to extend open-ended separators from left and right sides until they either reach to the contours of text regions, or they reach to the borders of the page. After traversing any new zone by extending the separator, a new search should be perform to connect the extended separator to another potentially available separator. 93

Having specified the model, a vertical zone c<strong>an</strong> be seen as a succession <strong>of</strong> initial<br />

text <strong>an</strong>d gaps that form observations <strong>of</strong> the model. The corresponding state<br />

sequence that characterizes the respective regions as text or gap, results with<br />

the application <strong>of</strong> Viterbi algorithm for maximization <strong>of</strong> the sequence probability.<br />

As mentioned before, separators <strong>of</strong> the text lines are drawn in the middle<br />

<strong>of</strong> each resulting gap region.<br />

Figure 5.4 shows the initial text <strong>an</strong>d gap regions <strong>an</strong>d the resulting regions<br />

after applying the Viterbi algorithm for the two <strong>images</strong> in figures 5.1 <strong>an</strong>d 5.2.<br />

5.3 Connecting separators across vertical zones<br />

tel-00912566, version 1 - 2 Dec 2013<br />

Up to this point, text line separators are found in vertical zones. But these separators<br />

are line fragments that do not always meet end-to-end across different<br />

vertical zones. The objective <strong>of</strong> a connecting algorithm is to correct the location<br />

<strong>of</strong> line fragments, connect separators from adjacent vertical zones <strong>an</strong>d extend<br />

them until they isolate text lines. Our connecting algorithm is slightly different<br />

from the one introduced in the original work. The steps are as follows:<br />

• The first step <strong>of</strong> our connecting algorithm is to perturb the location <strong>of</strong><br />

each separator parallel to the x-axis by either moving it up or down until<br />

it stays clear <strong>of</strong> <strong>an</strong>y connected components or text characters. This step<br />

is overlooked in the original algorithm. The reason for this perturbation<br />

is that although the Viterbi algorithm does a good job on clearing m<strong>an</strong>y<br />

false separators, it introduces some other false separators over text characters<br />

that have a considerably larger height th<strong>an</strong> the average height <strong>of</strong> CCs.<br />

• The second step is to remove <strong>an</strong>y separator that is located partially or<br />

completely outside <strong>of</strong> <strong>an</strong>y text region detected in the previous chapter.<br />

• The third step is to connect separators across vertical zones to one <strong>an</strong>other.<br />

All separators that are not connected from the right side to <strong>an</strong>y<br />

separator should search for the closest separator on the vertical zone to<br />

their right. The new founded separator should be within half the height <strong>of</strong><br />

averaged CCs in vertical direction from the main separator, otherwise two<br />

separators that separate different text lines may be connected incorrectly.<br />

Another search should be performed likewise to connect open-ended separators<br />

to their left counterparts. If a search is unsuccessful, the separator<br />

should be left open-ended.<br />

• The fourth step is to extend open-ended separators from left <strong>an</strong>d right<br />

sides until they either reach to the contours <strong>of</strong> text regions, or they reach<br />

to the borders <strong>of</strong> the page. After traversing <strong>an</strong>y new zone by extending<br />

the separator, a new search should be perform to connect the extended<br />

separator to <strong>an</strong>other potentially available separator.<br />

93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!