Method of analyzing data defining an image

Abstract: Input image data define an input image (10) that shows a row/column representation (12), such as a table; a matrix; an array; a calendar; a two-dimensional connection diagram such as a programmable logic array (PLA) diagram; a puzzle or game diagram such as a crossword puzzle, a chess or checkers diagram, a go game diagram, or ticktacktoe. The input image data are used to obtain row data (20) and column data (22). The row data (20) indicate parts of the input image within a row of the row/column representation (12). The column data (22) indicate parts of the input image within a column of the row/column representation. The row data and column data are used to obtain content data indicating information represented by the row/column representation for the combination of the row and the column. The content data (24) can be used to obtain output image data defining an output image that includes a table or other representation of the information represented by the row/column representation (12) for each row/column combination. The input image can show a sketch of a row/column representation and the content data can be used to obtain output image data defining an output image that includes a precisely formed row/column representation similar to the sketch.

Description: The present invention relates to a method of analyzing data defining an image and, more particularly, to techniques for analyzing an image showing a graphical representation. Takeda, et al., US-A 5, 228, 100, describe techniques that recognize document structure. JP-A-05 012 489 discloses table recognizing device which can recognize a table structure in graphic data read from printed matter or a document regardless of the type of lines used. An extraction part is provided to extract horizontal and vertical black picture elements having a length longer than a fixed length. A ruled line extraction part is provided to extract ruled lines by linking the horizontal and vertical black picture element runs. A table structure extraction part is provided to retrieve the rectangle provided by the extracted ruled lines and to extract it as cell of the table. "Multi-media RISSC Informatics: Retrieving Information with Simple Structural Components" by Rus, D. et al (ACM Conference on Information and Knowledge Management (CIKM), pages 283-294, November 5, 1993, ACM Press) deals with the segmentation of documents. The goal is to partition the document which is given as a pixel area, into regions that capture its layout. The problem can be separated into to parts: determining where the regions are and classifying them according to their layout structure. According to this document, an example of layout structures are tables. This document is also directed to detecting tables. The corresponding method operates on a block of text which constitutes a 2-dimensional area. The algorithm creates a white space density graph by calculating the percentage of black spaces in each column of block. A column that serves as a separator in perfect tables consists of 100% black spaces. Considering slight irregularities, a percentage of less than 100% is considered to be sufficient. If there are local maxima in the white space density graph which are higher than the required percentage of black spaces, they are candidates for column separators in a possible table. Then, each candidate column is analyzed for lexical structure. If there is lexical structure in each column, the block of text is considered to be a table. It is the object of this invention to provide a flexible method, a machine and an article of manufacture for automatically analyzing a variety of row/column representations. This object is achieved by a method according to claim 1, a machine according to claim 4 and an article of manufacture according to claim 5. Preferred embodiments of the subject matters of the dependent claims. The invention is based on a technique for analyzing an image showing a row/column representation such as a table; a matrix; an array; a calendar; a two-dimensional connection diagram such as a programmable logic array (PLA) diagram; a puzzle or game diagram such as a crossword puzzle, a chess or checkers diagram, a go game diagram, or ticktacktoe; or another graphical representation that includes rows and columns and represents information for row/column combinations. The technique is based on the recognition that a row/column representation includes. features that extend across the representation in orthogonal directions, with information for each row/column combination represented in a part of the representation where two such features intersect, one feature being a row and the other being a column. The technique therefore analyzes an image by first obtaining the line or band for a row and the line or band for a column; the lines or bands can then be used to obtain the information represented for the row/column combination. The technique obtains input image data defining an input image showing a row/column representation. The technique uses the input image data to obtain row data and column data. The row data indicate parts of the input image within a row of the row/column representation. The column data indicate parts of the input image within a column. The technique uses the row data and the column data to obtain content data indicating information represented for the row/column combination. The technique can, for example, obtain the row data and column data by first obtaining horizontal data and vertical data indicating, respectively, horizontal and vertical lines in the input image. Then, the technique can use the horizontal data to obtain row data indicating parts of the input image between horizontal lines and can also use the vertical data to obtain column data indicating parts of the input image between vertical lines. The row data and the column data together indicate rows and columns. The row data and column data can therefore include two versions of the input image, one a row data image indicating pixels in parts of the input image that are between horizontal lines, the other a column data image indicating pixels between vertical lines. Within the row data image, each pixel in a row could be labeled with an integer uniquely identifying its row, and, within the column data image, each pixel in a column could be labeled with an integer uniquely identifying its column. Content data can be obtained for each row/column combination. The content data can include a list of sublists, with each sublist including a list of combination identifiers identifying combinations of columns with one of the row. Each sublist can include, for each combination, bounding box data indicating a bounding box within which information for the identified combination of a column with a row is represented. The technique can store the content data or use it somehow. For example, the technique can use the content data to provide control signals to a system. Or the input image can show a sketch of a row/column representation and the technique can use the content data to obtain data defining an image showing a precisely formed row/column representation similar to the sketch, such as a table. The technique can be implemented with a machine that includes image input circuitry and data indicating image processing instructions. The image input circuitry can receive data defining an image set that shows a row/column representation. The machine's processor can execute the image processing instructions. In executing the image processing instructions, the processor can receive the input image data from the image input circuitry and use the input image data to obtain row data and column data as described above. The processor can then use the row data and column data to obtain content data indicating information represented by the row/column representation for a combination of a row and a column. The machine can be a high-speed image processing server that responds to image processing requests from a network to which it is connected. The machine can also include image output circuitry, and the processor can use the content data to obtain output image data defining an output image that shows a row/column representation similar to the analyzed row/column representation. The machine can be a fax server or a copier. The technique can also be implemented in a software product that includes a storage medium and data stored by the storage medium. The software product can be used in a machine that includes image input circuitry. The data stored by the storage medium can include image processing instructions the machine's processor can execute. In executing the image processing instructions, the processor can receive input image data from the image input circuitry defining an input image that shows a row/column representation and use the input image data to obtain row data and column data as described above. The processor can then use the row/column data to obtain content data indicating information represented by the row/column representation for a combination of a row and a column. The technique described above is advantageous because it makes it possible to automatically analyze a variety of row/column representations. The content data obtained by the technique can be used to produce an image showing a precisely formed row/column representation in response to a simple sketch by a user. The present invention will be described further, by way of examples, with reference to the accompanying drawings, in which:- Fig. 1 is a schematic diagram illustrating analysis of an image showing a row/column representation; Fig. 2 is a flow diagram showing general acts in analyzing an image showing a row/column representation; Fig. 3 is a schematic block diagram showing general components of a software product and a machine in which the software product can be used to implement the general acts in Fig. 2; Fig. 4 is a schematic block diagram showing ways in which a user can provide data defining an image showing a row/column representation made by hand; Fig. 5 is a schematic block diagram showing how a user can provide data defining an image showing a row/column representation produced interactively with a machine; Fig. 6 is a schematic block diagram of a machine that can analyze an image showing a row/column representation; Fig. 7 is a flow chart of acts performed by the machine of Fig. 6; Fig. 8 is a schematic flow diagram of data images used in obtaining indexed rows and columns data images in Fig. 7; Fig. 9 shows an example of a sketch of a table and a precisely formed table obtained using techniques shown in Figs. 6-8; Fig. 10 is a schematic block diagram of an implementation with an image processing server; Fig. 11 is a schematic block diagram of a fax server application; and Fig. 12 is a schematic block diagram of a copier application. A "combination of a row and a column" or a "row/column combination" is a pairing of a row and a column that both include one position at which information can be represented. The position may be called the "intersection" of the row and the column in the combination. A "row/column representation" is a graphical representation that includes rows and columns and represents information for row/column combinations. The following categories of graphical representations are examples of row/column representations: tables, matrices, arrays, calendars, two-dimensional connection diagrams, puzzles such as crossword puzzles, or game diagrams such as chess or checkers diagrams, go game diagrams, or ticktacktoe games. Fig. 1 shows schematically how an image showing a row/column representation can be analyzed. Fig. 2 shows general acts in analyzing an image showing a row/column representation. Fig. 3 shows general components of a software product and of a machine in which it can be used. In Fig. 1, image 10 shows row/column representation 12. Image 10 can, for example, be a sketch. Row/column representation 12 illustratively includes two rows and two columns if the rows and columns are features between horizontal and vertical lines, and three rows and three columns if the rows and columns are features that include horizontal and vertical lines. A machine receiving data defining image 10 can respond by automatically obtaining row data 20 indicating parts of image 10 that are within row m. The machine can also automatically obtain column data 22 indicating parts of image 10 that are within column n. The machine can automatically use row data 20 and column data 22 to obtain content data 24 indicating information represented by row/column representation 12 for the combination of row m and column n. The general acts in Fig. 2 begin in box 40 by receiving input image data defining an input image that shows a row/column representation. In response, the act in box 42 uses the input image data to obtain row data indicating parts of the input image within a row of the row/column representation and column data indicating parts of the input image within a column of the row/column representation. The act in box 44 then uses the row data and column data to obtain content data indicating information represented by the row/column representation for the combination of the row and the column. Fig. 3 shows software product 60, an article of manufacture that can be used in a system that includes components like those shown in Fig. 3. Software product 60 includes data storage medium 62 that can be accessed by storage medium access device 64. Data storage medium 62 could, for example, be a magnetic medium such as a set of one or more tapes, diskettes, or floppy disks; an optical medium such as a set of one or more CD-ROMs; or any other appropriate medium for storing data. Data storage medium 62 stores data that storage medium access device 64 can provide to processor 66. Processor 66 is connected for accessing memory 68, which can include program memory storing data indicating instructions that processor 66 can execute and also data memory storing data that processor 66 can access in executing the instructions. Processor 66 is also connected for receiving data defining images from image input circuitry 70. The data could be obtained from facsimile (fax) machine 72; from scanner 74; from editor 76, which could be a forms editor or other interactive image editor controlled by user input devices such as a keyboard and mouse or a pen- or stylus-based input device; or from network 78, which could be a local area network or other network capable of transmitting data defining an image. In addition to data storage medium 62, software product 60 includes data stored by storage medium 62. The stored data include data indicating image processing instructions 80, which processor 66 can execute to perform acts like those in Fig. 2. In executing instructions 80, processor 66 receives input image data defining an input image from image input circuitry 70. The input image shows a row/column representation. Processor 66 uses the input image data to obtain row data indicating parts of the input image within a row of the row/column representation and column data indicating parts of the input image within a column of the row/column representation. Processor 66 then uses the row data and column data to obtain content data indicating information represented by the row/column representation for the row/column combination. Processor 66 can also be connected for providing data defining images to image output circuitry 90. For example, software product 60 could include data indicating instructions processor 66 can execute to use the content data to obtain output image data defining an output image. The output image could show a table or other representation showing the information represented for each row/column combination, for example. The output image data could be provided to image output circuitry 90, and could in turn be provided to fax machine 92, to printer 94, to display 96, or to network 98. The content data could also be used to provide control signals. For example, memory 68 could store control instructions processor 66 can execute to use the content data to obtain control data defining control signals. The control data could be provided to control output circuitry 100, which could respond by providing control signals to system 102. Rather than being used immediately, the content data could instead be stored in memory 68 for possible future use. This would be appropriate, for example, where information indicating an operation to be performed on an input image has not been obtained at the time data defining the input image is received. Fig. 4 illustrates ways in which a user can provide an image showing a hand sketch of a row/column representation. Fig. 5 illustrates ways in which a user can provide an image showing a row/column representation by interacting with a machine. Fig. 4 shows at the top several examples of images showing row/column representations. Image 100 shows an array with two rows and two columns; for each row/column combination, the array includes a feature, illustratively a character. Image 102 shows a table with two rows and two columns; for each row/column combination, the table includes a rectangle containing a feature, illustratively a character. Image 104 shows a matrix with two rows and two columns, enclosed by brackets at left and right; for each row/column combination, the matrix includes a feature, illustratively a character. Image 106 shows a crossword puzzle with three rows and two columns; for each row/column combination, the puzzle includes a square, with some squares shaded and others filled in with characters. Image 108 shows an excerpt from a calendar with rows for weeks and a column for each day of the week; for each row/column combination, the calendar includes a rectangle large enough to include a number for a day of the month and additional information, illustratively a character for the first day of the month. Image 110 shows an excerpt from a chess diagram; for each row/column combination, the diagram includes a square, with alternate squares white and shaded as in a checkerboard, and with some squares including symbols for chess pieces. Image 112 shows a tic-tac-toe game with three rows and three columns; for each row/column combination, the puzzle includes an area bounded on at least two sides, with some areas blank and others filled in with "O" or "X". Image 114 shows an excerpt from a circuit diagram of a programmable logic array (PLA) or another such array of circuitry with input lines extending in one direction and output lines extending in the other, defining rows and columns of intersections; some intersections are unmarked, but others are marked with an "X" to indicate a connection. Image 116 shows an excerpt from a go game diagram with horizontal and vertical lines forming rows and columns of intersections; some intersections are vacant, but others are covered with a white or black circle to indicate a white or black stone. As suggested by the examples, a wide variety of row/column representations can be formed. In general, the images in Fig. 4 can be obtained in any appropriate way. For example, the row/column representations can be sketches produced by marking actions performed on a marking medium by hand. If the marking medium is a sheet, scanner 130 can receive the sheet. Scanner 130 operates on the sheet to provide data defining an image showing a row/column representation. If the marking medium is a marking surface of an electronic device that can sense marks, encoder 132 can receive signals from the electronic device and use the signals to obtain data defining an image showing a row/column representation. This data can then be provided to printer 134 to obtain a sheet on which marks are printed, and this sheet can be provided to scanner 130. Scanner 130 provides data defining an image showing a row/column representation. Fig. 4 also shows that data from encoder 132 could be used directly as data defining an image showing a row/column representation. This would be appropriate if encoder 132 could provide data defining an image in response to marking actions. Fig. 5 shows machine 150, which could be a personal computer, a workstation, or another data processing system. Machine 150 includes processor 152; display 154; keyboard 156; pointing device 158, illustratively a mouse; and screen position indicating device 160, illustratively a stylus. A user can operate keyboard 156 and pointing device 158 to provide signals to processor 152. Or a user can perform marking actions with screen position indicating device 160 on the surface of display 154 to provide signals to processor 152. In response, processor 152 presents and modifies image 162 on display 154, so that the user can continue to provide signals until image 162 shows a desired row/column representation. Then the user can provide a signal requesting that processor 152 provide data defining image 162. Processor 152 could execute a number of types of software to permit a user to produce an image in the manner described above. Processor 152 could execute document editing software or image editing software, for example. Fig. 6 shows a system in which the general features described above have been implemented. System 180 in Fig. 6 includes workstation 182, a Sun SPARCStation 10 workstation. Scanner 184 can be a conventional scanner such as a Xerox Datacopy GS Plus scanner. Printer 186 can be a conventional printer such as a Xerox laser printer. Network 188 can be a conventional network operating in accordance with a standard protocol, such as the Ethernet protocol. Workstation CPU 190 is connected to receive data from scanner 184 and network 188 and is connected to provide data to printer 186 and network 188. For example, CPU 190 can receive data defining an image showing a row/column representation from scanner 184 as described above in relation to Fig. 4. Similarly, CPU 190 can receive data defining an image obtained in the manner described above in relation to Fig. 5 from network 188. In addition, workstation CPU 190 is connected to access program memory 192 and data memory 194 and other conventional workstation peripherals (not shown). Data memory 194 is illustratively storing image data 196 defining an image showing a row/column representation. Program memory 192 stores instructions CPU 190 can execute to perform operations implementing the general acts in Fig. 2. CPU 190 executes operating system instructions 200 that provide a Unix operating system (Unix is a registered trademark) or other appropriate operating system. The other instructions stored by program memory 192 make calls to operating system instructions 200 in a conventional manner. In general, the instructions can be obtained from source code in a conventional programming language such as Lisp, C, or the like with conventional compiler or interpreter techniques that produce object code. A machine can store data indicating the source code or the resulting object code on a data storage medium in manufacturing a software product as described above in relation to Fig. 3, with the source code or object code being stored for access by a storage medium access device when the software product is used in a machine like system 180. In executing image receiving instructions 202, CPU 190 receives data defining an image and stores it in data memory 194, as illustrated by image data 196. The data defining the image may be received from scanner 184 or network 188. In executing image processing instructions 204, CPU 190 calls indexing instructions 206 and content extraction instructions 208. Image processing instructions 204 also perform other operations relating to analysis of row/column representations. In executing indexing instructions 206, CPU 190 calls analysis instructions 210 to perform basic geometric analysis of the image defined by image data 196, producing row data 220 and column data 222. Row data 220 indicate parts of the image within a row. Column data 222 indicate parts of the image within a column. In executing content extraction instructions 208, CPU 190 can call analysis instructions 210 to perform basic geometric analysis of images defined by row data 220 and column data 222, producing content data 224. Content data 224 indicate information represented by the row/column representation for the row/column combination. Fig. 7 shows acts in executing image processing instructions 204 in Fig. 6. Fig. 8 shows acts in executing indexing instructions 206 in Fig. 6. Many of the acts in Figs. 7 and 8 are performed on items of data, each of which defines an image. Each item is referred to as a "data image." Some data images can be used in obtaining others. In general, all of the data images define images with the same number of pixels, and each operation produces an image with the same number of pixels. An operation on two images typically uses values of pairs of pixels to produce, for each pair, a pixel value in an image being produced; within each pair, one pixel is from each image and the two pixels in the pair are both at the same location as the pixel value in the image being produced. Many examples of such operations are described in European Patent Applications EP 654 748 A2 and EP 654 766 A2. The act in box 240 in Fig. 7 begins by receiving data defining an input image. The input image data may have been received previously by executing image receiving instructions 202, and may be provided with a call to image processing instructions 204. The act in box 242 uses the input image data from box 240 to obtain an indexed rows data image and an indexed columns data image. If the input image shows a row/column representation that meets certain constraints, the indexed rows data image includes, for each row, a connected component in which each pixel is labeled with a unique identifier for the row. Similarly, the indexed columns data image includes, for each column, a connected component in which each pixel is labeled with a unique identifier for the column. An implementation of the act in box 242 is discussed in greater detail below. The act in box 250 begins an outer iterative loop that performs an iteration for each row's connected component in the indexed rows data image. The act in box 252 begins an inner iterative loop that performs an iteration for each column's connected component in the indexed columns data image. The act in box 254 begins each inner iteration by obtaining a table item data image showing a table item that is in both the row and in the column currently being handled. The act in box 254 can be implemented by comparing the unique identifier of the current row with each pixel's label in the indexed rows data image to obtain a current row data image in which each pixel in the current row's connected component is ON; the act in box 254 can also compare the unique identifier of the current column with each pixel's label in the indexed columns data image to obtain a current column data image in which each pixel in the current column's connected component is ON. The act in box 254 can then AND the current row data image, the current column data image, and a table items data image showing the items in the table to obtain the table item data image. The table items data image can be obtained as discussed below in relation to the implementation of the act in box 242. The act in box 256 then uses the table item data image from box 254 to obtain box data indicating the table item's bounding box. The box data can be a list of four items--a left x coordinate, a top y coordinate, a width, and a height. The act in box 258 then adds the box data from box 256 to a sublist of boxes for the row currently being handled. When all the columns have been handled for the current row, the act in box 260 adds the current row's sublist to a list of sublists, and when all the rows have been handled, the act in box 262 returns the list of sublists as the content data. The list of sublists indicates a bounding box for an item at each row/column combination, and the indicated bounding box can be used with the input image data from box 240 to obtain data defining an image of the item. Fig. 8 shows how the act in box 242 in Fig. 7 can be implemented. Each box in Fig. 8 represents a data image. Input image data 270 is received from box 240 in Fig. 7. The act in box 242 can obtain table boundary data image 272 by selecting a connected component that has the largest bounding box. The act in box 242 can label each connected component in input image 270 with a unique identifier. Then, each connected component can be handled separately to obtain a bounding box area that is the product of the box width and height. The act in box 242 can perform a spread operation to label the pixels in each connected component with the connected component's bounding box area. The act in box 242 can obtain the maximum bounding box area, and can compare each pixel's label from the spread operation with the maximum bounding box area, keeping a pixel ON if its label is equal to the maximum to obtain table boundary data image 272. The act in box 242 can then use table boundary data image 272 to obtain gap-filled horizontal and vertical data images 274. The act in box 242 can first use table boundary data image 272 to obtain a horizontal non-gap data image and a vertical non-gap data images. The act in box 242 can then use the horizontal and vertical non-gap data images to obtain horizontals and verticals data images. The act in box 242 can then perform a gap fill operation on each of these data images to obtain gap filled horizontals and verticals data images 274. The act in box 242 can obtain the horizontal non-gap data image by first using table boundary data image 272 to obtain a skeleton data image. The act in box 242 can first obtain the complement of table boundary data image 272, then use the complement to obtain four partial edge data images. The partial edge data images can then be used to obtain an edge direction data image in which pixels on edges in opposite directions are labeled differently. The act in box 242 can obtain a horizontal maximum data image by taking, at each pixel, the maximum of the value from the - x partial edge data image and twice the value from the + x partial edge data image. Similarly, the act in box 242 can obtain a vertical maximum data image by taking, at each pixel, the maximum of the value from the - y partial edge data image and twice the value from the + y partial edge data image. To obtain revised horizontal and vertical maximum data images in which spurious edges are suppressed, the act in box 242 can obtain a differences data image for each of the horizontal and vertical maximum data images, and can gate the value at each pixel of the horizontal and vertical maximum data images by the value at the same pixel in the complement of the respective differences data image; in the differences data image, a pixel is ON if it has a four-neighbor with a distinct nonzero value in the maximum data image from which it was obtained. Finally, the act in box 242 can perform a read operation to obtain resulting data images in which each pixel is labeled with the value of the revised horizontal or vertical maximum data image at the nearest neighboring ON pixel in the complement of table boundary data image 272; obtain a differences data image for each resulting data image; and obtain the skeleton data image as the union of the differences data images. The act in box 242 can use the skeleton data image to obtain two partial edge data images in the +y and -y directions. The act in box 242 can obtain two intersection data images, one by intersecting the + y partial edge data image with a translation of the - y partial edge data image by one pixel in the - y direction, the other by intersecting the - y partial edge data image with a translation of the +y partial edge data image by one pixel in the +y direction. Then the act in box 242 can take the union of the intersection data images, obtaining a union data image. The act in box 242 use the union data image to obtain a horizontally grown data image in which any pixel is ON if it was within two pixels in a horizontal direction from an edge between an ON pixel and an OFF pixel that are horizontal neighbors. The act in box 242 can take the intersection of the skeleton data image with the horizontally grown data image, and can then take the union of the resulting data image with the union data image to obtain a horizontal non-gap data image in which a two-pixel wide gap at a crossing has been eliminated. The act in box 242 can similarly obtain the vertical non-gap data image using the same skeleton data image to obtain two partial edge data images in the + x and - x directions; obtaining two intersection data images; taking the union of the intersection data images; taking the intersection of the skeleton data image with a vertically grown data image obtained from the union data image; and taking the union of the resulting data image with the union data image to obtain the vertical non-gap data image. The act in box 242 can then obtain a vertical subset data image showing connected components in the vertical non-gap data image that are completely included in connected components in the horizontal non-gap data image. The act in box 242 can then perform a set difference operation to remove the vertical subset data image from the horizontal non-gap data image, obtaining a vertical-free horizontals data image. The act in box 242 can similarly obtain a horizontal subset data image showing connected components in the horizontal non-gap data image that are completely included in connected components in the vertical non-gap data image. The act in box 242 can then perform a set difference operation to remove the horizontal subset data image from the vertical non-gap data image, obtaining a horizontal-free verticals data image. Each subset data image can be obtained from a first image and a second image by first performing a set difference operation to remove the first image from the second image, obtaining a seed data image. The seed data image is then used in a coloring operation to obtain a version of the second image in which pixels are ON in the connected components that include parts of the second image that are not within connected components in the first image. This version can then be removed from the second image to obtain the subset data image showing connected components of the second image that are subsets of connected components in the first image. The act in box 242 can then use the vertical-free horizontals data image and the horizontal-free verticals data image to obtain horizontals and verticals data images, respectively. For example, the act in box 242 can obtain two distances data images, a first one in which each pixel is labeled with the distance to the nearest connected component in the vertical-free horizontals data image and a second one in which each pixel is labeled with the distance to the nearest connected component in the skeleton data image. The distances data images are used to obtain an exclusive closer data image in which a pixel is ON if its distance in the first distances data image is smaller than its distance in the second distances data image, so that the skeleton is grown out to the full width of the curve in those parts indicated by the vertical-free horizontals data image. The act in box 242 then obtains the intersection of table boundary data image 272 and the exclusive closer data image to obtain the horizontals data image. The act in box 242 can similarly use the horizontal-free verticals data image to obtain the verticals data image. The act in box 242 can perform a gap fill operation on the horizontals data image and table boundary data image 272 using a gap fill radius such as five pixels. If a gap between two ON pixels in the horizontals data image is less than the gap fill radius and if the two ON pixels are in the same connected component in table boundary data image 272, the gap fill operation connects the two ON pixels with other ON pixels extending between them, obtaining a gap filled horizontal data image. Similarly, the act in box 242 can perform a gap fill operation on the verticals data image and table boundary data image 272 using the same gap fill radius, obtaining a gap filled vertical data image. The act in box 242 can use gap filled horizontal and vertical data images 274 to obtain h-band and v-band data images 276. A pixel is ON in the h-band data image if it has nearest neighbors both in the + and -y directions in the gap filled horizontal data image. Similarly, each pixel is ON in the v-band data image if it has nearest neighbors both in the + x and - x directions in the gap filled vertical data image. The act in box 242 can also use table boundary data image 272 to obtain filled data image 278. The act in box 242 can then AND h-band and v-band data images 276 and filled data image 278 to obtain table h-band and v-band data images 280. A pixel is ON in the table h-band data image if it is ON both in the h-band data image and in filled data image 278. A pixel is ON in the table v-band data image if it is ON both in the v-band data image and in filled data image 278. The act in box 242 can also use table boundary data image 272 to obtain table panes data image 282. The act in box 242 can use table boundary data image 272 to obtain a holes data image and an internals data image, as described in relation to Fig. 7 of the Node-Link Structure Application. Then the act in box 242 can take the union of the holes data image and the internals data image to obtain table panes data image 282 as a filled holes data image. The act in box 242 can AND input image 270 and table panes data image 282 to obtain table items data image 284. In other words, table items data image 284 shows connected components that are within the panes of the table. Alternatively, the act in box 242 could obtain table items data image 284 by obtaining an internals data image from table boundary data image 272. The act in box 242 can use table h-band and v-band data images 280 and table items data image 284 to obtain rows and columns data images 286 by applying row constraints and column constraints as appropriate. For example, to distinguish rows and columns from narrow separator bands, a column constraint can include a width criterion requiring a column to be wider than the narrowest set of items in any column and a height criterion requiring the column to have a height greater than the shortest height of the set of items in any column; similarly, a row constraint can include a height criterion requiring a row to be taller than the shortest set of items in any row and a width criterion requiring the row to have a width greater than the smallest width of the set of items in any row. As a result of applying such criteria, each pixel is ON in the rows data image if it is within the x and y span of one of the connected components in the table h-band data image that has x and y spans greater than the minimum spans of the set of connected components in table items data image 284 that are within the same connected component in the table h-band data image. Similarly, each pixel is ON in the columns data image if it is within the x and y span of one of the connected components in the table v-band data image that has x and y spans greater than the minimum spans of the set of connected components in table items data image 284 that are within the same connected component in the table v-band data image. finally, the act in box 242 can use rows and columns data images 286 to obtain indexed rows and columns data images 288. The act in box 242 can use the rows data image to obtain an up edges data image in which each pixel is ON if it is at an upward edge of a connected component in the rows data image. The act in box 242 can then perform a project operation, labeling each pixel that is ON in the up edges data image with one more than the number of pixels above it that are ON. Then the act in box 242 can use the resulting data image to perform a spread operation, labeling each pixel in a connected component in the rows data image with the maximum value of any of its pixels in the data image resulting from the project operation. Then, to obtain consecutive labels, the act in box 242 can label each pixel with a unique identifier starting with one, the unique identifiers being assigned in the same order as the labels from the spread operation, obtaining the indexed rows data image. Similarly, the act in box 242 can use the columns data image to obtain a left edges data image in which each pixel is ON if it is at a leftward edge of a connected component in the columns data image. The act in box 242 can then perform a project operation, labeling each pixel that is ON in the left edges data image with one more than the number of pixels left of it that are ON. Then the act in box 242 can use the resulting data image to perform a spread operation, labeling each pixel in a connected component in the columns data image with the maximum value of any of its pixels in the data image resulting from the project operation. Then, the act in box 242 can label each pixel with a unique identifier starting with one, the unique identifiers being assigned in the same order as the labels from the spread operation, obtaining the indexed columns data image. The list from box 262 in Fig. 7, indicating an item for each row/column combination, can be used for various purposes. For example, it can be used to obtain a precisely formed row/column representation, such as a table. Fig. 9 illustrates how a list obtained from a sketch of a table has been used to obtain a precisely formed table with items copied from within the sketch. In Fig. 9, input image 310 shows a sketch of a row/column representation that is a table. The sketch includes a separate title bar across the top, four rows, and three columns. The first row includes headings for the columns, and the heading of the second column includes a subdivision into two parts. The table includes a double line between the first and second columns. When a list of sublists is obtained from input image 310 as described above in relation to Fig. 7, the list can be used to produce output image 312. As shown, output image 312 also shows a table which includes the items from within the rows and columns of the sketched table in input image 310. The title bar, which was separate, is not included, the double line between the first and second columns is changed to a single line, and the heading of the second column is copied, including the lines forming its subdivision. A rendering operation can produce a table as in output image 312 using a list of sublists like that returned in box 262 in Fig. 7. The rendering operation can begin by setting up a LaTex command string or other page description language (PDL) file which can be provided to a printer when completed. The rendering operation can then obtain the list of sublists. The rendering operation can go through the list of sublists to find the maximum height of the bounding boxes; the maximum height can then be used to scale all other heights to the size of the output. Then the rendering operation can perform an iterative loop to create a table string that can be included in the LaTex command string in the math mode. The iterative loop can go through the bounding boxes in the list of sublists, obtaining a list of postscript files, each defining an item for a row/column combination, creating a LaTex table string. Each item can be scaled by dividing its bounding box height by the maximum height of the items, and then multiplying the result by a fixed height for the rows of the precisely formed table. Fig. 10 shows an alternative implementation that uses an image processing server. System 390 in Fig. 10 includes network 392, workstation 394, storage server 396, and image processing server 398. A user can operate workstation 394 to provide requests on network 392 for storage of data defining images, such as from a scanner or other source. In response, storage server 396 can store the data. Then, the user can operate workstation 394 to provide requests for image processing operations like those described above. In response, image processing server 388 can perform the requested operations, executing instructions like those described above in relation to Fig. 6. Fig. 11 shows how the techniques described above could be applied in a personal computer that can operate as a fax server. Fig. 12 illustrates how the techniques described above could be applied in a copier. System 400 in Fig. 11 includes CPU 402, which can be the CPU of a personal computer such as an IBM PC compatible machine. CPU 402 is connected to receive user input signals from keyboard 404 and mouse 406, and can present images to a user through display 408. CPU 402 is also connected to a number of other peripheral devices, illustratively including disk drive 410, modem 412, scanner 414, and printer 416. Program memory 420 stores operating system (OS) instructions 422, which can be a version of DOS; user interface instructions 424; fax server instructions 426; and image processing instructions 428. Fax server instructions 426 can be similar to the PaperWorks™ software product from Xerox Corporation. Image processing instructions 428 can be implemented as described above in relation to image processing instructions 204 in Fig. 6 and in relation to Figs. 7-9. Fax server instructions 426 and image processing instructions 428 could be obtained in the form of a software product stored on a floppy disk, diskette, or CD-ROM, and accessed for storage in program memory 420 by disk drive 410. Data memory 440 stores input image data 442, row data 444, column data 446, and content data 448 as described above in relation to Figs. 6-8. Data memory 440 can also store output image data 450 if image processing instructions 428 obtain data defining an output image as described above in relation to Fig. 9. System 400 can obtain input image data 442 defining an image that shows a row/column representation in many ways: Data defining an image showing a row/column representation could be produced interactively as described above in relation to Fig. 5, such as by executing user interface instructions 424. Any appropriate user interface techniques could be used, including pen-based techniques. Data defining a previously produced image showing a row/column representation could be retrieved from a storage medium by disk drive 410. Data defining an image showing a row/column representation could be obtained from scanner 414 as described above in relation to Fig. 4. A user could produce data defining an image showing a row/column representation elsewhere and provide it to system 400 through modem 412, such as by making a facsimile transmission to modem 412. CPU 402 could execute fax server instructions 426 in response to a request received by facsimile transmission through modem 412. The request could include a form indicating an analysis operation and also indicating an output image destination such as a fax machine or printer 416. The request could also include data defining an image showing a row/column representation or could indicate an image previously obtained by system 400. Fax server instructions 426 could include calls to image processing instructions 428 to perform acts like those shown in Figs. 7 and 8 if the request indicates an analysis operation. Execution of fax server instructions 426 could further provide data defining an output image, which could be provided to modem 412 for facsimile transmission or to printer 416 for printing. In Fig. 12, copier 460 can be a digital copier or other electronic reprographics system. Scanning circuitry 462 obtains data defining input image 464 showing a row/column representation. User interface circuitry 470 includes touch sensing device 472, which can be a push button, a heat or pressure sensitive element, a capacitance sensing element, or other device for sensing a touching action. When a user touches device 472, user interface circuitry 470 provides touch data indicating that device 472 has been touched. Processing circuitry 480 uses the touch data to obtain request data indicating a request for an analysis operation. Then, responding to the request, processing circuitry 480 uses data defining input image 464 to automatically obtain row/column data indicating rows and columns in the row/column representation. Processing circuitry 480 then uses the row/column data to obtain content data indicating an item for each of a set of row/column combinations. Processing circuitry 480 then uses the content data to obtain data defining an output image that shows a table or other representation of the item for each row/column combination in the set. This data is provided to printing circuitry 490 for printing of output image 492. The invention could also be applied in combination with other techniques, including those described in the European Patent Applictions EP 654 754 A2 and EP 654 750 A2

Claims: A method including: obtaining input image data defining an input image (10) that shows a row/column representation (12) with rows and columns; characterised by the steps of: obtaining a table boundary data image (272) by selecting a connected component that has the largest bounding box by labelling the pixels in each connected component with the connected components bounding box area and keeping a pixel ON if its label is equal to the maximum bounding box area; using the table boundary data image (272) to obtain horizontal data and vertical data; the horizontal data indicating horizontal lines in the input image; the vertical data indicating vertical lines in the input image; and using the horizontal data and the input image data to obtain row data (20) as well as using the vertical data and the input image data to obtain column data (22); the row data (20) indicating parts of the input image between horizontal lines and the column data (22) indicating parts of the input image between vertical lines, the row/column representation representing information for a combination of the mth row and the nth column; and using the row data (20) and the column data (22) to obtain content data (24; 286) indicating information represented by the row/column representation (12) for the combination of the row and the column. A method as claimed in claim 1, in which the input image includes pixels; the act of using the horizontal data to obtain the row data (20) and using the vertical data to obtain the column data (22) comprising: using the horizontal data to obtain a row data image indicating a color value for each pixel in the input image; the row data image indicating, for each pixel in a part of the input image that is between horizontal lines, a color value that uniquely identifies a row between horizontal lines; and using the vertical data to obtain a column data image indicating a color value for each pixel in the input image; the column data image indicating, for each pixel in a part of the input image that is between vertical lines, a color value that uniquely identifies a column between vertical lines. A method as claimed in one of claims 1 or 2, in which the content data (24) include a list of sublists, each sublist including a list of combination identifiers, each combination identifier identifying a combination of one of the columns of the row/column representation with a row of the row/column representation (12), the combination identifiers together identifying combinations of all of the columns of the row/column representation with the row. A method as claimed in one of claims 1 to 3, the method further comprising: providing data defining images as output via image output circuitry (90); the input image showing a sketch of a row/column representation (12); using the content data to obtain output image data defining an output image that includes a row/column representation similar to the sketch; and providing the output image data to the image output circuitry. A machine including: image input circuitry (70) for obtaining data defining images as input; a processor (66) connected for receiving data defining images from the image input circuitry (70) and connected for accessing data stored in a memory; the data stored in the memory comprising instruction data indicating image processing instructions the processor can execute; the processor, in executing the image processing instructions: receiving input image data from the image input circuitry, the input image data defining an input image that shows a row/column representation; characterised by executing the instructions of: obtaining a table boundary data image (272) by selecting a connected component that has the largest bounding box by labelling the pixels in each connected component with the connected components bounding box area and keeping a pixel ON if its label is equal to the maximum bounding box area; using the table boundary data image (272) to obtain horizontal data and vertical data; the horizontal data indicating horizontal lines in the input image; the vertical data indicating vertical lines in the input image; and using the horizontal data the input image data and to obtain row data (20) as well as using the vertical data and the input image data to obtain column data (22); the row data (20) indicating parts of the input image between horizontal lines and the column data (22) indicating parts of the input image between vertical lines; the row-column representation representing information for a combination of the row and the column; and using the row data (20) and the column data (22) to obtain content data (24; 286) indicating information represented by the row/column representation (12) for the combination of the row and the column. An article of manufacture for use in a machine that includes: image input circuitry (70) for obtaining data defining images as input; a storage medium access device (64) for accessing a medium (62) that stores data; and a processor (66) connected for receiving data defining images from the image input circuitry (70); the processor further being connected for receiving data from the storage medium access device; the article comprising: a storage medium that can be accessed by the storage medium access device when the article is used in the system; and data stored by the storage medium so that the storage medium access device can provide the stored data to the processor when the article is used in the system; the stored data comprising instruction data indicating instructions the processor can execute; the processor, in executing the instructions: receiving input image data from the image input circuitry, the input image data defining an input image that shows a row/column representation; characterised by executing the instructions of: obtaining a table boundary data image (272) by selecting a connected component that has the largest bounding box by labelling the pixels in each connected component with the connected components bounding box area and keeping a pixel ON if its label is equal to the maximum bounding box area; using the table boundary data image (272) to obtain horizontal data and vertical data; the horizontal data indicating horizontal lines in the input image; the vertical data indicating vertical lines in the input image; using the horizontal data and the input image data to obtain row data (20) as well as using the vertical data and the input image data to obtain the column data (22); the row data (20) indicating parts of the input image between horizontal lines and the column data (22) indicating parts of the input image between vertical lines; the row-column representation representing information for a combination of the row and the column; and using the row data (20) and the column data (22) to obtain content data (24; 286) indicating information represented by the row/column representation (12) for the combination of the row and the column.

Inventors: MAHONEY JAMES, MAHONEY, JAMES
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1994
Main classification: G06K9
IPC codes: G06T7, G06K9