Editing text in an image

Abstract: Character level text editing is performed on an image without recognizing characters, by operating on a character-size array obtained from a two-dimensional array defining an image region. A processor, in response to a request for a text editing operation, accesses an edit data structure that includes the image region array and performs the operation. The character-size array is obtained by dividing the image region array when necessary. An image region array that includes more than one line is divided along interline spaces. An image region array that includes one line is divided along intercharacter spaces. Character-size arrays are divided out of larger arrays by finding connected component bounding boxes, and then determining from the bounding boxes whether the connected components are likely to form a character. If so, the connected components are used to obtain the character-size array and spatial data about position, size, and shape of the character. Smaller arrays and spatial data can replace a larger array in the edit data structure. Smaller arrays are obtained only as necessary to perform a requested text editing operation, and if the edit data structure is not otherwise modified, obtaining a smaller array does not necessitate redrawing of the display. In addition to character level editing, a text editing operation can be performed on a sequence of arrays, such as a word, line, or a sequence that begins on one line and ends on another. The spatial data can be used to position arrays after insertion or deletion, to advance a cursor through the text, and to justify a line of arrays. A character-size array can be assigned to a keyboard key, and the key may then be used to insert that array into the text or to request a search for other arrays matching that array.

Description: Background of the Invention This invention was made with US-Government support under Contract No. N00140-86-C-8996 awarded by the Defense Advanced Research Projects Agency (DARPA). The Government has certain rights in this invention. The present invention relates to techniques for image processing. More specifically, the invention relates to editing an image of text defined by digital data. For example, the image can be defined by a two-dimensional data array. Kim, S.E., Viewpoint: Toward a Computer for Visual Thinkers, University Microfilms, Ann Arbor, 1988, pp. 22-97, 115, and 123-131 describes Viewpoint, a text and graphics editor. Pages 22-23 describe pixels, indicating that every structure in Viewpoint can be edited as pixels. Pages 24-25 describe Viewpoint, indicating that the representative form of structured graphics in Viewpoint is text, which uses a single, fixed width font, positioned on a fixed grid of square cells to simplify character parsing; text and graphics editing both work on cells. Pages 29-81 describe a demonstration of Viewpoint, with illustrations: Page 36 shows the effect of selecting a cell, including a large scale reproduction in a special screen area; pages 38-39 illustrate copying; pages 42-57 describe typing, including word wrap on encountering a noncharacter, deletion, font editing, and overtyping; pages 58-69 describe a visual boot, showing how the keyboard is built up; pages 70-81 describe edges of the system, including typing off the edge of the screen and drawing over a key border or a key image. Pages 84-97 describe inner workings of Viewpoint, with page 85 indicating that text is treated as a kind of graphics, page 93 describing how word wrap reveals the structure of text by pixel parsing to find the ends of lines and word breaks. Page 115 describes text editors, indicating that another editor stores text as a rectangular array of character cells and scans patterns of spaces and characters to locate paragraph and column breaks. Pages 123-125 are a Viewpoint manual, explaining at item 9 how typing a key copies the contents of the appropriate key image cell to the current cell, advancing the cursor one cell. Suenaga, Y., and Nagura, M., "A Facsimile Based Manuscript Layout and Editing System by Auxiliary Mark Recognition," 5th International Conference on Pattern Recognition Proceedings , December 1-4, 1980, Vol. 2, pp. 856-858, describe an editor whose only input device is a FAX transmitter and whose only output device is a FAX receiver. Fig. 1 shows components of the system, including OCR, and Fig. 2 shows the processing flow, which includes a text editing subsystem and a graphics editing subsystem. The text editing subsystem, described on page 857, employs eleven handwritten auxiliary marks, shown in Fig. 3, which are input on separate paper from the text being edited. In response to an auxiliary mark, the text editing subsystem rearranges the binary picture of the text, as illustrated in Figs. 4(a) and 4(b). The text format is estimated from the text picture. Marginal distribution (profile) and horizontal connectivity are used to divide the text picture into Segmented Blocks (SBs), corresponding to the rectangular regions which cover the individual characters in Japanese texts, individual words in alphanumeric texts, or graphics to be processed as binary patterns. A Segmented Block List (SBL) is constructed and used to extract and classify marks based on topological and metric features. A Mark Parameters List for Texts (MPL-T) is constructed. A Picture Allocation List (PAL), a list consisting of the SB numbers and their linkage addresses, is generated according to the MPL-T and SBL. Character strings or patterns are virtually deleted, moved, copied, and combined in PAL. The binary picture of the original text is rearranged according to the PAL to construct the fair copy. Previous work is described in Suenaga, Y., "A Facsimile Based Text Editor Using Handwritten Mark Recognition," Proceedings of the Sixth International Joint Conference on Artificial Intelligence, Tokyo, August 20-23, 1979 , Vol. 2, 1979, pp. 856-858. Page 856 indicates that the method can be combined with usual text editors or word processors. Page 856 also states the assumption that characters must be placed according to ruled lines and describes the position mark drawn according to the ruled lines and from which the format and block size of manuscripts are estimated. Page 857 describes the picture allocation list (PAL) as consisting of block numbers and addresses indicating the order. Wong, K.Y., Casey, R.G., and Wahl, F.M., "Document Analysis System," IBM Journal of Research and Development , Vol. 26, No. 6, November 1982, pp. 647-656, describe a system, shown in Fig. 1, that assists a user in encoding printed documents for computer processing. An Image Manipulation Editor (IEDIT) described at pages 648-649 reads and stores images on disk and provides image-editing functions such as copy, move, erase, etc. As described at pages 649-656, a digitized printed document is segmented and classified into regions of text and images. Blocks containing text can be analyzed with a pattern-matching program that groups similar symbols from the document and creates a prototype pattern to represent each group. During pattern matching, the position and matching prototype index for each text pattern is recorded; the position may be the coordinates of the lower left corner of the array representing the pattern. The prototype patterns are identified interactively or by automatic recognition logic. GB 2 162 350 A describes an image processing system which can process various information such as documents, pictures, tables or the like that have already been typed and which also can perform the editing such as deletion, addition or the like of this information. After inputting the image information, the processor recognises lines in the image, obtains a baseline of each character line and extracts spaces between characters and spaces between words. The image processing system is also capable to detect a paragraph, to recognise a hyphen and to convert the length of a line, thereby shifting the image information of single words. Moreover, the processor can perform the editing such as the insertion, deletion or the like of characters for text from such as the character code table or font table which is obtained from a sample page containing the fonts of all characters to be used which has to be processed similar to the ordinary image pages. It is the object of the present invention to provide a method of performing an editing operation on text included in a pixelwise defined image in a time efficient manner. This object is solved by the subject matter of claim 1. Preferred embodiments are the subject matter of the dependent claims. Brief Description of the Drawings Fig. 1 is a flow chart showing stages in editing text in an image according to the invention. Fig. 2 is a block diagram showing general components of a system that can edit text in an image according to the invention. Fig. 3 is a flow chart showing general steps in a character level text editing operation according to the invention. Fig. 4 is a flow chart illustrating steps in obtaining a character-size array that includes a single connected component according to the invention. Fig. 5 is a flow chart illustrating steps in obtaining a character-size array that includes more than one connected component. Fig. 6 is a flow chart illustrating steps in obtaining character-size arrays for connected components having potentially overlapping bounding boxes. Fig. 7 is a flow chart showing general steps in assigning a character-size array to a keyboard key according to the invention. Fig. 8 is a flow chart showing general steps in searching for arrays that match a character-size array assigned to a key. Detailed Description A. Conceptual Framework The following conceptual framework is helpful in understanding the broad scope of the invention, and the terms defined below have the meanings indicated throughout this application, including the claims. "Character" means a discrete element that appears in a writing system. Characters in the English language can thus include not only alphabetic and numerical elements, but also punctuation marks, diacritical marks, mathematical and logical symbols, and other elements included in writing English. More generally, characters can include, in addition to alphanumeric elements, phonetic, ideographic, or pictographic elements. A "character type" is a category of which a character may be an instance, such as the letter "a" or the number "3". A "word" is a set of one or more characters that is treated as a semantic unit in a language. A "text" is an arrangement of one or more lines of characters; the characters of a text may form words. An "image" is a pattern of light. An image may include characters, words, and text as well as other features such as graphics. A "data structure" is any combination of interrelated items of data. An item of data is "included" in a data structure when it can be accessed using the locations or data of other items in the data structure; the included item of data may be another data structure. Conversely, an item of data can be "removed" from a data structure by rendering it inaccessible, such as by deleting it. An "array of data" or "data array" or "array" is a data structure that includes items of data that can be mapped into an array. A "two-dimensional array" is a data array whose items of data can be mapped into an array having two dimensions. A data structure can be "obtained" from another data structure by operations that produce the data structure using data in the other data structure. For example, an array can be "obtained" from another array by operations such as producing a smaller array that is the same as a part of the other array, producing a larger array that includes a part that is the same as the other array, copying the other array, or modifying data in the other array or in a copy of it. A "data unit" is an item of data that is accessible as a unit within a data structure. An "array data unit" is a data unit that includes data sufficient to define an array; for example, an array data unit may include the defined array itself, a compressed or encoded form of the defined array, a pointer to the defined array, a pointer to a part of another array from which the defined array can be obtained, or pointers to a set of smaller arrays from which the defined array can be obtained. Data "defines" an image when the data includes sufficient information to produce the image. For example, a two-dimensional array can define all or any part of an image, with each item of data in the array providing a value indicating the color of a respective location of the image. A "character-size array" is a two dimensional array that defines only one character or character-size element. Each location in an image may be called a "pixel." In an array defining an image in which each item of data provides a value, each value indicating the color of a location may be called a "pixel value". Each pixel value is a bit in the "binary form" of the image, a grey-scale value in a "grey-scale form" of the image, or a set of color space coordinates in a "color coordinate form" of the image, the binary form, grey-scale form, and color coordinate form each being a two-dimensional array defining the image. A "version" of a first image is a second image produced using data defining the first image. The second image may be identical to the first image, or it may be modified by loss of resolution, by changing the data defining the first image, or by other processes that result in a modified version. A "view" of an image is a version of the image that is displayed to a user; a view can omit some details of the image or can be otherwise modified. A "text editing operation" is an operation that assumes that the data on which it is performed defines lines of elements that can be treated as if it were text. Examples of text editing operations include inserting and deleting elements, changing a characteristic of an element such as typeface, changing alignment and spacing, cursor positioning, justification, moving characters or a cursor to a following line, searching for a character or sequence of characters, and so forth. A "character level text editing operation" is a text editing operation that affects a character or character-size element in text being edited. Examples of character level text editing operations include inserting, deleting, changing, or positioning a character; positioning a cursor on a character; searching for a character; and so forth. A "connected component" or "blob" is a set of pixels within a data array defining an image, all of which are connected to each other through an appropriate rule such as that they are neighbors of each other or are both neighbors of other members of the set. A connected component of a binary form of an image can include a connected set of pixels that have the same binary value, such as black. A "connected component set" or "component set" is a set of connected components that are treated as a unit. A character can therefore be a component set; for example, the letter "i" includes two connected components that are treated as a single character in English text--the connected components "form" the character. A "bounding box" for a character or other component set is a rectangle just large enough to include all the pixels in the component set, and can be specified by coordinates. The data used to produce a modified version of an image that includes text can include information about a character in the text. "Identity information" about a character is information identifying its character type, case, typeface, point size, or the like. To "recognize" a character means to obtain identity information about the character from a digital form of an image that includes the character. "Spatial information" about a character is information identifying its spatial characteristics, such as its size, shape, position, orientation, alignment with other characters, or the like. Although spatial information and identity information are not completely independent, spatial information about a character can be obtained from a two-dimensional array defining an image without recognizing the character. A "data processing system" is a system that processes data. A "data processor" or "processor" is any component or system that can process data, and may include one or more central processing units or other processing components. An "image input device" is a device that can receive an image and provide a signal defining a version of the image. A "scanner" is an image input device that receives an image by a scanning operation, such as by scanning a document. A "user input device" is a device such as a keyboard or a mouse that can provide signals based on actions of a user. The data from the user input device may be a "request" for an operation, in which case the system may perform the requested operation in response. An "image output device" is a device that can provide an image as output. A "display" is an image output device that provides information in visual form, such as on the screen of a cathode ray tube. A processor "accesses" a data structure by any operation that retrieves or modifies data included in the data structure, such as by reading or writing data at a location in memory that is included in the data structure. A processor can be "connected for accessing" a data structure by any combination of connections with local or remote memory or input/output devices that permits the processor to access the data structure B. General Features General features of the invention can be understood from Figs. 1-8. Fig. 1 shows stages in character level text editing operations according to the invention. Fig. 2 shows general components of a system that can perform such editing. Fig. 3 shows general steps in a character level text editing operation performed by the processor of the system in Fig. 2. Fig. 4 illustrates steps in obtaining a character-size array that includes a single connected component. Fig. 5 illustrates steps in obtaining a character-size array that includes two connected components. Fig. 6 illustrates steps in finding two character-size arrays whose connected components have potentially overlapping bounding boxes. Fig. 7 shows steps in assigning a character to a key on a keyboard. Fig. 8 shows steps in searching for arrays that match a character-size array assigned to a key. Fig. 1 includes two columns of boxes. Each box in the left column indicates a process performed by the processor of a system in a stage of editing, while each box in the right column indicates a user interface event, either by showing a part of a text as it would be displayed or by showing a user input action. The editing operations result in an edit data structure that defines a modified version of an image. The process in box 10 is the display of a view of an image, which can be an image defined by a two-dimensional data array, such as a binary array. Box 12 shows a sequence of characters, "one", that appears in the view of the image, together with arrow 14 that is positioned to point to the character "o". The position of arrow 14 can be controlled through an appropriate user input device such as a mouse. The process in box 16 receives a first request for a character level text editing operation from the user. In this case, the request indicates a position on a character, which can be a request to position a currently active area such as a cursor on the character. This request can be provided by a click, as illustrated in box 18. For example, a mouse button, a keyboard key, or another button or key could be clicked when arrow 14 is pointing to a character. Requests indicating a position do not always indicate a character--in other cases, they may indicate operations on a sequence of characters such as a word, a line, or an extended sequence that begins on one line and ends on another; in these cases, the indicated position may precede or follow the indicated sequence of characters. In response to the request received in box 16, the process in box 20 obtains a smaller array from a larger array such as the image array. The process in box 20 also obtains spatial information about the part of the image defined by the smaller array. If the indicated part is a character, as illustrated, the process in box 20 obtains a character-size array and the spatial information may be about its size, shape, or position. The process in box 20 includes in the edit data structure an array data unit defining the array and the spatial information, and completes the requested operation by making this array data unit the currently active position for further text editing. The process in box 20 also provides feedback to the user, as shown in box 22. Like box 12, box 22 shows the sequence of characters "one", but with darkened rectangle 24 around the character "o" to indicate the currently active position, which is illustratively the left edge of rectangle 24. Rectangle 24 can also be inverted or flashing. Box 22 also shows arrow 26, now positioned to point to the character "n". The process in box 28 receives a second request from the user for another character level text editing operation. As illustrated in box 30, the requested operation is a copy operation, provided with a click to indicate a character to be copied to the currently active position, which is illustratively the position immediately preceding rectangle 24. In response to the request received in box 28, the process in box 32 obtains a character-size array that defines the character to be copied, and also obtains spatial information about it. It then inserts a character by including in the edit data structure an array data unit defining the character-size array, positioned in the modified version of the image in accordance with the spatial information about the character to be copied and also about the character "o", obtained in box 20; character-size arrays and spatial information for other characters, both those neighboring the character to be copied and those neighboring the position in which the copy is being inserted, can also be obtained and used in positioning the inserted character. The inserted character can be positioned by including appropriate position data in array data unit. Based on spatial information about spacings between characters, the inserted character can be positioned along the direction of the line of characters. Following characters on the line can be repositioned along the direction of the line to make room for the inserted character. Based on information about transverse character positions, the inserted character can also be positioned in a direction transverse to the line of characters. When the requested operation is completed, a view of the modified version of the image is displayed, as shown in box 34, with darkened rectangle 36 around the inserted character "n" to indicate the currently active position. System 50 in Fig. 2 includes processor 52, connected to receive signals from image input device 54 and user input device 56. Image input device 54 could be a scanner, a facsimile receiver or other image receiver, a camera, or other appropriate device or could be a part of local or remote memory that stores an image in digital form. User input device 56 could, for example, be a keyboard with a mouse. Processor 52 can also be connected to image output device 58, such as a screen display, a printer, a facsimile transmitter or other image transmitter, or a part of local or remote memory that can store an image in digital form. Processor 52 is also connected to access program memory 60 and data memory 80. Program memory 60 includes image input routine 62, user input routine 64, editing subroutines 66, image parsing subroutines 68, and image output subroutines 70. Data memory 80 includes image input data structure 82, parsed image data structure 84, and image output data structure 86. In executing image input routine 62, processor 52 loads data from image input device 54 into image input data structure 82, which is a two-dimensional data array. In response to signals from user input device 56, processor 52 performs user input routine 64, which may include calls to editing subroutines 66. Editing subroutines 66 in turn may call image parsing subroutines 68 which obtain smaller arrays from the data array in image input data structure 82 or from previously obtained arrays. As shown, parsed image data structure 84 includes one or more subsidiary data structures called lines; each line data structure in turn includes one or more array data units, each defining either a character-size array that includes a set of one or more connected components or an unparsed array that could be further parsed into character-size arrays by image parsing subroutines 68. Similarly, parsed image data structure 84 can also include array data units defining unparsed arrays that could be further parsed by image parsing subroutines 68 to obtain line data structures. Parsed image data structure 84 can thus define a modified version of the image defined by image input data structure 82. Editing subroutines 66 may also call image output subroutines 70, which produce image output data structure 86. Image output data structure 86 may be used to provide a view of the image defined by image input data structure 82 or to provide a view of the modified version of the image as defined by parsed image data structure 84. In either case, the view is provided to image output device 58. Fig. 3 shows steps that can occur in a character level text editing operation, steps that can be performed by a processor such as processor 52 in system 50. A request for the text editing operation is received in box 100. In system 50, the request can be received by processor 52 from user input device 56. In response, the step in box 102 performs the requested operation. In system 50, processor 52 can perform a character level text editing operation by executing the appropriate editing subroutines 66, during which it may access and modify parsed image data structure 84. When a text editing operation affects a character within an unparsed array, it may be necessary to obtain a character-size array for the character from the unparsed array. The array data unit defining the character-size array, as well as line data structures and other array data units defining character-size arrays and other arrays, can be manipulated within parsed image data structure 84 to perform the requested operation. Therefore, when necessary, processor 52 obtains a character-size array by executing image parsing subroutines 68, which may include finding a set of connected components that define a character or other element in an unparsed array. The manipulation of parsed image data structure 84 by processor 52 could affect arrays defining one or more characters or other character-size sets of connected components, one or more words, one or more lines of text, a subsequence of text that begins on one line and ends on another, and so forth. The manipulation could include operations equivalent to one or more insertions or deletions. After this manipulation, parsed image data structure 84 defines the modified or edited version of the image. When the requested operation is completed, processor 52 can execute image output subroutines 70 to produce image output data structure 86, which can be used to provide an output image through image output device 58. This output image is a view of the modified or edited version of the image defined by parsed image data structure 84. Fig. 4 illustrates steps that can be taken in dividing an unparsed array to obtain smaller arrays. These steps could occur in performing the step in box 102 in Fig. 3. Image part 120 is defined by the unparsed array being divided, and illustratively includes lines of text, each with several characters. The steps illustrated in Fig. 4 are performed in response to a user request indicating a position within the character "a" on the first line in image part 120. Based on the indicated position, processor 52 could access the array defining image part 120 by accessing the part of parsed image data structure shown in box 122 to find the smallest array that includes the indicated position. The parsed image data structure includes an array data unit for unparsed array A, which defines image part 120. This array data unit includes data indicating spatial information about unparsed array A, such as the size, shape, and position of image part 120; this data indicating spatial information is used to determine that the position indicated by the user request is within image part 120. The data unit also includes either a two-dimensional array defining image part 120 or a pointer to such an array. The initial step in dividing unparsed array A is to divide from it data defining the line of text that includes the position indicated by the user request. This can be done, for example, by dividing along the blank horizontal spaces nearest to the position indicated. Image part 120 has no blank horizontal space above the indicated position, but has a blank horizontal interline space below it, and therefore unparsed array A can be divided into line array B, defining image part 130, and unparsed array C, defining image part 132. Image part 130 is shown shaded to indicate it includes the indicated position. Since these arrays include sufficient data to define all of image part 120 defined by unparsed array A, array data units defining them can replace the array data unit for unparsed array A, as in the part of parsed image data structure shown in box 134. The next step is to divide from the current smallest array that includes the indicated position, line array B, a smaller part that includes the indicated position. This can be done, for example, by dividing along the blank vertical spaces nearest to the position indicated. In this manner, image part 130 can be divided along vertical intercharacter spaces into image parts 142 and 144, defined respectively by unparsed arrays D and E. Image part 142 is shown shaded to indicate it includes the indicated position. The data unit defining line array B is expanded to include array data units for each of these arrays, as in the part of parsed image data structure shown in box 146. Finally, the current smallest array that includes the indicated position, unparsed array D, is analyzed to find connected components. Unparsed array D only contains one connected component, the character "a". This connected component can therefore be treated as a component set, meaning a set of connected components that are likely to be a character and are therefore manipulated as a unit. A character-size array that includes all of the component set is then obtained; in this case, character-size array F, which has a rectangular bounding box, defines image part 150, shown shaded to indicate that it includes the indicated position. Character-size array F together with spatial information indicating the position of image part 150 are sufficient to define unparsed array D. Therefore, an array data unit for character-size array F can replace the array data unit for unparsed array D in the part of parsed image data structure shown in box 152. Fig. 4 thus illustrates dividing an unparsed array to find a character-size array that includes only one connected component that is the only component set in the unparsed array. Fig. 5 illustrates a case where the unparsed array includes two connected components that form one component set, and Fig. 6 illustrates a case where the unparsed array has two component sets whose bounding boxes could overlap. In Fig. 5, an unparsed array has been accessed that defines image part 170, which includes an instance of the character "i". The array, unparsed array L with an array data unit in the part of parsed image data structure shown in box 172, could be accessed based on a user request indicating a position within the character "i". Therefore, unparsed array L is the current smallest array that includes the indicated position. From the position of unparsed array L's data unit within the part of parsed image data structure shown in box 172, processor 52 can determine that the appropriate next step is to find connected components and, for each connected component, its bounding box. Image part 180 includes image parts 182 and 184, each defined by the bounding box of a connected component. Image part 182 includes the dot of the character "i", while image part 184 includes the body of the character "i" and is shaded to indicate that it includes the indicated position. Upon finding more than one connected component in an unparsed array, processor 52 can apply rules to determine whether the connected components can be treated as a unit; these rules could be based on the likelihood that the connected components form a character. These rules can use data about the bounding boxes of the connected components, such as their sizes, shapes, or positions. For example, if bounding box data indicates the relatively small size of image part 182 and indicates its proximity to relatively large image part 184, a rule could indicate that the connected components in the image parts can be treated as a unit. Or, if bounding box data indicates that the centers of the bounding boxes are within a specified number of pixels of being vertically aligned, a rule could indicate that the connected components can be treated as a unit, and therefore form a component set. Applying one of these rules, unparsed array L can be divided such that image part 190 includes image part 192, defined by character-size array N, a bounding box of the component set. Because the array data unit for character-size array N in the part of parsed image data structure shown in box 194 includes sufficient data to provide image part 190, it replaces the data unit for unparsed array L in the part of parsed image data structure shown in box 172. Image part 192 is shaded to indicate that it includes the indicated position. In Fig. 6, an unparsed array has been accessed that defines image part 200, which includes two adjacent instances of the character "/", positioned with the bottom of the second below the top of the first such that no blank vertical line can go between them. The array, unparsed array S with an array data unit in the part of parsed image data structure shown in box 202, could be accessed based on a user request indicating a position within the second instance of the character "/". Therefore, unparsed array S is the current smallest array that includes the indicated position. From the position of unparsed array S's data unit within the part of parsed image data structure shown in box 202, processor 52 can determine that the appropriate next step is to find connected components and, for each connected component, its bounding box. Image part 210 includes image parts 212 and 214, each defined by the bounding box of a connected component. Image part 212 includes the first instance of the character "/", while image part 214 includes the second and is shaded to indicate that it includes the indicated position. Processor 52 can again apply rules to determine whether the two connected components found can be treated as a unit. Here, if bounding box data indicates that the centers of the bounding boxes are separated by more than a threshold, a rule could indicate that the connected components cannot be treated as a unit forming a component set. Therefore image part 220, obtained after applying the rules, includes only image part 222 containing the connected component whose bounding box is image part 214. Image part 222 does not include any part of the connected component whose bounding box is image part 212. The part of parsed image data structure shown in box 226 includes array data units for character-size arrays U and V, with character-size array V defining image part 222 and character-size array U defining a similar image part that contains the connected component whose bounding box is image part 212. The array data units for character-size arrays U and V replace the data unit for unparsed array S in the part of parsed image data structure shown in box 226. Image part 222 is shaded to indicate that it includes the indicated position. Fig. 6 illustrates a special problem that arises where the bounding boxes of connected components could overlap. Image part 222 cannot be an actual part of image part 200, because then it would include one end of the connected component whose bounding box is image part 212. Therefore, the array data unit for character-size array V cannot be a pointer into the two-dimensional array defining image part 200. This problem can be solved by including a two-dimensional array defining image part 222 in the array data unit for character-size array V; this two-dimensional array can be obtained by starting with the connected component whose bounding box is image part 214 and obtaining a blank rectangular region around it. Fig. 6 suggests another problem that may arise with component sets that have potentially overlapping bounding boxes: How should the system respond if the user indicates a position in the overlapping area? This problem could be solved by treating a position in the overlapping area as indicating a position in the connected component set whose center is leftmost. Editing subroutines 66 can also include special operations involving character-size arrays. Figs. 7 and 8 show examples of special editing operations that involve character-size arrays. Fig. 7 illustrates steps in assigning an array to a key on the keyboard of user input device 56. Fig. 8 illustrates steps in performing a search for an array which matches one which has been previously assigned to a key. The steps in Fig. 7 could be preceded by steps like those in boxes 10 and 16 of Fig. 1 or other steps such as those in boxes 28 and 32, in either case resulting in an active array; in Fig. 1 the active array is indicated in box 22 by shaded area 24 and in box 34 by shaded area 36. The step in box 240, as in box 20 in Fig. 1, provides a view of an image, a portion of the view being shown in box 242 with shaded area 244 indicating that the character-size array that includes the character "r" in the sequence of characters "ered" within the view is the currently active array. In box 250, the user provides a signal requesting a key assigning operation. For example, the user could have previously requested entry into a teach mode in which a series of arrays can be successively assigned to keys. While in the teach mode, each time the user depresses a key on the keyboard, the currently active array is assigned to the depressed key. Therefore, in box 252, processor 52 receives the request for a key assignment and performs appropriate editing subroutines 66 to assign the character-size array that includes the character "r" to the specified key, which could appropriately be the "r" key on the keyboard. In the teach mode, processor 52 could then move the currently active array to the next position in the text, so that the user could then type another key to assign the next array; in this manner, the user could type the sequence of characters in the text in order to assign the arrays of the text to keys on the keyboard, with an appropriate rule for combining or replacing arrays where the same character appears more than once in the text so that more than one array is assigned to the same key. Processor 52 could also perform appropriate image output subroutines 70 to provide feedback indicating key assignment, such as by presenting a view of a keyboard with each assigned array displayed in the position of the assigned key. In general, rather than entering key assignments manually based on a text, the user should be able, through an appropriate signal, to request that a stored set of arrays be assigned to the keys, such as arrays for the characters of a given font of a typeface, or that arrays be assigned to the keys based on the results of character recognition. The user could also delete all earlier assignments upon entering the teach mode. No matter how the assignment of arrays to keys is made, when the user clicks an assigned key in the type mode, as in box 260, processor 52 receives this as a request to type a character in box 262. Processor 52 then executes appropriate editing subroutines 66 to insert the character-size array or other array assigned to the specified key at the currently active position in the image. Processor 52 then executes appropriate image output subroutines 70 to display a view of the modified version of the image, in box 264. As shown in box 266, this view includes shaded area 268 indicating the inserted array--in this case a character-size array that includes the character "r". Parsed image data structure 84 can also be searched for a character-size array that matches an array that has previously been assigned to a key, as illustrated in Fig. 8. The first event in Fig. 8 is a signal from user input device 56 indicating that the user has requested a search together with a click of the specified key assigned to a character-size array, in this case the key assigned to the character-size array that includes the character "r". In response, processor 52, receiving the request in box 282, finds a matching array in box 284. The matching array could be found with standard template matching and convolution techniques. Processor 52 then presents a view of the image in which the matching array is shaded, as shown in box 286 by shaded area 288.

Claims: A method of performing an editing operation on text included in a pixelwise defined image, said method being carried out by means of a processor (52) which is connected for accessing an edit data structure including a first two-dimensional array of data defining a region of said image (120) that includes a first character which is to be edited, said method comprising the steps of: receiving a request for a character level text editing operation input by a user, said request containing information related to the position of the first character, which information is input by the user through an input device, in response to the request, defining said first two-dimensional array such that it includes the position input by the user, parsing said defined first two-dimensional array by analysing the array for lines of text, dividing said first two-dimensional array of data into a second two-dimensional array that includes no lines of text other than that line of text which includes the indicated position and into an unparsed data array including the remaining lines of text, parsing said defined second two-dimensional array by analysing for interline spaces, dividing said parsed second two-dimensional array into a third two-dimensional array that defines an image region that cannot be further divided by the above steps and that includes the indicated position and into a further unparsed array, parsing said third two-dimensional array by analysing the array for connected components and if, based on this analysis, it is likely that the connected components form a character, obtaining a bounding box that defines a character size-array including only the character found by the analysis, considering the found character to represent said first character to be edited, and performing the requested editing operation on the character size-array. The method of claim 1 in which the image output device has a display, the image output device (58) presenting the views provided by the processor on the display, the processor being further connected for receiving the request from a user input device (56), the user input device including a pointer control device for providing signals indicating positioning of a pointer on the display. The method of claim 1 in which the substep of parsing the third two-dimensional array comprises the substep of finding a set of at least one connected component within the third two-dimensional array.

Inventors: BAGLEY STEVEN C, KOPEC GARY E, BAGLEY, STEVEN C., KOPEC, GARY E.
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1990
Main classification: G06T11
IPC codes: G06T1, G06T11