Patent Publication Number: US-2022237932-A1

Title: Computer implemented method for segmenting a binarized document

Description:
TECHNICAL FIELD 
     The present disclosure is related to a computer implemented method for segmenting a binarized document, a method for OCRing a binarized document, as well as a data processing apparatus, a computer program and computer-readable medium. 
     INTRODUCTION 
     Document image segmentation methods are generally classified into three categories known as the bottom-up, top down and hybrid. Bottom-up methods follow an agglomerative approach where letters or words are first extracted and then merged progressively into text lines and text regions. The publication L. O. Gorman, “The Document Spectrum for Page Layout Analysis,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 15, no. 11, pp. 1162-1173, November 1993. proposes a connected component based method where each connected component is paired with its k nearest neighbors. By investigating the histogram of the magnitude and the angle of the pairing vectors, the within-line nearest neighbors are determined and text lines are subsequently extracted. Text lines are then merged into text blocks by checking their parallelness, perpendicular proximity and overlap. The strength of this method lies in the exploitation of the local neighborhoods of each connected component. However the neglection of text and non-text discrimination limits its performance when handling versatile layouts with varying font sizes. On the contrary, top-down methods start from the whole image and make use of global information (e.g. large foreground or background strips) to segment the image iteratively into smaller regions until region homogeneity is reached. Defined as the histogram of the accumulated foreground (or background) pixels in the horizontal or vertical direction across an image region, projection profiles are often employed in the segmentation process of a top-down method. Bottom-up methods are in general time consuming while top-down methods tend to suffer from non-Manhattan layouts. In view of these difficulties, hybrid methods strive to provide a constructive combination of bottom-up and top-down techniques. However, similar to bottom-up and top-down methods where a reliable text and non-text components classification is currently absent, the hybrid methods show limitations when dealing with documents with rich non-text components. 
     It is to note that text and non-text classification is a fundamental step in document segmentation and has been addressed using heuristics, simple statistics or learning based approaches in existing document segmentation methods. While the first two are straight-forward to implement, their performance tends to suffer from complicated documents where the layout versatility is beyond their rigid comprehension. On the other hand, the demand for sufficient training samples is stringent for learning based approaches which may be less favorable in practical scenarios where it is expensive to collect training samples for the classifier. 
     SUMMARY 
     The present disclosure aims to provide a solution to at least one drawback of the above prior art teaching. More specifically, the present disclosure aims to provide a solution to improve the segmentation of documents through extracting text regions from complex layouts. 
     According to an object of the present disclosure, there is therefore provided a computer implemented method for segmenting a binarized document. The solution of the present disclosure relies on the assumption that a discrimination between regular (e.g. text) and irregular (e.g. non-text) components is enabled by any one or a combination of proximity, similarity and regularity (e.g. symmetry) characteristics exhibited by regions surrounding the components. These attributes, alone or in combination, are advantageously used to define homogeneity as a pattern displayed by a region of regular components (e.g. text), which consists of proximately and regularly (e.g. symmetrically) arranged units with similar morphological and texture features. The discrimination according to the present disclosure improves the segmentation process differentiating text region from non-text region, or more generally, a region with a regular pattern from a region with an irregular pattern. 
     It is another object of the present disclosure to disclose the method as defined above, wherein the homogeneity level value for the at least one of the connected components is based on a comparison between the at least one value representative of the at least one image characteristic parameter determined for said connected component and on the at least one value representative of the at least one image characteristic parameter determined for the at least one connected component adjacent to said connected component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one image characteristic parameter for a given connected component comprises at least one morphological feature determined for the given component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one morphological feature determined for the given connected component is at least one coordinate of the smallest rectangle containing the region spanned by said component, an aspect ratio of said rectangle, an area of said rectangle, an extent of the binary image of said component, the Euler number of said component, a parameter related to the set of connected components vertically neighboring said component, a parameter related to the set of connected components horizontally neighboring said component, a direction of said component, or any combination thereof. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one image characteristic parameter for a given connected component comprises at least one texture feature determined for the given connected component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one texture feature determined for the given connected component is based on a grey-level co-occurrence matrix determined for the given connected component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one texture feature determined for the given connected component is computed from a grey-level co-occurrence matrix determined using a region comprising the given connected component and one or more neighboring connected components of the given connected component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one texture feature determined for the given connected component is computed from a grey-level co-occurrence matrix determined using a region comprising periodic duplications of the given connected component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the homogeneity level value is a likelihood that a connected component is a regular component, preferably a text component, more preferably a text character. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the homogeneity level value is a probabilistic description of the homogeneity pattern displayed in a region comprising a connected component and a set of neighboring connected components related to the said component. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the homogeneity level value is evaluated based on a probabilistic cue integration of the at least one image characteristic parameter determined for the at least one of the connected components and the at least one image characteristic parameter determined for the at least one connected component adjacent to the at least one of the connected components. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the probabilistic cue integration is based on least one prior probability characterizing the cue probability based on the at least one image characteristic parameter determined for the at least one of the connected components and the at least one image characteristic parameter determined for the at least one connected component adjacent to the at least one of the connected components. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the probabilistic cue integration is based on least one cue-specific distribution characterizing the cue-specific probabilistic homogeneity based on the at least one image characteristic parameter determined for the at least one of the connected components and the at least one image characteristic parameter determined for the at least one connected component adjacent to the at least one of the connected components. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one cue-specific probabilistic homogeneity is characterized using the Bayesian rule based on the at least one likelihood of observing the at least one image characteristic parameter from the at least one of the connected components and the at least one image characteristic parameter from the at least one connected component adjacent to the at least one of the connected components conditioned on the homogeneity status of the two components. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the at least one cue-specific probabilistic homogeneity is characterized using the Bayesian rule based on the at least one cue-specific prior probability of the homogeneity between the at least one image characteristic parameter from the at least one of the connected components and the at least one image characteristic parameter from the at least one connected component adjacent to the at least one of the connected components. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein a given connected component is discriminated to be a regular component, preferably a text component, more preferably a text character, when the homogeneity level value of the given connected component is higher than a predefined threshold. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein a given connected component is discriminated to be a non-regular component, preferably a non-text component, more preferably a non-text character, when the homogeneity level value of the given connected component is below than or equal to the predefined threshold. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein an adjacent connected component to a given connected component, is at least a direct vertical neighbor, a direct horizontal neighbor, a secondary horizontal neighbor, or a secondary vertical neighbor. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein all the connected components are extracted from the binarized document and then for each connected component extracted, it is discriminated whether said connected component is a regular component, preferably a text component, more preferably a text character. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein at least one connected component which is determined as a text component and has the highest homogeneity value among all text components that are yet to be grown into text lines is selected as a seed for forming an initial text structure, preferably a text line. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein during a text line grow iteration, a test determining whether a further connected component is to be added to the text line or not, is performed, the test being based on the comparison of at least one text line parameter representing the level of homogeneity of the text line combined with the further connected component and a given threshold. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein a text block is assembled via grow text line iterations with top-down supervision. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein a text paragraph is extracted by segmenting a text block based on the analysis of geometric location of the text lines within the text block. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein a non-text region is extracted via a seed-grow-extraction process. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the or at least one text line which has yet to be grown into a text block is selected as a seed for forming an intermediate text structure, preferably a column or a row of a table, using at least one parameter of the text line parameter and a given threshold. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein during an intermediate text structure grow iteration, a test determining whether a further text line is to be added to the intermediate text structure or not, is performed, said test being based on the comparison of at least one intermediate text structure parameter representing the level of homogeneity of the intermediate text structure combined with the further text line and a given threshold. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein (the) at least one intermediate text structure which has yet to be grown into a complex text structure is selected as a seed for forming a complex text structure using (the) at least one parameter of the intermediate text structure and a given threshold, preferably said complex text structure being a table. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein during a complex text structure grow iteration, a test determining whether a further intermediate text structure is to be added to the complex text structure or not, is performed, said test being based on the comparison of at least one complex text structure parameter representing the level of homogeneity of the complex text structure combined with the further intermediate text structure and a given threshold, preferably said complex text structure being a table. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein the or at least one non-text component which has yet to be grown into a (further) non-text region is selected as a template for forming a(the) complex text structure using at least one image characteristic parameter of the said non-text component, preferably said complex text structure being a table, a form, a chart, or a diagram. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein at least one (further) text structure, preferably a text line or text block, which is contained in, or adjacent to, a region comprising (the) at least one template, is selected as a template-filling for forming a(the) complex text structure, preferably said complex text structure being a table, a form, a chart, or a diagram. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein during a(the) complex text structure grow iteration, a test determining whether a further template is to be added to the complex text structure or not, is performed, said test being based on the comparison of (the) at least one complex text structure parameter representing the level of homogeneity of the complex text structure combined with the further template and a given threshold, preferably said complex text structure being a table, a form, a chart or a diagram. 
     It is another object of the present disclosure to disclose such a method as defined in any of the above, wherein during a(the) complex text structure grow iteration, a test determining whether a further template-filling is to be added to the complex text structure or not, is performed, said test being based on the comparison of (the) at least one complex text structure parameter representing the level of homogeneity of the complex text structure combined with the further template-filling and a given threshold, preferably said complex text structure being a table, a form, a chart or a diagram. 
     In accordance with another object of the present disclosure, there is provided a method for optical character recognition (OCR). In accordance with another object of the present disclosure, there is provided a data processing apparatus. The data processing apparatus can comprise a computing or processing unit programmed to carry out the method as described herein. In accordance with another object of the present disclosure, there is provided a computer program. In accordance with another object of the present disclosure, there is provided a computer-readable medium. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       Aspects of the present disclosure will now be described in more detail with reference to the appended drawings, wherein same reference numerals illustrate same features and wherein: 
         FIG. 1  represents a homogeneous region (preferably a text region) in an image (preferably a document image) based on the analysis of the connected components extracted from the binarized image. 
         FIG. 2  represents the local region or local region of interest of a specific connected component, both in homogeneous and heterogeneous scenarios. 
         FIG. 3  represents the hierarchical projection of homogeneity from a region layer to component layer. 
         FIG. 4  represents a flowchart with the text and non-text discrimination of the connected components. 
         FIG. 5  represents a flowchart with a text block grow process. 
     
    
    
     DESCRIPTION OF EMBODIMENTS 
       FIG. 1  represents the analysis of a set of connected components (CC) (also denoted as    i  or    j , for individual CC, or CCs for a group of connected components depending on the circumstances) extracted from a binarized image. Approaches to extract connected components CC are not described in this disclosure because they are well known to the skilled person. A connected component CC can contain at least a regular (or irregular) component, a text component, a text character, part of a text character, a non-text component, part of a non-text component, and comes with a set of morphological features and a set of texture features. 
     At least one image characteristic parameter (e.g. morphological feature or texture feature) is used to discriminate whether a given connected component CC is a text character, for instance ASCII code, Unicode or the like. Of course the discrimination of the computer implemented method according to the present disclosure can be generalized to any text component (e.g. a part of a text character) or any component presenting a regular pattern. 
     At least one morphological feature of a given connected component    i  can be defined by any of the following features taken in isolation or any (linear or non-linear) combination thereof, or any other features that are derived from:
         a bounding box BB i  which is the smallest rectangle containing the region spanned by the given connected component    i ;   (x i ,y i ) which are the coordinates of the centroids of the bounding box BB i ;   bounding box vector    i =(x i   l , y i   l , w i , h i , x i   r , y i   r ) where (x i   l ,y i   l ) and (x i   r , y i   r ) are the coordinates of the top left and bottom right corner of the bounding box BB i  respectively, while w i  and h i  represent the width and height of the bounding box BB i ;       

       aspect ratio  a   i =min( w   i   ,h   i )/max( w   i   ,h   i ); 
       area  A   i   =w   i   ·h   i ; 
       extent  e   i =Σ x=x     i       l     x     i       r   Σ y=y     i       l     y     i       r     I   b ( x,y )/ A   i , where  I   b ( x,y ) is  a  binary image;
         Euler number β i =1−n i , where n i  is the number of holes contained in the given connected component    i ;   the set of connected components CCs horizontally neighboring the given connected component    i :       

           i ={   j |min( y   i   r   ,y   j   r )−max( y   i   l   ,y   j   l )&gt;=0, j≠i};  
         the set of connected components CCs vertically neighboring the given connected component    i :       

           i ={   j |min( x   i   r   ,x   j   r )−max( x   i   l   ,x   j   l )&gt;=0, j≠i};  
         a direction of the given connected component    i :dir i ∈{0,1} represents the direction (horizontal/vertical) of the text line that contains the given connected component    i . The direction dir i  is obtained by comparing the distances between the given connected component    i  and its horizontal and vertical neighbors.       

     At least one texture feature that can be used for the present disclosure is the grey level co-occurrence matrix GLCM. It defines the joint probability P dx, dy  (i, j) of the co-occurrence of a pair of pixels that are related to each other by their intensities (i, j) and spatial relativities (specified by dx and dy). A texture description scheme can be based on two GLCM configurations: context grey level co-occurrence matrix GLCM ct  and periodic grey level co-occurrence matrix GLCM pd . Owing to text homogeneity, the neighborhoods of two text components share a similar texture pattern. The co-occurrence matrix of GLCM ct  of a given connected component CC i  is extracted from a context region that contains not only the given connected component CC i  but also its neighborhood region. On the other hand, the co-occurrence matrix of GLCM pd  is extracted from a patch consisting of duplications of the given connected component CC i  itself. These two configurations are shown in  FIG. 1 . 
     Under each configuration, co-occurrence matrices GLCM θ  are extracted along four (θ=0, 45°, 90°, 135°) different directions. By analyzing the joint probabilities P θ (i,j) which are obtained by normalizing the co-occurrence matrices, the feature vector {right arrow over (f)} θ =[f con   θ , f cor   θ , f eng   θ , f hom   θ , f ent   θ ] T  is extracted, where the components are defined as: 
       contrast  f   con   θ =Σ i Σ j   |i−j|   2   P   θ ( i,j );
 
       correlation  f   cor   θ =Σ i Σ j [( i−μ   i )( j−μ   j ) P   θ ( i,j )/σ i σ j ], where μ i =Σ i Σ j   iP ( i,j ) and σ i =√{square root over (Σ i Σ j ( i−μ   i ) 2   P ( i,j ))};
 
       energy  f   eng   θ =Σ i Σ j   P   θ   2 ( i,j );
 
       homogeneity  f   hom   θ =Σ i Σ j [ P   θ ( i,j )/(1+| i−j |)];
 
       entropy  f   ent   θ =−Σ i Σ j   P   θ ( i,j ) lnP   θ ( i,j ).
 
     The texture descriptor of a given connected component    i  is constructed as {right arrow over (f)} mod =Σ θ  {right arrow over (f)} θ  where θ∈{0, 45°, 90°, 135°}, and mod ∈{ct, pd}. 
     In  FIG. 2 , a local region of interest LROI, which is also denoted as local region, is defined for a connected component    i  under both homogeneous and heterogeneous simulations. The regional layer text homogeneity is exploited by surveying the relationships between    i  and its neighboring (also denoted as adjacent) connected component CCs within the region. The local region of interest LROI of a given connected component    i  can consist of three groups of neighboring connected components CCs namely horizontal immediate neighbors    HIN   i , vertical immediate neighbors    VIN   i  and secondary neighbors    SN   i . Therefore, local region of interest LROI can be defined as follow: 
           i ={   HIN   i ,   VIN   i ,   SN   i }, 
     where the immediate neighbors of the given connected component    i  are defined as: 
           HIN   i ={   j |   j ∈   i ∧(¬∃   k :   k ∈   i ∧
 
           k ∈   j ∧( x   j   l   &lt;x   k   l   &lt;x   i   l   &lt;x   i   l   &lt;x   k   l   &lt;x   j   l ), k≠j ), j≠i} 
 
           VIN   i ={   j |   j ∈   i ∧(¬∃   k :   k ∈   i ∧
 
           k ∈   j ∧( y   j   l   &lt;y   k   l   &lt;y   i   l   ∨y   i   l   &lt;y   k   l   &lt;y   j   l ), k≠j ), j≠i} 
 
     To further enhance the statistical description of the regional layer homogeneity, the area of local region of interest LROI is expanded by introducing the secondary neighbors: 
     
       
         
           
             
               ℂ 
               ⁢ 
               
                 ℂ 
                 
                   S 
                   ⁢ 
                   N 
                 
                 i 
               
             
             = 
             
               ( 
               
                 
                   
                     
                       
                         
                           
                             
                               
                                 { 
                                 
                                   j 
                                 
                                  
                               
                               ⁢ 
                               
                                 j 
                               
                             
                             ∈ 
                             
                               𝕊ℝ 
                               i 
                               
                                 
                                   r 
                                   s 
                                 
                                 ⁢ 
                                 N 
                                 ⁢ 
                                 N 
                               
                             
                           
                           ⩓ 
                           
                             
                               j 
                             
                             ∉ 
                             
                               ℂ 
                               ⁢ 
                               
                                 ℂ 
                                 HIN 
                                 i 
                               
                             
                           
                         
                         } 
                       
                       ; 
                       
                         
                           if 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             dir 
                             i 
                           
                         
                         = 
                         0 
                       
                       ; 
                     
                   
                 
                 
                   
                     
                       
                         
                           
                             
                               
                                 { 
                                 
                                   j 
                                 
                                  
                               
                               ⁢ 
                               
                                 j 
                               
                             
                             ∈ 
                             
                               𝕊ℂ 
                               i 
                               
                                 
                                   r 
                                   s 
                                 
                                 ⁢ 
                                 N 
                                 ⁢ 
                                 N 
                               
                             
                           
                           ⩓ 
                           
                             
                               j 
                             
                             ∉ 
                             
                               ℂ 
                               ⁢ 
                               
                                 ℂ 
                                 VIN 
                                 i 
                               
                             
                           
                         
                         } 
                       
                       ; 
                       
                         
                           if 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             dir 
                             i 
                           
                         
                         = 
                         1. 
                       
                     
                   
                 
               
             
           
         
       
     
     where    i   r     s     NN  and    i   r     s     NN  represent the r s  nearest horizontal and vertical neighbors of a given connected component    i  respectively. The physical region spanned by the neighboring connected components CCs included in    i  is presented as    i : 
           i   ={HIN   i   ,VIN   i   ,SN   i }; 
     where HIN i , VIN i  and SN i  denote the subregions spanned by the given connected component    i  together with the neighboring connected components CCs included in    HIN   i ,    VIN   i , and    SN   i  respectively. A demonstration of configurations of a local region LROI of a  given connected component    i  in homogeneous and heterogeneous scenarios are depicted in  FIG. 2 . The definition of a local region LROI spanned by a set of neighboring connected components CCs refers to the physical region that contains and only contains the bounding boxes of all the neighboring connected components CCs included in the set. 
     This configuration of a local regional of interest (LROI) of a connected component can of course be generalized to describe any region containing a connected component and its neighboring components that could be related to the component in any forms (e.g. distances, orientations, etc.). 
       FIG. 3  shows how homogeneity is defined at regional layer and exploited at component layer. To exploit text homogeneity in the local region LROI of a connected component    i , the regional layer homogeneity is projected to the connected component layer where the homogeneity between the connected component    i  and a further connected component    i  is described using a binary random variable s ij : 
     
       
         
           
             
               s 
               ij 
             
             = 
             
               ( 
               
                 
                   
                     
                       
                         s 
                         ij 
                         + 
                       
                       , 
                       
                         
                           if 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           connected 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           components 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             i 
                           
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           and 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             j 
                           
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           are 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           homogeneous 
                         
                         ; 
                       
                     
                   
                 
                 
                   
                     
                       
                         s 
                         ij 
                         - 
                       
                       , 
                       
                         
                           if 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           connected 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           components 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             i 
                           
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           and 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             j 
                           
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           are 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           heterogeneous 
                         
                         ; 
                       
                     
                   
                 
               
             
           
         
       
     
     The regional layer homogeneity variable t iR     i    is introduced: 
         t   iR     i     =P ( s   ij   =s   ij   + )= p   ij ,   j ∈   R     i     i ;
 
     where R i ∈   i  and P(s ij =s ij   + ) denotes the probability that the connected component    i  and the further connected component    j  are homogeneous at the component layer. The regional layer homogeneity variable t iR     i    is associated with a uniform distribution: 
     
       
         
           
             
               
                 
                   
                     
                       P 
                       ⁡ 
                       
                         ( 
                         
                           
                             t 
                             
                               i 
                               ⁢ 
                               
                                 R 
                                 i 
                               
                             
                           
                           = 
                           
                             p 
                             ij 
                           
                         
                         ) 
                       
                     
                     = 
                     
                       1 
                       
                          
                         
                           ℂℂ 
                           
                             R 
                             i 
                           
                           i 
                         
                          
                       
                     
                   
                   , 
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     1 
                   
                   ] 
                 
               
             
           
         
       
     
     where |   R     i     i | denotes the cardinality of set    R     i     i . 
     The introduction of the regional layer homogeneity variable t iR     i    helps to characterize the homogeneity of a subregion R i  spanned by the connected component    i  and a set of its neighboring connected components CCs, and the stipulated uniform distribution inversely proportional to the region dimension in Equation 1 enables to incorporate the neighborhood geometric complexity when projecting homogeneity from regional layer to component layer. As it can be observed from  FIG. 2 , a complicated neighborhood results in an increased number of neighboring connected components CCs included in the local region LROI of connected component    i , which subsequently renders a reduced P(t iR     i   =p ij ). As such, the likelihood that homogeneity is preserved at regional level is lower from a component with complicated neighborhood comparing to a component with a more regular neighborhood. 
     The local text homogeneity variable r i  can be expressed as the result of a combination of the expectation of the regional homogeneity of different subregions 
         r   i   =E ( t   iR     k   )= e   iR     k     ,R   k ∈   i ;
 
     where E(t iR     k   ) denotes the expectation of the regional homogeneity variable t iR     k   . As it is assumed that the local homogeneity of a connected component    i  is affected equally by the homogeneity from each subregions of    i , the local text homogeneity variable r i  is associated to a uniform distribution: 
         P ( r   i   =e   iR     k   )=1/|   i |; 
     and the probabilistic local text homogeneity PLTH of the connected component    i  is defined as the expectation of r i : 
       PLTH i   =E ( r   i ). 
     Given the local region configuration presented in this present disclosure, the probabilistic local text homogeneity PLTH can be the following: 
     
       
         
           
             
               
                 
                   
                     P 
                     ⁢ 
                     L 
                     ⁢ 
                     T 
                     ⁢ 
                     
                       H 
                       i 
                     
                   
                   = 
                   
                     
                       E 
                       ⁡ 
                       
                         ( 
                         
                           r 
                           i 
                         
                         ) 
                       
                     
                     = 
                     
                       
                         
                           ∑ 
                           k 
                         
                         ⁢ 
                         
                           
                             e 
                             
                               i 
                               ⁢ 
                               
                                 R 
                                 k 
                               
                             
                           
                           ⁢ 
                           
                             P 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   r 
                                   i 
                                 
                                 = 
                                 
                                   e 
                                   
                                     i 
                                     ⁢ 
                                     
                                       R 
                                       k 
                                     
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       = 
                       
                         
                           
                             ∑ 
                             k 
                           
                           ⁢ 
                           
                             
                               E 
                               ⁡ 
                               
                                 ( 
                                 
                                   t 
                                   
                                     i 
                                     ⁢ 
                                     
                                       R 
                                       k 
                                     
                                   
                                 
                                 ) 
                               
                             
                             ⁢ 
                             
                               P 
                               ⁡ 
                               
                                 ( 
                                 
                                   
                                     r 
                                     i 
                                   
                                   = 
                                   
                                     e 
                                     
                                       i 
                                       ⁢ 
                                       
                                         R 
                                         k 
                                       
                                     
                                   
                                 
                                 ) 
                               
                             
                           
                         
                         = 
                         
                           
                             
                               1 
                               
                                  
                                 
                                   ℝ 
                                   i 
                                 
                                  
                               
                             
                             ⁡ 
                             
                               [ 
                               
                                 
                                   E 
                                   ⁡ 
                                   
                                     ( 
                                     
                                       t 
                                       
                                         iHIN 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                                 + 
                                 
                                   E 
                                   ⁡ 
                                   
                                     ( 
                                     
                                       t 
                                       
                                         iVIN 
                                         i 
                                       
                                     
                                     ) 
                                   
                                 
                                 + 
                                 
                                   E 
                                   ⁡ 
                                   
                                     ( 
                                     
                                       t 
                                       
                                         i 
                                         ⁢ 
                                         S 
                                         ⁢ 
                                         
                                           N 
                                           i 
                                         
                                       
                                     
                                     ) 
                                   
                                 
                               
                               ] 
                             
                           
                           = 
                           
                               
                             
                               
                                 
                                   1 
                                   
                                     3 
                                     ⁢ 
                                     
                                        
                                       
                                         ℂℂ 
                                         HIN 
                                         i 
                                       
                                        
                                     
                                   
                                 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   
                                     ∑ 
                                     l 
                                   
                                   ⁢ 
                                   
                                     P 
                                     ⁡ 
                                     
                                       ( 
                                       
                                         
                                           s 
                                           il 
                                         
                                         = 
                                         
                                           s 
                                           il 
                                           + 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                               
                               + 
                               
                                 
                                   1 
                                   
                                     3 
                                     ⁢ 
                                     
                                        
                                       
                                         ℂℂ 
                                         VIN 
                                         i 
                                       
                                        
                                     
                                   
                                 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   
                                     ∑ 
                                     m 
                                   
                                   ⁢ 
                                   
                                     P 
                                     ( 
                                     
                                         
                                     
                                     ⁢ 
                                     
                                       
                                         s 
                                         im 
                                       
                                       = 
                                       
                                         s 
                                         im 
                                         + 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               + 
                               
                                   
                                 
                                   
                                     
                                       1 
                                       
                                         3 
                                         ⁢ 
                                         
                                            
                                           
                                             ℂℂ 
                                             
                                               S 
                                               ⁢ 
                                               N 
                                             
                                             i 
                                           
                                            
                                         
                                       
                                     
                                     ⁢ 
                                     
                                       
                                         ∑ 
                                         n 
                                       
                                       ⁢ 
                                       
                                         P 
                                         ⁡ 
                                         
                                           ( 
                                           
                                             
                                               s 
                                               
                                                 i 
                                                 ⁢ 
                                                 n 
                                               
                                             
                                             = 
                                             
                                               s 
                                               
                                                 i 
                                                 ⁢ 
                                                 n 
                                               
                                               + 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                   
                                   ; 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     2 
                   
                   ] 
                 
               
             
           
         
       
     
     where    i ={HIN i , VIN i , SN i },    l ∈   HIN   i ,    m ∈   VIN   i  and    n  ∈   SN   i . 
     As shown in  FIG. 3 , an hierarchical structure can be observed from Equation 2 where regional layer local text homogeneity r i  is advantageously projected progressively onto first sub-regional layer (characterized by t iHIN     i   , t iVIN     i   , and t iSN     i   ) and then component layer where the probabilistic homogeneity is characterized by P(s ij =s ij   + ) between two connected components    i  and    j . 
     This model formulated to describe homogeneity can of course be generalized to any models that characterize, based on the exploitation of relations between connected components that are relatable to each other, any pattern in a region consisting of proximately and regularly (e.g. symmetrically) arranged components with similarities. 
     The evaluation of component layer homogeneity advantageously uses a probabilistic cue integration approach. Given the observations {right arrow over (H)} i  and {right arrow over (H)} j  of two connected components    i  and    j , the probabilistic component layer homogeneity P(s ij   + |{right arrow over (H)} i ,{right arrow over (H)} j ) is advantageously evaluated using a ‘mixture-of-experts’ model: 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               
                                 P 
                                 ( 
                                 
                                   s 
                                   ij 
                                   + 
                                 
                                  
                               
                               ⁢ 
                               
                                 
                                   H 
                                   → 
                                 
                                 i 
                               
                             
                             , 
                             
                               
                                 H 
                                 → 
                               
                               j 
                             
                           
                           ) 
                         
                         = 
                         
                           
                             ∑ 
                             k 
                           
                           ⁢ 
                           
                             P 
                             ( 
                             
                               
                                 s 
                                 ij 
                                 + 
                               
                               , 
                               
                                 
                                   c 
                                   k 
                                 
                                 ⁢ 
                                 
                                    
                                   
                                     
                                       
                                         H 
                                         → 
                                       
                                       i 
                                     
                                     , 
                                     
                                       
                                         H 
                                         → 
                                       
                                       j 
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         = 
                         
                           
                             ∑ 
                             k 
                           
                           ⁢ 
                           
                             P 
                             ( 
                             
                               
                                 s 
                                 ij 
                                 + 
                               
                               ⁢ 
                               
                                  
                                 
                                   
                                     
                                       H 
                                       → 
                                     
                                     i 
                                   
                                   , 
                                   
                                     
                                       H 
                                       → 
                                     
                                     j 
                                   
                                   , 
                                   
                                     c 
                                     k 
                                   
                                 
                                 ) 
                               
                               ⁢ 
                               
                                 P 
                                 ( 
                                 
                                   
                                     
                                       c 
                                       k 
                                     
                                     ⁢ 
                                     
                                        
                                       
                                         
                                           
                                             H 
                                             → 
                                           
                                           i 
                                         
                                         , 
                                         
                                           
                                             H 
                                             → 
                                           
                                           j 
                                         
                                       
                                       ) 
                                     
                                   
                                   , 
                                 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     3 
                   
                   ] 
                 
               
             
           
         
       
     
     where P(s ij   + |{right arrow over (H)} i ,{right arrow over (H)} j , c k ) measures the probabilistic homogeneity P(s ij   + |{right arrow over (H)} i ,{right arrow over (H)} j ) under cue c k , and P(c k |{right arrow over (H)} i ,{right arrow over (H)} j ) characterizes the cue priority. 
     This component layer homogeneity model can of course be generalized to any models that evaluate the similarity/dissimilarity of two components by first evaluating the similarities/dissimilarities of two components from multiple aspects using one or more morphological or texture or any other features, and then integrating these respective measurements into the overall similarity/dissimilarity. 
     The cue integration structure of Equation 3 offers a comprehensive yet particular way to evaluate the component layer probabilistic homogeneity. The comprehensiveness is offered by the cue integration process, which enables a joint analysis of various types of features when evaluating the homogeneity between two components, while the particularity is offered by P(s ij   + |{right arrow over (H)} i , {right arrow over (H)} j , c k ) which can engage one or more different features tailored to specific cues. Flexibility of the model is further controlled during the integration process through the cue priority P(c k |{right arrow over (H)} i ,{right arrow over (H)} j ). 
     A joint morphological and texture analysis for the evaluation of component layer homogeneity can be based on Equation 3. Three (one morphological and two texture) different cues can be considered, where the feature vector {right arrow over (f)} mor =[h i , a i , A i , e i ] T  serves as the observation vector under the morphological cue and the GLCM feature vectors {right arrow over (f)} ct  and {right arrow over (f)} pd  are engaged under the two texture cues respectively. It is alternatively possible to use more or less different cues, e.g. two (one morphological and one texture), or just one (morphological or texture). 
     Under each cue, the probabilistic homogeneity is calculated by following the Bayesian rule: 
     
       
         
           
             
               
                 
                   
                     
                       P 
                       ⁡ 
                       
                         ( 
                         
                           
                             
                               s 
                               ij 
                               + 
                             
                             | 
                             
                               
                                 H 
                                 → 
                               
                               i 
                             
                           
                           , 
                           
                             
                               H 
                               → 
                             
                             j 
                           
                           , 
                           
                             c 
                             k 
                           
                         
                         ) 
                       
                     
                     = 
                     
                       
                         
                           λ 
                           
                             i 
                             ⁢ 
                             j 
                           
                           + 
                         
                         ⁢ 
                         
                           P 
                           ⁡ 
                           
                             ( 
                             
                               
                                 s 
                                 
                                   i 
                                   ⁢ 
                                   j 
                                 
                                 + 
                               
                               | 
                               
                                 c 
                                 k 
                               
                             
                             ) 
                           
                         
                       
                       
                         
                           
                             λ 
                             
                               i 
                               ⁢ 
                               j 
                             
                             + 
                           
                           ⁢ 
                           
                             P 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   s 
                                   
                                     i 
                                     ⁢ 
                                     j 
                                   
                                   + 
                                 
                                 | 
                                 
                                   c 
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             λ 
                             
                               i 
                               ⁢ 
                               j 
                             
                             - 
                           
                           ⁢ 
                           
                             P 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   s 
                                   
                                     i 
                                     ⁢ 
                                     j 
                                   
                                   - 
                                 
                                 | 
                                 
                                   c 
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     4 
                   
                   ] 
                 
               
             
           
         
       
     
     where λ ij   ± =p({right arrow over (H)} i , {right arrow over (H)} j |s ij   ± , c k ) represents the likelihood of obtaining the observations {right arrow over (H)} i  and {right arrow over (H)} j  given the homogeneity status s ij   ±  between components    i  and    j , and P(s ij   ± |c k ) is the cue-specific homogeneity prior. In the present implementation, cue independent priors are considered: 
         P ( s   ij   ±   |c   k )= P ( s   ij   ± ), 
     and Equation 4 is simplified as: 
     
       
         
           
             
               
                 
                   
                     P 
                     ⁡ 
                     
                       ( 
                       
                         
                           
                             s 
                             ij 
                             + 
                           
                           | 
                           
                             
                               H 
                               → 
                             
                             i 
                           
                         
                         , 
                         
                           
                             H 
                             → 
                           
                           j 
                         
                         , 
                         
                           c 
                           k 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         
                           λ 
                           
                             i 
                             ⁢ 
                             j 
                           
                           + 
                         
                         ⁢ 
                         
                           P 
                           ⁡ 
                           
                             ( 
                             
                               s 
                               
                                 i 
                                 ⁢ 
                                 j 
                               
                               + 
                             
                             ) 
                           
                         
                       
                       
                         
                           
                             λ 
                             
                               i 
                               ⁢ 
                               j 
                             
                             + 
                           
                           ⁢ 
                           
                             P 
                             ⁡ 
                             
                               ( 
                               
                                 s 
                                 
                                   i 
                                   ⁢ 
                                   j 
                                 
                                 + 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             λ 
                             ij 
                             - 
                           
                           ⁢ 
                           
                             P 
                             ⁡ 
                             
                               ( 
                               
                                 s 
                                 
                                   i 
                                   ⁢ 
                                   j 
                                 
                                 - 
                               
                               ) 
                             
                           
                         
                       
                     
                     . 
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     5 
                   
                   ] 
                 
               
             
           
         
       
     
     Embodiments of this disclosure itself however clearly follow a general formulation where the cue-specific prior P(s ij   ± |c k ) can be formulated using any cue-dependent or cue-independent information in respective implementations. 
     Given the observed feature vectors if {right arrow over (H)} i   k ⊂{right arrow over (H)} i , {right arrow over (H)} j   k ⊂{right arrow over (H)} j  of components    i  and    i  under cue c k , the likelihood can be modelled using the multivariate Gaussian (MVG) densities: 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           λ 
                           ij 
                           ± 
                         
                         = 
                         
                           
                             p 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   
                                     H 
                                     → 
                                   
                                   i 
                                   k 
                                 
                                 , 
                                 
                                   
                                     
                                       H 
                                       → 
                                     
                                     j 
                                     k 
                                   
                                   | 
                                   
                                     s 
                                     ij 
                                     ± 
                                   
                                 
                                 , 
                                 
                                   c 
                                   k 
                                 
                               
                               ) 
                             
                           
                           = 
                           
                             p 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   
                                     
                                       g 
                                       ± 
                                     
                                     ⁡ 
                                     
                                       ( 
                                       
                                         Δ 
                                         ⁢ 
                                         
                                           
                                             H 
                                             → 
                                           
                                           k 
                                         
                                       
                                       ) 
                                     
                                   
                                   | 
                                   
                                     s 
                                     ij 
                                     ± 
                                   
                                 
                                 , 
                                 
                                   c 
                                   k 
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         = 
                         
                           𝒩 
                           ⁡ 
                           
                             ( 
                             
                               
                                 
                                   
                                     H 
                                     → 
                                   
                                   ij 
                                   k 
                                 
                                 | 
                                 
                                   
                                     μ 
                                     → 
                                   
                                   ± 
                                 
                               
                               , 
                               
                                 Σ 
                                 ± 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           = 
                           
                             𝒩 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   
                                     
                                       H 
                                       → 
                                     
                                     ij 
                                     k 
                                   
                                   | 
                                   
                                     
                                       μ 
                                       → 
                                     
                                     ± 
                                   
                                 
                                 , 
                                 
                                   diag 
                                   ⁡ 
                                   
                                     ( 
                                     
                                       
                                         σ 
                                         1 
                                         ± 
                                       
                                       , 
                                       
                                         . 
                                         
                                             
                                         
                                         . 
                                         
                                             
                                         
                                         . 
                                       
                                       ⁢ 
                                       
                                           
                                       
                                       , 
                                       
                                         σ 
                                         M 
                                         ± 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               ) 
                             
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     6 
                   
                   ] 
                 
               
             
           
         
       
     
     where Δ{right arrow over (H)} k ={right arrow over (H)} i   k −{right arrow over (H)} j   k  measures the discrepancy between the features of connected components    i  and    j , and g ±  is a transformation function (   m×1 →   m×1 ),  ({right arrow over (μ)} ± , Σ ± ) is the MVG density with mean vector {right arrow over (μ)} ±  and covariance matrix Σ ± . Assuming that different features under the same cue are independent from each other, Σ ±  reduces to a diagonal matrix diag(σ 1   ± , . . . σ M   ± ) where σ m   ±  (m=1,2, . . . , M) control the dimensional variance of the MVG distribution. Take note that M represents the dimension of the feature vector {right arrow over (H)} i   k  under cue c k . To keep a compact notation and without introducing ambiguity, the cue indicator k is dropped and the cue specific feature vector {right arrow over (H)} i   k  as {right arrow over (H)} i  is denoted in the following discussions. 
     Embodiments of this disclosure itself however clearly follow a general formulation where the likelihood densities λ ij   ±  can be modelled using any single-variate (in case of using single-element feature vectors {right arrow over (H)} i   k  and {right arrow over (H)} j   k ) density models such as Laplacian distribution, or multivariate (in case of using multi-elements feature vectors {right arrow over (H)} i   k  and {right arrow over (H)} j   k ) density models such as multivariate generalized Gaussian distribution or matrix gamma distribution. 
     Given that similarity between components is a major characteristic of the text homogeneity, a higher positive likelihood density p({right arrow over (H)} i ,{right arrow over (H)} j |s ij   + , c k ) suggests a smaller disparity between the observations {right arrow over (H)} i  and {right arrow over (H)} j  of the two components. The positive likelihood density can be modeled as a zero mean MVG distribution 
         p ( {right arrow over (H)}   i   ,{right arrow over (H)}   j   |s   ij   +   ,c   k )= ( {right arrow over (H)}   ij   + |{right arrow over (0)},diag(σ 1   + , . . . σ M   + ))  [Equation 7]
 
     of the discrepancy vector H which is obtained using a linear transformation L: 
         L =diag(min(| h   i   1   |,|h   j   1 |), . . . , min(| h   i   M   |,|h   j   M |)),  [Equation 8]
 
     such that: 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               H 
                               → 
                             
                             ij 
                             + 
                           
                           = 
                           
                             
                               
                                 g 
                                 + 
                               
                               ⁡ 
                               
                                 ( 
                                 
                                   Δ 
                                   ⁢ 
                                   
                                     H 
                                     → 
                                   
                                 
                                 ) 
                               
                             
                             = 
                             
                               
                                 L 
                                 
                                   - 
                                   1 
                                 
                               
                               ⁢ 
                               Δ 
                               ⁢ 
                               
                                 H 
                                 → 
                               
                             
                           
                         
                         , 
                       
                     
                   
                   
                     
                       
                         
                           = 
                           
                             
                               [ 
                               
                                 
                                   
                                     Δ 
                                     ⁢ 
                                     
                                       h 
                                       
                                         i 
                                         ⁢ 
                                         j 
                                       
                                       1 
                                     
                                   
                                   
                                     min 
                                     ( 
                                     
                                       
                                         | 
                                         
                                           h 
                                           i 
                                           1 
                                         
                                         | 
                                       
                                       , 
                                       
                                          
                                         
                                           
                                             h 
                                             j 
                                             1 
                                           
                                           | 
                                         
                                         ) 
                                       
                                     
                                   
                                 
                                 , 
                                 
                                   . 
                                   
                                       
                                   
                                   . 
                                   
                                       
                                   
                                   . 
                                 
                                 ⁢ 
                                 
                                     
                                 
                                 , 
                                 
                                   
                                     Δ 
                                     ⁢ 
                                     
                                       h 
                                       
                                         i 
                                         ⁢ 
                                         j 
                                       
                                       M 
                                     
                                   
                                   
                                     min 
                                     ( 
                                     
                                       
                                         | 
                                         
                                           h 
                                           i 
                                           M 
                                         
                                         | 
                                       
                                       , 
                                       
                                          
                                         
                                           
                                             h 
                                             j 
                                             M 
                                           
                                           | 
                                         
                                         ) 
                                       
                                     
                                   
                                 
                               
                               ] 
                             
                             T 
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     9 
                   
                   ] 
                 
               
             
           
         
       
     
     where h i   m , h j   m , m=1, . . . , M are the m th  components of {right arrow over (H)} i  and {right arrow over (H)} j  respectively, and Δh ij   m =h i   m −h j   m . 
     The vector {right arrow over (σ)} + =[σ 1   + , . . . , σ M   + ] T  controls the sharpness of the MVG distribution in M-dimensional space. Small values in {right arrow over (σ)} +  render a compact distribution where the density is concentrated around the origin 0 such that likelihood increases when H ij   + →0, and decreases drastically when the measured differences between the two components deviates from 0. On the other hand, higher values in {right arrow over (σ)} +  give a flattened distribution where the decrease in likelihood is less drastic when the measured differences between two components is increasing, however the homogeneity likelihood is also smaller comparing to that of a model with smaller {right arrow over (σ)} +  when the measured differences approach zero. 
     A set of neighboring connected component CCs is incorporated in the vicinity of given components    i  and    j  when estimating {right arrow over (σ)} + : 
       {right arrow over (σ)} + =½({right arrow over (σ)} i   + +{right arrow over (σ)} j   + ).  [Equation 10]
 
     To determine {right arrow over (σ)} i   +  (and likewise for {right arrow over (σ)} j   + ),    rNN   i  is first identified.    rNN   i  contains r nearest neighboring connected component CCs of the given component    i . Then, the discrepancy vector {right arrow over (H)} is     n     +  between    i  and    s     n   ∈   rNN   i  is computed by following a similar process to that expose in Equation 9: 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               H 
                               → 
                             
                             
                               i 
                               ⁢ 
                               
                                 s 
                                 n 
                               
                             
                             + 
                           
                           = 
                           
                             
                               L 
                               
                                 - 
                                 1 
                               
                             
                             | 
                             
                               
                                 
                                   H 
                                   → 
                                 
                                 i 
                               
                               - 
                               
                                 
                                   H 
                                   → 
                                 
                                 
                                   s 
                                   n 
                                 
                               
                             
                             | 
                           
                         
                         , 
                       
                     
                   
                   
                     
                       
                         
                           = 
                           
                             
                               [ 
                               
                                 
                                   
                                     | 
                                     
                                       Δ 
                                       ⁢ 
                                       
                                         h 
                                         
                                           i 
                                           ⁢ 
                                           
                                             s 
                                             n 
                                           
                                         
                                         1 
                                       
                                     
                                     | 
                                   
                                   
                                     min 
                                     ( 
                                     
                                       
                                         | 
                                         
                                           h 
                                           i 
                                           1 
                                         
                                         | 
                                       
                                       , 
                                       
                                          
                                         
                                           
                                             h 
                                             
                                               s 
                                               n 
                                             
                                             1 
                                           
                                           | 
                                         
                                         ) 
                                       
                                     
                                   
                                 
                                 , 
                                 
                                   . 
                                   
                                       
                                   
                                   . 
                                   
                                       
                                   
                                   . 
                                 
                                 ⁢ 
                                 
                                     
                                 
                                 , 
                                 
                                   
                                     | 
                                     
                                       Δ 
                                       ⁢ 
                                       
                                         h 
                                         
                                           i 
                                           ⁢ 
                                           
                                             s 
                                             n 
                                           
                                         
                                         M 
                                       
                                     
                                     | 
                                   
                                   
                                     min 
                                     ( 
                                     
                                       
                                         | 
                                         
                                           h 
                                           i 
                                           M 
                                         
                                         | 
                                       
                                       , 
                                       
                                          
                                         
                                           
                                             h 
                                             
                                               s 
                                               n 
                                             
                                             M 
                                           
                                           | 
                                         
                                         ) 
                                       
                                     
                                   
                                 
                               
                               ] 
                             
                             T 
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     11 
                   
                   ] 
                 
               
             
           
         
       
     
     where {right arrow over (H)} s     n    is the cue specific feature vector of component    s     n   . 
     {right arrow over (σ)} i   +  is determined by analyzing the element-wise variance of the discrepancy vectors H is     n     +  between    i  and its r nearest neighbors: 
       {right arrow over (σ)} i   + =Σ n=1   r (   d     is     n   ( {right arrow over (H)}   is     n     + ) 0.2 )−(Σ n=1   r     d     is     n     {right arrow over (H)}   is     n     + ) 0.2 ,  [Equation 12]
 
     where (H is     n     + ) 0.2  represents the element-wise square on vector H is     n     + , and  d   is     n    is the normalized inversed distance between connected components    i  and    s     n   : 
     
       
         
           
             
               
                 
                   
                     
                       d 
                       ¯ 
                     
                     
                       i 
                       ⁢ 
                       
                         s 
                         n 
                       
                     
                   
                   = 
                   
                     
                       
                         1 
                         
                           d 
                           
                             i 
                             ⁢ 
                             
                               s 
                               n 
                             
                           
                         
                       
                       / 
                       
                         Σ 
                         
                           n 
                           = 
                           1 
                         
                         r 
                       
                     
                     ⁢ 
                     
                       
                         1 
                         
                           d 
                           
                             i 
                             ⁢ 
                             
                               s 
                               n 
                             
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     13 
                   
                   ] 
                 
               
             
           
         
       
     
     As suggested by Equation 12, homogeneous neighborhoods of connected component    i  (and    j ) will lead to small valued model parameters {right arrow over (σ)} +  such that the homogeneity likelihood between components    i  and    j  is sensitively tuned to the measured differences {right arrow over (H)} ij   + . On the other hand, heterogeneous neighborhoods of connected components    i (and      j ) will lead to a flattened likelihood distribution where the homogeneity likelihood of the two components is expected to be low even if the two share some similarities. 
     In contrast to the positive likelihood, a higher negative likelihood density p({right arrow over (H)} i ,{right arrow over (H)} j |s ij   − ,c k ) suggests a larger discrepancy between the observations of the two components. The negative likelihood density can be modeled as a zero mean MVG distribution: 
         p ( {right arrow over (H)}   i   ,{right arrow over (H)}   j   |s   ij   −   ,c   k )= ( {right arrow over (H)}   ij   − |{right arrow over (0)},diag(σ 1   − , . . . σ M   − )),  [Equation 14]
 
     where the discrepancy vector {right arrow over (H)} ij   −  is obtained using a element-wise nonlinear transformation function: 
     
       
         
           
             
               
                 
                   
                     
                       
                         g 
                         - 
                       
                       ⁡ 
                       
                         ( 
                         x 
                         ) 
                       
                     
                     = 
                     
                       
                         sgn 
                         ⁡ 
                         
                           ( 
                           x 
                           ) 
                         
                       
                       ⁢ 
                       
                         
                           α 
                           ⁢ 
                           
                             e 
                             
                               - 
                               
                                 | 
                                 x 
                                 | 
                                 
                                   / 
                                   3 
                                 
                               
                             
                           
                         
                         
                           | 
                           x 
                           ⁢ 
                           
                             | 
                             3 
                           
                           ⁢ 
                           
                             + 
                             β 
                           
                         
                       
                     
                   
                   , 
                   
                     
                       sgn 
                       ⁡ 
                       
                         ( 
                         x 
                         ) 
                       
                     
                     = 
                     
                       ( 
                       
                         
                           
                             
                               1 
                               , 
                             
                           
                           
                             
                               
                                 x 
                                 ≥ 
                                 0 
                               
                               ; 
                             
                           
                         
                         
                           
                             
                               
                                 - 
                                 1 
                               
                               , 
                             
                           
                           
                             
                               x 
                               &lt; 
                               0. 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     15 
                   
                   ] 
                 
               
             
           
         
       
     
     such that: 
     
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             H 
                             → 
                           
                           ij 
                           - 
                         
                         = 
                         
                           
                             g 
                             - 
                           
                           ⁡ 
                           
                             ( 
                             
                               
                                 H 
                                 → 
                               
                               ij 
                               + 
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           = 
                           
                             [ 
                             
                               
                                 
                                   sgn 
                                   ⁡ 
                                   
                                     ( 
                                     
                                       h 
                                       1 
                                       + 
                                     
                                     ) 
                                   
                                 
                                 ⁢ 
                                 
                                   
                                     
                                       γ 
                                       1 
                                     
                                     ⁢ 
                                     
                                       e 
                                       
                                         - 
                                         
                                           | 
                                           
                                             h 
                                             1 
                                             + 
                                           
                                           | 
                                           
                                             / 
                                             3 
                                           
                                         
                                       
                                     
                                   
                                   
                                     | 
                                     
                                       h 
                                       1 
                                       + 
                                     
                                     ⁢ 
                                     
                                       | 
                                       3 
                                     
                                     ⁢ 
                                     
                                       + 
                                       
                                         γ 
                                         2 
                                       
                                     
                                   
                                 
                               
                               , 
                               
                                 . 
                                 
                                     
                                 
                                 . 
                                 
                                     
                                 
                                 . 
                               
                               ⁢ 
                               
                                   
                               
                               , 
                               
                                 
                                   sgn 
                                   ⁡ 
                                   
                                     ( 
                                     
                                       h 
                                       M 
                                       + 
                                     
                                     ) 
                                   
                                 
                                 ⁢ 
                                 
                                   
                                     
                                       γ 
                                       1 
                                     
                                     ⁢ 
                                     
                                       e 
                                       
                                         - 
                                         
                                           | 
                                           
                                             h 
                                             M 
                                             + 
                                           
                                           | 
                                           
                                             / 
                                             3 
                                           
                                         
                                       
                                     
                                   
                                   
                                     | 
                                     
                                       h 
                                       M 
                                       + 
                                     
                                     ⁢ 
                                     
                                       | 
                                       3 
                                     
                                     ⁢ 
                                     
                                       + 
                                       
                                         γ 
                                         2 
                                       
                                     
                                   
                                 
                               
                             
                             ] 
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     16 
                   
                   ] 
                 
               
             
           
         
       
     
     where h M   +  is the m th  component of {right arrow over (H)} ij   + . γ 1  and γ 2  are set to 2.8 and 1 in the present embodiment. 
     To determine {right arrow over (σ)} − =[σ 1   − , . . . , σ M   − ] T  the element-wise average of the discrepancy vectors over the local regions LROI of components    i  and    j  is measured: 
       {right arrow over (σ)} i   − =Σ n=1   r (   d     is     n   ( {right arrow over (H)}   is     n     − ) 0.2 ),  [Equation 17]
 
       {right arrow over (σ)} j   − =Σ n=1   r (   d     jt     n   ( {right arrow over (H)}   jt     n     − ) 0.2 ),  [Equation 18]
 
     where {right arrow over (H)} is     n     − =g −  ({right arrow over (H)} is     n     + ) and {right arrow over (H)} jt     n     − =g −  ({right arrow over (H)} jt     n     + ), and {right arrow over (σ)} −  is estimated as: 
       {right arrow over (σ)} − =½({right arrow over (σ)} i   − +{right arrow over (σ)} j   − ).  [Equation 19]
 
     Embodiments of this disclosure itself however clearly follow a general formulation where the likelihood densities λ ij   ±  can be modelled using any distributions where appropriate. The estimation of the parameters of the respective likelihood densities can be implemented in different manners which may or may not exploit features of sets of connected components which could be related to the connected components    i  and    j . 
     The proximity and regularity (e.g. symmetry) attributes of text homogeneity can be modelled when formulating the prior: 
         P ( s   ij   + )= P   ij   d   ·P   ij   a ,  [Equation 20]
 
     where P ij   d  and P ij   a  represent the characterization of the text homogeneity prior using the distance between and the alignment of the two connected components    i  and    j  respectively. 
     Considering the distance cue, two letters or words are expected to be placed neither too close nor too far from each other. The normalized distance d ij ′ between two components can be mapped to the distance prior P ij   d  by using a bi-model Gaussian kernel: 
     
       
         
           
             
               
                 
                   
                     
                       P 
                       ij 
                       d 
                     
                     = 
                     
                       
                         
                           1 
                           c 
                         
                         ⁢ 
                         
                           e 
                           
                             - 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       d 
                                       
                                         ij 
                                         ′ 
                                       
                                     
                                     - 
                                     
                                       μ 
                                       1 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                               
                                 2 
                                 ⁢ 
                                 
                                   σ 
                                   d 
                                   2 
                                 
                               
                             
                           
                         
                       
                       + 
                       
                         
                           1 
                           c 
                         
                         ⁢ 
                         
                           e 
                           
                             - 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       d 
                                       
                                         ij 
                                         ′ 
                                       
                                     
                                     - 
                                     
                                       μ 
                                       2 
                                     
                                   
                                   ) 
                                 
                                 2 
                               
                               
                                 2 
                                 ⁢ 
                                 
                                   σ 
                                   d 
                                   2 
                                 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     21 
                   
                   ] 
                 
               
             
           
         
       
     
     where c is a normalization factor and d ij ′ denotes the dimensional distance normalized with respect to the size of    i : 
     
       
         
           
             
               
                 
                   
                     
                       d 
                       ij 
                     
                     ′ 
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             
                               
                                 ( 
                                 
                                   
                                     x 
                                     i 
                                   
                                   - 
                                   
                                     x 
                                     j 
                                   
                                 
                                 ) 
                               
                               / 
                               
                                 
                                   A 
                                   i 
                                 
                               
                             
                             , 
                           
                         
                         
                           
                             
                               
                                 if 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   j 
                                 
                               
                               ∈ 
                               
                                 ℂℂ 
                                 HIN 
                                 i 
                               
                             
                             ; 
                           
                         
                       
                       
                         
                           
                             
                               
                                 ( 
                                 
                                   
                                     y 
                                     i 
                                   
                                   - 
                                   
                                     y 
                                     j 
                                   
                                 
                                 ) 
                               
                               / 
                               
                                 
                                   A 
                                   i 
                                 
                               
                             
                             , 
                           
                         
                         
                           
                             
                               if 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 j 
                               
                             
                             ∈ 
                             
                               
                                 ℂℂ 
                                 VIN 
                               
                               . 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     22 
                   
                   ] 
                 
               
             
           
         
       
     
     On the other hand, the alignment between components    i  and    j  can be measured 
     
       
         
           
             
               ali 
               ij 
             
             = 
             
               ( 
               
                 
                   
                     
                       
                         
                           ( 
                           
                             
                               y 
                               i 
                             
                             - 
                             
                               y 
                               j 
                             
                           
                           ) 
                         
                         / 
                         
                           h 
                           i 
                         
                       
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             j 
                           
                         
                         ∈ 
                         
                           ℂℂ 
                           HIN 
                           i 
                         
                       
                       ; 
                     
                   
                 
                 
                   
                     
                       
                         
                           ( 
                           
                             
                               x 
                               i 
                             
                             - 
                             
                               x 
                               j 
                             
                           
                           ) 
                         
                         / 
                         
                           w 
                           i 
                         
                       
                       , 
                     
                   
                   
                     
                       
                         
                           if 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           
                             j 
                           
                         
                         ∈ 
                         
                           ℂℂ 
                           VIN 
                           i 
                         
                       
                       ; 
                     
                   
                 
               
             
           
         
       
     
     and P ij   a  can be determined as: 
     
       
         
           
             
               
                 
                   
                     P 
                     ij 
                     a 
                   
                   = 
                   
                     e 
                     
                       - 
                       
                         
                           ali 
                           
                             i 
                             ⁢ 
                             j 
                           
                           2 
                         
                         
                           2 
                           ⁢ 
                           
                             σ 
                             a 
                             2 
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     23 
                   
                   ] 
                 
               
             
           
         
       
     
     In the present embodiment, the parameters can be set according to Table 1 shown below. 
     
       
         
           
               
             
               
                 TABLE 1 
               
             
            
               
                   
               
               
                 Prior model parameter 
               
            
           
           
               
               
               
            
               
                   
                   
                 Text Line Direction 
               
            
           
           
               
               
               
               
            
               
                   
                 Spatial Relations 
                 Horizontal (dir i  = 0) 
                 Vertical (dir i  = 1) 
               
               
                   
                   
               
               
                   
                 *   j  ∈    HIN   i   
                 μ 1  = −1, μ 2  = 1, 
                 μ 1  = −2.2, μ 2  = 2.2, 
               
               
                   
                   
                 σ d  = 0.51, σ a  = 0.51 
                 σ d  = 0.51, σ a  = N.A. 
               
               
                   
                 *   j  ∈    VIN   i   
                 μ 1  = −2.5, μ 2  = 2.5, 
                 μ 1  = −1, μ 2  = 1, 
               
               
                   
                   
                 σ d  = 0.51, σ a  = N.A. 
                 σ d  = 0.51, σ a  = 0.51 
               
               
                   
                   
               
            
           
         
       
     
     When evaluating the local text homogeneity of a given connected component    i , the alignment prior can be neglected (denoted as N.A. in Table 1) if a further connected component    j  is neighboring the given connected component    i  in the direction perpendicular to the text line direction of    i . 
     Embodiments of this disclosure itself however clearly follow a general formulation where the Prior could be implemented in either cue-dependent (P(s ij   ± |c k )) or cue-independent (P(s ij   ± )) manner. Different models with different features of    i  and    j , can be used when formulating the prior. In case of the particular formulation provided in Equation 20 to Equation 23, model parameters provided in Table 1 can be adjusted to adapt to various circumstances. 
     The morphological cue during integration as shown in Table 2 below can be given priority. 
     
       
         
           
               
             
               
                 TABLE 2 
               
             
            
               
                   
               
               
                 Cue Integration 
               
            
           
           
               
               
               
               
            
               
                   
                   
                 Feature 
                 P(c k  | {right arrow over (H)} i , {right arrow over (H)} j ) 
               
            
           
           
               
               
               
               
               
            
               
                   
                 Cue 
                 Vector 
                 Normality 
                 Abnormality 
               
               
                   
                   
               
               
                   
                 c 1   
                 {right arrow over (f)} mor   
                 0.5 
                 0.6 
               
               
                   
                 c 2   
                 {right arrow over (f)} ct   
                 0.2 
                 0.1 
               
               
                   
                 c 3   
                 {right arrow over (f)} pd   
                 0.3 
                 0.3 
               
               
                   
                   
               
            
           
         
       
     
     The values presented in Table 2 can be adapted depending on the circumstances. Preferably, two different cue integration schemes are used based on the assertion of morphological normality, which is measured by comparing the sizes of the two connected components. The normality scheme can be used when no one of the two neighboring connected components CCs is more than two times larger (in terms of their bounding box areas) than the other one. 
     The probabilistic local text homogeneity PLTH values of the non-text components of a document image are generally lower than that of the text components, therefore a text and non-text classification scheme can be obtained by thresholding the probabilistic local text homogeneity PLTH map of a document image. 
     The segmentation of a document can be done advantageously in the following way: 
     Based on the probabilistic local text homogeneity PLTH map of a document image, text and non-text components are classified by applying a threshold: 
           T ={   i |PLTH i &gt;β},
 
           NT ={   i |PLTH i ≤β}.
 
     Text layouts and non-text structures are subsequently extracted from    T  and    NT  respectively. 
       FIG. 4  represents a flowchart describing one way to carry out the aspects of present disclosure, where all the connected components CC are extracted from the binarized document in Step  100 . Then, for each connected component CC extracted, it is discriminated whether the connected component is a regular component in Step  120  based on the determination of the probabilistic local text homogeneity PLTH in Step  110 . 
       FIG. 5  represents a flowchart describing a further embodiment of the present disclosure, where the text block grow process is described. The connected components CC with the highest homogeneity value are selected as seeds for forming initial text components in Step  200 . Step  210  relates to the text line grow iterations, wherein a further connected component candidate is added to a text line if a text line parameter representing the level of homogeneity of the text line combined with the further connected component is asserted. Finally, a text block is assembled via grow text line iterations with top-down supervision in Step  220 . The segmented document obtained by this process can be subsequently used for an optical character recognition (OCR) process. A properly segmented document allows a better OCR process in terms of quality and processing speed. 
     Step  230  relates to the text paragraph extraction process, where detailed paragraph information is retrieved based on the within-block analysis of the geometric locations of the text lines contained in the same text block. 
     Text components with higher probabilistic local text homogeneity PLTH values are identified as text line seeds and are given priorities to be grown into text lines (Step  200 ). The text homogeneity is defined on the text line layer by introducing a binary random variable l ij : 
     
       
         
           
             
               
                 
                   
                     l 
                     ij 
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             
                               l 
                               ij 
                               + 
                             
                             , 
                           
                         
                       
                       
                         
                           
                             
                               l 
                               ij 
                               - 
                             
                             ; 
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     24 
                   
                   ] 
                 
               
             
           
         
       
     
     where P(l ij =l ij   + ) represents the possibility that text homogeneity is upheld within text line    i   TL  after the inclusion of a new component    j  ∈   T  (   i   TL  is used to denote the set of components contained in the text line grown from seed    i ∈   T ), and is computed as: 
     
       
         
           
             
               
                 
                   
                     P 
                     ⁡ 
                     
                       ( 
                       
                         
                           l 
                           ij 
                         
                         = 
                         
                           l 
                           ij 
                           + 
                         
                       
                       ) 
                     
                   
                   = 
                   
                     ( 
                     
                       
                         
                           
                             1 
                             , 
                           
                         
                         
                           
                             
                               assertion 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               of 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               
                                 hom 
                                 TL 
                               
                             
                             ; 
                           
                         
                       
                       
                         
                           
                             0 
                             , 
                           
                         
                         
                           
                             otherwise 
                             ; 
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
     where hom TL  is defined as (for horizontal text line): 
     
       
         
           
             
               
                 
                   
                     h 
                     ⁢ 
                     o 
                     ⁢ 
                     
                       m 
                       
                         T 
                         ⁢ 
                         L 
                       
                     
                   
                   = 
                   
                     
                       
                         
                           min 
                           ⁡ 
                           
                             ( 
                             
                               
                                 h 
                                 i 
                               
                               , 
                               
                                 h 
                                 j 
                               
                             
                             ) 
                           
                         
                         
                           max 
                           ⁡ 
                           
                             ( 
                             
                               
                                 h 
                                 i 
                               
                               , 
                               
                                 h 
                                 j 
                               
                             
                             ) 
                           
                         
                       
                       &gt; 
                       
                         
                           C 
                           
                             T 
                             ⁢ 
                             
                               L 
                               1 
                             
                           
                         
                         ⋀ 
                         
                           
                             min 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   w 
                                   i 
                                 
                                 , 
                                 
                                   w 
                                   j 
                                 
                               
                               ) 
                             
                           
                           
                             max 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   w 
                                   i 
                                 
                                 , 
                                 
                                   w 
                                   j 
                                 
                               
                               ) 
                             
                           
                         
                       
                       &gt; 
                       
                         
                           C 
                           
                             T 
                             ⁢ 
                             
                               L 
                               2 
                             
                           
                         
                         ⋀ 
                         
                           
                             
                               min 
                               ⁡ 
                               
                                 ( 
                                 
                                   
                                     y 
                                     i 
                                     r 
                                   
                                   , 
                                   
                                     y 
                                     j 
                                     r 
                                   
                                 
                                 ) 
                               
                             
                             - 
                             
                               max 
                               ( 
                               
                                 
                                   y 
                                   i 
                                   1 
                                 
                                 , 
                                 
                                   y 
                                   
                                     j 
                                     ) 
                                   
                                   1 
                                 
                               
                             
                           
                           
                             min 
                             ⁡ 
                             
                               ( 
                               
                                 
                                   h 
                                   i 
                                 
                                 , 
                                 
                                   h 
                                   j 
                                 
                               
                               ) 
                             
                           
                         
                       
                       &gt; 
                     
                     = 
                     
                       
                         
                           C 
                           
                             T 
                             ⁢ 
                             
                               L 
                               3 
                             
                           
                         
                         ⋀ 
                         
                           
                             w 
                             ⁢ 
                             s 
                           
                           j 
                         
                       
                       &lt; 
                       
                         
                           C 
                           
                             T 
                             ⁢ 
                             
                               L 
                               4 
                             
                           
                         
                         · 
                         
                           
                             
                               A 
                               i 
                             
                           
                           . 
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   
                     Equation 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     25 
                   
                   ] 
                 
               
             
           
         
       
     
     ws j  is used to denote the whitespace between the text line candidate    i  and the relatable boundary of the current text line grown from    i . Four parameters are used to characterize text line homogeneity in terms of height (by C TL     1   ) and width (by C TL     2   ) similarity, text line regularity (e.g. symmetry) (by C TL     3   ) and proximity (by C TL     4   ). 
     Equation 25 in general promotes a bottom-up analysis of the candidate components. To prevent the false extension of a text line across different text blocks, a top-down supervision is incorporated on the text line growing process. Given an alerting whitespace ws j  measured between text line candidate    j  and current text line boundary, the projection profile of a local region stretched across multiple text lines around text line candidate    j  is inspected. The presence of zero runs in the projection profile triggers the termination of the text line extension. A refinement process is also foreseen after the initial text line extraction to remove negative text lines consisting of fragmentary noise from a neighboring connected component CCs, and to recover irregular characters (e.g. dots) removed during the probabilistic local text homogeneity PLTH filtering. 
     Text blocks are extracted based on the exploitation of text homogeneity on text block layer using an approach similar to the method proposed in K. Chen, F. Yin and C. -L. Liu, “Hybrid Page Segmentation with Efficient Whitespace Rectangles Extraction and Grouping,” in Proc. 12th Int. Conf. Doc. Anal. Recog., 2013, pp. 958-962. This known approach is enhanced by incorporating a similar projection profile analysis based top-down supervision to prevent the merging of horizontally neighboring (especially nested) text blocks. Upon the extraction and refinement of the text blocks, paragraphs are identified through a within text block segmentation based on the analysis of relative locations of the text lines within the block. 
     A seed-grow-extraction (SGE) solution to extract different types of structures from image I NT  which contains only non-text connected components    i ∈   NT . When extracting a certain type of structure (e.g separators), seeding is advantageously the initial step taken to process image I NT  such that regions of the target structures are located while that of the non-target structures are erased to produce an target image I tar   NT  which contains only eroded target structures. Then, the second step to grow target regions by dilating and merging the components area of the target image I tar   NT , takes place. The final structures are extracted from the grown target image I tar   NT . 
     The proposed SGE process is implemented using mathematical morphology and separators are first extracted. Specifically for vertical (and likewise horizontal) separator extraction, non-text image is first filtered with a horizontal line structuring element se HL : 
         I′=I   nt ∧(¬(( I   nt   ∘se   HL )⊕ se   sQ )),
 
     where I nt  denotes a copy of the image I NT  and se sQ  is a square element with short sides. Line seeds are then located by opening the filtered image I′ using a vertical line structuring element se vL : 
         I   VL   nt =( I′∘se   VL )· se   sQ .
 
     The length of structuring element se vL  and se HL  is set to the average text line height computed from the height of the bounding boxes of all text lines extracted from the image. After the seeding process, the lines are grown by first extending the bounding boxes of the line seeds in both horizontal and vertical directions and then merging all line seeds in the same box that are horizontally aligned with each other. The margin of the extension is proportional to the width and height of the bounding boxes of the line seeds. 
     After the extraction of separators, remaining non-text components are heuristically classified into images, graphics, charts and ‘reverse-video’ text. Similar processes that all follow the SGE paradigm are performed to extract those regions. 
     In particular cases, the local region of interest LROI can comprise only one connected component    i  where this connected component    i  does not have any adjacent (in horizontal or vertical directions) neighbour(s). In this case, the local region of interest LROI can be defined as an empty local region of interest LROI. Similarly, a non-empty LROI can be defined as a local region of interest LROI of a given connected component    i , comprising the given connected component    i  and at least one connected component CCs (e.g. neighbour(s) in horizontal or vertical directions) adjacent to the given connected component    i . If a connected component    i  does not have any adjacent (in horizontal or vertical directions) neighbour(s), the homogeneity level value, preferably the probabilistic local text homogeneity PLTH value of this connected component    i  can be selected to be a predefined value, preferably zero. In such case, this component    i  is considered as a non-regular component, preferably a non-text component, more preferably a non-text character. 
     Advantageously, the document segmentation method based on homogeneity probability (DSHP) described above can be combined with a complementary method for recognizing a binarized document. Preferably, the complementary method is a keyword spotting method, a figure extraction method, a text searching method, or any methods that extract information-of-interest based on the comprehension of the layout of a document image. Even though, the document segmentation with a probabilistic homogeneity approach (DSPH), according to the present disclosure, is recognized as outperforming (ICDAR2019 Competition on Recognition of Documents with Complex Layouts—RDCL2019) other segmentation methods (see table below), a combination of the DSPH method with one of the methods of the table, or any common techniques for document segmentation and layout analysis, or any combination thereof can be foreseen to compensate any possible weaknesses of one of the methods or techniques used. It has been shown that a combination of the method DSPH and some common document processing techniques, such as projection profile analysis, shows a surprising improvement in the discrimination accuracy of text and non-text region, in particular for the recognition of table. 
     The following table contains a list of document segmentation methods. These methods form the state of the art: 
     
       
         
           
               
             
               
                 TABLE 3 
               
               
                   
               
               
                 State of the art document segmentation methods 
               
               
                   
               
             
            
               
                   
               
            
           
           
               
               
            
               
                 BINYAS 
                 a document segmentation method mainly based on 
               
               
                   
                 connected component analysis and morphology 
               
               
                 BKZA 
                 a document segmentation method using deep learning to 
               
               
                   
                 segment page and heuristic algorithms forpost-processing 
               
               
                 JBM 
                 a document segmentation method using following steps:  
               
               
                   
                 obtaining segmentation maps from a convolutional neural 
               
               
                   
                 network (CNN), post-processing based on polygons,  
               
               
                   
                 OCR (CNN-based) 
               
               
                 LingDIAR 
                 a document segmentation method based on a multi-task 
               
               
                   
                 deep network model trained with synthetic document  
               
               
                   
                 images 
               
               
                 MHS 
                 a document segmentation method based on following steps: 
               
               
                   
                 negative/positive image detection, binarization, text/non- 
               
               
                   
                 text classification, text segmentation, image classification, 
               
               
                   
                 region refinement + labelling, OCR 
               
               
                 MICS 
                 A method similar to Pyramid Scene Parsing Network in  
               
               
                   
                 combination with training on augmented data and final 
               
               
                   
                 inference/post-processing steps 
               
               
                 TAQ 
                 a document segmentation method based on following steps: 
               
               
                   
                 text/non-text classification, text region improvements/ 
               
               
                   
                 smoothing, non-text classification. 
               
               
                 ZLCW 
                 a document segmentation method using FCN(fully 
               
               
                   
                 convolutional networks) trained with 15 original training 
               
               
                   
                 images, augmented to 3960 images (using cropping,  
               
               
                   
                 gaussian blur, adding random noise as well as colour  
               
               
                   
                 jittering). FRE11 ABBYY FineReader ™ Engine 11 with 
               
               
                   
                 PRImA ™ FineReader-to-PAGE wrapper. FRE12 ABBYY 
               
               
                   
                 FineReader ™ Engine 12 with PRImA ™ FineReader-to- 
               
               
                   
                 PAGE wrapper. Tess.4 Tesseract ™ 4 with PRImA ™  
               
               
                   
                 Tesseract-to-PAGE wrapper 
               
               
                 LIPADE 
                 a method for complex layout extraction based on features 
               
               
                   
                 of higher level than pixels obtained from a document  
               
               
                   
                 straight line based covering catching some information on 
               
               
                   
                 the dimensions and directions of the objects contained in 
               
               
                   
                 the binarized document image. 
               
               
                 CVML 
                 a method first extracts text lines in images, and estimates 
               
               
                   
                 paragraph structures using the detected text lines. Then, 
               
               
                   
                 other regions (e.g. separators, pictures) are extracted in  
               
               
                   
                 non-text regions. 
               
               
                 AOSM 
                 a hybrid page segmentation method combined top-down  
               
               
                   
                 and bottom-up approaches. It firstly over-segments page 
               
               
                   
                 image using a set of white-spaces covering the whole  
               
               
                   
                 document background. It then groups over-segmented  
               
               
                   
                 text regions using adaptive parameters. Finally, local  
               
               
                   
                 context analysis sub-divides (under-segmented) text 
               
               
                   
                 regions into paragraphs. 
               
               
                 JU_Aegean 
                 starting point is a combination of pre-processing steps, 
               
               
                   
                 including conversion to greyscale, contrast stretching,  
               
               
                   
                 region filling, and binarisation before connected  
               
               
                   
                 components are analysed to eliminate separators and 
               
               
                   
                 margins. The resulting image is segmented into 
               
               
                   
                 horizontal segments based on sufficiently thick horizontal 
               
               
                   
                 white space. A further step produces an image I large    
               
               
                   
                 without small components by applying a morphological 
               
               
                   
                 closing operation with a dynamically chosen structuring 
               
               
                   
                 element to each horizontal segment. Based on this and 
               
               
                   
                 the binarized image, a corresponding image I small    
               
               
                   
                 containing only small components is obtained. The  
               
               
                   
                 segmentation is then performed by exploiting I large  and 
               
               
                   
                 I small . 
               
               
                   
               
            
           
         
       
     
     This disclosure can be implemented in any programmable platforms/devices/machines where appropriate, such as a computer, a FPGA platform, a DSP platform, a mobile device such as a smart phone or a tablet 
     In general, the various exemplary embodiments may be implemented in hardware or special purpose circuits, software, logic or any combination thereof. For example, some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software which may be executed by a controller, microprocessor or other computing device, although the present disclosure is not limited thereto. While various aspects of the exemplary embodiments of this disclosure may be illustrated and described as block diagrams, flow charts, or using some other pictorial representation, it is well understood that these blocks, apparatus, systems, techniques or methods described herein may be implemented in, as non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing devices, or some combination thereof. 
     Embodiments as discussed above are defined by the following numbered clauses: 
     1. Computer implemented method for segmenting a binarized document comprising the steps of:
         extracting a plurality of connected components from the binarized document;   discriminating for at least one of the connected components whether said connected component is a regular component, preferably a text component, more preferably a text character based on a homogeneity level value, wherein the homogeneity level value is representative of the level of homogeneity within the local region of said connected component, wherein the local region comprises said connected component and at least one connected component adjacent to said connected component, wherein the homogeneity level value is based on at least one value representative of at least one image characteristic parameter determined for said connected component and on at least one value representative of the at least one image characteristic parameter determined for the at least one connected component adjacent to said connected component.       

     2. Method according to clause 1, characterized in that the homogeneity level value for the at least one of the connected components is based on a comparison between the at least one value representative of the at least one image characteristic parameter determined for said connected component and on the at least one value representative of the at least one image characteristic parameter determined for the at least one connected component adjacent to said connected component. 
     3. Method according to clause 1 or 2, characterized in that the at least one image characteristic parameter for a given connected component comprises at least one morphological feature determined for the given component. 
     4. Method according to clause 3, characterized in that the at least one morphological feature determined for the given connected component is at least one coordinate of the smallest rectangle containing the region spanned by said component, an aspect ratio of said rectangle, an area of said rectangle, an extent of the binary image of said component, the Euler number of said component, a parameter related to the set of connected components vertically neighboring said component, a parameter related to the set of connected components horizontally neighboring said component, a direction of said component, or any combination thereof. 
     5. Method according to any preceding clause, characterized in that the at least one image characteristic parameter for a given connected component comprises at least one texture feature determined for the given connected component. 
     6. Method according to clause 5, characterized in that the at least one texture feature determined for the given connected component is based on a grey-level co-occurrence matrix determined for the given connected component. 
     7. Method according to clause 6, characterized in that the at least one texture feature determined for the given connected component is computed from a grey-level co-occurrence matrix determined using a region comprising the given connected component and one or more neighboring connected components of the given connected component. 
     8. Method according to clause 6, characterized in that the at least one texture feature determined for the given connected component is computed from a grey-level co-occurrence matrix determined using a region comprising periodic duplications of the given connected component. 
     9. Method according to any preceding clause, characterized in that the homogeneity level value is a likelihood that a connected component is a regular component, preferably a text component, more preferably a text character. 
     10. Method according to any preceding clause, characterized in that the homogeneity level value is a probabilistic description of the homogeneity pattern displayed in a region comprising a connected component and a set of neighboring connected components related to the component. 
     11. Method according to clause 10, characterized in that the homogeneity level value is evaluated based on a probabilistic cue integration of the at least one image characteristic parameter determined for the at least one of the connected components and the at least one image characteristic parameter determined for the at least one connected component adjacent to the at least one of the connected components. 
     12. Method according to clause 11, characterized in that the probabilistic cue integration is based on least one prior probability characterizing the cue probability based on the at least one image characteristic parameter determined for the at least one of the connected components and the at least one image characteristic parameter determined for the at least one connected component adjacent to the at least one of the connected components. 
     13. Method according to clause 11, characterized in that the probabilistic cue integration is based on least one cue-specific distribution characterizing the cue-specific probabilistic homogeneity based on the at least one image characteristic parameter determined for the at least one of the connected components and the at least one image characteristic parameter determined for the at least one connected component adjacent to the at least one of the connected components. 
     14. Method according to clause 13, characterized in that the at least one cue-specific probabilistic homogeneity is characterized using the Bayesian rule based on the at least one likelihood of observing the at least one image characteristic parameter from the at least one of the connected components and the at least one image characteristic parameter from the at least one connected component adjacent to the at least one of the connected components conditioned on the homogeneity status of the two components. 
     15. Method according to clause 13, characterized in that the at least one cue-specific probabilistic homogeneity is characterized using the Bayesian rule based on the at least one cue-specific prior probability of the homogeneity between the at least one image characteristic parameter from the at least one of the connected components and the at least one image characteristic parameter from the at least one connected component adjacent to the at least one of the connected components. 
     16. Method according to any preceding clause, characterized in that a given connected component is discriminated to be a regular component, preferably a text component, more preferably a text character, when the homogeneity level value of the given connected component is higher than a predefined threshold. 
     17. Method according to any preceding clause, characterized in that a given connected component is discriminated to be a non-regular component, preferably a non-text component, more preferably a non-text character, when the homogeneity level value of the given connected component is below than or equal to the predefined threshold. 
     18. Method according to any preceding clause, characterized in that an adjacent connected component to a given connected component, is at least a direct vertical neighbor, a direct horizontal neighbor, a secondary horizontal neighbor, or a secondary vertical neighbor. 
     19. Method according to any preceding clause, characterized in that all the connected components are extracted from the binarized document and then for each connected component extracted, it is discriminated whether said connected component is a regular component, preferably a text component, more preferably a text character. 
     20. Method according to any preceding clause, characterized in that at least one connected component which is determined as a text component and has the highest homogeneity value among all text components that are yet to be grown into text lines is selected as a seed for forming an initial text structure, preferably a text line. 
     21. Method according to clause 20, characterized in that during a text line grow iteration, a test determining whether a further connected component is to be added to the text line or not, is performed, said test being based on the comparison of at least one text line parameter representing the level of homogeneity of the text line combined with the further connected component and a given threshold. 
     22. Method according to clause 21, characterized in that a text block is assembled via grow text line iterations with top-down supervision. 
     23. Method according to clause 22, characterized in that a text paragraph is extracted by segmenting a text block based on the analysis of geometric location of the text lines within the text block. 
     24. Method according to any preceding clause, characterized in that a non-text region is extracted via a seed-grow-extraction process. 
     25. Method according to any preceding clauses, characterized in that the or a text line which has yet to be grown into a text block is selected as a seed for forming an intermediate text structure, preferably a column or a row of a table, using at least one text line parameter and a given threshold. 
     26. Method according to the preceding clause, characterized in that during an intermediate text structure grow iteration, a test determining whether a further text line is to be added to the intermediate text structure or not, is performed, said test being based on the comparison of at least one intermediate text structure parameter representing the level of homogeneity of the intermediate text structure combined with the further text line and a given threshold. 
     27. Method according to the preceding clause, characterized in that the intermediate text structure which has yet to be grown into a complex text structure is selected as a seed for forming a complex text structure using at least one parameter of the intermediate text structure and a given threshold. 
     28. Method according to the preceding clause, characterized in that during a complex text structure grow iteration, a test determining whether a further intermediate text structure is to be added to the complex text structure or not, is performed, said test being based on the comparison of at least one complex text structure parameter representing the level of homogeneity of the complex text structure combined with the further intermediate text structure and a given threshold. 
     29. Method according to clause 27 or 28, characterized in that the complex structure is a table. 
     30. Method according to any preceding clauses, characterized in that at least one non-text component which has yet to be grown into a non-text region is selected as a template for forming a or the complex text structure using at least one image characteristic parameter of the non-text component. 
     31. Method according to the preceding clause, characterized in that the complex text structure being a table, a form, a chart, or a diagram. 
     32. Method according to any preceding clauses, characterized in that at least one further text structure, preferably a text line or text block, which is contained in, or adjacent to, a region comprising the at least one template, is selected as a template-filling for forming a or the complex text structure. 
     33. Method according to any preceding clauses, characterized in that during the or a complex text structure grow iteration, a test determining whether a further template is to be added to the or a complex text structure or not, is performed, said test being based on the comparison of the at least one or at least one complex text structure parameter representing the level of homogeneity of the complex text structure combined with the further template and a given threshold. 
     34. Method according to any preceding clauses, characterized in that during the or a complex text structure grow iteration, a test determining whether a further template-filling is to be added to the or a complex text structure or not, is performed, said test being based on the comparison of the at least one or at least one complex text structure parameter representing the level of homogeneity of the complex text structure combined with the further template-filling and a given threshold. 
     35. Method for OCRing a binarized document, characterized in that it comprises the steps of segmenting the binarized document according to any preceding clause 1-34. 
     36. A data processing apparatus comprising means for carrying out the steps of the method according to any of the clauses 1-35. 
     37. A computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out the steps of the method according to any of the clauses 1-35. 
     38. A computer-readable medium comprising instructions which, when executed by a computer, cause the computer to carry out the steps of the method according to any of the clauses 1-35.