A comparison inequality function based method and apparatus for accelerated OCR correlation

Abstract: A general method of accelerating the classification of an unclassified input symbol S into a library of pre-classified templates employs a comparison inequality function. The correlation calculation is initiated between the input symbol S and templates retrieved from the library of templates. Templates with a low degree of correlation are excluded prior to completion of the correlation calculation to accelerate the correlation. Sorting by template intensity permits the template foreground pixels to be correlated first, which also accelerates the correlation calculation. A second sort by discrimination power permits critical conflict pixels to be correlated first for further accelerating the correlation calculation.

Description: This invention relates to the OCR classification of input symbols, and more particularly to a method and apparatus based on comparison inequality function which employs an exclusion threshold for accelerating the correlation calculations, "OCR" stands for Optical Character Recognition. BACKGROUND Heretofore, comparison functions have been employed to classify input symbol bit maps against a library of character template bit maps. The summation of all of the pixel comparisons in each of the input/template correlations produced correlation values which revealed the closest match. However, these prior correlation techniques did not employ a comparison inequality function and underlying "Exclusion Inequality Principle" for excluding low correlation templates in order to accelerate the classification process. Nor did these prior art techniques employ pixel intensity sorting and pixel discrimination sorting. European application EP-A-0586217 teaches the use of a comparison function to enhance a library of character templates with respect to a particular font or variation range of the input symbols. European application EP-A-0608148 teaches enhancement of library character templates with a provision for template sub-classes to accommodate multiple representations of each input symbol. European application EP-A-0625764 teaches the use of the "Triangle of Inequality Principle" in order to exclude distant templates and accelerate the classification process. It is known from US-A-4,975,974 to provide a comparison of an input pattern with dictionary patterns in which data strings representing the patterns are compared and mismatch signals generated for each mismatch occurrence. The mismatch signals are summed to provide mismatch distances in respect of each dictionary pattern as a basis for comparison. The time taken for calculation is reduced by interruption of the summing process when the sum exceeds a threshold. According to the present invention there is disclosed a method of and an apparatus for performing symbol classification for use in optical character recognition as set out in claims 1 and 37. The method according to the invention comprising the steps of; providing an input symbol S in the form of an input vector defining an unclassified character having "q" elements ( S = s 1 , s 2 , s 3 , ... s k ... s j ... s q ); providing a library of T templates (T 1 , T 2 , T 3 , ... T i ... T T ) which are retrievable for correlation with the input vector, each template being in the form of a template vector respectively defining a pre-classified character having "q" elements ( T i = t 1 , t 2 , t 3 , ... t k , ... t j ... t q ) and forming "q" pairs of corresponding elements with the "q" elements of the input vector; correlating the input vector with the template vectors by an element by element correlation calculation (s, t i ) which executes an element calculation cycle for successive pairs of corresponding elements of the input vector and each retrieved template vector to yield a respective element term for each pair of corresponding elements; summing the element terms from previous calculation cycles of the correlation calculation (s,t i ) to yield a cumulative bound after "k" calculation cycles and to yield a final bound after the completion of "q" calculation cycles; determining an exclusion threshold for excluding the retrieved template if the cumulative bound crosses the exclusion threshold and non-excluding the retrieved template if the cumulative bound does not cross the exclusion threshold; retrieving an initial template from the library of templates; initiating the element by element correlation calculation (s,t i ) for the "q" pairs of corresponding elements to yield the cumulative bound; excluding the retrieved template if the cumulative bound crosses the exclusion threshold; repeating the correlation calculation and excluding steps until the retrieved template has been excluded or until the correlation calculation (s,t i ) for the retrieved template has proceeded to completion to yield the final bound; saving non-excluded retrieved templates; retrieving a next template from the library of templates; repeating the correlation calculation and excluding and saving and retrieving steps until all of the template vectors have been correlated with the input vector; and classifying the unclassified input symbol against the non-excluded pre-classified templates on the basis of the numerical values of the final bound yielded by the correlation calculations; characterised in that the correlations and summing steps are provided by computing the cumulative bound to be the value of a comparison inequality function (CIF) comprising a) a monotonically increasing Leading Partial Correlation sum representing the cumulative sum of the first k element terms; and b) a monotonically decreasing Residual Intensity sum representing the image intensity data remaining after the kth calculation cycle. Other aspects of the present invention are disclosed in accordance with the appended claims. A preferred embodiment of this invention provides a comparison inequality function (CIF) based method for accelerated OCR vector classification with accelerated correlation calculations for classifying an unclassified input symbol into a library of pre-classified character templates. The correlation calculation is accelerated by employing an "Exclusion Inequality Principle". Further embodiments employ exclusion check points with further acceleration provided by intensity sorting. A further alternative embodiment provides such a CIF based method which is accelerated by discrimination power sorting. The preferred embodiment further provides such a CIF based method in which template data is pre-calculated and stored for immediate use in the correlation calculations. In one embodiment, there is disclosed a method of accelerating the classification of an unclassified input symbol S into a library of pre-classified templates. A correlation calculation is initiated between the input symbol S and templates retrieved from the library of templates. Templates with a low degree of correlation are excluded prior to completion of the correlation calculation. An input symbol S is provided in the form of an input vector defining an unclassified character having "q" elements ( S = s 1 , s 2 , s 3 , ... s k ... s j ... s q ). A library of T templates (T 1 , T 2 , T 3 , ... T i ... T T ) are provided which are retrieved for correlation with the input vector. Each template is in the form of a template vector defining a pre-classified character having "q" elements ( T i = t 1 , t 2 , t 3 , ... t k ... t j ... t q ) forming "q" pairs of corresponding elements with the "q" elements of the input vector. A comparison inequality function is provided for correlating the input vector with the template vectors, which defines an element by element correlation calculation (s,t i ). The comparison inequality function executes an element calculation cycle for each of the "q" pairs of corresponding elements of the input vector and each retrieved template vector to yield an element term for each pair of corresponding elements. The comparison inequality function sums the element terms from previous calculation cycles of the correlation calculation (s,t i ) to yield a cumulative bound after "k" calculation cycles and to yield a final bound after the completion of "q" calculation cycles. An exclusion threshold is determined for excluding the retrieved template if the cumulative bound crosses the exclusion threshold and non-excluding the retrieved template if the cumulative bound does not cross the exclusion threshold. An initial template is retrieved from the library of templates. The element by element correlation calculation (s,t i ) is initiated for the "q" pairs of corresponding elements to yield the cumulative bound. The retrieved template is excluded if the cumulative bound crosses the exclusion threshold. The correlation calculation and excluding steps are repeated until the retrieved template has been excluded or until the correlation calculation (s,t i ) for the retrieved template has proceeded to completion to yield the final bound. Non-excluded retrieved templates are saved. A next template is retrieved from the library of templates. The correlation-calculation and excluding and saving and retrieving steps are repeated until all of the template vectors have been correlated with the input vector. The unclassified input symbol is classified against the non-excluded pre-classified templates on the basis of the numerical values of the final bound yielded by the correlation calculations. BRIEF DESCRIPTION OF THE DRAWINGS FIGURE 1A shows a binary low resolution bit map diagram of an input symbol "E"; FIGURE 1B shows a binary low resolution bit map diagram of a template character "T"; FIGURE 1C is an element by element plot of the input "E" bit map correlated with the template "T" bit map showing the LPC sum and the TRI sum and the CIF; FIGURE 2 is a flow chart of the basic steps of the accelerated CIF based method; FIGURE 3A and 3B and 3C are similar in format to Figure 1A and 1B and 1C, and illustrate an intensity sorted embodiment for reducing the calculation cycles required to complete the E/T correlation calculation; FIGURE 4A and 4B and 4C are also similar in format to Figure 1A and 1B and 1C, and illustrate a double sorted embodiment; FIGURE 5 is an E/T correlation graph based on high resolution greyscale bit maps without sorting showing the LPC sum and the TRI sum and the CIF total; and FIGURE 6 is the E/T correlation graph of Figure 5 with intensity sorting for accelerating the correlation calculations. The first digit of each reference numeral in the above-figures indicates the figure in which that element is most prominently shown. The second digit indicates related structural elements, and the final letter indicates a sub-portion of an element. EXCLUSION INEQUALITY PRINCIPLE The accelerated classification of an unclassified input symbol into a library of pre-classified character templates, is based on an inequality principle developed from a suitable Comparison Function (CF) such as an equality Cauchy-Schwartz function. The Comparison Function provides an element by element correlation in which each element of the input symbol vector is combined with the corresponding element of the template vector to yield a correlation coefficient. The Cauchy-Schwartz (C-S) Equality Correlation Function (Symbol, ith Template) format for correlating an unclassified input symbol vector (S = s 1 , s 2 , s 3 , ... s k ... s j ... s q ) and the ith pre-classified template vector (T i = t 1 , t 2 , t 3 , ... t k ... t j ... t q ) is: CF(S,T 1 ) = (dot product sum) / (image intensity sum) The input vector is equivalent to the memory bit map of the input symbol, with each individual element representing the image intensity (the binary or greyscale contrast level) of an individual pixel within the bit map. Similarly, the elements of the template vector represent pixels in the character template bit map. The dot product sum (numerator of Equation 1) is the summation of all the individual (S,T 1 ) element calculations for corresponding pairs of elements from the first element pair (s 1 , t 1 ) to the last element pair (s q , t q ). In the Cauchy-Schwartz case this element calculation is a simple multiplication. The image intensity sum (denominator of Equation 1) in the Cauchy-Schwartz case involves the square of each s j and t j element. The unclassified input character S is classified as the template character having the highest correlation therewith. Without loss of generality, the input vector and the template vectors may be prescaled (normalized) to unit norm. In which case Equation 1 becomes: Normalized C-S Correlation Function (CF) = CF(S,T i norm ) = j =1 q s j t j The image intensity sum in the denominator of Equation 2 has been normalized to unity. The dot product sum in the numerator remains unchanged, except that the "s" and "t" elements now refer to a normalized "s" and "t" values. The input vector and the template vectors may be separated into a Leading Partial Vector (LPV) and a Tailing Partial Vector (TPV) by the kth element calculation: for any k between 1 and q. The Comparison Function is similarly separated into a Leading Partial Correlation (LPC) and a Tailing Partial Correlation (TPC) by the kth term as the correlation calculation proceeds: CF(S,T i ) = LPC + TPC CF(S,T i ) = j =1 k s j t j + j = k +1 q s j t j The leading partial correlation (LPC) of the first k elements is cumulative. That is, the LPC sum is updated after each element calculation cycle by summation of the current element calculation with the prior (k-1) LPC sum. The TPC containing the remaining k+1 elements is never calculated. Instead the TPC is replaced by a Residual Intensity sum (see equations 4, 5, and 6). The equality Comparison Function (CF) of Equation 3 becomes the Cauchy-Schwartz Comparison Inequality Function (CIF) of Equation 4 by replacing the TPC with a compound residual intensity sum formed by a Symbol Residual Intensity sum and a Template Residual Intensity sum. The Symbol Residual Intensity (SRI) sum is the image intensity data (or input symbol information) remaining in the TPC after the kth calculation cycle. The Template Residual Intensity (TRI) sum is the image intensity data (or template character information) remaining in the TPC after the kth calculation cycle. CIF(S,T i ) ≤ LPC + (SRI)(TRI) CIF(S,T i ) ≤ j =1 k s j t j + j = k +1 q s 2 j j = k +1 q t 2 j The compound residual intensity sum represents the maximum possible value of the TPC which theoretically would occur if all of the remaining k+1 elements of the input vector were to correlate perfectly with the remaining k+1 elements of the template vector. Because the Equation 4 inequality is based on the normalized Equation 2 equality, the residual sums SRI and TRI are necessarily less than unity. As the correlation calculation proceeds, LPC increases at a faster rate than (SRI)(TRI) decreases. Both the SRI sum and the TRI sum approach zero as "k" approaches "q", causing the inequality bound to become "tighter". At "k" equal "q", LPC becomes the complete correlation. The uncertainty introduced by the residual sums is self-removing. The Equation 4 inequality becomes an equality. The Comparison Inequality Function (CIF) of Equation 4 becomes a simpler SRI Comparison Inequality Function (CIF) by setting the TRI sum to unity: CIF(S,T i ) ≤ LPC + SRI CIF(S,T i ) ≤ j =1 k s j t j + j = k +1 q s 2 j The SRI inequality of Equation 5 has more uncertainty than the (SRI)(TRI) inequality of Equation 4. At " k = q ", LPC becomes the complete correlation and the SRI sum becomes zero. The Equation 5 inequality becomes an equality. The Comparison Inequality Function (CIF) of Equation 4 may also become a simpler TRI Comparison Inequality Function (CIF) by setting the SRI sum to unity: CIF(S,T i ) ≤ LPC + TRI CIF(S,T i ) ≤ j =1 k s j t j + j = k +1 q t 2 j The TRI inequality of Equation 6 also has more uncertainty than the (SRI)(TRI) inequality of Equation 4. At "k" equal "q", the TRI sum becomes zero, and the Equation 6 inequality becomes an equality. BINARY EMBODIMENT - UNSORTED (Figures 1A, 1B, 1C) The element by element correlation of input symbol "E" (see pixel bit map, Figure 1A) and template character "T" (see pixel bit map, Figure 1B) may be illustrated by a correlation graph 10 (see Figure 1C). Leading partial correlation sum LPC 12 (bold plot) of the TRI inequality (Eq-6) is cumulative and increases stepwise monotonically as the E/T correlation calculation (s,t i ) proceeds to completion. TRI sum 14 (medium plot) decreases stepwise monotonically, and comparison inequality function CIF 16 (light plot) decreases at a slower rate. CIF 16 defines an upper cumulative bound which becomes the final bound ( CIF = LPC ) as TRI 14 becomes zero. In order to minimize the number of elements and calculation cycles in the Figure 1 example, a simple binary, low resolution (10 rows by 7 columns) pixel matrix of symbol "E" and template "T" is presented. The inequality exclusion principle is applicable to higher resolution binary (and greyscale) embodiments which of course are more complex and require a great deal more data and computer memory. The corresponding pixel pairs of symbol "E" and template "T" are indicated by numbers 01 through 70 in the bit maps of Figures 1A and 1B. Only the numbers of landmark pixels have been included in the bit maps (and in the plots of correlation graph 10). Most landmark pixels indicate an intensity transition between background pixels (typically light or white) and foreground pixels (typically dark or black). Background pixels usually form the majority of the pixel population, and foreground pixels usually form the minority. Foreground pixels form the strokes of the input symbol and templates, as shown by the bold outline of "E" in Figure 1A and "T" in Figure 1B. In the Figure 1 low resolution embodiment, the pixels are considered in the ordinary raster scan order from the first pixel (number 01, upper lefthand corner) to the last pixel (number 70, lower righthand corner); and are sequentially accessed from the bit map memory. The effect of sorting the pixels based on binary light/dark (or on greyscale intensity) is discussed in the GREYSCALE EMBODIMENTS section. Double sorting is discussed in the DOUBLE TEMPLATE SORT section. The horizontal axis of Figure 1C is equivalent to time and increments to the right after the each calculation cycle (kth) to the next corresponding pixel pair (k+1), until completion ( k = q = 70 ). The correlation calculation (s, t 1 ) is effectively complete at k = 60 when TRI = 0 and LPC = CIF . The remaining pixels 61 through 70 are background pixels and do not contain useful data for the Cauchy-Schwartz TRI inequality embodiment (Eq-6). The vertical axis of Figure 1C shows the value of LPC 12 and TRI 14 and CIF 16 normalized between 0.00 and 1.00. TRI 14 starts at 1.00 (k = 0) and remains zero through the top margin (Rows 1 and 2) until pixel number 16 when template "T" changes from light background to dark foreground. LPC 12 starts at zero (k = 0) until pixel number 16 when both template "T" and symbol "E" change from light background to dark foreground. The binary embodiment given above presents four classes of conflict situations (shown in the Binary Conflict Table below) between input pixels (light or dark) and template pixels (light or dark). BINARY CONFLICT TABLE CLASS A (Absent Conflict) Input Light - Template Light (includes the light margin region around the perimeter of the bit map, Rows 1, 2, and 10, Columns 1 and 7, and some interior pixels). LPC 12 does not change at Class A absent conflict pixels because "s" and "t" are zero. TRI 14 does not change because "t" is zero. CIF 16 does not change because neither LPC 12 nor TRI 14 changes. CLASS B (Overt Conflict) Input Light - Template Dark (Includes pixels 25, 32, 46, and 53). LPC 12 does not change at Class B overt conflict pixels because "s" is zero. TRI 14 decreases because "t" is non-zero. CIF 16 decreases because only TRI 14 changes. CLASS C (Covert Conflict) Input Dark - Template Light (includes pixels 23, 30, 37, 38, 44, 51, 58, 59, 61, and 62). LPC 12 does not change at Class C covert conflict pixels because "t" is zero. TRI 14 does not change because "t" is zero. CIF 16 does not change neither LPC 12 nor TRI 14 changes. CLASS D (Absent Conflict) Input Dark - Template Dark (includes pixels 16, 17, 18, 19, 20, 39, and 60). LPC 12 increases because both "s" and "t" are non-zero. TRI 14 decreases because "t" is non-zero. CIF 16 does not change because LPC 12 and TRI 14 make offsetting changes. TRI 14 step decreases eleven times during the correlation calculation, when "t" is non-zero (Classes B and D). LPC 12 step increases only seven times, when both "s" and "t" are non-zero (Class D). CIF 16 decrease four times (Class B). TRI 14 is a "t" square summation and is not affected by the zero status of "s". While LPC 12 is an "s" times "t" product summation and is zero when either "s" or "t" is zero. The size of the step changes in LPC 12 and TRI 14 and CIF 16 are not drawn to scale in Figure 1C. The step sizes are presented as equal and constant for simplicity of illustration. The step sizes are actually a function of the intensity information (the number of foreground pixels) in the bit maps. The normalized step size of the LPC 12 plot is one over the square root of the number of foreground pixels in the "E" input symbol bit map, and is constant throughout the correlation calculations. The normalized step size of the TRI 14 plot is one over the square root of the ratio of foreground pixels remaining in the TRI sum (at k = j ) to the foreground pixels in the "T" template bit map (at k = 0). The TRI step progressively decreases as the correlation calculation proceeds to completion. The step size of the CIF plot tracks the varying difference in the LPC and TRI step sizes. GENERAL METHOD - FLOW CHART (Figure 2) A general method of accelerating the classification of an unclassified input symbol S into a library of pre-classified templates is shown in Figure 2. The correlation calculation (s,t i ) is initiated between the input symbol S and templates retrieved from the library of templates. Templates with a low degree of correlation are excluded prior to completion of the correlation calculation in order to accelerate the correlation. The basic steps of the OCR method are shown in Figure 2 and described below. Providing an input symbol S in the form of an input vector defining an unclassified character having "q" elements ( S = s 1 , s 2 , s 3 , ... s k ... s j ... s q ). Providing a library of T templates (T 1 , T 2 , T 3 , ... T i ... T T ) which are retrieved for correlation with the input vector. Each template is in the form of a template vector defining a pre-classified character having "q" elements ( T i = t 1 , t 2 , t 3 , ... t k ... t j ... t q ) forming "q" pairs of corresponding elements with the "q" elements of the input vector. Providing a comparison inequality function for correlating the input vector with the template vectors which defines an element by element correlation calculation (s,t i ) and executes an element calculation cycle for each of the "q" pairs of corresponding elements. The correlation calculation (s,t i ) yields an element term for each pair of corresponding elements. The correlation calculation (s,t i ) also sums the element terms from previous calculation cycles of the correlation calculation (s,t i ) to yield a cumulative bound after "k" calculation cycles and to yield a final bound after the completion of "q" calculation cycles. Determining an Exclusion Threshold for excluding the retrieved template if the cumulative bound crosses the exclusion threshold, and not excluding the retrieved template if the cumulative bound does not cross the exclusion threshold (see EXCLUSION THRESHOLDS section). An exclusion threshold (ETH) of 0.78 is shown in the unsorted embodiment (Figure 1) and the intensity sorted embodiment (Figure 3) and the double sorted embodiment (Figure 4) for comparison of the calculation cycles required to complete the correlation. Determining a series of sequential Exclusion Check Points with intervals of element calculation cycles therebetween for comparing the cumulative bound to the exclusion threshold as the correlation calculation (s,t i ) proceeds (see EXCLUSION CHECK POINTS section). Retrieving an initial template from the library of templates. The template vector may be obtained from the library in memory order, or in random order, or selected based on historical inference or other selection criteria. Initiating the Element by Element Correlation Calculation (s,t i ) for the "q" pairs of corresponding elements to yield the cumulative bound. Excluding the retrieved template if the cumulative bound crosses the exclusion threshold. An entire correlation calculation need not be completed for the excluded templates. Repeating the Correlation Calculation and excluding steps until the retrieved template has been excluded or until the correlation calculation (s,t i ) for the retrieved template has proceeded to completion to yield the final bound Saving non-excluded retrieved templates . Retrieving a next template from the library of templates. Repeating the correlation calculation and excluding and saving and retrieving steps until all of the template vectors have been correlated with the input vector. Classifying the unclassified input symbol against the non-excluded pre-classified templates on the basis of the numerical values of the final bound yielded by the correlation calculations. EXCLUSION THRESHOLDS Exclusion thresholds (ETH) may be employed for excluding the retrieved template if the cumulative bound crosses the threshold. An ETH of 0.78 (as shown in Figures 1 and 3 and 4) is a suitable value for excluding low correlation templates early in the correlation calculation. If the cumulative bound does not cross the exclusion threshold, then the retrieved template is not excluded. The exclusion threshold may be cumulative and determined by replacing an initial exclusion threshold with the final bound of each non-excluded template during the classification process of the input vector with the template vectors. All of the retrieved templates are excluded during a typical classification process except for a single non-excluded template. The cumulative bound progresses toward the final bound of the single non-excluded template. The initial cumulative bound for each correlation calculation (s,t i ) may be high and form an upper bound which progresses downward toward the final bound. In the upper bound embodiment of Figure 1, the cumulative bound is initially 1.00, and decreases until the correlation calculation is complete or the cumulative bound crosses the ETH of 0.78. The initial exclusion threshold may be zero, and may build up a little (or a lot) for each non-excluded template. The correlation calculation (s,t i ) for the initial template yields the first finite exclusion threshold. As the exclusion threshold increases, the decreasing cumulative bound will generally cross the exclusion threshold in fewer calculation cycles. That is, the higher the exclusion threshold the greater is the correlation acceleration. The initial exclusion threshold may be finite, in which case correlation acceleration is in effect from the initial calculation cycle. The initial exclusion threshold may be greater than zero but less than (or equal to) a minimum acceptable final bound. The greatest acceleration is provided by an exclusion threshold equal to the minimum acceptable final bound. This high exclusion threshold does not require a build-up time as does the zero initial exclusion threshold; and rapidly excluded the hopeless low correlation templates from the very first calculation cycle. EXCLUSION CHECK POINTS (Figures 5 and 6) Referring to Figure 5, exclusion check points 58 may be provided at intervals during each correlation calculation for comparing the decreasing cumulative bound with the exclusion threshold to determine whether the cumulative bound has crossed the exclusion threshold. If the exclusion threshold has been crossed the correlation calculation for that template vector is terminated, and the next template vector is retrieved. The excluding step (see Figure 2) may include the additional steps described below. Checking for exclusion of the retrieved template at the first exclusion check point by comparing the cumulative bound with the exclusion threshold. Excluding the retrieved template by terminating the element by element correlation calculation (s,t i ) if the cumulative bound has crossed the exclusion threshold. Continuing the Element by Element Correlation Calculation (s,t i ) to the next exclusion check point if the cumulative bound has not crossed the exclusion threshold. The number of element calculation cycles within each interval of calculation cycles between the exclusion check points may be fixed providing a linear series of exclusion check points equally spaced along the horizontal axis of the correlation plot (as shown in Figure 5). Short intervals with a few calculation cycles involve frequent checking, and minimizes overshoot of the cumulative bound beyond the exclusion threshold. The fixed number of calculation cycles in each interval may be one, in which case the checking step occurs after every calculation cycle, and overshoot is prevented. If the bit map matrix is large (high resolution), checking the present cumulative bound may require less computer time than calculating the next cumulative bound. The number of calculation cycles in each interval may be variable, or adaptive as the element by element correlation calculation (s,t 1 ) proceeds providing a nonlinear series of exclusion check points. In one adaptive embodiment shown in Figure 6, the number of calculation cycles in each interval between exclusion check points 68 may become smaller as the element by element correlation calculation (s,t i ) proceeds. The correlation calculation is checked less frequently at the start of the correlation calculation, and more frequently as the cumulative bound approaches the exclusion threshold. The exclusion check point interval may be based on the change in the TRI sum or the cumulative bound instead of the number of calculation cycles executed in the correlation calculation. The change in the cumulative bound during each interval of element calculation cycles between the exclusion check points may be fixed providing a linear series of exclusion check points equally spaced along the vertical axis of the correlation plot. Alternatively, the change in the cumulative bound during each interval may be adaptive, and for example become progressively smaller as the LPC sum approaches the CIF sum. TEMPLATE INTENSITY SORT (Figure 3) Referring to Figure 1, the q pairs of corresponding elements in the input vector and the template vector may be unsorted and correlated by the correlation calculation (s,t i ) in sequential order of position within the input vector bit map and the template vector bit map. Alternatively, the q pairs of corresponding elements may be sorted and correlated in the order of the sort to accelerate the correlation calculation Figure 3. The vector elements have numerical values indicating intensity, and the pixels in the bit map may be sorted by numerical value prior to the correlation calculation to determine the correlation order. The sort may be by background pixels (majority population) or by foreground pixels (minority population) in either the input vector or the template vector. The numerical sort may be in forward numerical order (lowest intensity first) or in reverse order (highest intensity first). Binary bit maps require a simple two level sort. Greyscale bit maps may be sorted by all (or some) intensity levels, or digitized to binary for sorting. Figure 3C illustrates the E/T correlation plot 30 of a low resolution binary template which has been foreground sorted. The strokes of template "T" contain eleven foreground pixels which form the first eleven elements of the correlation calculation (see Figure 3B). TRI 34 decreases each calculation cycle until TRI = 0 (at k = 11) at which time leading partial correlation LPC 32 is equal to comparison inequality function CIF 36 and the correlation calculation is complete. For an exclusion threshold (ETH) of 0.78, the template vector is excluded at the ninth calculation cycle as shown in Figure 3C. The E/T unsorted correlation of Figure 1 required 46 calculation cycles before CIF 16 crossed the ETH at 0.78. Sorting by template foreground pixels as shown in Figure 3 has several advantages. A bit map normally has fewer foreground pixels than background pixels, and therefore fewer calculation cycles required for completion. Only the stroke pixels (dark) must be sorted and correlated. The large area forming the peripheral background margins (white) are not applicable to foreground sorting and may be disregarded. Also the intensity sort order of each template may be predetermined and stored in memory for retrieval with the template bit map. DOUBLE TEMPLATE SORT (Figure 4) Referring to Figure 4, the q pairs of corresponding elements in the input vector and the template vector may be double sorted, first by intensity and then by discrimination power. Each pixel in a character bit map has a certain probability of being in overt conflict (see conflict table - Class B) with the corresponding pixel in another bit map. The pixels within the central background area of the bit map that are less likely to contain a stroke pixel have the highest discrimination power, and are correlated first in the double sort embodiment. Figure 4C illustrates the E/T correlation plot 40 of a low resolution binary template in which foreground pixels have been double sorted. The template "T" contains eleven pixels which form the first eleven elements of the correlation calculation (see Figure 4B), as determined by the first sort (the same intensity sort as shown in Figure 3). As in the single intensity sort, TRI 44 decreases each calculation cycle until TRI = 0 (at k = 11) at which time LPC 42 is equal to comparison inequality function CIF 46 and the correlation calculation is complete. However, CIF 46 and leading partial correlation LPC 42 behave differently in the double sort embodiment. CIF 46 decreases at each of the first four calculation cycles, and LPC 42 has remained at 0.00. Pixels 01, 02, 03, and 04 of the "T" template are off the common stroke paths. Most characters including input symbol "E" do not have a central vertical stroke forming a column of background pixels in the center of the bit map. Further, the heights of these four template pixels are slightly displaced from the heights of most horizontal strokes. Of all of the pixels in the "T" template, these four are the most likely to be in overt conflict (Class B) with the pixels of an input symbol presented at random. For an ETH of 0.78, the template vector is excluded at the third calculation cycle as shown in Figure 4C. The E/T single sorted correlation of Figure 3 required nine calculation cycles before CIF 36 crossed the ETH at 0.78. The unsorted correlation of Figure 1 required 46 calculation cycles. GREYSCALE EMBODIMENTS (Figures 5 and 6) The exclusion threshold, intensity sorting, and double sorting acceleration techniques are also applicable to high resolution greyscale bit maps. Figure 5 shows E/T correlation graph 50 based on high resolution bit maps (60 rows by 50 columns) with greyscale (256 levels). The three plots LPC 52 and TRI 54 and CIP 56 are flat during the intial correlation calculations due to the low intensity top margins of the "E" and "T" bit maps. TRI 54 descends to zero and the correlation calculation is complete at about q = 2600. The last 400 pixels or so are template bottom margin. However for an ETH = 0.50, the "T" template is excluded at about q = 2450. Figure 6 shows E/T correlation graph 60 with the same bit map base as graph 50 but with intensity sorting for accelerating the correlation calculations. The three plots LPC 62 and TRI 64 and CIP 66 progress at a faster rate. TRI 54 descends to zero and the correlation calculation is complete at about q = 1000. However for an ETH = 0.50, the "T" template is excluded at about q = 600.

Claims: A method of symbol classification for use in optical character recognition comprising the steps of; providing an input symbol S in the form of an input vector defining an unclassified character having "q" elements ( S = s 1 , s 2 , s 3 , ... s k ... s j ...s q ); providing a library of T templates (T 1 , T 2 , T 3 , ... T i ... T T ) which are retrievable for correlation with the input vector, each template being in the form of a template vector respectively defining a pre-classified character having "q" elements ( T i = t 1 , t 2 , t 3 , ... t k , ... t j ... t q ) and forming "q" pairs of corresponding elements with the "q" elements of the input vector; correlating the input vector with the template vectors by an element by element correlation calculation (s, t i ) which executes an element calculation cycle for successive pairs of corresponding elements of the input vector and each retrieved template vector to yield a respective element term for each pair of corresponding elements; summing the element terms from previous calculation cycles of the correlation calculation (s,t i ) to yield a cumulative bound after "k" calculation cycles and to yield a final bound after the completion of "q" calculation cycles; determining an exclusion threshold for excluding the retrieved template if the cumulative bound crosses the exclusion threshold and non-excluding the retrieved template if the cumulative bound does not cross the exclusion threshold ; retrieving an initial template from the library of templates; initiating the element by element correlation calculation (s,t i ) for the "q" pairs of corresponding elements to yield the cumulative bound; excluding the retrieved template if the cumulative bound crosses the exclusion threshold; repeating the correlation calculation and excluding steps until the retrieved template has been excluded or until the correlation calculation (s,t i ) for the retrieved template has proceeded to completion to yield the final bound; saving non-excluded retrieved templates; retrieving a next template from the library of templates; repeating the correlation calculation and excluding and saving and retrieving steps until all of the template vectors have been correlated with the input vector; and classifying the unclassified input symbol against the non-excluded pre-classified templates on the basis of the numerical values of the final bound yielded by the correlation calculations; characterised in that the correlations and summing steps are provided by computing the cumulative bound to be the value of a comparison inequality function (CIF; 16,36,46,56,66) comprising a) a monotonically increasing Leading Partial Correlation sum (12;32,42,52,62) representing the cumulative sum of the first k element terms; and b) a monotonically decreasing Residual Intensity sum (14,34,44,54,64) representing the image intensity data remaining after the kth calculation cycle. A method as claimed in claim 1, wherein the exclusion threshold is cumulative and is determined by replacing an initial exclusion threshold with the final bound of each non-excluded template during the classification process of the input vector with the template vectors. A method as claimed in claim 2, wherein all of the retrieved templates are excluded during the classification process except for a single non-excluded template. A method as claimed in claim 3, wherein the cumulative bound progresses monotonically toward the final bound of the single non-excluded template. A method as claimed in any of claims 3 and 4, wherein the initial cumulative bound for each correlation calculation (s,t i ) forms an upper bound which progresses downward toward the final bound. A method as claimed in any of claims 2 to 4, wherein the initial exclusion threshold is zero. A method as claimed in claim 6, wherein the correlation calculation (s,t i ) for the initial template yields the first finite exclusion threshold. A method as claimed in any of claims 2 to 4, wherein the initial exclusion threshold is finite. A method as claimed in any of claims 2 t 4, wherein the initial exclusion threshold is greater than zero but less than a minimum acceptable final bound. A method as claimed in any preceding claim wherein the correlation calculation (s,t i ) is complete when the Residual Intensity sum decreases to zero. A method as claimed in any preceding claim, wherein the comparison inequality function comprises the relationship: CIF(S,Ti) ≤ LPC + (SRI)(TRI) where CIF is the comparison inequality function, LPC is a Leading Partial Correlation sum, SRI is a Symbol Residual Intensity sum representing the symbol image intensity data remaining in the CIF as the correlation calculation proceeds, and TRI is a Template Residual Intensity sum representing the template image intensity data remaining in the CIF as the correlation calculation proceeds. A method as claimed in claim 11, wherein the comparison inequality function is the relationship: CIF(S,T i ) ≤ j =1 k s j t j + j = k +1 q s 2 j j = k +1 q t 2 j A method as claimed in any of claims 1 to 9, wherein the comparison inequality function comprises the relationship: CIF (S,Ti) ≤ LPC + SRI where CIF is the comparison inequality function, LPC is a Leading Partial Correlation sum, and SRI is a Symbol Residual Intensity sum representing the symbol image intensity data remaining in the CIF as the correlation calculation proceeds. A method as claimed in claim 13, wherein the comparison inequality function is the relationship: CIF(S,T i ) ≤ j =1 k s j t j + j = k +1 q s 2 j A method as claimed in any of claims 1 to 9, wherein the comparison inequality function comprises the relationship: CIF(S,Ti) ≤ LPC + TRI where CIF is the comparison inequality function, LPC is a Leading Partial Correlation sum, and TRI is a Template Residual Intensity sum representing the template image intensity data remaining in the CIF as the correlation calculation proceeds. A method as claimed in claim 15 wherein the comparison inequality function is the relationship: CIF(S,T i ) ≤ j =1 k s j t j + j = k +1 q t 2 j A method as claimed in claim 15, wherein the value of the LPC sum is determined by the correlation calculation (s,t i ) each calculation cycle, and the value of the TRI sum is pre-calculated based on the template vectors in the template library and is retrieved from the library. A method as claimed in any preceding claim, further comprising, before initiating the element by element correlation calculation (s,t i ) step, the additional step of: determining a series of sequential exclusion check points (58) with intervals of element calculation cycles therebetween for comparing the cumulative bound to the exclusion threshold as the correlation calculation (s,t i ) proceeds. A method as claimed in claim 18, wherein the excluding step further comprising the additional steps of: checking for exclusion of the retrieved template at the first exclusion check point by comparing the cumulative bound with the exclusion threshold; excluding the retrieved template by terminating the element by element correlation calculation (s,t i ) if the cumulative bound has crossed the exclusion threshold; and continuing the element by element correlation calculation (s,t i ) to a next exclusion check point if the cumulative bound has not crossed the exclusion threshold. A method as claimed in any of claims 18 and 19, wherein the number of element calculation cycles in each interval of calculation cycles between the exclusion check points is fixed. A method as claimed in claim 20, wherein the fixed number of element calculation cycles in each interval of calculation cycles is one and the checking step occurs after every calculation cycle. A method as claimed in any of claims 18 and 19, wherein the number of element calculation cycles in each interval of calculation cycles between the exclusion check points is variable. A method as claimed in claim 22, wherein the number of element calculation cycles in each interval is adaptive as the element by element correlation calculation (s,t i ) proceeds. A method as claimed in any of claims 22 and 23, wherein the number of element calculation cycles in each interval of calculation cycles becomes smaller as the element by element correlation calculation (s,t i ) proceeds. A method as claimed in claim 18, wherein the change in the cumulative bound during each interval of element calculation cycles between the exclusion check points is fixed. A method as claimed in any preceding claim, wherein the q pairs of corresponding elements in the input vector and the template vector are unsorted and are correlated by the correlation calculation (s,t i ) in sequential order of position within the input vector and the template vector. A method as claimed in any of claims 1 to 25, wherein the q pairs of corresponding elements in the input vector and the template vector are sorted and are correlated by the correlation calculation (s,t i ) in the order of the sort. A method as claimed in claim 27,wherein the vector elements in the input vector and the template vector have numerical values, and the sort is by numerical value. A method as claimed in claim 28, wherein the numerical values are binary values. A method as claimed in claim 28, wherein the numerical values are representative of greyscale levels. A method as claimed in claim 28, wherein the q pairs of corresponding elements are sorted by the numerical values of the elements forming the input vector. A method as claimed in claim 28, wherein the q pairs of corresponding elements are sorted by the numerical values of the elements forming the template vector. A method as claimed in claim 28, wherein elements forming the foreground of the template vectors are characterised by discrimination power, and the q pairs of corresponding elements are double sorted; first by the numerical values of the elements forming the template vector; and second by the discrimination power of the foreground elements forming the template vector. A method as claimed in claim 33 wherein the elements corresponding to a central area of a bit map defined by the template vector have the highest discriminating power. A method as claimed in claim 28, wherein the q pairs of corresponding elements are sorted by the numerical values of the elements forming the foreground. A method as claimed in claim 28, wherein the q pairs of corresponding elements are sorted by the numerical values of the elements forming the background. Apparatus for performing symbol classification in optical character recognition comprising; input means for receiving an input symbol S in the form of an input vector defining an unclassified character having "q" elements ( S = s 1 , s 2 , s 3 , ... s k ... s j ...s q ); a library of T templates (T 1 , T 2 , T 3 , ... T i ... T T ) which are retrievable for correlation with the input vector, each template being in the form of a template vector respectively defining a pre-classified character having "q" elements ( T i = t 1 , t 2 , t 3 , ... t k , ... t j ... t q ) and forming "q" pairs of corresponding elements with the "q" elements of the input vector; correlating means for correlating the input vector with the template vectors by an element by element correlation calculation (s, t i ) which executes an element calculation cycle for successive pairs of corresponding elements of the input vector and each retrieved template vector to yield a respective element term for each pair of corresponding elements; summing means for summing the element terms from previous calculation cycles of the correlation calculation (s,t i ) to yield a cumulative bound after "k" calculation cycles and to yield a final bound after the completion of "q" calculation cycles; determining means for determining an exclusion threshold for excluding the retrieved template if the cumulative bound crosses the exclusion threshold and non-excluding the retrieved template if the cumulative bound does not cross the exclusion threshold; retrieving means for retrieving templates from the library of templates; saving means for saving non-excluded retrieved templates; control means operable to control the correlating means, summing means, retrieving means and saving means to retrieve an initial template, initiate the element by element correlation calculation (s,t i ) for the "q pairs of corresponding elements to yield the cumulative bound, exclude the retrieved template if the cumulative bound crosses the exclusion threshold, repeat the correlation calculation and excluding steps until the retrieved template has been excluded or until the correlation calculation (s,t i ) for the retrieved template has proceeded to completion to yield the final bound, and save non-excluded retrieved templates, retrieve a next template from the library of templates, and repeat the correlation calculation and excluding and saving and retrieving steps until all of the template vectors have been correlated with the input vector; and classifying means for classifying the unclassified input symbol against the non-excluded pre-classified templates on the basis of the numerical values of the final bound yielded by the correlation calculations; characterised in that the correlation means and summing means are operable to compute the cumulative bound to be the value of a comparison inequality function (CIF; 16,36,46,56,66) comprising a) a monotonically increasing Leading Partial Correlation sum (12;32,42,52,62) representing the cumulative sum of the first k element terms; and b) a monotonically decreasing Residual Intensity sum (14,34,44,54,64) representing the image intensity data remaining after the kth calculation cycle.

Inventors: AVI-ITZHAK HADAR, AVI-ITZHAK, HADAR
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1994
Main classification: G06K9
IPC codes: G06K9