Image processing apparatus and method allowing control of edge enhancement effect

Thresholding is performed on an inputted pixel value using a corrected threshold value in a thresholding unit, and a binarized pixel value is output. The output is inverted, and from the inverted output the threshold value used for the thresholding is subtracted, and the resultant value is distributed to threshold values used for processing of the surrounding pixels. At this time, an input value is added to the value to be distributed (feedback value). Then, in the thresholding of the next pixel, the input value is subtracted from the distributed value, and the result is subtracted from an initial threshold value to derive a value which becomes a threshold value to be used in the binarization. When the input value changes, there is an effect of canceling out the change so that the edge can be weakened.

This application is based on application No. 2000-293608 filed in Japan, the content of which is hereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing apparatus, and more specifically, to an image processing apparatus that allows formation of an image in which gradations are reduced using a threshold value.

2. Description of the Related Art

Digital handling of images is currently dominant in the field of image processing. When displaying or outputting a digital image, there often is a need to express the gradations of the image using a smaller number of gradation levels due to restrictions imposed by the characteristics of the output device and so on. From the early stages of development, various image processing techniques of digital half toning, such as binarization in which the gradations are reproduced by white and black dots alone as a pseudo halftone processing, have been researched.

Among such techniques, an error diffusion method and a threshold value diffusion method, which is proposed by the applicant of the present invention in Japanese Patent Laying-Open No. 2000-165669, have proved to be particularly superior in that they maintain good resolution and gradation quality.

In the error diffusion method and the threshold value diffusion method, however, no technique had been established that enabled an edge enhancement effect to be controlled freely. Thus, the object of the present invention is to provide an image processing apparatus that allows effective control of the edge enhancement effect with extremely simple processing in a half toning process such as the error diffusion method or the threshold value diffusion method.

SUMMARY OF THE INVENTION

According to one aspect of the present invention, an image processing apparatus is provided with an input unit for successively receiving as input a first image signal representing each pixel, a thresholding unit for performing thresholding on the inputted first image signal using a prescribed threshold value, and a distributing unit for distributing a value used in the thresholding in a succeeding pixel, where the thresholding unit performs thresholding based on the value distributed by the distributing unit and on a specific value determined for each pixel, and the distributing unit calculates a value to be distributed to the succeeding pixel based on an input signal and an output signal of the thresholding unit and on the specific value determined for each pixel.

According to another aspect of the present invention, an image processing method includes the steps of successively inputting a first image signal representing each pixel, performing thresholding on the inputted first image signal using a prescribed threshold value, and distributing a value used in the thresholding in a succeeding pixel, where the step of performing thresholding is done based on the value distributed by the distributing unit and on a specific value determined for each pixel, and the step of distributing calculates a value to be distributed to the succeeding pixel based on an input signal and an output signal of the thresholding unit and on the specific value determined for each pixel.

According to these inventions, when an input value changes in the image processing, the change can be enhanced or diminished at will. Consequently, the edge enhancement effect can be controlled freely.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1is a block diagram representing an arrangement of an image forming apparatus according to a first embodiment of the present invention.

FIGS. 2 to 5are diagrams related to the description of processing according to the first embodiment.

FIG. 6is a diagram showing a specific example of a diffusion weight coefficient.

FIG. 7is a diagram showing a specific example of a pattern of an initial threshold value.

FIG. 8is a diagram showing a specific example of an image as an object to be processed.

FIG. 14is a block diagram representing an arrangement of an image processing apparatus according to a second embodiment of the present invention.

FIGS. 15 to 18are diagrams related to the description of processing according to the second embodiment.

FIGS. 19 to 22are diagrams showing the effects when k=0, 0.6, 1, −0.5, respectively, in the second embodiment.

FIG. 23is a diagram showing an image when a threshold value=0.5+0.1×P in the second embodiment.

FIGS. 24 to 28are block diagrams representing the respective arrangement of image processing apparatuses according to third to seventh embodiments of the present invention.

FIG. 29is a diagram representing an arrangement of an image processing apparatus using an error diffusion method.

FIG. 30is another diagram representing an arrangement of an image processing apparatus using an error diffusion method.

FIG. 31is a block diagram representing an arrangement of an image forming apparatus in a reference example.

FIG. 32is a diagram related to the description of the function of a correction value memory119.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Reference Example

FIG. 29is a block diagram representing an arrangement of an image processing apparatus executing an error diffusion method in the reference example of the present invention.

Referring to the diagram, the image processing apparatus includes an input unit501for receiving as an input a pixel value of one pixel of a multi-value image, a subtractor503for subtracting a diffused error from the input pixel value, an output unit505for outputting an output from subtractor503as a corrected pixel value, a thresholding unit507for performing thresholding on an output of output unit505to form binary data, an output unit509for outputting an output of thresholding unit507as pixel data, a subtractor511for subtracting the output of output unit505from the output of thresholding unit507, and an error memory513for diffusing an output result from subtractor511to pixels surrounding a pixel which is the object of processing (pixel of interest).

Moreover, an output of subtractor511shown inFIG. 29is to be distributed to the surrounding pixels by error memory513so that the image processing apparatus shown inFIG. 29may be represented as shown inFIG. 30.

Thus, as shown inFIG. 30, the output of subtractor511in the processing of a pixel is distributed to the surrounding pixels by weighted distribution units309,311. The result of distribution is input to subtractor503.

In addition, a threshold value used in thresholding unit507may be set by a threshold value setting unit307.

FIG. 31is a block diagram representing an arrangement of an image forming apparatus in a reference example of the present invention. The binarizing process of an image performed by the apparatus will be referred to as a “threshold value diffusion method.” In the diagrams of the present application, a portion enclosed by a normal rectangle represents a portion performing some sort of operation, while a portion enclosed by a rounded rectangle represents a portion that performs no operation and simply outputs a value.

Referring to the diagram, the image forming apparatus includes an image (pixel value) input unit101, a thresholding unit103, a binary image output unit105, an inverting unit113, an initial threshold value generating unit107, a subtracting unit109, a corrected threshold value output unit111, a subtracting unit115, a coefficient multiplying unit117, and a correction value memory119.

One pixel value (0 to 1) of a multi-value image is input to image input unit101. When a multi-value image n of 256 gradations (0 to 255) is to be handled, for instance, a normalized value normalized to 0 to 1 (n/255) is input to image input unit101. Thresholding unit103compares a corrected threshold value Th(x) output from corrected threshold value output unit111with the pixel value input to image input unit101. When pixel value≧corrected threshold value Th(x), thresholding unit103outputs “1,” whereas when pixel value<corrected threshold value Th(x), thresholding unit103outputs “0.” Consequently, binary image output unit105outputs an image having binary value of “0” or “1.”

Initial threshold value generating unit107outputs an initial threshold value Th(x) before correction. The initial threshold value Th(x) before correction may be a constant value, or it may be varied in accordance with the position of the pixel so as to provide a dither pattern.

Subtractor109reads a correction value stored in correction value memory119which corresponds to the pixel which is the object of processing (pixel of interest), and subtracts the correction value from the initial threshold value Th(x). The result becomes the corrected threshold value Th(x).

Inverting unit113inverts an output from thresholding unit103. In other words, inverting unit113outputs “1” when the output of thresholding unit103is “0,” and outputs “0” when the output is “1.”

Subtracting unit115subtracts corrected threshold value Th(x) from the output of inverting unit113and outputs the result. Coefficient multiplying unit117multiplies the output of subtracting unit115by a feed back coefficient β, which is set between 0 and 1, and outputs the result. Note that setting β=0 means that the threshold value diffusion is not to be performed.

Correction value memory119is a memory for distributing the output result of coefficient multiplying unit117to the correction values of the threshold values for pixels surrounding the pixel which is the object of processing. Referring toFIG. 32, when the pixel which is the object of processing is shown as a white circle, the output result from coefficient multiplying unit117is allocated at the ratio (weight coefficient) of 1 to 32 to the correction values of threshold values of the surrounding pixels and the corrected values are stored.

First Embodiment

An image forming apparatus according to the first embodiment of the present invention will be described below. The image forming apparatus according to the first embodiment is characterized in that it performs control of the edge enhancement effect by simple processing, while at the same time, performing half toning process.

The threshold value diffusion method described as a reference example above is a superior half toning method that may replace the error diffusion method, but it has an edge enhancement effect, the degree of which could not be controlled, so that the situations in which it could be employed is disadvantageously limited. The first embodiment allows the intensity of the edge enhancement effect to be controlled freely without substantially changing the load of the threshold value diffusion method in the above reference example.

According to the first embodiment, in the threshold value diffusion method, an input value is added to a value to be fed back (a feedback value), and the result is weighted and diffused to threshold values of surrounding pixels. Then, upon using the feedback value, the input value at that time is subtracted the feedback value. When the input value does not change and remains constant, this operation involves only adding and subtracting the input value (which is constant) so that no effect is produced, but when the input value changes, the operation functions to diminish the change. Consequently, the edge can be weakened.

When the amount of the input value added to the feedback value is changed, the effect changes to the extent the amount is changed. By reversing the sign of the input value added, edge enhancement can be effected.

FIG. 1is a block diagram representing an arrangement of the image forming apparatus according to the first embodiment.

Referring to the diagram, in the first embodiment, a portion enclosed by the broken line ofFIG. 1is additionally provided as an algorithm for controlling the edge enhancement effect to the image forming apparatus that employs the threshold value diffusion method in the reference example ofFIG. 31. In the portion enclosed by the broken line are provided a k multiplying unit203for multiplying an input value of image input unit101by k, an adding unit207for adding an output of k multiplying unit203and an output of coefficient multiplying unit117, and a subtractor205for subtracting the output of k multiplying unit203from a value that is weighted and distributed. In addition, an output of adding unit207is distributed to threshold values of surrounding pixels by a weighted distribution unit209and a weighted distribution unit201.

An operation of the image processing apparatus according to the first embodiment will be described below with reference toFIGS. 2 to 5. Here, for simplicity of description, it is set such that k=1, and an input value takes a value in a range of 0 to 1. In addition, it is assumed that the input value indicates a darker color as it increases from 0 toward 1.

As shown inFIG. 2, if the input value is 0.8 and constant, k multiplying unit203performs processing of 0.8×1=0.8, and adding unit207adds this value of 0.8 to a feedback value (output of coefficient multiplying unit117). Consequently, the feedback value to be distributed becomes larger by 0.8 than that of the image forming apparatus shown inFIG. 31.

As shown inFIG. 3, if the input remains unchanged at 0.8 in the processing of the next pixel, k multiplying unit203would perform processing of 0.8×1=0.8, and subtractor205would subtract this value of 0.8 from a value that is weighted and distributed (feedback value). In other words, in the processing ofFIGS. 2 and 3, merely the operations of adding 0.8 to the feedback value and subsequently subtracting 0.8 therefrom are ultimately performed so that the same processing is performed as the threshold value diffusion process in the above-described reference example.

On the other hand, if the input value is reduced to 0.5 as shown inFIG. 4after the processing ofFIG. 2, although 0.8 was added to the feedback value inFIG. 2, subtractor205would only subtract 0.5 from the feedback value inFIG. 4. Consequently, the feedback value becomes +0.8−0.5=+0.3 such that it increases from its original value by 0.3.

As shown inFIG. 5, the feedback value is subtracted from an initial threshold value by subtracting unit109so that the feedback value being increased by 0.3 is the same as the threshold value being decreased by 0.3. Moreover, the threshold value being decreased is the same as the input value being increased.

As shown by the above-described processing, the image processing apparatus according to the first embodiment ultimately achieves the same effect as increasing the input value in order to diminish the change in the input value when the input value changes in the direction of becoming smaller.

Conversely, the image processing apparatus according to the first embodiment achieves the same effect as decreasing the input value in order to diminish the change in the input value when the input value changes in the direction of becoming larger. With such processing, the edge can be weakened within the image which is the object of processing.

Moreover, when the value of k is changed, the intensity of the effect can be changed to the extent the value of k is changed so that the user can set the strength of the edge at will by simple processing. Conversely, when k is set to a negative value, the change of the input can be enhanced (the edge can be strengthened).

Next, a specific example of processing performed by the image processing apparatus according to the above-described embodiment will be described.

In this example, a diffusion weight coefficient shown inFIG. 6is employed as the diffusion weight coefficient used for performing the weighted distribution. Referring toFIG. 6, a feedback value (output of adding unit207) produced by the processing of the pixel of interest (X) is distributed to pixels indicated by “3,” “2,” and “1.”

A 3/40 of the feedback value would be distributed to a pixel indicated by “3,” a 2/40 of the feedback value would be distributed to a pixel indicated by “2,” and a 1/40 of the feedback value would be distributed to a pixel indicated by “1.”

In addition, in this example, initial threshold value generating unit107outputs a pattern of a threshold value shown inFIG. 7. This is a pattern for producing closely arranged parallel lines directed toward a direction that is 70 degrees from the horizontal direction,

More specifically, an initial threshold value is calculated using a formula: initial threshold value=0.5+0.05×P. Then, P in this formula is a line pattern signal to be added to a threshold value, and is calculated by the following formula:
P=((i/3+j)%4−1.5)/3

Here, (i, j) are numerical values representing a coordinate of a pixel. In addition, %4 represents a remainder produced as a result of division by 4.

Moreover, in this example, it is set such that a diffusion coefficient β=0.48, and it is adjusted such that no dot is output when the input is 0, while a dot is output when the input is not 0.

FIG. 8is a diagram showing an original image as the object to be processed. In this image data, one pixel takes a value between 0 to 255, where the density of the pixel becomes greater as the value increases from 0 toward 255. A pixel of a portion that appears white inFIG. 8is a pixel having a density of “4,” and a pixel that appears black is a pixel having a density of “251.” In addition, there is a line made of pixels having a density of “245” in the area indicated by the arrows in the portion that appears black.

FIGS. 9 to 13are diagrams showing the results of thresholding in the cases where k=0, 0.5, 0.8, 1, −0.5, respectively.

When k=0, the processing that is performed by the portion enclosed by the broken line inFIG. 1is not performed, and the same processing as the processing that is performed by the image processing apparatus employing the threshold value diffusion method shown inFIG. 3is performed. Thus, an edge of the image is enhanced as shown inFIG. 9.

As shown inFIGS. 10 to 12, it can be seen that the edge becomes weaker as the value of k is increased. This is because the effect to cancel out the change in the input becomes stronger as the value of k is increased, as described above. The user may subtly adjust the strength of an edge by successively changing the value of k at will.

Conversely, as shown inFIG. 13, the edge can be strengthened by selecting a negative value for k.

As described above, the first embodiment allows edge control in the threshold value diffusion method without particularly increasing the burden of processing.

Second Embodiment

The second embodiment provides for the control of the edge enhancement effect of an image processing apparatus employing an error diffusion method.

In the error diffusion method, also, the edge enhancement effect would become obvious with a broader range of error diffusion so that some measure was required. The second embodiment allows the intensity of the edge enhancement effect to be controlled freely without substantially changing the load in the error diffusion method.

FIG. 14is a block diagram representing an arrangement of an image processing apparatus according to the second embodiment. Referring to the diagram, in the second embodiment, a portion enclosed by the broken line is additionally provided to the image processing apparatus (seeFIGS. 29 and 30) employing a normal error diffusion method.

In other words, in addition to the arrangement of the image processing apparatus shown inFIG. 30, the image processing apparatus according to the second embodiment is provided with a k multiplying unit301for multiplying an input value by k, a subtractor305for subtracting an output of k multiplying unit301from an output from subtractor511, and an adding unit303for adding the output of k multiplying unit301to an error that is weighted and distributed.

In the second embodiment, also, the edge enhancement effect can be changed freely by changing the value of k.

Referring toFIG. 14, the second embodiment performs the operation of distributing an input value multiplied by k to the neighboring pixels along with an error (subtracting from the error), and adding the input value multiplied by k to the distributed value when an error is received from the neighboring pixels.

Such an operation would only involve processing of subtracting and adding a constant value when the input value does not change, so that there is no effect. When the input changes, however, such operation functions to diminish the change. As an amount of the input value added to the error is changed (that is, when the value of k is changed), the effect successively changes. In addition, by reversing the sign of k, edge enhancement can be effected.

Next, an operation of the image processing apparatus according to the second embodiment will be described with reference toFIGS. 15 to 18. Here also, for simplicity of description, it is set such that k=1, and an input value takes a value in a range of 0 to 1. In addition, it is assumed that the input value indicates a darker color as it increases from 0 toward 1.

As shown inFIG. 15, if the input value is 0.8 and constant, k multiplying unit301performs processing of 0.8×1=0.8, and subtractor305subtracts this value of 0.8 from an error. Consequently, the error to be distributed becomes smaller by 0.8.

As shown inFIG. 16, if the input remains unchanged at 0.8 in the processing of the next pixel, k multiplying unit301would perform processing of 0.8×1=0.8, and adding unit303would add this value of 0.8 to the distributed error.

In other words, in the processing ofFIGS. 15 and 16, merely the operations of subtracting 0.8 from the error and subsequently adding 0.8 thereto are ultimately performed so that the same processing as a normal error diffusion process is performed.

On the other hand, if the input value becomes 0.5 as shown inFIG. 17after the processing ofFIG. 15, although 0.8 was subtracted from the error inFIG. 15, adding unit303would only add 0.5 to the error. Consequently, the error becomes −0.8+0.5=−0.3 such that it decreases from its original value by 0.3.

Consequently, as shown inFIG. 18, the value to be subtracted by subtractor503is reduced by 0.3 so that the input ultimately increases by 0.3. In other words, an error made smaller is the same as an input made greater.

As shown by the above processing, the second embodiment achieves the same effect as increasing the input and decreasing the change when the input value changes in the direction of becoming smaller.

Conversely, the second embodiment similarly achieves the effect of canceling out the change when the input value changes in the direction of becoming larger. Moreover, when the value of k is changed, the intensity of the effect can be changed. Conversely, when k is set to a negative value, the change can be enhanced.

Next, a specific example of processing performed by the image processing apparatus according to the second embodiment will be described.

In this example, a diffusion weight coefficient shown inFIG. 6is employed as the diffusion weight coefficient used for performing weighted distribution of an error. In addition, in this example, threshold value generating unit307outputs a pattern of a threshold value shown inFIG. 7. The same formula as that of the first embodiment was employed as the formula for calculating P, but the threshold value is set to a smaller value than that in the first embodiment so as to mitigate dot delay in the upper left portion of an image. More specifically, the threshold value is calculated using a formula: threshold value=0.15+0.1×P.

Moreover, the original image which is the object to be processed employed was the one shown inFIG. 8.

When k=0, the processing performed by the portion indicated by the broken line inFIG. 14is not performed, and an error diffusion processing similar to that of the reference example is performed. Consequently, the edge of an image is strengthened as shown inFIG. 19.

As shown inFIGS. 20 and 21, it can be seen that the edge becomes weaker as the value of k increases. Moreover, the strength of an edge may be subtly adjusted by continuously changing the value of k.

Conversely, as shown inFIG. 22, the edge can be strengthened by selecting a negative value for k.

As described above, the second embodiment allows edge control in the error diffusion method without particularly increasing the burden of processing.

Further,FIG. 23is a diagram showing a result of processing of an image when it is set that a threshold value=0.5+0.1×P, and k=0.6. In this example, the threshold value is large so that dot delay is seen to have taken place in the upper left portion of the image where the processing started.

Third Embodiment

FIG. 24is a block diagram representing an arrangement of an image processing apparatus according to the third embodiment.

Referring to the diagram, the third embodiment is provided with a k determining unit203afor setting a coefficient k in addition to the arrangement of the image processing apparatus according to the first embodiment shown inFIG. 1. By operating k determining unit203a, the user is able to change the value of k at will in order to control the degree of edge enhancement.

Fourth Embodiment

FIG. 25is a block diagram representing an arrangement of an image processing apparatus according to the fourth embodiment of the present invention.

Referring to the diagram, the apparatus of the fourth embodiment is provided with a pattern generating unit221as compared to the image processing apparatus ofFIG. 24. A pattern output by pattern generating unit221(for instance, white noise, which is a random pattern) is input to k multiplying unit203. Then, after the multiplication by the value of k, the resultant value is input to adding unit207and subtractor205.

According to the fourth embodiment, a pattern such as noise and so on may be added to an image. In addition, by setting k such that 0<k(<1), high frequency components of an output image can be decreased so as to cause the image to be influenced by pink noise. Moreover, when it is set such that k<0, high frequency components would increase so as to cause the image to be influenced by blue noise.

Fifth Embodiment

FIG. 26is a block diagram representing an arrangement of an image processing apparatus according to the fifth embodiment of the present invention. Referring to the diagram, the apparatus of the fifth embodiment is provided with a k determining unit301afor setting a value of k in multiplying unit301in addition to the arrangement of the image processing apparatus shown inFIG. 14. Consequently, the user is able to change the value of k at will through k determining unit301aso as to control the intensity of an edge.

Sixth Embodiment

FIG. 27is a block diagram representing an arrangement of an image processing apparatus according to the sixth embodiment of the present invention. The arrangement of the apparatus in the sixth embodiment is somewhat different from the arrangement shown inFIG. 26; yet, it is capable of performing the same operation as that of the apparatus shown inFIG. 26.

Specifically, the image processing apparatus is provided with a k multiplying unit301for multiplying an input from an input unit501by k, a (1−k) multiplying unit321for multiplying the input by a value of (1−k), a subtractor323for subtracting an error that is weighted and distributed from an output of (1−k) multiplying unit321, a thresholding unit507for performing thresholding on an output of subtractor323, an output unit509for outputting a result of thresholding, a subtractor511for subtracting the value before thresholding from a value derived after thresholding, a subtractor305for subtracting an output of k multiplying unit301from an output of subtractor511, a threshold value generating unit307for generating a threshold value, and a k determining unit301afor setting k at will.

Seventh Embodiment

FIG. 28is a block diagram representing an arrangement of an image processing apparatus according to the seventh embodiment of the present invention.

Referring to the diagram, the image processing apparatus of the seventh embodiment is provided with a pattern generating unit325in addition to the arrangement of the image processing apparatus shown inFIG. 26. An output of pattern generating unit325is input to k multiplying unit301.

In this apparatus arrangement, like the image processing apparatus ofFIG. 25, for instance, pattern generating unit325generates a pattern signal, such as white noise, that is about a few percent of the input. By setting k such that 0<k (<1), high frequency components of an output image would decrease so that the image would be influenced by pink noise. Moreover, when it is set such that k<0, high frequency components would increase so that the image would be influenced by blue noise.

Moreover, a threshold value used inFIG. 25orFIG. 28may be a pattern as shown inFIG. 7or may be a constant value. In addition, a pattern as the one shown inFIG. 7may be generated using a pattern generating unit, and a threshold value307may be a white noise (a random value).

The processing in the above-described embodiment may be performed by software or using a hardware circuit.

In addition, a program may be provided for executing the processing in the above-described embodiment, and such program may be stored in a recording medium such as a CD-ROM, a flexible disk, a hard disk, an ROM, an RAM, and a memory card, and provided to the user.

Furthermore, although the above description only illustrates the conversion from an input image of 256 gradations into an output image of two gradations, it is also possible to convert arbitrary input gradations into arbitrary output gradations using a similar technique.