Image processing method and image processing system
The invention provides an image processing method such as line thickness reduction performed for a digital image from an image reading system, which is improved in that regular mask patterns can be determined to realize simplification and increase of the speed of line thickness reduction processing and production of branch-like fine lines upon line thickness reduction based on mask processing is prevented to allow character recognition or graphic recognition to be performed with certainty. Line thickness reduction processing using a plurality of mask patterns of a first type each provided for changing a black picture element protruding at a boundary portion of an area of black picture elements of image data to a white picture element is first performed repetitively, and then, after the image data no more has a black picture element which may be changed to a white picture element using any of the mask patterns of the first type, a plurality of mask patterns of a second type each provided for changing a black picture element of the original image data at the center of the matrix to a white picture element to scoop out a boundary portion of the area of black picture elements of the image data are added to the mask patterns of the first type and line thickness reduction processing is performed repetitively using the mask patterns of the first and second types.
Latest Fujitsu Limited Patents:
- Terminal device and transmission power control method
- Signal reception apparatus and method and communications system
- RAMAN OPTICAL AMPLIFIER, OPTICAL TRANSMISSION SYSTEM, AND METHOD FOR ADJUSTING RAMAN OPTICAL AMPLIFIER
- ERROR CORRECTION DEVICE AND ERROR CORRECTION METHOD
- RAMAN AMPLIFICATION DEVICE AND RAMAN AMPLIFICATION METHOD
This invention relates to an image processing method which is applied to a digital image read by an image reading apparatus such as an optical character reader (OCR) or an image scanner, and more particularly to a line thickness reduction method which is performed for a digital image as preprocessing to character or graphic recognition or a method by which a digital image is converted into frequency components by fast Fourier transform (FFT).
Generally, in order to perform character recognition or graphic recognition of image data (digital image) read and processed by binary digitization processing by an image reading apparatus, line thickness reduction processing is performed as preprocessing for the thus read digital image.
The line thickness reduction processing is a technique which has been developed principally in the field of character recognition, and in recent years, it is employed also as preprocessing for graphic understanding or as preprocessing for vectorization or the like. In any such processing, the structure of a graphic form by lines is important, but the thickness or width of a line is unnecessary information. Therefore, it is necessary to reduce the thickness or width of a line to a line of a single picture element while the continuity and the structure of a graphic form are maintained.
Various line thickness reduction processes are conventionally known, and one of the conventional line thickness reduction processes employs regeneration for a graphic image while a matching process based on a mask pattern or a process which employs a mask for determining a termination or a corner from a result of regeneration is known as a line thickness reduction process for a character image.
In the former processing based on matching, a mask of, for example, 3.times.3 picture elements is successively moved on picture elements forming a digital image read, and when the picture element at the center of the mask of 3.times.3 picture elements is a black picture element on the boundary between binary white and black image data, the black picture element is changed to a white picture element. For example, when the mask of 3.times.3 picture elements is in such a condition as shown in FIG. 15(a), the black picture element at the center of the mask is changed to a white picture element. However, when such change of the black picture element at the center of the mask to a white picture element disturbs the continuity between adjacent black picture elements (for example, refer to FIGS. 15(b) and 15(c)) or when only one of adjacent picture elements to the black picture element at the center of the mask is a black picture element (for example, refer to FIGS. 15(d) and 15(e)), the processing of changing the black picture element at the center of the mask described above is not performed.
Meanwhile, an operation of changing deletable elements one by one from black to white picture elements is called regeneration of a graphic form. The regeneration process is significant to a digital graphic form since the graphic form can be displayed simply. However, where letters, characters or the like are handled, if deletable elements are successively deleted, then since the connectivity is 1 and the order is 1, the image data are regenerated to a single element, resulting in loss of original character information.
Therefore, in the latter process based on the regeneration, a stopping requirement for regeneration is set to inhibit the change of a deletable picture element from black to white in order to prevent regeneration to a single point. The stopping requirement may be that a termination of a line or a corner should not be deleted. Various conditions of a termination of a line on a mask of 3.times.3 picture elements (termination detecting mask) are illustrated in FIGS. 16(a) to 16(d) in each of which the termination is indicated at x.sub.0. Similarly, various conditions of a corner on a mask of 3.times.3 picture elements (corner detecting mask) are shown in FIGS. 17(a) to 17(d) in each of which the corner is indicated at x0. Line thickness reduction can be achieved by deleting deletable elements except those black picture elements which satisfy any of the conditions of a termination or a corner.
By the way, by the progress of the semiconductor technology in recent years, the numerical processing technique of images has been put into practical use in various applications, and particularly since it allows simplification in calculation by conversion of an image from a spatial region into a frequency region prior to object processing of the image, development of fast Fourier transform techniques is demanded. Thus, a great number of LSIs for executing product sum calculations at a high speed such as digital signal processors (DSP) have been proposed.
However, most of the LSIs perform one-dimensional processing such as audio processing and cannot support a huge memory space required for image processing. Further, even if virtual storage is used for processing in a work station for universal use or a like equipment, for the direction of a column of an image matrix, swapping with a disk is required for each accessing to one element, and consequently, much time is required. Accordingly, an algorithm which reduces the accessing frequency to a disk is required.
However, the line thickness reduction processing method which is based on regeneration described above exhibits, even if it is realized, a very low processing speed since determination of conditions is complicated.
Meanwhile, in the method which employs matching with a mask, selection of a mask requires artisan-like trial and error. Further, when an object character has a thick line or an image is scanned in a high resolution, a branch likely appears at an end point of the object character or the image, which makes recognition of the object character or the image difficult. In particular, when Chinese characters read as seen in FIG. 18(a) are reduced in line thickness or width, branch-like fine lines appear at end points of thick lines as seen from FIG. 18(b) and make character recognition difficult.
Such branch-like fine lines are produced as a result of repetition of processing of changing, using, for example, such boundary condition masks of 3.times.3 picture elements as shown in FIGS. 19(a) to 19(c) (including masks corresponding to masks obtained by rotating the boundary condition masks by 90.degree., 180.degree. and 270.degree.), a black picture element at the center of a 3.times.3 picture element matrix to a white picture element when the matrix coincides with any of the boundary condition masks since picture elements at an end portion of a line having a great line thickness are gradually removed. However, unless such boundary condition masks are not used, a linear boundary cannot be processed and line thickness reduction comes to an end while the thickness remains as it is.
Conventional two-dimensional fast Fourier transform techniques either rely upon the faculty of virtual storage of a work station as described hereinabove or rely upon a complicated algorithm which involves fast Fourier transform in the direction of a row of a buffer for two rows in a memory called non-transposed fast Fourier transform and possible calculation in the direction of a column. Particularly, non-transposed fast Fourier transform is not used commonly at all.
Meanwhile, it seems promising to perform two-dimensional fast Fourier transform on a digital signal processor system for exclusive use having a memory of a large capacity, and to this end, a DRAM is used for the memory. However, where a DRAM is employed, such an effect as can be achieved by a high speed SRAM which is normally used for a digital signal processor, and consequently, the system which employs a digital signal processor system for exclusive use becomes expensive.
Accordingly, upon processing of two-dimensional fast Fourier transform in the direction of a column, it is necessary to read elements necessary for processing for each accessing from a disk, resulting in degradation of the processing speed.
SUMMARY OF THE INVENTIONIt is an object of the present invention to provide an image processing method wherein regular mask patterns can be determined to realize simplification and increase of the speed of line thickness reduction processing and production of branch-like fine lines upon line thickness reduction based on mask processing is prevented to allow character recognition or graphic recognition to be performed with certainty.
It is another object of the present invention to provide an image processing system wherein transposition of a matrix in two-dimensional fast Fourier transform can be performed at a high speed and a processed block can be controlled as frequency components to allow image processing in a frequency region and realize simplification of calculation.
In order to attain the objects described above, according to an aspect of the present invention, there is provided an image processing method wherein image data read by image reading means and converted into binary data of white and black by binary digitization are repetitively processed to change a black picture element of the original image data positioned at the center of a mask pattern in the form of a matrix to a white picture element when the original image data coincide with the mask pattern thereby to reduce the line thickness of the image data, the image processing method comprising the steps of repetitively performing line thickness reduction processing using a plurality of mask patterns of a first type each provided for changing a black picture element protruding at a boundary portion of an area of black picture elements of the image data to a white picture element, and adding, after the image data no more has a black picture element which may be changed to a white picture element using any of the mask patterns of the first type, a plurality of mask patterns of a second type each provided for changing a black picture element of the image data at the center of the matrix to a white picture element to scoop out a boundary portion of the area of black picture elements of the image data to the mask patterns of the first type and repetitively performing line thickness reduction processing using the mask patterns of the first type and the second type.
Each of the mask patterns may be in the form of a matrix of 3.times.3 picture elements. In this instance, line thickness reduction processing may be performed using, in addition to the mask patterns of the first type and the second type, an isolated point removing mask for removing an isolated black picture element at the center of the matrix of 3.times.3 picture elements or at the center of the matrix of 5.times.5 or more picture elements.
Where the image data are a character string arranged in a plurality of lines, line thickness reduction processing may be performed divisionally for each one line.
In the image processing method, in an initial condition of original image data in which the original image data include much noise, mask processing is performed using the mask patterns of the first type other than the mask patterns of the second type effective to scoop out a boundary portion of an area of black picture elements of the image data into a concave condition. Then, after the image data no more have a picture element which can be processed using any of the mask patterns of the first type, the mask patterns of the second type are added and line thickness reduction processing is performed using the resulted mask patterns, that is, the mask patterns of the first and second types. Consequently, regular mask patterns can be determined and line thickness reduction processing can be simplified and increased in speed. Further, production of branch-like fine lines upon line width reduction based on mask processing can be prevented with certainty, and consequently, character recognition can be performed with certainty.
According to another aspect of the present invention, there is provided an image processing system, which comprises first storing means for storing 2.sup.n line data of 2.sup.m picture elements, m and n being natural numbers, m being greater than n, image processing means for transforming the 2.sup.n line data of 2.sup.m picture elements stored in the first storage means by one-dimensional fast Fourier transform, transposition means for transposing a square matrix of 2.sup.n .times.2.sup.n picture elements of each of 2.sup.m-n blocks into which the 2.sup.n line data stored in the first storage means are divided, and second storage means for saving processed blocks: and wherein image data of a square matrix of 2.sup.m .times.2.sup.m picture elements are divided into 2.sup.m-n .times.2.sup.m-n blocks of the square matrix of 2.sup.n .times.2.sup.n picture elements; for each row of the blocks obtained by the division. 2.sup.m-n blocks in the direction of a row are stored into the first storage means and the data of the 2.sup.m-n blocks in the direction of a row stored in the first storage means are transformed by one-dimensional fast Fourier transform in the direction of a row by the image processing means, and then for each of the blocks in the direction of a row after such one-dimensional fast Fourier transform processing, transposition processing is performed on the first storage means by the transposition means, whereafter the 2.sup.m-n blocks in the direction of a row after such transposition processing are stored into the second storage means; and for each column of the blocks obtained by the division, 2.sup.m-n blocks in the direction of a column stored in the second storage means are stored into the first storage means and the data of the 2.sup.m-n blocks in the direction of a column stored in the first storage means are transformed by one-dimensional fast Fourier transform in the direction of a column by the image processing means, and then for each of the blocks in the direction of a column after such one-dimensional fast Fourier transform processing, transposition processing is performed on the first storage means by the transposition means, whereafter the 2.sup.m-n blocks in the direction of a column after such transposition processing are stored into the second storage means.
The transposition means may transpose the matrix of each block by switching address buses to the first storage means. Or, where the first storage means is constituted from a DRAM, the transposition means may transpose the matrix of each block by replacing a row address signal and a column address signal to the DRAM with each other.
The image processing system may further comprise inputting means for adding a predetermined number of bytes of 0s to input data of one byte when the image data are written into the first storage means and writing the resulted data into the first storage means and for writing a number of lines of 0s for a predetermined number of rasters in the direction of a column.
With the image processing system, transposition of a matrix in two-dimensional fast Fourier transform can be performed at a high speed on the first storage means, and the processed blocks can be controlled as frequency components, which allows image processing in a frequency region and realization of simplification in calculation.
Further objects, features and advantages of the present invention will become apparent from the following detailed description when read in conjunction with the accompanying drawings in which like parts or elements are denoted by like reference characters.
BRIEF DESCRIPTION OF THE DRAWINGSFIG. 1 is a flow chart illustrating a first aspect of the present invention;
FIG. 2 is a block diagram illustrating a second aspect of the present invention;
FIG. 3 is a block diagram of a system to which an image processing method according to the present invention is applied showing a first preferred embodiment of the present invention;
FIGS. 4(a) to 4(f) are diagrammatic views showing mask patterns of a first type employed in the system shown in FIG. 3;
FIGS. 5(a) to 5(c) are diagrammatic views showing mask patterns of a second type employed in the system shown in FIG. 3;
FIG. 6 is a diagrammatic view showing an isolated point removing mask employed in the system shown in FIG. 3;
FIG. 7 is an illustrative view showing characters of lines having widths reduced by the system shown in FIG. 3;
FIG. 8 is a block diagram of another system to which another image processing method according to the present invention is applied showing a second preferred embodiment of the present invention;
FIG. 9 is a diagrammatic view showing a first form of transposition means of the system shown in FIG. 8;
FIG. 10 is a block diagram showing a second form of transposition means of the system shown in FIG. 8;
FIG. 11 is a diagrammatic view showing picture elements which make an object for fast Fourier transform in the system shown in FIG. 8;
FIG. 12 is a diagrammatic view showing the construction of each picture element in the system shown in FIG. 8;
FIG. 13 is a diagrammatic view illustrating image data of a square matrix divided into a number of blocks of a square matrix of 2.sup.n picture elements by the system shown in FIG. 8;
FIGS. 14(a) to 14(g) are diagrammatic views illustrating an image processing procedure in the system shown in FIG. 8;
FIGS. 15(a) to 15(e) are diagrammatic views showing a mask pattern for which the change of a black picture element to a white picture element is allowed and several mask patterns for which the change of a black picture element to a white picture element is inhibited upon line thickness reduction processing;
FIGS. 16(a) to 16(d) are similar views but showing different termination detecting masks;
FIGS. 17(a) to 17(d) are similar views but showing different corner detecting masks;
FIG. 18(a) is a schematic illustration showing Chinese characters when read as image data, and FIG. 18(b) is a similar view but showing those Chinese characters after the image data illustrated in FIG. 18(a) are processed by conventional line thickness reduction processing; and
FIGS. 19(a) to 19(c) are diagrammatic views showing different mask patterns which remove, when they are used to change a black picture element at the center of a matrix into a white picture element, a boundary portion of image data into a concave condition.
DESCRIPTION OF THE PREFERRED EMBODIMENTSa. Aspects of the Invention
Referring first to FIG. 1, there is illustrated in flow chart a first aspect of the present invention, which is applied to an image processing method wherein image data read by image reading means and converted into binary data of white and black by binary digitization are repetitively processed to change a black picture element of the original image data positioned at the center of a mask pattern in the form of a matrix to a white picture element when the original image data coincide with the mask pattern to reduce the line thickness of the image data.
In the first aspect of the present invention, line thickness reduction processing is performed using a plurality of mask patterns of a first type each provided for changing a black picture element protruding at a boundary portion of an area of black picture elements of the image data to a white picture element (step S1), and it is determined whether or not there still remains in the image data a black picture element which can be changed to a white picture element using any of the mask patterns of the first type (step S2). Thereafter, the line thickness reduction processing using the mask patterns of the first type at step S1 is repetitively performed until after it is determined that the image data no more have a black picture element which can be changed to a white picture element using any of the mask patterns of the first type.
When it Is determined at step S2 that the image data no more have a black picture element which can be changed to a white picture element using any of the mask patterns of the first type, the mask patterns of the second type each provided for changing a black picture element of the image data at the center of the matrix to a white picture element to scoop out a boundary portion of the area of black picture elements of the image data are added to the mask patterns of the first type, and line thickness reduction processing is performed using the mask patterns of the first type and the second type (step S3).
Then, it is determined whether or not there still remains in the image data a black picture element which can be changed to a white picture element using any of the mask patterns of the second type (steps S4). Thereafter, the line thickness reduction processing using the mask patterns of the second type at step S3 is repetitively performed until after it is determined that the image data no more have a black picture element which can be changed to a white picture element using any of the mask patterns of the second type.
It is to be noted that matrices of 3.times.3 picture elements may be used as the mask patterns. In this instance, line thickness reduction processing may be performed using, in addition to the mask patterns of the first and second types, an isolated point removing mask for removing an isolated black picture element at the center of the matrix of 3.times.3 picture elements or at the center of the matrix of 5.times.5 or more picture elements. Further, where the image data are a character string arranged in a plurality of lines, line thickness reduction processing may be performed divisionally for each one line.
If, different from the image processing method of the first aspect of the present invention described above, the mask patterns of the second type each provided for changing a black picture element of the original image data at the center of the matrix to a white picture element to scoop out a boundary portion of an area of black picture elements of the image data are used from the beginning, then unnecessary branch-like fine lines may be produced. However, if the mask patterns of the second type are not used, then a linear boundary cannot be processed and line thickness reduction comes to an end while leaving the thickness of the line. Therefore, in the image processing method of the first aspect of the present invention, in an initial condition of original image data in which the original image data include much noise, mask processing is performed using the mask patterns of the first type, which are each provided for changing a black picture element protruding at a boundary portion of an area of black picture elements of the image data to a white picture element, other than the mask patterns of the second type. Then, after the image data no longer has a picture element which can be processed using any of the mask patterns of the first type, the mask patterns of the second type are added and line thickness reduction processing is performed using the resulting masks of the first and second types.
Further, matrices of 3.times.3 picture elements are used as the mask patterns, and line thickness reduction processing is performed using, in addition to the mask patterns of the first and second types, an isolated point removing mask for removing an isolated black picture element at the center of the matrix of 3.times.3 picture elements.
In this instance, where an isolated point removing mask for removing an isolated black picture element at the center of the matrix of 5.times.5 or more picture elements is used instead, the processing can be performed at a higher speed. Further, where the image data are a character string arranged in a plurality of lines, the number of repetitions of line thickness reduction processing can be reduced by performing line thickness reduction processing divisionally for each one line.
In this manner, with the image processing method of the first aspect of the present invention, in an initial condition of original image data in which the original image data include much noise, mask processing is performed using the mask patterns of the first type other than the mask patterns of the second type which is effective to scoop out a boundary portion of an area of black picture elements of the image data into a concave condition. Then, after the image data no longer has a picture element which can be processed using any of the mask patterns of the first type, the mask patterns of the second type are added and line thickness reduction processing is performed using the resulted mask patterns, that is, the mask patterns of the first and second types. Consequently, regular mask patterns can be determined and line thickness reduction processing can be simplified and increased in speed. Further, production of branch-like fine lines upon line width reduction based on mask processing can be prevented with certainty, and consequently, character recognition can be performed with certainty.
Referring now to FIG. 2, there is shown in block diagram a second aspect of the present invention, which is applied to an image processing system. The image processing system comprises first storing means 1 for storing 2.sup.n line data of 2.sup.m picture elements, m and n being natural numbers, m being greater than n, image processing means 2 for transforming the 2.sup.n line data of 2.sup.m picture elements stored in the first storage means 1 by one-dimensional fast Fourier transform, transposition means 3 for transposing a square matrix of 2.sup.n .times.2.sup.n picture elements of each of 2.sup.m-n blocks into which the 2.sup.n line data stored in the first storage means 1 are divided, and second storage means 4 for saving processed blocks.
In the image processing system of the second aspect of the present invention, image data of a square matrix of 2.sup.m .times.2.sup.m picture elements are divided into 2.sup.m-n .times.2.sup.m-n blocks of the square matrix of 2.sup.n .times.2.sup.n picture elements, and then, for each row of the blocks obtained by the division, 2.sup.m-n blocks in the direction of a row are stored into the first storage means 1 and the data of the 2.sup.m-n blocks in the direction of a row stored in the first storage means 1 are transformed by one-dimensional fast Fourier transform in the direction of a row by the image processing means 2. Then for each of the blocks in the direction of a row after such one-dimensional fast Fourier transform processing, transposition processing is performed on the first storage means 1 by the transposition means 3, whereafter the 2.sup.m-n blocks in the direction of a row after such transposition processing are stored into the second storage means 4.
Thereafter, for each column of the blocks obtained by the division, 2.sup.m-n blocks in the direction of a column stored in the second storage means 4 are stored into the first storage means 1 and the data of the 2.sup.m-n blocks in the direction of a column stored in the first storage means 1 are transformed by one-dimensional fast Fourier transform in the direction of a column by the image processing means 2. Then for each of the blocks in the direction of a column after such one-dimensional fast Fourier transform processing, transposition processing is performed on the first storage means 1 by the transposition means 3. Thereafter, the 2.sup.m-n blocks in the direction of a column after such transposition processing are stored into the second storage means 4.
It is to be noted that the transposition means 3 may transpose the matrix of each block by switching address buses to the first storage means 1, or where the first storage means 1 is constituted from a DRAM, the transposition means 3 may transpose the matrix of each block by replacing a row address signal and a column address signal to the DRAM with each other.
Meanwhile, the image processing system may further comprise inputting means for adding a predetermined number of bytes of 0s to input data of one byte when the image data are written into the first storage means 1 and writing the resulted data into the first storage means 1 and for writing a number of lines of 0s for a predetermined number of rasters in the direction of a column.
Further, in the image processing system of the second aspect of the present invention, image data of a square matrix are divided into a plurality of blocks of the square matrix of 2.sup.n picture elements, and, for each row of the blocks obtained by the division, a plurality of blocks in the direction of a row are stored into the first storage means 1.
Then, the data of the plurality of blocks in the direction of a row stored in the first storage means 1 are transformed by one-dimensional fast Fourier transform in the direction of a row by the image processing means 2, and for each of the blocks in the direction of a row after such one-dimensional fast Fourier transform processing, the data in each block are transposed on the first storage means 1 by the transposition means 3 and then stored into the second storage means 4.
Thereafter, for each column of the blocks obtained by the division, a plurality of blocks in the direction of a column stored in the second storage means 4 are stored into the first storage means 1 and the data of the plurality of blocks in the direction of a column stored in the first storage means 1 are transformed by one-dimensional fast Fourier transform in the direction of a column by the image processing means 2. Then, for each of the blocks in the direction of a column after such one-dimensional fast Fourier transform processing, the data in each block are transposed on the first storage means 1 by the transposition means 3 and then stored into the second storage means 4.
It is to be noted that the transposition processing by the transposition means 3 is performed by switching address buses to the first storage means 1 or by replacing a row address signal and a column address signal to the first storage means 1, which is formed from a DRAM, with each other.
Further, when the image data are written into the first storage means 1, the inputting means adds the predetermined number of bytes of 0s to input data of one byte and writes the input data of one byte into the first storage means 1 and further performs interpolation processing to write a number of lines of 0s for the predetermined number of rasters in the direction of a column. By the processing, a result equivalent to that which can be obtained by low-pass filter can be achieved.
In this manner, with the image processing system of the second aspect of the present invention, transposition of a matrix in two-dimensional fast Fourier transform can be performed at a high speed on the first storage means 1, and the processed blocks can be controlled as frequency components, which allows image processing in a frequency region and realization of simplification in calculation.
b. First Embodiment
Referring now to FIG. 3, there is shown a system to which an image processing method according to the present invention is applied as a first preferred embodiment of the present invention. The system shown includes an image reading apparatus 11 serving as image reading means for reading image data and converting the image data into binary data of black and white by binary digitization. The image reading apparatus 11 includes a CCD (charge coupled device) element 12, an analog to digital (A/D) conversion section 13, a binary digitization circuit 14 and a serial to parallel (S/P) conversion section 15.
The CCD element 12 scans in a main scanning direction and a perpendicular sub scanning direction to detect a density value of image data for each picture element, and the analog to digital conversion section 13 converts such analog density value obtained by the CCD element 12 into a digital density value of a predetermined number of bits.
The binary digitization circuit 14 compares a digital density value from the analog to digital conversion section 13 for each picture element with a predetermined threshold value to convert the digital density value into a binary value of black or white. The serial to parallel conversion section 15 converts results of binary digitization, that is, binary signals of black and white, obtained as a serial signal from the binary digitization circuit 14 into a parallel signal of a suitable length, for example, 8 bits=1 byte and outputs the resulted parallel signal.
The system shown in FIG. 3 further includes a line thickness reduction processing section 16 for applying line thickness reduction processing to image data read by the image reading apparatus 11 and converted into binary values of white and black. The line thickness reduction processing section 16 includes a memory 17, a mask pattern memory 18, a mask pattern selection section 19 and a mask processing operation section 20.
The line thickness reduction processing is performed as preprocessing of a read digital image before character recognition or graphic recognition is performed for the read image, and reduces the thickness or width of a line to a line of a single picture element while maintaining the continuity and the structure of the graphic form. In particular, a mask pattern in the form of a preset matrix, which includes 3.times.3 picture elements in the present embodiment, is successively applied to the object image data read by the image reading apparatus 11 and converted into binary values of white and black to detect matching between them, and each time a portion which matches with the mask pattern is present in the image data, a black picture element of the original image data positioned at the center of the mask pattern is changed to a white picture element. The processing just described is performed repetitively.
The memory 17 stores image data, which make an object for line thickness reduction processing, as a matrix. The mask pattern memory 18 stores in advance mask patterns of 3.times.3 picture elements to be used for line thickness reduction processing.
Various mask patterns are stored in the mask pattern memory 18 including six mask patterns of a first type shown in FIGS. 4(a) to 4(f), three mask patterns of a second type shown in FIGS. 5(a) to 5(c), and a single isolated point removing mask shown in FIG. 6. The mask patterns of the first type shown in FIGS. 4(a) to 4(f) are used to change a black picture element which projects at a boundary portion of an area of black picture elements of image data to a white picture element; the mask patterns of the second type shown in FIGS. 5(a) to 5(c) are used to change a black picture element of image data at the center of a matrix of 3.times.3 picture element to a white picture element to scoop out a boundary portion of an area of black picture elements of image data into a concave condition; and the isolated point removing mask shown in FIG. 6 is used to remove an apparently isolated picture element at the center of a matrix of 3.times.3 picture element.
Also mask patterns obtained by rotating the nine different mask patterns shown in FIGS. 4(a) to 4(f) and 5(a) to 5(c) by 90 degrees, 180 degrees and 270 degrees are used as applicable mask patterns in the system shown in FIG. 3. Meanwhile, the capacity for storing the basic mask patterns other than the mask patterns obtained by rotating the basic mask patterns is 10.times.9 bits. Thus, since the mask processing operation section 20 which will be hereinafter described has a function of detecting matching with a mask pattern rotating the mask pattern, the mask pattern memory 18 can be constructed from 10 registers.
The mask pattern selection section 19 selectively reads out a mask pattern necessary for line thickness reduction processing from the mask pattern memory 18 in accordance with a processing situation of the mask processing operation section 20 and sends out the mask pattern to the mask processing operation section 20.
The mask processing operation section 20 basically executes the operation described hereinabove with reference to FIG. 1. In particular, after image data which make an object for line thickness reduction processing are stored into the memory 17, the mask processing operation section 20 reads out the mask patterns of the first type and the isolated point removing pattern from the mask pattern memory 18 by way of the mask pattern selection section 19 and successively matches the image data stored in the memory 17 with the mask patterns. Then, each time a portion which matches one of the mask patterns is found in the image data, the mask processing operation section 20 performs first mask processing of changing a black picture element of the original image data positioned at the center of the mask pattern to a white picture element. The mask processing operation section 20 repetitively performs such first mask processing.
When the mask processing operation section 20 determines that there no more remains a black picture element which can be changed to a white picture element as a result of the first mask processing, that is, when the image data no more have a portion which coincides with any of the mask patterns, the mask processing operation section 20 reads out the mask patterns of the second type from the mask pattern memory 18 by way of the mask pattern selection section 19 and adds the mask patterns of the second type to the mask patterns of the first type and the isolated point removing mask. Then, the mask processing operation section 20 successively matches the image data stored in the memory 17 with the mask patterns and performs, each time a portion which coincides with one of the mask patterns is found in the image data, second mask processing of changing a black picture element of the original image data positioned at the center of the mask pattern to a white picture element. The mask processing operation section 20 repetitively performs such second mask processing. Then, when the mask processing operation section 20 determines that there no more remains a black picture element which can be changed to a white picture element as a result of the second mask processing, the mask processing, that is, the line thickness reduction processing, is ended. A result of the line thickness reduction processing by the line thickness reduction processing section 16 is sent out to an image recognition apparatus or a like apparatus not shown.
In the image processing system of the construction described above, image data read by the image reading apparatus 11 and converted into binary data of white and block are first stored as an object for line thickness reduction processing into the memory 17. Then, the mask pattern selection section 19 reads out the mask patterns of the first type and the isolated point removing mask from the mask pattern memory 18, and the mask processing operation section 20 successively matches the entire image data stored in the memory 17 with the mask patterns. Then, each time a portion which coincides with any of the mask patterns is found in the image data, the mask processing operation section 20 changes a black picture element of the original image data positioned at the center of the mask pattern to a white picture element.
Such first mask processing is repetitively performed until after there no more remains a black picture element which can be changed to a white picture element, that is, until after the image data no more have a portion which coincides with any of the mask patterns. Consequently, black picture elements which protrude at the boundary of an area of black picture elements of the image data are successively converted into white picture elements.
In this instance, in the present embodiment, a flag which is changed from "0" to "1" after a black picture element is changed to a white picture element is provided, and each time the first mask processing comes to an end, the mask processing operation section 20 refers to the flag. Then, if the flag is "1", the mask processing operation section 20 resets the flag to "0" and then executes the first mask processing again. On the contrary, if the flag is "0", the mask processing operation section 20 determines that there no more remains a black picture element which can be changed to a white picture element, and enters the next second mask processing.
Then, the mask pattern selection section 19 reads out the mask patterns of the second type from the mask pattern memory 18 and adds them to the mask patterns of the first type and the isolated point removing mask, and the mask processing operation section 20 successively matches the entire image data stored in the memory 17 with the mask patterns. Each time a portion which coincides with any of the mask patterns is found in the image data, the mask processing operation section 20 changes a black picture element of the original image data positioned at the center of the mask pattern to a white picture element.
Also the second mask processing is performed repetitively until after there no more remains a black picture element which can be changed to a white picture element, that is, until after the image data no more include a portion which coincides with any of the mask patterns.
Also in this instance, a similar flag is provided, and the mask processing operation section 20 refers to the flag each time the second mask processing comes to an end. When the flag is "1", the mask processing operation section 20 resets the flag to "0" and then executes the second mask processing again. On the contrary when the flag is "0", the mask processing operation section 20 determines that there no more remains a black picture element which can be changed to a white picture element, and ends the second mask processing, thereby ending the line thickness reduction processing.
In this manner, according to the image processing method of the first preferred embodiment of the present invention, in an initial condition of image data wherein the image data include much noise, the first mask processing is performed using the mask patterns of the first type shown in FIGS. 4(a) to 4(f) and the isolated point removing mask shown in FIG. 6 other than the mask patterns of the second type shown in FIGS. 5(a) to 5(c) which are effective to remove a boundary portion of image data into a concave condition. Then, after the image data no longer has a picture element which can be processed using the mask patterns of the first type, the mask patterns of the second type are added and the second mask processing is performed using the resulted mask patterns.
Accordingly, in the second mask processing, some branches which later make branch-like fine lines may possibly be produced. However, in the condition of the image data after noise has been removed by the first mask processing, no branch of more than one picture element is produced by the mask patterns used in the first mask processing, and accordingly, such branches produced by the second mask processing as mentioned above sufficiently remain with an allowable range in recognition processing, which allows character recognition or graphic recognition to be performed with certainty based on the image data read by the image reading apparatus 11. For example, when Chinese characters read by the image reading apparatus 11 as shown in FIG. 18(a) are reduced in line thickness or width, while the prior art fails to prevent production of branch-like fine lines at end points of lines of great line thickness as seen in FIG. 18(b), the line thickness reduction processing in the present embodiment can achieve line thickness reduction with seldom production of a branch-like fine line as seen in FIG. 7.
Further, before mask processing is performed, such regular mask patterns as shown in FIGS. 4(a) to 4(f), 5(a) to 5(c) and 6 can be determined. Consequently, simplified and higher speed line thickness reduction processing can be realized.
Particularly, in the present embodiment, since only 10 different basic mask patterns of 9 bits are used other than those mask patterns obtained by rotation of such basic mask patterns and the mask processing operation section 20 has a function of performing matching with the mask patterns rotating the mask patterns, there is no need of providing a special memory upon hardware implementation of the system.
It is to be noted that, while a matrix of 3.times.3 picture elements is employed for the mask patterns in the embodiment described above, the present invention is not limited to such specific matrix.
Further, while a matrix of 3.times.3 picture elements is employed for the isolated point removing mask in the embodiment described above, line thickness reduction may be performed otherwise adding another isolated point removing mask with which an isolated picture element at the center of a matrix of 5.times.5 or more picture elements can be removed. While it is possible to finally regenerate image data to a single picture element also in the present embodiment described above, the speed of processing can be further increased by performing isolated point removal of 5.times.5 or more picture elements in accordance with a condition then.
Furthermore, while it is assumed in the embodiment described above that all image data are stored in the memory 17, particularly where a document image makes an object for line thickness reduction processing and image data of the same are a character string arranged in lines, the number of repetitions of line thickness reduction processing can be reduced by performing line thickness reduction for each line. Processing for such small divisional sections of image data reduces the number of repetitions of first time mask processing, for example, from 50 or more to approximately 5 to 8. Thus, the capacity of the memory 17 used can be saved and the speed of processing can be increased by such division of image data at any time.
b. Second Embodiment
Referring now to FIG. 8, there is shown an image processing system to which the present invention is applied as a second preferred embodiment of the present invention. The system shown includes an image scanner 21 serving as an image reading apparatus for reading an image of a graphic form or characters and outputting the image as image data, and a direct memory access (DMA) controller (DMAC) 22 for transferring data from the image scanner 21 to a buffer memory 23 and from the buffer memory 23 to a hard disk 25.
The buffer memory 23 serves as first storage means for storing a partial image of image data from the image scanner 21, that is, data of 2.sup.n lines of 2.sup.m picture elements (m and n are natural numbers and m>n). The image processing system further includes a digital signal processor 24 serving as image processing means for performing one-dimensional fast Fourier transform (hereinafter referred to merely as fast Fourier transform) for a partial image stored in the buffer memory 23. The hard disk 25 serves as second storage means for storing image data to save a processed block.
Further, in the present embodiment, such transposition means as shown, for example, in FIG. 9 or 10 is provided as transposition means for transposing a square matrix of 2.sup.n .times.2.sup.n picture elements of each of 2.sup.m-n blocks into which a partial image stored in the buffer memory 23 is divided.
Referring first to FIG. 9, the transposition means shown is in the form of a selector which switches between DMA addresses A.sub.0 to A.sub.19 and memory addresses M.sub.A0 to M.sub.A19 of the buffer memory 23. An address bus of the buffer memory 23 is switched by the selector (transposition means) to transpose the matrix of each block in the buffer memory 23, and consequently, the digital signal processor 24 need not transpose the matrix of each block.
Referring now FIG. 10, where a DRAM (in the present embodiment, eight 4.times.1 Mbit DRAMs are used in order to allow handling of such image data as hereinafter described with reference to FIGS. 11 to 13) is employed for the buffer memory 23, a replacement section 26 for replacing a row address signal (RAS) and a column address signal (CAS) to the buffer memory 23 in the form of DRAMs with each other is provided as the transposition means. The row address signal and the column address signal are replaced with each other in response to a replacement instruction signal XCHG by the replacement section 26 to switch a multiplexer signal for switching between row and column addresses. Consequently, the matrix of each block in the buffer memory 23 can be transposed by addition of minimum circuits.
The circuitry shown in FIG. 10 includes several additional circuit elements including an inputting section 27 for inputting row and column information in accordance with a DMA address A.sub.0 and A.sub.1. Data from the inputting section 27 and the row and column address signals from the replacement section 26 are ANDed by a plurality of 8 in the present embodiment, AND gates 30 so that predetermined row and column address signals are inputted to the buffer memory 23. The circuitry further includes a multiplexer 28 for multiplexing a DMA address A.sub.2 and A.sub.3 and writing the multiplexed data into the buffer memory 23.
The circuitry further includes an inputting section 29 for writing image data at DMA addresses A.sub.4 to A.sub.21 into the buffer memory 23. The inputting section 29 functions as inputting means for adding, when image data are to be written into the buffer memory 23, where a 32-bit bus is constructed as in the present embodiment, 3 bytes of 0s (one byte of 0s where a 16-bit bus is employed) to input data of one byte (8 bits) from the image scanner 21 and writing resulted data into the buffer memory 23 and for writing a line of 0s for 3 rasters (for one raster where a 16-bit bus is employed) in the direction of a column.
An image processing process on the image processing system of the second embodiment constructed in such a manner as described above will be described below. As shown in FIG. 11, in the present embodiment, image data of 1,024.times.1,024 picture elements are presumed as picture elements (matrix) which make an object for fast Fourier transform. Meanwhile, if it is assumed that each picture element is such a single precision complex number whose real part and imaginary part are each in the form of a single precision real number of 32 bits as seen in FIG. 12, then one element is represented by 8 bytes and the capacity of 8 Mbytes is required for the entire image. It is to be noted that, where a double precision real number is used, a double capacity of 16 Mbytes is required.
In the present embodiment, the original image data of a square matrix of 1,024.times.1,024 (m=10) picture elements are divided into 16 (m-n=2) square matrices or blocks with a lattice of 2.sup.n .times.2.sup.n picture elements (here, a lattice of 256.times.256 (n=8) picture elements). The blocks are numbered "1" to "16" as seen in FIG. 13.
First, where the original picture data of a square matrix of 1,024.times.1,024 picture elements are divided into blocks of 256.times.256 picture elements before object processing as described above, the image scanner 21 reads the image divisionally for each 256 rasters and sends out an operation request signal REQ to the direct memory access controller 22.
Upon reception of the operation request signal REQ, the direct memory access controller 22 successively supplies addresses to the buffer memory 23 and then sends out a transfer completion signal to the digital signal processor 24 after the four blocks "1" to "4" in the direction of a row are stored into the buffer memory 23 as seen in FIG. 14(a).
Upon reception of the transfer completion signal, the digital signal processor 24 first converts data in units of a byte from the image scanner 21 into data in the form of a complex number and then performs fast Fourier transform in the direction of a row for 256 rows as shown in FIG. 14(b). Then, using such transposition means as shown in FIGS. 9 or 10, transposition processing (replacement processing between rows and columns: no such replacement is naturally required for diagonal elements indicated by slanting lines in FIG. 14(c)) is performed for each block as seen in FIG. 14(c), and then the blocks after such transposition processing are written into the hard disk 25 by the direct memory access controller 22 as seen in FIG. 14(d).
The processing described above with reference to FIGS. 14(a) to 14(d) are executed for each of the rows of the divisional blocks, that is, for each four blocks "5" to "8", "9" to "12" and "13" to "16" along the direction of a row. As a result of the processing so far, fast Fourier transform in the direction of a row and transposition processing between rows and columns for each block are completed. It is to be noted that numerals of the block numbers written in a laid-down condition in FIGS. 14(d) and 14(e) represent that transposition processing has been completed for the blocks.
Subsequently, in order to perform fast Fourier transform in the direction of a column, the direct memory access controller 22 outputs a read-out request signal REQ to the hard disk 25 to read out and store four blocks "1", "5", "9" and "13" in the direction of a column from the hard disk 25 into the buffer memory 23. Consequently, since the rows and the columns in each block have been transposed with each other as seen in FIG. 14(e), fast Fourier transform in the direction of a column can be performed immediately for 256 columns as seen in FIG. 14(f).
Thereafter, transposition processing is performed for each block similarly as in FIG. 14(c) using such transposition means as shown in FIG. 9 or 10, and the blocks after such transposition processing are written into the hard disk 25 by the direct memory access controller 22 as seen in FIG. 14(g).
The processes described above with reference to FIGS. 14(e) to 14(g) are executed for the individual columns of the divisional blocks, that is, for each four blocks "2", "6", "10" and "14": "3", "7", "11" and "15"; and "4", "8", "12" and "16" in the direction of a row.
As a result, the image data for which two-dimensional fast Fourier transform has been completed in the form shown in FIG. 11 are stored on the hard disk 25.
Consequently, according to the image processing system of the present invention, when compared with simple fast Fourier transform, the number of seeking operations of the hard disk 25 (operations of positioning a memory access mechanism to a designated position) is remarkably decreased from 1,024.times.1,024 times to 16.times.2 times in the processes of FIGS. 14(e) to 14(g). While actual seeking depends upon the capacities of the hard disk 25 and the buffer memory 23, there is no trouble if the size of each block is smaller than the capacity of the buffer memory 23. Actually, the effective block size is considered approximately 64.times.64.times.8=32,768 picture elements.
In this manner, according to the image processing system of the second embodiment of the present invention, transposition of a matrix in two-dimensional fast Fourier transform can be performed at a high speed on the buffer memory 23 and blocks thus processed can be controlled as frequency components. Consequently, image processing can be performed in a frequency region and the calculation can be simplified remarkably.
It is to be noted that, in the present embodiment, where such transposition means as shown in FIG. 10 is employed, interpolation processing can be performed by writing 8-bit data from the image scanner 21 into the buffer memory 23 after 3 bytes of 0s are added to the data by the inputting section 29. In this instance, it is necessary to add a line of 0s for three rasters also in the direction of a column, and to this end, the direct memory access controller 22 transfers the necessary number of 0s. Therefore, also input data from the image scanner 21 are transferred for each 64 rasters which corresponds to one fourth.
As a result of such processing, where Fourier transform is involved, the blocks "4", "13" and "16" apparently make aliases (alias entries to a subroutine of a computer) to the block "1" of the image data, and similarly, the image data have aliases to the blocks "2", "5" and "6". Accordingly, actually necessary data are only the blocks "1", "2", "5", and "6". Meanwhile, if interpolation processing described above is performed, then reproduction of only one fourth components at low frequencies of the block "1" is equivalent to low-pass filter processing. Further, since sufficient high picture quality can be obtained only from low frequency components of image data, it is easy to transfer only necessary data within a block.
The present invention is not limited to the specifically described embodiment, and variations and modifications may be made without departing from the scope of the present invention.
Claims
1. An image processing method wherein image data read by image reading means and converted into binary image data of white and black by binary digitization is repetitively processed to change a black picture element of the image data positioned at the center of a mask pattern in the form of a matrix to a white picture element when the image data coincides with the mask pattern, thereby to reduce the line thickness of the image data, comprising the steps of:
- repetitively performing first processing to thin a line, using a plurality of mask patterns of a first type each provided for changing a black picture element protruding at a boundary portion of an area of black picture elements of the image data to a white picture element so as not to produce a branch which will make a branch-shaped thin line, the first processing being done by matching the mask patterns of the first type with the image data;
- adding a plurality of mask patterns of a second type to the mask patterns of the first type when the image data has no black picture elements which may be changed to a white picture element using the mask patterns of the first type, the mask patterns of the second type being provided for changing a black picture element of the image data at the center of the matrix to a white picture element to thereby remove a boundary portion of the area of black picture elements of the image data and produce branches; and
- repetitively performing second processing to thin a line using the mask patterns of the first type and the second type, the second processing being done by matching the mask patterns of the first and second types with the image data.
2. The image processing method as claimed in claim 1, wherein each of the mask patterns is in the form of a matrix of 3.times.3 picture elements.
3. The image processing method as claimed in claim 2, wherein line thinning processing is performed using, in addition to the mask patterns of the first type and the second type, an isolated point removing mask for removing an isolated black picture element at the center of a matrix of 3.times.3 picture elements.
4. The image processing method as claimed in claim 2, wherein line thinning processing is performed using, in addition to the mask patterns of the first type and the second type, an isolated point removing mask for removing an isolated black picture element at the center of a matrix of 5.times.5 or more picture elements.
5. The image processing method as claimed in claim 1, wherein the image data are a character string arranged in a plurality of lines, and line thinning processing is performed divisionally for each line.
6. The image processing method as claimed in claim 2, wherein the image data are a character string arranged in a plurality of lines, and line thinning processing is performed divisionally for each line.
7. The image processing method as claimed in claim 3, wherein the image data are a character string arranged in a plurality of lines, and line thinning processing is performed divisionally for each line.
8. The image processing method as claimed in claim 4, wherein the image data are a character string arranged in a plurality of lines, and line thinning processing is performed divisionally for each line.
9. The image processing method as claimed in claim 1, wherein the mask patterns of the first type have three to five adjacent white picture elements with two or three of the white picture elements being adjacent respectively to two or three of the four sides of a black picture element at the center of a matrix of 3.times.3 picture elements, and the mask patterns of the second type have two or three adjacent white picture elements with one of the white picture elements being adjacent to one of the four sides of a black picture element at the center of a matrix of 3.times.3 picture elements.
10. A method of processing image data, comprising the steps of:
- repetitively performing processing to thin a line by matching different portions of the image data with a plurality of mask patterns of a first type, the mask patterns of the first type not producing branches which will make a branch-like thin line, each portion of image data having a size corresponding to a size of the mask patterns;
- changing to a white picture element, a black picture element of the portion of the image data positioned corresponding to the center of the mask pattern, every time the portion of the image data matches a mask pattern of the first type;
- adding a plurality of mask patterns of a second type to the mask patterns of the first type when the image data has no black picture elements which may be changed to a white picture element using the mask patterns of the first type, the mask patterns of the second type producing branches and being different from the mask patterns of the first type; and
- repetitively performing processing to thin a line using the mask patterns of the first and second types by matching different portions of the image data with the mask patterns of the first and second types.
4034344 | July 5, 1977 | Saraga et al. |
4539704 | September 3, 1985 | Pastor |
4977533 | December 11, 1990 | Miyabayashi et al. |
5050229 | September 17, 1991 | Barski et al. |
5054103 | October 1, 1991 | Yasuda et al. |
5142589 | August 25, 1992 | Longheed et al. |
5224179 | June 29, 1993 | Denker et al. |
2 317 440 | October 1973 | DEX |
35 45 106 | June 1987 | DEX |
58-151675 | September 1983 | JPX |
- Ben K. Jang and Roland T. Chin, One-Pass Parallel Thinning: Analysis, Properties, and Quantitative Evaluation; IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 14, No. 11, Nov. 1992. Ralston et al, Encyclopedia of Computer Science and Engineering, Jan. 1983 pp. 1418-1422.
Type: Grant
Filed: Jun 19, 1997
Date of Patent: Nov 24, 1998
Assignee: Fujitsu Limited (Kawasaki)
Inventor: Nobuo Ogawa (Kawasaki)
Primary Examiner: Christopher Kelley
Law Firm: Staas & Halsey
Application Number: 8/879,217