The disclosed embodiments generally relate to the field of image processing.
Error diffusion methods, such as the method described in R. W. Floyd & L. Steinberg, “An Adaptive Algorithm for Spatial Grayscale,” in the Proceedings of the Society for Information Display, vol. 17, pp 75-77 (1976) (the “Floyd-Steinberg method”), are often used to convert grayscale images to binary images on a binary output device. Such error diffusion methods typically examine a pixel in an input image, determine whether the intensity for the pixel in the input image exceeds a threshold, and assign either a light or dark binary value to the pixel in an output image based on whether it exceeds the threshold. The difference between the input image pixel intensity and the corresponding pixel intensity in the output image is the error for the pixel. Error diffusion methods assign at least a portion of the error to one or more neighboring pixels that have not been previously assigned a pixel intensity for the output image. In this manner, the total pixel intensity is substantially maintained throughout the output image without a substantial loss of resolution. However, individual pixels might be lighter or darker in the resulting image than in the input image.
For example,
For the second pixel, the error value E1 is subtracted from the original value for the pixel. Since the resulting value is less than the threshold, the second pixel is assigned a value of “0” (e.g., “dark”). The error value, E2, is computed for the second pixel. The process iterates over each subsequent pixel until all pixels are computed. Alternate error diffusion methods might diffuse the calculated error among a plurality of unconverted pixels. For example, a first portion of the error value E1 for the first pixel could be subtracted from the second pixel and a second portion could be subtracted from the third pixel.
Exemplary methods of using error diffusion to generate an output image include the methods described in U.S. Pat. Nos. 5,226,094 and 5,374,997 to Eschbach, the disclosures of which are each incorporated herein by reference in their entireties.
One problem inherent in the Floyd-Steinberg method is that displeasing textures (i.e., worms) are produced in the highlight and shadow regions. An exemplary error diffusion rendered binary output having worm effects is shown in
Accordingly, modifications to the Floyd-Steinberg method, such as the one described in U.S. Pat. No. 5,353,127 to Shiau et al., which is incorporated herein by reference in its entirety, and shown in
A third error diffusion method, called “threshold stamping” and described in U.S. Pat. No. 5,535,019 to Eschbach, which is incorporated herein by reference in its entirety, modulates the error diffusion threshold level in order to adjust the dot placement in the extreme highlight and shadow regions. As such, the worm artifact is virtually eliminated. The stamping function requires a complete line-buffer of memory to store and adjust the slow-scan threshold video that is used to render the downstream pixels via error diffusion processing.
The error diffusion blocks 405a-d receive pixel information 410a-d corresponding to the color for each pixel on a scanline. The pixel information 410a-d is within a range, such as from 0 to 255, and represents the intensity of the particular color for the pixel in an input image.
The error diffusion blocks 405a-d also receive error information from the error scanline buffer memory 415a-d corresponding to the same color. Each error value is within a range, such as from −128 to 127, and represents the amount of error passed to the pixel from preceding pixels according to an error diffusion algorithm.
Moreover, the error diffusion blocks 405a-d receive threshold information from the threshold scanline buffer memory 420a-d corresponding to the same color. Each threshold value is within a range, such as from −128 to 127, and represents the change from the base threshold for the particular pixel.
The error diffusion blocks 405a-d determine whether the sum of the pixel value and the error value for a pixel is greater than the sum of the base threshold and the threshold value for the pixel. If the sum of the pixel value and the error value is greater, then the pixel is supplied with the designated color 425a-d. Otherwise, the pixel is not supplied with the designated color.
The error diffusion blocks 405a-d then compute updated error values based on the above comparison for a scanline and store the updated error values in the error scanline buffer memory 415a-d corresponding to the same color. Likewise, the error diffusion blocks 405a-d compute updated threshold values based on the above comparison for a scanline and store the updated threshold values in the error scanline buffer memory 420a-d corresponding to the same color. Accordingly, slow-scan error and threshold information is passed from preceding scanlines to subsequent scanlines using this process.
Although threshold stamping produces excellent image quality with pleasing dot structures, it requires numerous computations to achieve the desired output rendering effect. Accordingly, the overall throughput performance of the algorithm is limited and could not typically be used for high-speed image processing applications.
As shown in
What is needed is an error diffusion method and system that enables high-speed error diffusion while performing threshold stamping.
A need exists for an error diffusion method and system that reduces the worm effects traditionally caused in highlight and shadow regions of an image.
A further need exists for a method of reducing the memory size and number of memory accesses for an error diffusion algorithm while substantially maintaining image quality.
The present disclosure is directed to solving one or more of the above-listed problems.
Before the present methods, systems and materials are described, it is to be understood that this disclosure is not limited to the particular methodologies, systems and materials described, as these may vary. It is also to be understood that the terminology used in the description is for the purpose of describing the particular versions or embodiments only, and is not intended to limit the scope.
It must also be noted that as used herein and in the appended claims, the singular forms “a,” “an,” and “the” include plural references unless the context clearly dictates otherwise. Thus, for example, reference to a “pixel” is a reference to one or more pixels and equivalents thereof known to those skilled in the art, and so forth. Unless defined otherwise, all technical and scientific terms used herein have the same meanings as commonly understood by one of ordinary skill in the art. Although any methods, materials, and devices similar or equivalent to those described herein can be used in the practice or testing of embodiments, the preferred methods, materials, and devices are now described. All publications mentioned herein are incorporated by reference. Nothing herein is to be construed as an admission that the embodiments described herein are not entitled to antedate such disclosure by virtue of prior invention.
In an embodiment, a system for performing threshold stamping may include a threshold memory including a plurality of threshold values, an error memory including a plurality of error values, a register array including a plurality of register blocks, and a threshold damping circuit in communication with the third register block and the threshold memory. A first register block may be in communication with the threshold memory and the error memory. A second register block may include an error diffusion block. A third register block may be in communication with the error memory and may output a stamped threshold value. The threshold damping circuit may reduce the stamped threshold value.
Optionally, in the system, each register block may include a register, a look-up table (LUT), and a multiplexer in communication with the register and the LUT. The register may outputs threshold value for a local pixel, wherein the LUT outputs a threshold delta value based on a pixel value of a pixel analyzed by the error diffusion block. The multiplexer may select either the threshold value or a sum of the threshold value and the threshold delta value to send to the next register block.
In the above-described system, the threshold damping circuit may reduce the stamped threshold value by multiplying the stamped threshold value by a constant, wherein the constant is a value from about 0 to about 1. Alternatively, threshold damping circuit may reduce the stamped threshold value by subtracting a constant from the absolute value of the stamped threshold value to determine a damped threshold value, wherein if the computed damped threshold value is less than zero, the damped threshold value equals zero.
The system may also include an upscaling circuit in communication with the threshold memory and the first register block, wherein the upscaling circuit performs linear interpolation using adjacent threshold values. The upscaling circuit may include a register that outputs a first threshold value and receives a second threshold value from the threshold memory, a subtractor that communicates with the register and determines a delta value equal to the difference between the first threshold value and the second threshold value, a divider that communicates with the subtractor and determines an interpolation factor by dividing the delta value by a scaling factor, a state machine that outputs each integer value from zero to the scaling factor minus one (inclusive, in succession), a multiplier that communicates with the divider and the state machine and calculates a product of the interpolation factor and the output of the state machine, and an adder that communicates with the multiplier and the register and outputs the sum of the product and the first threshold value to the first register block.
Further, the system may include a downscaling circuit in communication with the third register block and the threshold memory, wherein the downscaling circuit averages a plurality of stamped threshold values received from the third register. The downscaling circuit may include: a first number of registers, wherein the first number equals a scaling factor plus one, and wherein each register outputs a stamped threshold value; an averager that communicates with the registers and averages the stamped threshold values output from the registers; and a sampler that communicates with the averager and outputs a downscaled threshold value once every second number of clock cycles, wherein the second number equals the scaling factor.
In another embodiment, a method of performing threshold stamping may include retrieving a threshold value corresponding to a first pixel from a threshold memory, updating the threshold value at each of one or more register blocks, calculating a binary pixel value at an error diffusion block, damping the updated threshold value, and storing the damped threshold value in the threshold memory.
In such an embodiment, when updating the threshold value at each of one or more register blocks, the method may include, for each register block: storing the threshold value in the register block; selecting one of the threshold value and a sum of the threshold value and a threshold delta value as an updated threshold value, wherein the threshold delta value is determined based on a pixel value from the error diffusion block; and transmitting the updated threshold value to the next register block. When calculated a binary pixel value, the method may include calculating the binary pixel value based on at least an updated threshold value corresponding to the first pixel, an error value corresponding to the first pixel, and a pixel value corresponding to the first pixel. When damping the updated threshold value, the method may include setting the damped threshold value to a product of the updated threshold value and a value, wherein the value is between about 0 and about 1. Alternatively, when damping the updated threshold value, the method may include: (i) if a constant is less than the absolute value of the updated threshold value, setting the damped threshold value to a difference between the constant and the updated threshold value; and (ii) if not, setting the damped threshold value to zero.
In an embodiment, a method of performing threshold stamping may include retrieving a first threshold value corresponding to a first pixel and a second threshold value corresponding to a second pixel from a threshold memory, computing a plurality of upscaled threshold values based on the first threshold value and the second threshold value, updating an upscaled threshold value at each of one or more register blocks, computing a binary pixel value at an error diffusion block, computing a downscaled threshold value based on a plurality of updated threshold values, damping the downscaled threshold value, and storing the damped threshold value in the threshold memory.
Aspects, features, benefits and advantages of the embodiments described herein will be apparent with regard to the following description, appended claims and accompanying drawings where:
The register array 805a-y may permit multiple point accessibility during the threshold computation and error diffusion processes. Such accessibility may permit high-data throughput rates while applying threshold stamping and dynamic modulation of the threshold level(s) relative to each pixel being processed. This may be in direct contrast to the synchronous single-port memory depicted in
The following description pertains to a single instance of an error diffusion algorithm and a threshold stamping algorithm in the register array 805a-y. The operation for each of, for example, cyan, magenta, yellow and black error diffusion algorithms and threshold stamping algorithms may function substantially similar to the described embodiment using the pixel information for each of those colors. Other, additional, or fewer colors may be used within a particular embodiment and still be within the scope of this disclosure.
In an embodiment, FF[+12] 805a may receive a pixel value 810, which may be a value within a range from, for example, 0 to 255; an error value from the error scanline buffer memory 815, which may be a value within a range from, for example, −128 to 127; and a threshold value from the threshold scanline buffer memory 820, which may be a value within a range from, for example, −128 to 127. The pixel value 810 may represent the pixel intensity of a corresponding pixel in an input image. The error value may represent the initial error assigned to the pixel according to an error diffusion algorithm. The threshold value may represent a stored threshold value for the pixel based on preceding scanlines. Each of FF[+12, . . . , −12] 805a-y may perform the functions described in reference to
The threshold value for the local pixel may be added to the threshold delta value 920 to generate a stamped threshold value 925. The threshold value and the stamped threshold value 925 may be input to a multiplexer 930. The multiplexer 930 may select one of the two values to forward to the next register stage 935. In an embodiment, the determination may be based upon the pixel value 910 of the pixel being processed by the error diffusion block 805m. The updated threshold information may be forwarded to the next register stage 935 for further threshold stamping during the following clock cycle. Accordingly, this architecture may allow a distinct profile to be simultaneously “stamped” at each register stage. A significant increase in the image-processing throughput speed for the stamping operation may result.
As shown in
In an embodiment, if the input pixel value 910 falls within the first range, the stamp level remapping logic 1105 may direct a 2's complement conversion module 1110 to make the threshold delta value 920 negative by, for example, assigning a ‘1’ to a sign bit. In an embodiment, if the input pixel value 910 falls within the second range, the stamp level remapping logic 1105 may direct the 2's complement conversion module 1110 to make the threshold delta value 920 positive by, for example, assigning a ‘0’ to a sign bit.
In an embodiment, if the input pixel value 910 does not fall within either the first range or the second range, the threshold delta value 920 may be assigned a value of ‘0’ (not shown). In an alternate embodiment, if the input pixel value 910 does not fall within either the first range or the second range, a signal (not shown) may be used to make multiplexer 930, as shown in
Referring back to
In an embodiment, the threshold damping circuit 830 may multiply the updated threshold value by a fractional value, such as a value greater than 0 but less than 1, in order to reduce the effect on a particular pixel position for each subsequent scanline. In an alternate embodiment, the threshold damping circuit 830 may subtract a value from the absolute value of each updated threshold value. If the resulting value is less than zero, the threshold damping circuit 830 may set the value to 0. The damped threshold value and the error value may then be stored in the same memory location within the threshold scanline buffer memory 820 and the error scanline buffer memory 815, respectively, from which they were originally retrieved. The values may then be used, for example, in the computation of threshold and error values for the next scanline.
The following description pertains to a single instance of an error diffusion algorithm and a threshold stamping algorithm in the register array 805a-y. The operation for each of, for example, cyan, magenta, yellow and black error diffusion algorithms and threshold stamping algorithms may function substantially similar to the described embodiment using the pixel information for each of those colors. Other, additional, or fewer colors may be used within a particular embodiment and still be within the scope of this disclosure.
As shown in
FF[−12] 805y may output an updated threshold value (as determined, for example, by the threshold stamping operation performed in FF[+12] 805a to FF[−12]), an updated error value (as determined, for example, by the error diffusion block 805m), and a binary pixel value 825 (as determined, for example, by the error diffusion block) for each color, such as cyan, magenta, yellow and black. The binary pixel value 825 may represent whether a particular pixel is light or dark. The updated threshold value may be passed to threshold downscaling logic 1210, which is described in reference to
In an embodiment, the downscaled threshold value may be passed to the threshold damping circuit 830. In an embodiment, the threshold damping circuit 830 may multiply the updated threshold value by a value, such as a value between about 0 and about 1. In an alternate embodiment, the threshold damping circuit 830 may subtract a value from the absolute value of each updated threshold value. If the resulting value is less than zero, the threshold damping circuit 830 may set the value to 0. The damped threshold value may reduce the effect of the threshold delta value on a particular pixel position for each subsequent scanline.
In an alternate embodiment, the threshold downscaling logic 1210 and the threshold damping circuit 830 may be combined into one circuit to reduce delay in computing the damped threshold value.
The damped threshold value and the error value may then be stored in the same memory location within the threshold scanline buffer memory 1215 and the error scanline buffer memory 815, respectively, from which they were originally retrieved. The values may then be used, for example, in the computation of the threshold and error values for the next scanline.
In an embodiment, the register 1305 may be used to determine the threshold value stored in memory location N and memory location N+1. The number of register array clock cycles for which the register 1305 maintains a threshold value may depend upon the scaling factor for the threshold upscaling logic 1205. The scaling factor may correspond to the size reduction of the threshold scanline buffer memory 1215. For example, if the scaling factor is four, the register 1305 may maintain its value for four register array clock cycles. Alternate scaling factors are also encompassed within the scope of this disclosure.
The subtractor circuit 1310 may compute the difference between the threshold value stored in memory location N and the threshold value stored in memory location N+1. This may be termed the delta value (Δ) between the two threshold values. The divider circuit 1315 may then be used to divide Δ by the scaling factor (e.g., four) to determine an interpolation factor (δ). The state machine 1325 may cycle through the numbers 0, 1, 2 and 3 as constants to be used by the multiplier circuit 1320 in computing products with δ. In an embodiment, the number 0 may be used in the cycle in which the register 1305 accepts a new threshold value. The output of the multiplier circuit 1320 may be the values {0, δ, 2δ, 3δ} in four consecutive clock cycles for the register array 805a-y. Similarly, the adder circuit 1330 may output the values {ThreshN, ThreshN+δ, ThreshN+2δ, ThreshN+3δ} to FF[+12] 805a in four consecutive register array clock cycles. In this manner, the threshold upscaling circuit may send four threshold values to FF[+12] 805a with only one access of the threshold scanline buffer memory 1215.
The threshold downscaling logic 1210 may receive updated threshold values from FF[−12] 805y. The threshold downscaling logic 1210 may sum the last (scaling factor+1) updated threshold values, stored in the registers 1350a-e, using the adder circuit 1355. The average value may then be determined by multiplying the sum by an averaging factor using the threshold averaging multiplier 1360. In an embodiment, the averaging factor may equal
In an embodiment, the threshold downscaling logic 1210 may multiply the output of the threshold average multiplier 1360 by a damping factor for the threshold damping multiplier 1365. In an alternate embodiment, the averaging factor and the damping factor may be combined. This may result in a single multiply operation being performed using a threshold averaging/damping multiplier 1370. The output of the multiplier logic may be sampled once every (scaling factor) clock cycles for the register array 805a-y by the sampling circuit 1375.
In an alternate embodiment, the threshold averaging multiplier 1360, the threshold damping multiplier 1365 and/or the threshold averaging/damping multiplier 1370 may be accessed after the sampling circuit 1375 has sampled a value.
In an embodiment, the threshold upscaling logic 1205 and the threshold downscaling logic 1210 may be synchronized to retrieve and store threshold values for the same pixel in the threshold scanline buffer memory 1215.
A disk controller 1504 interfaces with one or more optional disk drives to the system bus 1528. These disk drives may be external or internal floppy disk drives such as 1510, CD ROM drives 1506, or external or internal hard drives 1508. As indicated previously, these various disk drives and disk controllers are optional devices.
Program instructions may be stored in the ROM 1518 and/or the RAM 1520. Optionally, program instructions may be stored on a computer readable medium such as a floppy disk or a digital disk or other recording medium, a communications signal or a carrier wave.
An optional display interface 1522 may permit information from the bus 1528 to be displayed on the display 1524 in audio, graphic or alphanumeric format. Communication with external devices may optionally occur using various communication ports 1526. An exemplary communication port 1526 may be attached to a communications network, such as the Internet or an intranet.
In addition to computer-type components and their equivalents, the hardware may also include an interface 1512 which allows for receipt of data from input devices such as a keyboard 1514 or other input device 1516 such as a remote control, pointer and/or joystick.
A multiprocessor system may optionally be used to perform one, some or all of the operations described herein. Likewise, an embedded system, such as a sub-system within a xerographic apparatus, may optionally be used to perform one, some or all of the operations described herein.
For example, a xerographic apparatus may scan an image into, download an image in or otherwise receive an image in, for example, a digital format. The digital format may include one or more pixel values for each pixel in the image. The pixel values may be stored in a memory prior to processing or may be utilized for processing as the image is being scanned. The xerographic apparatus may use a method described above or an equivalent method to determine binary pixel values, error values and threshold values as each pixel is processed. Error values and threshold values may be written to the error and threshold scanline buffer memories, respectively, for the processing of subsequent scanlines. Upon completion of or during pixel processing, the resulting binary image may be transferred to, for example, a printing module of the xerographic apparatus, a printer, or any other device for generating a human-readable representation of the image.
It will be appreciated that various of the above-disclosed and other features and functions, or alternatives thereof may be desirably combined into many other different systems or applications. Also that various presently unforeseen or unanticipated alternatives, modifications, variations or improvements therein may be subsequently made by those skilled in the art which are also intended to be encompassed by the following claims.
This application claims priority to and is a continuation application of U.S. patent application Ser. No. 11/172,151, filed Jun. 30, 2005 now U.S. Pat. No. 7,460,727, and entitled “Error Diffusion Method And Hardware Architecture.” The above-identified application is incorporated by reference herein, in its entirety, for all purposes.
Number | Name | Date | Kind |
---|---|---|---|
5226094 | Eschbach | Jul 1993 | A |
5353127 | Shiau et al. | Oct 1994 | A |
5374997 | Eschbach | Dec 1994 | A |
5535019 | Eschbach | Jul 1996 | A |
5565994 | Eschbach | Oct 1996 | A |
5748785 | Mantell et al. | May 1998 | A |
5784496 | Mantell | Jul 1998 | A |
5875249 | Mintzer et al. | Feb 1999 | A |
6325487 | Mantell | Dec 2001 | B1 |
6962400 | Minnebo et al. | Nov 2005 | B2 |
7084903 | Narayanaswami et al. | Aug 2006 | B2 |
7181087 | Kang et al | Feb 2007 | B2 |
7460727 | Metcalfe et al. | Dec 2008 | B2 |
Number | Date | Country | |
---|---|---|---|
20090073496 A1 | Mar 2009 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 11172151 | Jun 2005 | US |
Child | 12274842 | US |