GB2187357A - Encoding image data - Google Patents

Encoding image data Download PDF

Info

Publication number
GB2187357A
GB2187357A GB08628512A GB8628512A GB2187357A GB 2187357 A GB2187357 A GB 2187357A GB 08628512 A GB08628512 A GB 08628512A GB 8628512 A GB8628512 A GB 8628512A GB 2187357 A GB2187357 A GB 2187357A
Authority
GB
United Kingdom
Prior art keywords
image
pel
black
lines
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
GB08628512A
Other versions
GB2187357B (en
GB8628512D0 (en
Inventor
Murray James John Holt
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Services Ltd
Original Assignee
Fujitsu Services Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Services Ltd filed Critical Fujitsu Services Ltd
Publication of GB8628512D0 publication Critical patent/GB8628512D0/en
Publication of GB2187357A publication Critical patent/GB2187357A/en
Application granted granted Critical
Publication of GB2187357B publication Critical patent/GB2187357B/en
Expired legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/41Bandwidth or redundancy reduction
    • H04N1/411Bandwidth or redundancy reduction for the transmission or storage or reproduction of two-tone pictures, e.g. black and white pictures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/004Predictors, e.g. intraframe, interframe coding

Abstract

A method of encoding image data is described in which the image is first partially thinned to produce a semi-thinned image in which most lines are reduced to skeletons, but thicker lines and solid areas remain more than one picture element (pel) wide. The semi-thinned image is then decomposed into a thin component containing the skeletal lines, and a thick components containing the remainder of the image. These two components are then encoded separately to ensure efficient encoding. For example, the thin component may be encoded by chain-coding or pel-prediction coding, and the thick component by modified READ coding. Decoding is essentially the reverse of the encoding process. <IMAGE>

Description

SPECIFICATION Method of encoding image data Background to the invention This invention relates to a method of encoding image data and is particularly, although not exclusively, concerned with an encoding method for use in a digital facsimile system.
Digital facsimile is an increasingly important aspect of office automation. Equipment is widely available that can scan and digitise black and white documents at a resolution of 7.7 dots per mm, horizontally and vertically. At this resolution, an A4 document generates about 0.5 Mbytes of image data, and compression of this data is therefore of great importance.
One known method of compressing two-level image data is the Modified READ Code (MRC) scheme described for example in ''International digital facsimile coding standards" by R. Hunter et al, Proc. IEEE, Vol. 68, No. 7, pages 854-867 (1980). This can compress typical office documents by factors between 8 and 30, depending on information content. MRC is essentially an encoding of the positions of the edges of black objects in the image, from which the original image can be reconstructed exactly, point for point.
Greater compression can often be achieved by tracing and coding the individual black lines in the image, at the expense of some of the accuracy of the reconstructed image. One such method is described in "Compression of binary images by stroke encoding" by l.D. Judd, IEE Journal of Computers and Digital Techniques, Vol. 2, No. 1, pages 41-48 (1979). In this method, the image is pre-processed by a thinning step which removes an outer layer of black picture elements (pels) from each black object in the image. This reduces most typewritten characters to skeletons one pel in width. Lines of connected black pels are then traced in the thinned image, and are encoded using a chain coding technique, in which the position of each pel is represented by a code indicating its position relative to the preceding pel in the line.The image can be reconstructed from its encoded form by reversing the process, i.e., retracing the lines and then thickening them.
This method is found to be satisfactory for images consisting only of thin black lines.
However, it is not suitable for images containing bolder black lines or solid black areas. These areas are not reduced to skeletons, and are encoded as if they consisted of bundles of black lines of unit width, which is not an efficient way of encoding them.
The object of the present invention is to overcome this problem.
Summary of the invention According to the invention there is provided a method of encoding image data, comprising the steps: (a) thinning the image by an amount such as to produce a semi-thinned image in which lines of less than a predetermined thickness are reduced to skeletons one pel wide, but any thicker lines and areas remain more than one pel wide; (b) decomposing the semi-thinned image into a thin component, containing lines one pel wide, and a thick component containing the remainder of the image; (c) encoding the thin component by means of method that is efficient at encoding lines one pel wide (e.g. chain-coding or pel-prediction coding) and (d) separately encoding the thick component (e.g. by MRC Coding) One encoding method in accordance with the invention will now be described, by way of example, with reference to the accompanying drawings.
Brief description of the drawings Figure 1 is an overall view of the encoding method.
Figure 2 shows the corresponding decoding method.
Figure 3 shows a set of masks used for noise filtering in the encoding method.
Figure 4 shows a set of masks used for image thinning in the encoding method.
Figure 5 shows a pair of masks used for image decomposition in the encoding method.
Figure 6 shows a set of masks used for image thickening in the decoding method.
Description of an embodiment of the invention The method described is intended for use in a digital facsimile system in which documents are stored or transmitted in digitised form. Documents are initially digitised by means of a conventional document scanner, at a resolution of 7.7 dots per mm. The image data from the scanner is stored in a memory, and is then operated upon by the encoding method to produce a compressed image. The compressed image can either by stored in a memory, or transmitted over a channel. When it is desired to read the document, the compressed image data is decoded, so as to reconstruct the original image. The image can then be displayed in a screen, or printed. The encoding and decoding can be performed by any'suitable data processing apparatus, such as the ICL PERQ computer.
Referring to Fig. 1, this shows an overall view of the encoding method.
The image is first processed by a noise filtering step to eliminate isolated pels and irregularities in the edges of objects. A partial thinning process then removes the outer layers of pels from black objects, subject to constraints which preserve connectivity. The extent of this thinning is varied according to the thickness of lines in the original image. The output from this process is called a 'semi-thin' image.
The semi-thin image is then decomposed into thin and thick components. The thin component contains only those black lines that are one pel wide in the semi-thin image, whilst the thick component consists of solid black areas and lines two or more pels in thickness. The thin component is chain-coded, whilst the thick component is modified READ coded.
Fig. 2 shows the decoding process. The thin component is reconstructed exactly from the chain code. The thick component is reconstructed from the MRC representation, and superimposed on the thin component. A thickening process is then applied to restore the average thickness of the original image.
The process steps shown in Figs. 1 and 2 will now be described in detail.
In the descriptions that follow, the procedures for noise-filtering, partial thinning, and thickening, are defined in terms of 'masks'. A mask is a two-dimensional pattern of black and white pels which is mapped onto the image in every possible position. Whenever equivalence exists between the mask and the image, the pel corresponding to the centre of the mask is changed in the image from black to white or vice versa. The application of masks to an image can be timeconsuming if only sequential operations are used. However, the ICL Perq computer is capable of hardware-assisted pseudo-parallel raster operations which enable masks to be applied extremely rapidly.
Noise Filtering The original scanned image data may contain erroneous pels due to the presence of microscopic dirt spots on the original page or minor deficiencies in the scanning and thresholding processes. It is desirable to eliminate such irregularities prior to thinning since they can cause distortion in the reconstructed image and can also reduce the compression achieved by the coding princess.
The noise filtering process uses a set of masks as shown in Fig. 3a and 3b.There are also further masks, not shown, corresponding to rotations of the last four masks in Figs. 3a and 3b by 90 , 1800, and 270".
The first mask in Fig. 3a eliminates isolated black pels, whilst the first mask in Fig. 3b eliminates isolated white pels. Similarly, the other 3 x 3 masks in Figs. 3a, and 3b (and their rotations) eliminate single-pel irregularities in horizontal and vertical edges.
The 5 x 5 masks eliminate irregularities in diagonal edges. 5 x 5 masks are used for this purpose, rather than 3 > c x3 masks since it was found that the latter can introduce unwanted distortion, by eliminating 2 x 2 dots and holes, and by eroding the ends of lines which are two pels in thickness. Such effects are particularly detrimental to the legibility of punctuation and small characters. The use of 5 5x5 5 masks does not substantially increase the processing time since, as can be seen from Figs. 3a and 3b, only one of the outer pels in each 5x5 masks needs to be examined.
The masks are applied in two stages. First, the black-pel masks in Fig. 3a are applied simultaneously to the original data, changing black pels to white whenever a match is detected.
Next, the white-pel masks in Fig. 3b are applied to the result, changing white pels to black whenever a match is detected. The application of the masks in this order has been found to produce the desired noise-filtering without introducing any unwanted distortion.
Thinning In the thinning procedure, edge pels of black objects are removed by an iterative application of a set of 3 x 3 masks, subject to certain constraints. Each iteration consists of four subcycles which remove separately the left, right, top and bottom edges of black objects.
The masks used in the left-edge subcycle are shown in Fig. 4. The masks for the other three subcycles are the same, but rotated by 90 , 1800 and 270 as appropriate.
The first mask shown in Fig. 4 is an edge-detection mask which detects the left-hand edges of black objects, whilst the other three masks are used as constraining masks. If a 3 x 3 area of the image matches the edge-detection mask, the central black pel of that area is changed to white, provided that the area does not also match any of the three constraining masks. The purpose of the first two constraining masks is to preserve connectivity between the black areas in the image. These masks detect the situation where, if the central pel were deleted, connectivity between the black pels would be destroyed. The purpose of the third constraining mask is to prevent erosion of line ends.
The thinning procedure is performed as a number of half-cycles. In odd-numbered half-cycles, the left and top edges are removed, and in the even-numbered half-cycles, the right and bottom edges are removed. The number of half-cycles executed in the thinning procedure depends on the average thickness of the black lines in the image; in this case, the number of half-cycles is chosen to be one less than the average line thickness (expressed in pels). For example, if the average line thickness is three pels, then two half-cycles (i.e., one complete cycle) are performed.
The average line thickness may be determined experimentally or subjectively by the operator and entered as a constant into the system before the encoding procedure is started. Alternatively, the average line thickness may be determined automatically by measuring the distribution of black run-lengths in the image.
In this way, the majority of black lines in the image are reduced to skeletons, one pel wide, whilst the substance of thicker black lines and solid objects is preserved.
The final half-cycle is followed by a further smoothing, again using the 3 x 3 masks of Fig. 3a.
The purpose of this smoothing is to remove occasional notches from otherwise skeletal lines, thereby increasing the effectiveness of chain coding.
Decomposition The semi-thin image is decomposed by assigning to the thin component any black pel which has at least one pair of adjacent white pels on opposite sides. The remaining black pels are assigned to the thick component.
The decomposition process is defined using a pair of masks shown in Fig. 5. In any 3x3 neighbourhood in the semi-thin image which matches either of the two masks, the central black pel is copied to a second image buffer which is previously initialised with all white pels. The corresponding pels in the semi-thin image are then deleted (i.e. changed to white). The masks are then applied in the same way a second time, in order to ensure that the 'thin' component includes the black pels at right-angle bends in lines and at junctions between lines. The remaining black pels in the semi-thin image become the 'thick' component.
Coding The thin component is processed by a line-tracking procedure which identifies chains of connected black pels. These chains are then coded by a chain-coding procedure. The thick component is modified READ coded.
Line- Tracking Lines are tracked sequentially in a copy of the 'thin' component, held in memory. To avoid double-tracking, black pels in a line are deleted (i.e. changed to white) once they have been tracked and coded.
The direction of a line is denoted below by one of eight compass points (N, NW, W, SW, S, SE, E, NE), where N is towards the top of the image, E is to the right and so on. The 'starting point' of a tracked line is defined as the position of the first black pel in the line. At any stage during the tracking, the 'current point' is the location of the most recently identified black pel in a line, and the 'current direction' is the direction of the current point relative to the previous point.
The line-tracking procedure consists of the following steps: (1) Starting from the top, each scan line in the image data is searched from left to right, until a run of one or more consecutive black pels is identified.
(2) If the run-length is one, then the current direction defaults to S, and the single pel becomes both the starting point and the current point.
If the run-length is greater than one, then two pels on the next scan line, and to the S and SE of the right-most black pel in the run are tested.
If either of these two pels is black, then the leftmost black pel in the run becomes the starting point, and the black pels in the run are added to the line from left to right. If the pel to the S of the rightmost black pel is black, then that pel becomes the current point and the current direction is S. Otherwise, the pel to the SE of the rightmost black pel becomes the current point, and the current direction is SE.
If both of the pels to the S and SE of the rightmost black pel are white, then the rightmost black pel becomes the starting point, and the black pels in the run are added to the line from right to left. The leftmost black pel becomes the current point, and the current direction is W.
(3) Each subsequent cycle in the line-tracking procedure searches for a further pel in the line.
Five positions adjoining the current point are searched for a black pel. The pel in the current direction is tested first, followed by the two pels at 45" to the current direction, and finally the two pels at 90" to the current direction. For example, if the current direction is S, then pels adjoining the current point are tested in order S, SE, SW, E, W. Acute-angled turns are not allowed. As soon as a black pel is found in any of the five positions tested, that pel is added to the line, the current point and the current direction are updated, and step (3) is repeated.
(4) If none of the five pels tested is black, then the current line is considered to have ended.
Searching of the thinned image data continues from the starting point of the line until the next black run is located. A new line is then tracked by repeating step (2).
(5) When the search of the image data reaches the righthand end of the bottom scan line, the procedure terminates.
The procedure groups all of the black pels in the image into a set of lines. Any simple continuous line of one pel in thickness is tracked to its end. At a junction where a line branches into two, the straighter branch is tracked, leaving the other branch to be tracked later as a separate line. In lines of two or more pels in thickness, and in solid black areas, the straightest possible course is tracked, leaving the remaining black areas to be tracked as subsequent lines.
Chain-coding The positions of black pels in any line are encoded by differential chain-coding. Each pel is encoded as soon as it is located by the line-tracking procedure. The codewords used for chaincoding are given in Table 1. Each codeword is decodable instantaneously, i.e., without reference to subsequent codewords in the encoded data.
TABLE 1 Codewords used in Chain-coding
GROUP STATE CODEWORD HORIZONTAL LINE-START COORDINATE 00000000000 to (0-1727) 11010111111 END OF SCAN LINE (EOL) 111 E 00 INITIAL SE 110 DIRECTION S 01 SW 111 W 10 STRAIGHT-AHEAD 0 CHANGE IN 450 LEFT 100 DIRCTION 450 RIGHT 101 0 90 LEFT 1100 900 RIGHT 1101 END OF CHAIN 111 The position of the starting point of a line is defined absoluteiy in the code. The position of each subsequent pel in the line can be fully defined by its direction relative to the preceding pel, since successive pels in a given line are always in adjacent positions. The second pel in a line is defined by an absolute direction relative to the starting point. Subsequent pels are defined by a change of direction, or 'turn', relative to the preceding two pels.
For each scan line in the image, any tracked lines starting in that scan line are encoded. A three-bit end-of-line (EOL) codeword is then inserted, indicating no more line-starts in the current scan line. A scan line in which no line-starts occur is encoded with just the EOL codeword.
The vertical coordinate of the starting point of a line is implicitly defined in the code, since the number of the current scan lines can be determined from a count of previous occurrences of the EOL codeword. The horizontal coordinate of a starting point is encoded uncompressed, requiring 11 bits. This allows a maximum page width of 1728 pels, corresponding to an A4 document sampled at 7.7 points per mm.
Since the line-tracking procedure searches the image from top to bottom, an initial line direction of NW, N, or NE occurs with zero probability. Thus, there are only five possible states for the initial direction. SW and SE are assigned longer codewords, since they have been found to occur slightly less frequently than the other three possible initial directions.
Subsequent turns can take six states. The straight-ahead turn (no change in direction) occurs very frequently (observed probability=0.45-0.55), and is therefore assigned a single-bit codeword. Thrns of 45" to the left and right are each assigned three-bit codewords, and the two 90 turns, which occur less frequently, are assigned four-bit codewords. An acute-angled turn is ignored by the line-tracking procedure. The sixth state is the end of a tracked line, and has a three-bit codeword.
The end of the chain-coded sequence is defined when the final EOL code is sent.
Decoding The reconstruction of the semi-thin image from the code is essentially a reversal of the encoding process. An image buffer is initialised with all white pels. The chain-coded lines are then 're-drawn' by changing pels to black at the positions given by the decoded starting points and directions, so as to reconstruct the thin component. The 'thick' component is then added by decoding the Modified READ Coded data, super-imposing each decoded scan line on the reconstructed image.
Thickening The thickening procedure is iterative, each cycle increasing the thickness of black lines and objects by one pel. The number of thickening cycles is chosen so that the thickness of lines in the reconstructed image is as close as possible to the average line thickness in the original image. This number can be chosen during the encoding process and passed to the decoder with the coded image data.
Each thickening cycle adds a layer of black pels to the edges of black objects and lines in the semi-thin image. In the first cycle, and any subsequent odd-number cycles, black pels are added to the left-hand and top edges of objects. If there is more than one thickening cycle, then the right-hand and bottom edges of black objects are extended in the even-numbered cycles of the procedure. In this way each thickening cycle is roughly a reversal of a corresponding half-cycle in the thinning procedure used by the encoder.
The thickening procedure uses the set of masks in Fig. 6. The centre pel of each mask is changed from white to black. In odd-number cycles, mask (a) is applied to the entire image, adding black pels to left-hand edges. Mask (b) is then applied to extend top edges. In evennumber cycles, mask (c) is applied first, followed by mask (d), extending right-hand and bottom edges respectively.
Instead of the chain-coding method described above, other methods may be used for encoding the thin component. For example, a pel-prediction coding scheme may be used, such as described by P. Elias, IRE Transactions, Volume IT-l, pages 19-33 (1955). In such a scheme, the image is scanned and a predicted value for each pel is derived from the values of a predetermined number of previously scanned pels in the current and preceding lines. The predicted value is compared with the actual value, to produce an error signal. If the image data is highly correlated, then the errors will be very sparse, and can be encoded very compactly.
This method is particularly efficient for encoding the thin component. Since this component contains only strokes of one pel in thickness, there are certain states for which the predicted gel value is highly probably or certain. Prediction errors are therefore rarer and the obtainable compression is higher than for the undecomposed image.
It will be appreciated that while the embodiment of the invention described above is concerned with encoding images consisting of black lines and areas on a white background, the invention is equally applicable to images containing other combinations of colours, for example white lines and areas on a black background.

Claims (7)

1. A method of encoding image data, comprising the steps: (a) thinning the image by an amount such as to produce a semi-thinned image in which lines of less than a predetermined thickness are reduced to skeletons one pel wide, but any thicker lines and areas remain more than one pel wide; (b) decomposing the semi-thinned image into a thin component, containing lines one pel wide, and a thick component containing the remainder of the image; (c) encoding the thin component by means of method that is efficient at encoding lines one pel wide, and (d) separately encoding the thick component.
2. A method according to Claim 1 wherein the thin component is encoded by chain coding.
3. A method according to Claim 1 wherein the thin component is encoded by pel-prediction coding.
4. A method according to any preceding Claim wherein the thick component is encoded by modified READ coding.
5. A method of encoding image data substantially as hereinbefore described with reference to Figs. 1, 3, 4 and 5 of the accompanying drawings.
6. A method of decoding image data encoded by a method in accordance with any preceding claim, the method of decoding comprising the steps: (a) decoding the thick component, (b) decoding the thin component, (c) superimposing the decoded thick and thin components, to form a semi-thinned image, and (d) thickening the semi-thinned image by adding pels to the edges of areas in the semi-thin image.
7. A method of decoding image data substantially as hereinbefore described with reference to Figs. 2 and 6 of the accompanying drawings.
GB8628512A 1986-02-28 1986-11-28 Method of encoding image data Expired GB2187357B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB868605007A GB8605007D0 (en) 1986-02-28 1986-02-28 Encoding image data

Publications (3)

Publication Number Publication Date
GB8628512D0 GB8628512D0 (en) 1987-01-07
GB2187357A true GB2187357A (en) 1987-09-03
GB2187357B GB2187357B (en) 1989-11-08

Family

ID=10593852

Family Applications (2)

Application Number Title Priority Date Filing Date
GB868605007A Pending GB8605007D0 (en) 1986-02-28 1986-02-28 Encoding image data
GB8628512A Expired GB2187357B (en) 1986-02-28 1986-11-28 Method of encoding image data

Family Applications Before (1)

Application Number Title Priority Date Filing Date
GB868605007A Pending GB8605007D0 (en) 1986-02-28 1986-02-28 Encoding image data

Country Status (1)

Country Link
GB (2) GB8605007D0 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1996039773A1 (en) * 1995-06-05 1996-12-12 Motorola Inc. Encoded facsimile communication with a selective call system and method therefor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1996039773A1 (en) * 1995-06-05 1996-12-12 Motorola Inc. Encoded facsimile communication with a selective call system and method therefor

Also Published As

Publication number Publication date
GB2187357B (en) 1989-11-08
GB8605007D0 (en) 1986-04-09
GB8628512D0 (en) 1987-01-07

Similar Documents

Publication Publication Date Title
US4189711A (en) Multilevel processing of image signals
US6334001B2 (en) Iterative smoothing technique for pre-processing mixed raster content planes to improve the quality of a decompressed image and increase document compression ratios
US4020462A (en) Method and apparatus for form removal from contour compressed image data
US5732157A (en) Image processing apparatus and method using lossless encoding of a difference between image blocks
JPH03119486A (en) Method of compressing information included in entered form for storage or transfer
GB1594130A (en) Image data resolution change apparatus
CA2013232C (en) Image reduction system
JPH05328325A (en) Device for transmitting and/or accumulating signal corresponding to one or more texture of picture, device for synthesizing texture signal and system
Ramachandran Coding method for vector representation of engineering drawings
US6728412B1 (en) Method and apparatus for on-the-fly image coding
EP0105085B1 (en) A method and apparatus for filtering grey scale image data
US5170445A (en) Document decompressing system
US4893187A (en) Image processing apparatus
KR100199243B1 (en) Multidimensional multi-valued color image compression and decompression method
EP0675460A2 (en) Method and apparatus for encoding a segmented image without loss of information
GB2187357A (en) Encoding image data
JP2672521B2 (en) Image processing method
CA1089991A (en) Image encoding apparatus
US6556715B1 (en) Method for CCITT compression of image data
Kamata et al. Region-based scanning for image compression
US5243435A (en) Method of decoding MR codes of continuous vertical mode data for the same change points
Quddus et al. A new compression technique for binary text images
JP2755463B2 (en) Image data compression method
JP2881039B2 (en) Data compression device
Vasilyev Contour-based image compression for fast real-time coding

Legal Events

Date Code Title Description
PCNP Patent ceased through non-payment of renewal fee