Method and apparatus for pattern matching coding

Abstract: Image data is separated to character region and image region in a character/image separating portion (102). A mark is cut off from the character region by a mark cut-off portion (103). The image region is inputted to both the mark cut-off portion and an image period determining portion (104). The image period determining portion determines the period of grid image and dither image in the image region and notifies that period information to the mark cut-off portion. The mark cut-off portion cuts off the mark from an image in accordance with the period information. The mark cut-off by the mark cut-off portion is accumulated in an accumulating portion (106) for use as a library and it is determined whether or not there is a match library in old libraries by a match determining portion (105). If the match determining portion determines that there is a match library, it sends both the mark and match library to a coding portion (107). The coding portion carries out arithmetic coding by using a template for referring to the mark and reference match library at the same time.

Description: The present invention relates to a pattern matching coding device using pattern matching and a coding method therefor, and more particularly to a pattern matching coding device for coding by extracting a mark from an image region and a character region and a coding method therefor. As a document on the conventional art, ISO/IEC JTC 1/SC 29/WGI N205 Lossless and Lossy Compression of Test Images by Soft Pattern Matching, pages 1-29 (issued on June 30, 1995) by Paul G. Howard (AT & T Bell Labs) is accessible. The above-mentioned document states a coding method which is effective for image data including mainly binary characters and images and employs a pattern matching coding system. According to this conventional pattern matching coding method, characters are extracted from an image in a small unit such as a unit of a single character (hereinafter referred to as mark) and that mark is compared with a plurality of marks accumulated preliminarily (hereinafter referred to as library). If there is a mark equivalent to an extracted mark in a library, when the extracted mark is coded, also that match mark in the library is referred to as a part of a coding template at the same time, thereby making it possible to achieve coding. A similar pattern matching coding system is disclosed in US-A-4,922,545. However, such a method of the conventional art has a problem that since only the character region is an object for processing and a conventional coding method is applied for the image region, compression rate is not improved. Further, according to the conventional method, since different coding portions need to be provided for the character region and image region, there is a problem that the circuit size is enlarged. It is an object of the present invention to provide a pattern matching coding device in which a mark is extracted also from the image region and the image region is subjected to the same processing as the character region, thereby eliminating the necessity of a coding portion dedicated for the image region, so that the circuit size can be reduced. Further, another object of the present invention is to provide a pattern matching coding device in which when the mark is cut off from the image region, a periodicity of the object image is recognized and a region of a size matching with that period is cut off from the image as a mark, thereby making it possible achieve a high compression rate. These objects are achieved with the features of the claims. Fig. 1 is a block diagram showing a structure of a conventional pattern matching coding system; Figs. 2A and 2B are explanatory views showing conventional match templates; Fig. 3 is an explanatory view showing a conventional match template; Fig. 4 is a block diagram showing a structure of an embodiment of a pattern matching coding device of the present invention; Fig. 5 is a block diagram showing a concrete example of the pattern matching coding device of the present invention; Fig. 6 is an explanatory view showing a region of grid image in which grids are independent in an embodiment of the pattern matching coding device of the present invention; Fig. 7 is an explanatory view showing a region in which a plurality of grids are connected to each other in an embodiment of the pattern matching coding device of the present invention; Fig. 8 is an explanatory view showing an observation window in an embodiment of the pattern matching coding device of the present invention; and Fig. 9 is a. flowchart showing a flow of processing in a mark correlation check portion of the pattern matching coding device of the present invention. Fig. 1 shows a block diagram of a structure of a conventional pattern matching coding system. Referring to Fig. 1, image data inputted through an input terminal 9 is separated by a character/image separating portion 10 into a character region in which characters are concentrated and an image region in which no character exists. The image region in which no character exists is coded by a conventional coding device 14 such as JBIG (Joint Bi-level Image coding experts Group ITU-T T.82/ISO/IEC 11544) without effecting any special processing. The character region in which characters are concentrated is subjected to the following processing. First of all, a mark cut-off portion 11 cuts off the characters one by one from the character region in which characters are concentrated. Each cut-off character is called mark. The cut-off marks are accumulated in an accumulating portion 13 and the accumulated mark is inputted from the accumulating portion 13 into a coding portion 15 as reference library. The reference library inputted into the coding portion 15 is used as a future library. At the same time, the reference library outputted from the accumulating portion 13 is inputted into a match determining portion 12. The match determining portion 12 determines whether or not there is a library matching with the mark cut off by the mark cut-off portion 11. In the case where the match determining portion 12 determines that there is a matching library, that matching library is sent to the coding portion 15 together with the cut-off mark and outputted through an output terminal 16. The coding portion 15 codes using a match template for the mark exemplified in Fig. 2A and a match template for the mark exemplified in Fig. 2B so as to be capable of referring to both the cut-off mark and match library. As a result, the coding amount is reduced because a higher coding efficiency is exhibited in comparison with an unmatch template for the mark exemplified in Fig. 3 which does not refer to the library. Incidentally, in Figs. 2A and 2B and Fig. 3, the symbol [P] indicates a processing object pixel and the numbers [1]-[11] indicate reference pixels. However, the conventional pattern matching coding system has such a problem that since only the character region is an object for processing and the conventional coding method is applied to the image region, compression ratio is not improved. Further, according to the conventional method since different coding portions need to be provided for the character region and image region, there is a problem that the circuit size is enlarged. Hereinafter, the pattern matching coding device of the present invention and the coding method therefor will be concretely described with reference to the accompanying drawings. Fig. 4 shows a structure of an embodiment of the pattern matching coding device of the present invention through a block diagram. Referring to Fig. 4, the pattern matching coding device comprises an input terminal 101 through which image data is to be inputted, a character/image separating portion 102 for separating the image data inputted through the input terminal 101 to the character region and image region, a mark cut-off portion 103 for cutting off a mark from the character region, and an image period determining portion 104 for determining the period of grid image and dither image in the image region and notifying the period information to the mark cut-off portion 103. Further, the pattern matching coding device further comprises a match determining portion 105 for determining whether or not there is a matching library in an old library, an accumulating portion 106 for accumulating a mark cut off by the mark cut-off portion 103 and using it as library, a coding portion 107 for carrying out arithmetic coding (QM-coder) using a template to refer both to the mark in the mark cut-off portion 103 and reference match library accumulated in the accumulating portion 106, and an output terminal 108 which is connected to the coding portion 107. In this pattern matching coding device, image data inputted through the input terminal 101 is separated into the character region and image region by the character/image separating portion 102. From the character region, the mark is cut off by the mark cut-off portion 103 in the same manner as the conventional method. The image region is inputted to both the mark cut-off portion 103 and image period determining portion 104. The image period determining portion 104 determines the period of the grid image and dither image in the image region and notifies that period information to the mark cut-off portion 103. The mark cut-off portion 103 cuts off the mark from the image according to the period information. At this time, the mark size is of the period or integer times of the period. As a result, as the mark of an image having a period is used, it is possible to obtain a high matching ratio, so that a high compression ratio can be obtained. The mark cut off by the mark cut-off portion 103 is accumulated in the accumulating portion 106 for use as library, and by the match determining portion 105 it is determined whether or not there is a library matching with an old library. If the match determining portion determines that there is a matching library, the matching library (hereinafter referred to as match library) is sent together with the mark to the coding portion 107. The coding portion 107 carries out arithmetic coding using a template for referring to both the mark and reference match library at the same time. If there is no match library, only the mark is sent to the coding portion 107. In this case, the coding portion 107 carries out arithmetic coding using a template for referring to only the mark. Next, Fig. 5 shows a concrete example of the pattern matching coding device of the present invention. Incidentally, in this embodiment, the image data including the characters and grid image is an object for processing. For the following description, see Fig. 5. The pattern matching coding device comprises an input terminal 118 through which image data 119 is to be inputted, a memory 120 for accumulating image data 119 inputted through the input terminal 118, a boundary tracing portion 122 for fetching the necessary part of an image data 121 from the memory 120 and cutting off a mark, and a mark correlation check portion 125 to which a mark 124 larger than a predetermined value is to be inputted from the boundary tracing portion 122 and which is provided with an observation window for observing pixels on a straight line, the observation window being moved over the mark 124 so as to search for a pixel having a high correlation. The pattern matching coding device further comprises a mark redividing portion 127 to which period information observed by the mark correlation check portion 125 is to be sent and which redivides the mark in accordance with a size matching with the period, an accumulative FIFO memory (first-in first-out memory) 130 for accumulating redivided mark 128 into the library, a match determining portion 129 for referring to a library 132 accumulated in the accumulative FIFO memory 130 and determining whether or not there is a library matching with the redivided mark 128 or normal size mark 123 sent from the boundary tracing portion 122, a match template 135 in which it is determined that a library sent from the match determining portion 129 matches with the mark 131 and that library is sent as a match library 133 together with the mark 131, an unmatch template 134 to which only the mark 131 from the match determining portion 129 is to be sent, and an arithmetic coder 138. The arithmetic coder 138 outputs a template value 136 from the unmatch template 134 as an encoded code 139 through an output terminal 140 and outputs a template value 137 of the match template 135 as an encoded code 139 through the output terminal 140. Incidentally, if there are plural matching libraries, a library found first is selected. If there is no matching library, only the mark 131 from the match determining portion 129 is sent to the unmatch template 134. In this pattern matching coding device, the image data 119 inputted through the input terminal 118 is accumulated in the memory 120. The boundary tracing portion 122 fetches the necessary part of the image data 121 from the memory 120 and cuts off a mark by the boundary tracing method. At this time, if the size of the cut-off mark is below a predetermined value, it is determined to be a character region or a region of grid image in which the grids are independent. The region of grid image in which the grids are independent means a region in which a grid 150 is separated from an adjacent grid 150 as shown in Fig. 6. If the size of the cut-off mark 124 is over a predetermined value, it is determined to be a region of grid image in which a plurality of the grids 150 are connected to each other. The region in which a plurality of the grids 150 are connected to each other means a region shown in Fig. 7. If the region shown in Fig. 7 is subjected to boundary tracing by the boundary tracing portion 122, since the entire connected region is cut off as a single mark, the size of the mark is so large that the possibility that it matches upon pattern match is reduced. A mark 124 larger than a predetermined value is inputted into the mark correlation check portion 125. The mark correlation check portion 125 is provided with an observation window 160 for observing a pixel on a straight line as shown in Fig. 8 and by moving the observation window 160 over the mark, a pixel having a high correlation is searched. Incidentally, in Fig. 8, the symbol [X] indicates a reference pixel and the symbols [A]-[G] indicate observation pixels. Next, Fig. 9 shows a flow of processing in the mark correlation check portion 125. First of all, counts (A count, B count, ... G count) corresponding respectively to the observation pixels [A]-[G] are prepared (step S1). Next, it is determined whether or not each of the observation pixels [A]-[G] matches with the reference pixel [X] (X = A?) (step S2). If each of the observation pixels [A]-[G] matches with the reference pixel [X] (same color), the corresponding counter is incremented by 1 (A count = A count + 1) (step S3). If none of the observation pixels matches with the reference pixel, the corresponding counter is decremented by 1 (A count = A count - 1) (step S4). In such a flow, the observation window 160 is repeatedly moved in the mark for X = A-G and it is determined whether or not the observation window has moved in a predetermined amount or moved entirely over the mark (step S5). And, if the observation window has moved over a predetermined amount or entirely over the mark, this processing is terminated and then it is investigated which counter has a maximum value. A distance between the observation pixel [A]-[G] corresponding to the counter having the maximum value and the reference pixel [X] becomes a period (step S6). For example, if the counter of the observation pixel [C] has the maximum value, a distance between the observation pixel [A] and the reference pixel [X] or three pixels is the period Further, if the observation window has not moved by a predetermined amount or entirely over the mark, the observation window 160 is moved by a single pixel to return the processing to step S2 and then the following steps are repeated. Returning to Fig. 5, the period information 126 observed by the mark correlation check portion 125 is sent to the mark redividing portion 127. The mark redividing portion 127 redivides the mark 124 in a size matching with the period and outputs it as the mark 128. The redivided mark 128 is accumulated in the accumulative FIFO memory 130 and added to the library and used for match determination in the match determining portion 129. The match determining portion 129 refers to the library 132 accumulated in the accumulative FIFO memory 130 and determines whether or not there is a library matching with the mark. In this embodiment, the matching library needs to satisfy the following conditions. I. The library size and mark size are smaller than a predetermined value both in the longitudinal and lateral directions (for example, below one pixel both in the longitudinal and lateral directions). II. When the library is overlapped with the mark, the number of pixels not matching is smaller than a predetermined value (for example, below 20 pixels). A library satisfying the above conditions is determined to match with the mark and sent to the match template 135 together with the mark 131 as the match library 133. In the case where there are a plurality of matching libraries, a library found first is selected. In the case where there is no matching library, only the mark 131 is sent to the unmatch template 134. The template value 136 from the unmatch template 134 is coded by the arithmetic coder 138 and outputted as the code 139 through the output terminal 140. In the same manner, the template value 136 from the match template 135 is outputted through the output terminal 140 as the code 139 encoded in the arithmetic coder 138. Hereunder, a flow of the operation of the pattern matching device shown in Fig. 5 will be described. First of all, after processing of the image data 121 is started, the boundary tracing portion 122 cuts off one mark contained in the image data 121 by boundary tracing. Next, it is determined whether or not the cut-off mark is larger than a predetermined size. If the cut-off mark is larger than the predetermined size, since the possibility that that mark 124 is not a character is high, its correlation check is carried out by the mark correlation check portion 125 and it is determined whether or not that mark has a periodicity. If it has a periodicity, the mark 124 is redivided in a size matching with the period by the mark redividing portion 127. The divided mark 128 is registered in the library and then it is determined whether or not there is a matching library in libraries previously registered. If there is a match library, the match library 133 and the mark 131 are coded by using the match template 135. If there is no match library, only the mark 131 is coded by using the unmatch template 134. The above processing is repeated until all the marks 131, 133 are processed and if all the marks have been processed, the processing is terminated. As described above by the embodiment, according to the pattern matching coding device of the present invention and the coding method therefor, the mark is divided into marks having a predetermined size so as to improve the matching rate. Thus, the present invention is capable of providing the pattern matching coding device in which the pattern matching coding system which can be conventionally applied only to the character region can be applied to the image region, and the coding method therefor. Further, according to the present invention, specifically for an image having a periodicity, a higher coding efficiency can be achieved by matching the period with a pattern size. Further, according to the present invention, since no additional coder is necessary for image region processing, the circuit size can be reduced.

Claims: A pattern matching coding device comprising: a character/image separating portion (102) for separating an inputted image data into a character region and an image region; a mark cut-off portion (103) for cutting off a mark from said character region; a match determining portion (105) for determining whether or not there is a match library in old libraries; an accumulating portion (106) for accumulating the mark cut off by said mark cut-off portion and using it as a library; and a coding portion (107) for carrying out arithmetic coding; characterized in that the image region is inputted both to the mark out-off portion for the extraction of a mark from the image region and to an image period determining portion (104) for determining a period of a grid image and dither image in the image region and notifying the period information to said mark cut-off portion; and wherein the coding portion (107) is adapted for using a template for referring at the same time to the mark cut off by said mark cut-off portion and reference match library accumulated in said accumulating portion. A coding method for a pattern matching coding device, wherein image data is separated into a character region and an image region by a character/image separating portion (102); a mark is cut off from said character region by a mark cut-off portion (103); and the cut-off mark is accumulated in an accumulating portion (106) for use as a library and used for a match determining portion (105) to determine whether or not there is a match library in old libraries and if there is a match library, both said mark and the match library are sent to a coding portion (107); characterized in that said image region is inputted to both said mark cut-off portion for the extraction of a mark from said image region, and to an image period determining portion (104); said image period determining portion determines the period of the grid image and dither image in said image region; the period information is notified to said mark cut-off portion and said coding portion (107) carries out arithmetic coding by using a template for referring to the mark and said match library at the same time. A coding method as claimed in claim 2, wherein when said mark cut-off portion cuts off the mark from an image in accordance with said period information, the mark size is the period or integer times of the period.

Inventors: ARAI MITSUTOSHI, ARAI, MITSUTOSHI
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1999
Main classification: G06T9
IPC codes: H04N1, G06T9