Image processing

Abstract: A processor (282) measures size or spacing of connected components for an image of text by obtaining a distribution of measurements of distances between edges of connected components. The distances are measured along lines extending in a measuring direction, such as a direction parallel or perpendicular to lines of text, which can be determined based on a measurement of skew. The distance measurements then can be used to produce a distribution of measurements as a function of distance, such as a histogram. Sufficient distances are measured for the histogram or other distribution data to indicate a measure of size or spacing of connected components for the image, such as a stroke width, a maximum character width or height, or a spacing between characters, words, or lines. To measure sizes, distance can be measured across pixels within connected components. To measure spacings, distance can be measured across pixels that are not within connected components. Measurements in a direction parallel to lines of text can indicate intercharacter spacing, interword spacing, vertical stroke width, and maximum character width. Measurements in a direction perpendicular to lines of text can indicate interline spacing, horizontal stroke width, and maximum character height. A machine could store an input image in memory, obtain data indicating size or spacing of connected components, modify the stored data according to the sizes or spacings indicated, and provide an output image based on the modification. The data indicating size or spacing could be used in segmentation and character recognition.

Description: The present invention relates to image processing, and particularly to analysis of an image that includes text. US-A-4,847,912 describes a technique of detecting a space between words with an optical character reader. As shown and described in relation to Figs. 2-6 of that specification, the reader scans each printed line in the direction of its height from its beginning to its end sequentially at a predetermined interval. The number of continuous white bits between black bits is counted. The histogram of the counts has two peaks corresponding to gaps between letters and gaps between words. The present invention provides image processing techniques for analyzing an image that includes text. The techniques measure distances between edges of connected components along lines extending in a measuring direction, such as a direction parallel or perpendicular to lines of text. The measurement results are used to obtain distribution data indicating distribution of distances between edges of connected components in the measuring direction. Sufficient distances are measured that the distribution data further indicate a measure of size or spacing of connected components for the image, such as a stroke width, a maximum character width or height, or a spacing between characters, words, or lines. The invention is specified in claim 1 and a corresponding method is specified in claim 2. It is based on the discovery of techniques that measure character and stroke sizes and spacings for text in an image, but that avoid problems in measuring characters and strokes based on segmentation of an image into lines of text or into characters. Segmentation may be difficult if lines are closely spaced or if characters have bled together or are connected. An error in segmentation can lead to erroneous measurement, and making a measurement for a single line or for a single character can require inefficient computations, such as finding bounding boxes. Furthermore, segmentation can be done more effectively if character and stroke sizes and spacings are already known. The techniques measure character and stroke sizes and spacings without segmenting the image. Instead, the techniques measure distances between edges of connected components along lines extending in one or more measuring directions and use the results to produce distribution data indicating a distribution of distances for each measuring direction. Each distance is measured either across a connected component or across a space between connected component edges. The distances can be measured, for example, in a direction approximately parallel to lines of text or in a direction approximately perpendicular to lines of text. If sufficient distances are measured, the distribution data indicate one or more measures of size or spacing of connected components in the measuring direction for the image. In other words, it is not necessary to measure all distances in the image--it is sufficient to measure a smaller number of distances in appropriate parts of the image so that the distribution of the measured distances is approximately the same as the distribution of distances for the image. Such techniques can be implemented, for example, by obtaining distribution data indicating a distribution of measurements as a function of distance in each direction. The distribution data can take the form of a histogram. For example, in an image in which lines of text extend horizontally, four histograms can be obtained, one each for horizontal distances across spaces between connected component edges, for vertical distances across spaces between connected component edges, for horizontal distances across connected components, and for vertical distances across connected components. Data indicating character and stroke sizes and spacings can then be obtained from the histograms. The present invention will now be described by way of example with reference to the accompanying drawings, in which: Fig. 1 is a schematic diagram showing measures of character and stroke spacing in an image that includes text; Fig. 2 is a schematic diagram showing measures of character and stroke size in a connected component in an image; Fig. 3 is a flow chart showing general steps in a technique that obtains distribution data indicating character or stroke size or spacing; Fig. 4 is a flow chart showing steps in obtaining a distance count indicating distance from a starting pixel to a pixel that meets a criterion; Fig. 5 is a flow chart showing steps in obtaining a histogram of distances measured as in Fig. 4; Fig. 6 is a flow chart showing steps in using a histogram produced as in Fig. 5 to obtain data indicating horizontal spacing; Fig. 7 is a flow chart showing steps in using a histogram produced as in Fig. 5 to obtain data indicating vertical spacing; Fig. 8 is a flow chart showing steps in using a histogram produced as in Fig. 5 to obtain data indicating horizontal size; Fig. 9 is a flow chart showing steps in using a histogram produced as in Fig. 5 to obtain data indicating vertical size; Fig. 10A is a histogram produced as in Fig. 6. Fig. 10B is a smoothed version of the histogram in Fig. 10A; Fig. 11A is a histogram produced as in Fig. 7. Fig. 11B is a smoothed version of the histogram in Fig. 11A; Fig. 12 is a histogram produced as in Fig. 8; Fig. 13 is a histogram produced as in Fig. 9; Fig. 14 is a flow chart showing steps that use skew data in producing data indicating an attribute, as in Figs. 6-9; Fig. 15 is a schematic block diagram of a system in which the invention is implemented with a serial machine; Fig. 16 is a schematic block diagram of a system in which the invention is implemented with a parallel machine; Fig. 17 is a flow chart showing steps in obtaining distance measurement data according to an implementation of the invention; Fig. 18 is a flow chart showing steps in using distance measurement data produced as in Fig. 17 to obtain histogram data; Fig. 19 is a flow chart showing steps in using histogram data produced as in Fig. 18 to obtain data indicating a particular character or stroke size or spacing attribute, and Fig. 20 is a schematic block diagram illustrating an application of the invention in a copying machine. Figs. 1-3 illustrate general features of the invention. Fig. 1 shows an image with distance measurements between connected components to obtain data indicating spacing between characters and lines. Fig. 2 shows an image with measurements made across a connected component to obtain data indicating character size and stroke width. Fig. 3 is a flowchart showing general steps in obtaining data indicating size or spacing of connected components. Fig. 1 shows image 10 which includes lines of text in which distance measurements can be made horizontally or vertically between connected components to measure spacing of connected components in the image. Each measurement starts from a starting location that meets an edge criterion and continues across a space between connected components to an ending location that also meets the edge criterion. From starting location 12, a first distance d 1 is measured along a line parallel to the text lines to location 14 where the line meets an edge. From starting location 16, a second distance d 2 is measured parallel to the text lines to location 18 where the line meets an edge. From starting location 20, a third distance d 3 is measured along a line perpendicular to the text lines to location 22 where the line meets an edge. From starting location 24, a fourth distance d 4 is measured parallel to the text lines to location 26 where the line meets an edge. From starting location 28, a fifth distance d 5 is measured perpendicular to the text lines to location 30 where the line meets an edge. The distance d 1 indicates an intercharacter spacing, d 2 an interword spacing, and d 3 an interline spacing. Distances d 4 and d 5 indicate parallel and perpendicular inner-character spacings, respectively. Fig. 2 shows connected component 40 across which distance measurements can be made horizontally or vertically to measure character size. Each measurement starts from a starting location that meets an edge criterion and continues across connected component 40 to an ending location that also meets the edge criterion. The horizontal and vertical directions can be parallel and perpendicular to the text lines that include connected component 40. From starting location 42, a distance d 6 is measured along a line vertically to location 44 where the line meets an edge. From starting location 46, a distance d 7 is measured horizontally to location 48 where the line meets an edge. From starting location 50, a distance d 8 is measured vertically to location 52 where the line meets an edge. From starting location 54, a distance d 9 is measured horizontally to location 56 where the line meets an edge. Distance d 6 is a component height. Distance d 7 is a component width. Distance d 8 is the width of a horizontal stroke, and distance d 9 is the width of a vertical stroke. In the flowchart of Fig. 3 the step in box 70 measures distances in a direction between edges of connected components in an image of text. The step in box 72 uses the distances to obtain distribution data indicating the distribution of distances in a direction. The measured distances are sufficient for the distribution data to indicate size or spacing of connected components for the image. This could be done by measuring distances at all edge locations in the image, but it can be done more efficiently by selecting a smaller number of edge locations as starting locations for distance measurement, as described more fully below. The starting locations are selected so that the distance measurements are representative of the distances between edge locations for the image. The flowcharts of Figs. 4 and 5 show a method that can be used to obtain a histogram of distance data. The flowchart of Fig. 4 shows steps in measuring distance from a starting location to an ending location. The flowchart of Fig. 5 shows steps in storing the distance data from Fig. 4 in a histogram data structure. Fig. 4 shows steps in obtaining data indicating the distance along a line in a direction from a location to the nearest location along the line meeting a criterion, such as an edge criterion. The step in box 80 starts at a location. The step in box 81 resets a distance count to start counting distance. The step in box 82 increments the distance count. The test in box 84 determines whether the distance count exceeds a limit. The distance limit could be based on the height and width of the image, or on an arbitrary length after which no important data are likely to be found. If the distance limit is not exceeded, the step in box 86 accesses data defining the next location along the line. The step in box 88 then tests the accessed location to see if it meets the criterion. If the accessed location does not meet the criterion, another iteration begins with the step in box 82. Iterations continue until a location is found that meets the criterion in box 88, or the distance count exceeds the distance limit in box 84. For example, if the criterion is an edge pixel, the step of box 88 would test whether the next location is an edge pixel, and iterations would continue until an edge pixel is found or the distance limit is exceeded. At that point, the step in box 90 returns the distance count, which indicates either the distance to the nearest edge pixel or the distance limit. The step in box 88 can find an edge pixel based on a simple criterion. For example, if the starting location is a black edge pixel, the next nonadjacent black pixel is an edge pixel when measuring distance between connected components, and the next nonadjacent white pixel is an edge pixel when measuring distance across a connected component. Fig. 5 shows general steps in combining distance data for a plurality of selected locations in an image to obtain a histogram of distances for the image that includes the locations. The step in box 92 begins an iterative loop that handles each of a number of locations. Data indicating a distance are obtained for the next location by the step in box 94, such as by finding a location that meets the starting criterion, and then following the steps in Fig. 4 to obtain a distance count from the location. Then the step in box 96 increments a frequency count for a range that includes the distance indicated by the distance data. The frequency count can be stored with frequency counts for other ranges in a data structure in memory, so that each frequency count in the data structure indicates how many locations have been found with a distance in the respective range. When distances at sufficient locations have been measured, the step in box 98 obtains a histogram using the frequency counts. The histogram may then be used or stored. Each iteration of the loop in Fig. 5 measures a distance in the same direction, so that the resulting histogram indicates distribution of distances in that direction for the image. The direction can be chosen so that the histogram indicates size or spacing of connected connected components in the image. Depending on the attribute to be measured, distance may be measured in different directions, such as parallel to lines of text in the image for character width or interword spacing, or perpendicular to lines of text for character height or interline spacing. The flowcharts of Figs. 6-9 show steps in using a histogram to obtain data indicating character or stroke sizes or spacings for text in an image. The step in box 110 of Fig. 6 obtains a histogram of distances between connected components in a direction parallel to lines of text in an image, following the steps of Fig. 5. For black text on a white background, this step measures distance across white pixels between edge pixels. The step in box 112 uses the histogram to obtain data indicating spacings between characters or words for the image. The step in box 120 of Fig. 7 obtains a histogram of distances between connected components in a direction perpendicular to lines of text in an image, following the steps of Fig. 5. For black text on a white background, this step measures distance across white pixels between edge pixels. The step in box 122 uses the histogram to obtain data indicating spacings between text lines or vertically inside characters. The step in box 130 of Fig. 8 obtains a histogram of distances across connected components in a direction parallel to lines of text in an image, following the steps of Fig. 5. For black text on a white background, this step measures distance across black pixels between edge pixels. The step in box 132 uses the histogram to obtain data indicating width of characters or width of vertical strokes in the text. The step in box 140 of Fig. 9 obtains a histogram of distances across connected components in a direction perpendicular to lines of text in an image, following the steps of Fig. 5. For black text on a white background, this step measures distance across black pixels between edge pixels. The step in box 142 uses the histogram to obtain data indicating height of characters or width of horizontal strokes in the text. Figs. 10-13 show histograms obtained in the manner described in Figs. 6-9 for a text image of black text on a white background. Fig. 10A shows a histogram of distances between connected components in the direction parallel to the lines of text in an image of New York typeface, obtained following the steps shown in Fig. 6. The horizontal axis is the length of the white runs, and the vertical axis is the number of edge pixels having white runs of a given length. The most common white run lengths occur at the intercharacter spacing interval and at the interword spacing interval. Fig. 10B shows the histogram of Fig. 10A after smoothing, where the peaks are more distinct. The step of smoothing the function also smooths out false peaks caused by spaces inside characters or noise in the image, for example. In Fig. 10B, the intercharacter spacing interval of about seven pixels is shown by the first large peak 150, and the interword spacing interval is given by smaller peak 152 at about 25 pixels. The width of each peak may be dependent on the typeface--for typefaces where the intercharacter spacing varies considerably, the first peak is broader; where the intercharacter spacing is constant the peak is narrower. The same holds true for interword spacing. Another peak is shown around 48 pixels. This peak indicates the distance limit, which will often be the result of measuring distance from edge pixels adjacent to the margins of white at each side of the image. Fig. 11A shows a histogram of distances between connected components in the direction perpendicular to the lines of text in an image of New York typeface, obtained following the steps shown in Fig. 7. The histogram captures a number of properties of the text, including the white spaces within characters, the spaces above and below ascending and descending characters, and interline spacing. Fig. 11B shows the smoothed histogram. Peak 160, the third peak, is the interline spacing at about 25 pixels. The first peak 162 at about seven pixels indicates the white spaces within characters. The second peak 164 at about 13 pixels indicates the space above and below ascending and descending characters. Once again, another peak is shown around 48 pixels. This peak indicates the distance limit, which will often be the result of measuring distance from edge pixels adjacent the margins of white at the top and bottom of the image. Fig. 12 shows a histogram of distances across connected components in the direction parallel to lines of text in an image of New York typeface, obtained following the steps shown in Fig. 8. The histogram captures stroke width of vertical strokes, and if the image contains only characters it also captures character width. Peak 170 shows the width of vertical strokes. Second peak 172 occurs because this typeface uses a variable stroke width. A typeface with a constant stroke width, such as Avant Garde, has only a single peak at the stroke width. The histogram drops off to zero at 16 pixels, indicating maximum width of the characters. Fig. 13 shows a histogram of distances across connected components in the direction perpendicular to lines of text in an image of New York typeface, obtained as shown in Fig. 9. The histogram captures the width of horizontal strokes, and if the page contains only characters it also captures character height. Peak 180 at about three pixels indicates the width of horizontal strokes in the image. The histogram drops off to zero at about 25 pixels, indicating the maximum height of the characters. The drop at peak 182 to about 18 pixels indicates the height of lower case characters. This latter measure may be quite difficult to extract reliably from histograms. The flowchart of Fig. 14 shows steps in obtaining size and spacing data for text in an image using information about skew. If skew of the image is not taken into consideration, histograms of the text may not indicate the correct measurements of character and stroke size and spacing. The step in box 190 obtains skew data indicating the skew of text lines in an image. The step in box 192 uses the skew data in obtaining distribution data indicating size or spacing of connected components for the image. This may be done by first correcting the page orientation to deskew the image, or by shifting the angles at which distances are measured to compensate for the skew. The step in box 194 uses the distribution data to obtain data indicating a character or stroke size or spacing attribute, which could be obtained as in one of Figs. 6-9, as illustrated by Figs. 10-13. Fig. 15 shows system 220 in which the invention is implemented on a serial machine. Processor 222 is connected for receiving input data from input device 224 and for providing output data to output device 226. Processor 222 can be the CPU of a workstation, and input device 224 and output device 226 can be I/O devices. For example, input device 224 can be an image input device such as a scanner or a digital image source. Also input device 224 can provide a connection to a peripheral storage device or other storage or transmission medium from which model profiles, that indicate distance as a function of direction can be received. Similarly, output device 226 can be a device for providing data obtained by processor 222, such as data indicating a typeface or a profile that indicates distance as a function of direction in an image, to a storage or transmission medium. During operation, processor 222 executes instruction from program memory 228 and accesses data memory 230 to read and write data. Program memory 228 stores instructions for various operations of processor 222. Data memory 230 stores data structures as shown and can also temporarily store intermediate data used by the processor 222 in performing its operations. Image data storing operation 232 receives image data through input device 224 and stores them in data memory 230, and image data modifying operation 234 modifies image data 260. Similarly, image data output operation 236 provides image data 260 to output device 226. Size obtaining operation 238 obtains data indicating a size attribute of characters or strokes in an image, and can store the results in data memory 230 as size data 266. Spacing obtaining operation 240 obtains data indicating a spacing attribute of characters or strokes in an image, such as spacing between characters, words, or lines, and can store the results as spacing data 268. Size obtaining operation 238 and spacing obtaining operation 240 may call distribution obtaining operation 248 to obtain distribution data 264, and the results can be stored in distribution data 264 in data memory 230. Measuring operation 244 may be called by distribution obtaining operation 242 to measure distance in a direction in the image from a starting location, and the results can be stored in measurement data 262 in data memory 230. Skew obtaining operation 246 may be called by size obtaining operation 238 and spacing obtaining operation 240 to obtain skew information about an image which may be used in obtaining size or spacing information. Random location operation 248 may be called by distribution obtaining operation 242 to obtain starting locations from which measuring operation 244 measures distance. Image data 260 in data memory 230 includes data indicating a value for each pixel of an image. Image data 260 can be stored by image data storing operation 232. Measurement data 262 stores distances across and between connected components, and may be accessed to store the results of measuring operation 244 as described above. Distribution data 264 may be accessed to store the results of distribution obtaining operation 242 as described above. Size data 266 may be accessed by size obtaining operation 238, and spacing data 268 may be accessed by spacing obtaining operation 240. System 280 in Fig. 16 is a parallel system which resembles system 220 in Fig. 15. System 280 includes host processor 282 connected to receive data from input device 284 and to provide data to output device 286. Host processor 282 is also connected to exchange data with parallel processor 290, which could, for example, be a Connection Machine from Thinking Machines Corporation. Parallel processor 290 includes processing units 294, each with local memory 292. Data defining an image can be stored in local memory 292 so that each pixel's value is stored in a respective processing unit's local memory. Each processing unit can store the respective value of one or more pixels in its local memory. Host processor 282 executes instructions from program memory 300 and accesses data memory 302 in performing image processing, as described above in relation to Fig. 15. Host processor 282 performs operations that include operating each pixel's respective processing unit in parallel to obtain distance data for use in obtaining distribution data indicating an attribute of character or stroke size or spacing. Figs. 17-19 show an implementation of operations that could be performed by system 220 of Fig. 15. Fig 17 shows an operation that produces a distance count in a direction within an image. Fig. 18 shows an operation that produces a histogram of distances that provides information about size or spacing of connected components in an image. Fig. 19 shows an operation that finds peaks and valleys in a histogram and chooses the peak corresponding to a desired attribute of character or stroke size or spacing. Fig. 17 shows a method of measuring distance in a direction from a location in an image. The step in box 310 starts at a location. The step in box 312 determines increments in both the x and y directions based on the direction in which distance is being measured, and resets a distance count d and directional counts xx and yy . The step in box 314 begins an iterative loop by incrementing the xx and yy counts by the respective increments. The step in box 316 checks that the new coordinates are not beyond limits xmax and ymax , the boundaries of the image. If they are, the step in box 318 returns nil , indicating the coordinates are beyond the boundary limits of the image. If the coordinates xx and yy are not outside the boundaries of the image, the step in box 320 rounds the coordinates xx and yy to integer values x and y , respectively. The step in box 322 accesses an array of data items defining the image and uses the indices [ x,y ] to retrieve a data item defining a location in the image. The step in box 324 increments the distance count d . The step in box 326 checks whether a distance limit has been reached. The method works well with a distance of 50 pixels for this limit. If the distance limit has not been reached, the step in box 328 checks whether the location defined by the retrieved data item meets a criterion for stopping. The criterion can be indicated by a variable end-value , indicating the color of a pixel at which an edge occurs for the measurement being made. If either the distance limit has been reached or the location has a value of end-value, the step in box 330 returns the value of the distance count d. Otherwise, the loop returns to box 314 for another iteration. Fig. 18 shows an operation that uses the distance data obtained in Fig. 17 to obtain a histogram of distances measured in a direction within an image. The step in box 348 sets the value of end-value. This value determines whether the measurements will be made across black pixels or white pixels. If end-value is black, measurements will be made across white pixels until a black edge pixel is encountered. Conversely, if end-value is white, measurements will be made across black pixels until a white edge pixel is encountered. The step in box 350 begins an iterative loop that handles each of a number of locations. The technique has been found to work well with 5000 locations. The step in box 354 chooses a random location. The step in box 356 checks to see that the chosen location is an edge pixel, and if not returns to box 354 to choose another location. The step in box 358 measures a distance d to a pixel matching end-value using the method shown in Fig. 17. Each distance measurement is made in the same direction. The step in box 360 checks whether the distance d is greater than 1. If it is not, the adjacent pixel to the current location has matched end-value , so that no distance can be measured. Therefore, the loop returns to box 350 to begin another iterative loop. If the value of d is greater than 1, the step in box 362 increments the location counter, and the step in box 364 accesses a histogram data structure and increments a frequency count for the range of distances that includes the distance d. When the step in box 350 determines that sufficient locations have been measured, the step in box 352 returns the histogram data structure. This histogram data structure is distribution data that implicitly indicates character or stroke size or spacing attributes. Fig. 19 shows an operation that uses the histogram obtained in Fig. 18 to obtain data explicitly indicating a particular character or stroke size or spacing attribute of text in an image. The step in box 380 sets constants which determine the direction and the color of pixels across which measurements are to be made. For example, if the desired attribute is interword spacing, measurements will be made parallel to lines of text, counting white pixels until a black edge pixel is reached. The step in box 382 computes a histogram as shown in Fig. 18 using the constants set in box 380. The step in box 384 smooths the curve of the histogram from box 382 using conventional smoothing techniques. This step makes the peaks easier to pick out. It has been found that a smoothing factor of two or three is sufficient to produce good results in this step for histograms of white pixels. It has also been found that histograms of black pixels may not require smoothing in order to pick out peaks and valleys reliably. The step in box 386 collects lists of peaks and valleys in the histogram. The lists from box 386 could be used to choose the peak or valley corresponding to the desired attribute. For example, if the desired attribute to be detected is interword spacing, the histogram will be made up of measurements of white pixels made parallel to the line of text. The first peak in the smoothed histogram indicates intercharacter spacing, and the second peak indicates interword spacing. This step may be done manually by looking at the lists or the histogram, or by a machine which automatically chooses the appropriate peak or valley from the list. If the peak is automatically chosen, the machine could return the distance at which the peak occurs. The invention could be applied in many ways. In general, data indicating character or stroke size or spacing attributes can be used in any image processing application that employs segmentation. Fig. 20 illustrates an application of the invention in a copying machine. In Fig. 20, copying machine 400 includes scanner 402, image processing system 404, and printer 406. Scanner 402 can produce data defining an image of an input document. Image processing system 404 can be implemented as shown in Fig. 15 or Fig. 16, and can, in addition to measuring character and stroke sizes and spacings, use optical character recognition techniques to identify characters in the document. The character and stroke sizes and spacings can be used for page segmentation to improve character recognition. Image processing system 404 might also apply techniques to produce data defining a modified image. For example, if a character or groups of characters is highlighted or otherwise shown in a way that indicates selection, character spacings could be used to determine the outer boundary of the highlighting or the like. Character sizes and spacings could also be used to help identify connected components that are not part of the printed text, so that they can be removed from the image. The data defining the modified image could then be provided to printer 406 to print an output document. The invention has been described in relation to implementations in which operations are performed on data defining an image to obtain data indicating information about character and stroke sizes and spacings in text in the image. The invention might also be implemented with specialized circuitry connected to photosensors for directly obtaining data indicating information about character and stroke sizes and spacings in text in an image. The invention has also been described in relation to implementations in which distances are measured from randomly selected locations. The starting locations for distance measurement could alternatively be selected with some other criterion, such as all pixels at edges, or every Nth edge pixel. The invention has been described in relation to implementations in which distribution data is obtained by obtaining histograms. Other techniques might be used to obtain distribution data, including other techniques that indicate frequency as a function of distance or that indicate the maxima or central value of frequency as a function of distance. In general, distribution data can be obtained after all distance measurements are obtained or, to reduce data storage requirements, distance measurements can be combined as they are obtained. The invention has been described in relation to software implementations, but the invention might be implemented with specialized hardware.

Claims: An image processing machine (220; 280) comprising: memory (230; 302) for storing data; and a processor (222; 282) connected for accessing the memory; the data stored by the memory including: image data (260) defining an image that includes text, the image including two or more connected components that form the text; the connected components together having a frequently occurring size or spacing in a measuring direction in the image; and the processor: measuring two or more distances between edges of the connected components along lines extending in the measuring direction within the image, each distance being measured by starting at a location at an edge and moving incrementally along a line in the measuring direction, accessing data items in the image data, defining locations along the line to determine whether the accessed data items indicate locations at another edge (80, 82, 86, 88, 90); and obtaining a distribution of the distances between edges of the connected components in the measuring direction, the distances being measured between edges of a sufficient number of the connected components that the distribution indicates a measure of the frequently occurring size or spacing of the connected components in the measuring direction for the image (92, 94). A method of performing image processing on an image that includes text, the image including two or more connected components that form the text; the connected components together having a frequently occurring size or spacing in a measuring direction in the image; the method comprising steps of: measuring two or more distances between edges of the connected components along lines extending in the measuring direction; each distance being measured by starting at a location at an edge and moving incrementally along a line in the measuring direction, accessing data items defining locations along the line to determine whether the accessed data items indicate locations at another edge (80, 82, 86, 88, 90); and obtaining a distribution of the distances between edges of the connected components in the measuring direction; the distances being measured between edges of a sufficient number of the connected components that the distribution indicates a measure of the frequently occurring size or spacing of the connected components in the measuring direction for the image (92,94).

Inventors: HUTTENLOCHER DANIEL P, HUTTENLOCHER, DANIEL P.
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1992
Main classification: G06K9
IPC codes: G06K9, G06F9