Image processing apparatus and image processing method
The image processing device enhances thin line reproduction by using edge angle detection to optimize error diffusion thresholds, addressing the issue of line disappearance and artifacts in existing methods.
Patent Information
- Application Number
- JP2024111759
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2026-01-23
AI Technical Summary
Existing error diffusion methods struggle to accurately reproduce thin lines with a thickness of one or two pixels, particularly in directions other than 135°, due to delayed dot generation and trailing artifacts, leading to line disappearance.
An image processing device and method that incorporates edge angle detection to adjust error diffusion thresholds based on the angle of thin lines, enhancing gradation values and optimizing dot generation to prevent line disappearance.
Improves the reproducibility of thin lines by adjusting error diffusion thresholds according to line angles, reducing dot generation delays and trailing artifacts, ensuring accurate reproduction of thin lines at various orientations.
Smart Images

Figure 2026011278000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to an image processing device and an image processing method. [Background technology]
[0002] Conventionally, multi-tone image data scanned using a scanner or multi-tone graphic image data calculated using a computer is subjected to halftoning to reduce the number of gradations, and images are then produced using a printer or display. Error diffusion is a well-known halftoning technique. However, in typical error diffusion methods, the threshold for determining whether dot formation is enabled or disabled for each pixel is a fixed value, such as the median of the input gradation value range. This can result in delayed dot generation and trailing dots, resulting in reduced image quality. In contrast, the error diffusion method described in Patent Document 1 sets a threshold for pixels with gradation values smaller than the median value lower than the median, and a threshold for pixels with gradation values higher than the median value higher than the median. By using such optimal thresholds according to the gradation value, dot generation delays and trailing dots can be reduced. In particular, when multiple pixels with the same gradation value exist in a two-dimensional space, the delay in dot generation is adjusted appropriately according to the dot density, significantly improving the reproducibility of low-density lines and edges in low-density areas. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent No. 3360391 Summary of the Invention [Problem to be solved by the invention]
[0004] However, for thin lines with a thickness of about one or two pixels, even a delay of two pixels can cause the line area to end before dot generation begins, resulting in the thin line disappearing. Specifically, error diffusion binarizes multi-tone input image data sequentially, pixel by pixel, with two processing directions: the main scanning direction, in which one raster is processed pixel by pixel, and the sub-scanning direction, in which the next raster is processed. Furthermore, the quantization error generated by the binarization of a single pixel is distributed and diffused to multiple nearby unprocessed pixels using weights defined by an error diffusion matrix, resulting in error distribution directionality due to the processing direction and error diffusion matrix. Due to this error distribution directionality, when the main scanning direction is right and the sub-scanning direction is downward, thin lines in the lower right direction (135°) are generally well reproduced, but thin lines in the vertical direction, lower left direction (45°), are difficult to reproduce and may disappear. One solution to this problem is the method shown in Patent Document 1, in which the threshold is reduced below the optimum threshold in low-density areas to create an overcorrected state, thereby accelerating dot generation. This has the effect of accelerating dot generation at edges and preventing the disappearance of lines, but there is a concern that excessive correction will cause errors to accumulate, resulting in side effects such as trailing. [Means for solving the problem]
[0005] One aspect of the image processing device according to the present invention is 1. An image processing device that converts first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, an edge angle detection processing unit that detects angles of thin lines included in the first image data; and a threshold determination processing unit that determines a threshold value for the error diffusion method for each pixel included in the first image data based on the angle of the thin line.
[0006] Another aspect of the image processing device according to the present invention is 1. An image processing device that converts first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, an edge angle detection processing unit that detects angles of thin lines included in the first image data; an edge enhancement processing unit that increases the gradation value of the thin line according to the angle of the thin line; Equipped with The first image data in which the tone value of the thin line is increased is converted into the second image data using an error diffusion method.
[0007] One aspect of the image processing method according to the present invention is to 1. An image processing method for converting first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, comprising: Detecting an angle of a thin line included in the first image data; A threshold value of the error diffusion method for the thin line is determined based on the angle of the thin line.
[0008] Another aspect of the image processing method according to the present invention is 1. An image processing method for converting first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, comprising: Detecting an angle of a thin line included in the first image data; increasing the gradation value of the thin line in accordance with the angle of the thin line; The first image data in which the tone value of the thin line is increased is converted into the second image data using an error diffusion method. [Brief explanation of the drawings]
[0009] [Figure 1] FIG. 1 is a schematic configuration diagram of an image processing apparatus according to a first embodiment. [Figure 2] FIG. 10 is a flowchart showing the steps of an image processing method. [Figure 3] FIG. 10 is a flowchart showing the procedure of halftone processing in a comparative example. [Figure 4] FIG. 2 is a diagram showing an example of pixel arrangement. [Figure 5] FIG. 10 is a diagram showing an example of the correspondence between pixel gradation values and optimal threshold values. [Figure 6]FIG. 10 is an explanatory diagram of error diffusion processing. [Figure 7] A diagram showing a thin line with a width of one pixel. [Figure 8] A diagram showing the reproducibility of thin lines with a width of one pixel. [Figure 9] FIG. 4 is a flowchart showing the procedure of halftone processing according to the first embodiment. [Figure 10] FIG. 10 is a diagram showing an example of an edge detection filter. [Figure 11] 10 is a diagram showing threshold values at which thin lines are reproduced at approximately the same dot density as the input tone values for each combination of input tone values and angles of the thin lines. [Figure 12] FIG. 10 is a diagram showing an example of an edge detection filter. [Figure 13] FIG. 10 is a diagram showing an example of an edge detection filter. [Figure 14] FIG. 10 is a diagram showing an example of an edge detection filter. [Figure 15] FIG. 10 is a diagram showing an example of an edge detection filter. [Figure 16] FIG. 10 is a schematic configuration diagram of an image processing apparatus according to a second embodiment. [Figure 17] FIG. 10 is a flowchart showing the procedure of halftone processing according to the second embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0010] Preferred embodiments of the present invention will be described below with reference to the drawings. The drawings used are for the convenience of explanation. Note that the embodiments described below do not unduly limit the content of the present invention as defined in the claims. Furthermore, not all of the configurations described below are necessarily essential components of the present invention.
[0011] 1. First embodiment 1-1. Image processing device configuration FIG. 1 is a block diagram showing the configuration of an image processing device 1 according to a first embodiment. As shown in FIG. 1, the image processing device 1 processes input image data to generate print data PD, and outputs the print data PD to be transferred to a printer 2. The image processing device 1 is, for example, a personal computer, and can be connected to external devices 3, such as digital cameras, memory cards, and USB memory sticks, via various ports (not shown), and can also be connected to external devices 3, such as various servers and information terminals, via a network. The image processing device 1 acquires input image data from, for example, the external device 3. The printer 2 forms an output image corresponding to the input image data on a medium M based on the print data PD. The printer 2 is, for example, an inkjet printer capable of forming full-color images.
[0012] 1, the image processing device 1 includes a processing unit 10, a storage unit 20, a communication unit 30, an operation unit 40, and a display unit 50. Note that the image processing device 1 may have a configuration in which some of the components shown in FIG. 1 are omitted or modified, or other components are added.
[0013] The processing unit 10 acquires input image data and performs image processing. Specifically, the processing unit 10 executes an image processing program 21 stored in the storage unit 20, and performs image processing on input image data 22 stored in the storage unit 20. The input image data 22 is, for example, RGB image data. In addition, the processing unit 10 performs various processes in response to operation signals from the operation unit 40, processes for displaying various images on the display unit 50, processes for controlling the communication unit 30 for data communication with the external device 3, and the like. The processing unit 10 is realized by, for example, a CPU (Central Processing Unit) or a DSP (Digital Signal Processor).
[0014] The processing unit 10 executes the image processing program 21 to function as a resolution conversion processing unit 11, a color conversion processing unit 12, a halftone processing unit 13, and a rasterization processing unit 14. That is, the image processing device 1 includes the resolution conversion processing unit 11, the color conversion processing unit 12, the halftone processing unit 13, and the rasterization processing unit 14.
[0015] 2 is a flowchart showing the steps of an image processing method performed by the image processing device 1. In Fig. 2, first, in a resolution conversion processing step S1, the processing unit 10 of the image processing device 1 functions as a resolution conversion processing unit 11. The resolution conversion processing unit 11 performs processing to convert the resolution (i.e., the number of pixels per unit length) of the input image data 22, which is RGB image data, into a resolution at which the printer 2 can perform printing.
[0016] Next, in a color conversion processing step S2, the processing unit 10 functions as a color conversion processing unit 12. The color conversion processing unit 12 converts the resolution-converted input image data 22 into multi-tone data of multiple ink colors that can be used by the printer 2, while referring to a color conversion table 25 stored in the storage unit 20. This multi-tone data is stored in the storage unit 20 as first image data 23 of a first number of gradations. The first number of gradations is, for example, 256, and each pixel of the first image data 23 has a gradation value between 0 and 255.
[0017] Next, in the halftone processing step S3, the processing unit 10 functions as the halftone processing unit 13. The halftone processing unit 13 converts the first image data 23 having a first number of gradations into second image data 24 having a second number of gradations that is less than the first number of gradations. In this embodiment, the halftone processing unit 13 executes halftone processing using an error diffusion method to generate second image data 24 that determines whether or not to form a dot in each of the multiple pixels that make up the output image, based on the gradation values of the first image data 23. The second image data 24 is stored in the storage unit 20. If the printer 2 is only capable of forming one type of dot size, the halftone processing is a binary processing that determines whether or not to form a dot, and the second number of gradations is two. If two types of dots, small and large, can be formed, the halftone processing is a ternary processing that determines whether or not to form a dot. The number of second gradations is 3. If the halftone process can form three types of ink dots (small, medium, and large), it is a four-value process of none, small, medium, and large, and the number of second gradations is 4. In the following description, it is assumed that the printer 2 can form one type of dot, and the image processing device 1 performs binarization processing as halftone processing.
[0018] 1, the halftone processing unit 13 includes an edge angle detection processing unit 131, a threshold value determination processing unit 132, a tone value correction processing unit 133, a tone number conversion processing unit 134, an error calculation processing unit 135, and an error diffusion processing unit 136, and the halftone processing is performed by each of these units performing their respective processes. The halftone processing will be described in detail later.
[0019] Finally, in the rasterization process step S4, the processing unit 10 functions as a rasterization processing unit 14. The rasterization processing unit 14 rearranges the halftone-processed second image data 24 in the data order to be transferred to the printer 2, and outputs it to the printer 2 as final print data PD. The print data PD includes raster data that indicates the dot recording status during each main scan, and data that indicates the sub-scan feed amount.
[0020] 1, the storage unit 20 has a ROM (Read Only Memory) and a RAM (Random Access Memory), neither of which is shown. The ROM stores various programs such as an image processing program 21 and predetermined data such as a color conversion table 25, while the RAM stores input image data 22 acquired via the communication unit 30. The RAM is also used as a working area for the processing unit 10, and stores programs and data read from the ROM, data input from the operation unit 40, first image data 23, second image data 24 generated by the processing unit 10, etc.
[0021] The communication unit 30 performs various controls to establish data communication between the processing unit 10 and the external device 3. The communication unit 30 also acquires input image data 22 from the external device 3 and stores it in the storage unit 20.
[0022] The operation unit 40 is an input device configured with operation keys, button switches, etc., and outputs an operation signal to the processing unit 10 in response to an operation by a user.
[0023] The display unit 50 is a display device configured by an LCD (Liquid Crystal Display) or the like, and displays various images based on display signals output from the processing unit 10. The display unit 50 may be provided with a touch panel that functions as the operation unit 40. For example, the display unit 50 displays information relating to various states of the image processing device 1.
[0024] At least part of the resolution conversion processing unit 11, color conversion processing unit 12, halftone processing unit 13, and rasterization processing unit 14 may be realized by dedicated hardware. Also, part of the information stored in the storage unit 20, and part of the resolution conversion processing unit 11, color conversion processing unit 12, halftone processing unit 13, and rasterization processing unit 14 may be provided in the printer 2. For example, the printer 2 may receive image data that has not been halftoned from the image processing device 1, perform halftoning, and then perform printing.
[0025] Below, we will explain the halftone process that generates the second image data 24, which is dot data. In the following, we will assume that the second number of gradations in the second image data 24 is 2, that is, that the second image data 24 is image data that indicates whether dot formation in each pixel is on or off. The halftone process is performed using the error diffusion method. First, we will explain the content and problems of the halftone process using the error diffusion method described in Patent Document 1 as a comparative example, and then we will explain the halftone process of this embodiment.
[0026] 1-2. Halftone processing for comparison Fig. 3 is a flowchart showing the procedure of halftone processing of the comparative example. The halftone processing of the comparative example is processing to convert each pixel P(x, y) having a gradation value of any one of 0 to 255 into a gradation value of 0 or 255, and is performed by halftone processing unit 13A (not shown). As shown in Fig. 4, x is the horizontal coordinate, y is the downward coordinate, and the pixel in the upper left corner is P(0, 0) and the pixel in the lower right corner is P(n-1, m-1).
[0027] 3, in step S301, the halftone processing unit 13A initializes both coordinates x and y to 0. Then, in step S302, the halftone processing unit 13A sets pixel P(x, y) included in the first image data 23 as a pixel of interest (pixel to be processed), and performs processing from step S303 onwards on pixel P(x, y).
[0028] First, in threshold determination process S303, the halftone processing unit 13A determines a threshold EdThreshold(Data[x,y]) for the pixel of interest P(x,y) based on the gradation value Data[x,y] of the pixel of interest P(x,y). For example, the gradation values of all pixels in the first image data 23 are set to the same value in advance, and the gradation values of all pixels corrected by a process similar to that of gradation value correction process S304, which will be described later, are binarized. The gradation values are then varied from 0 to 255 to investigate the optimal threshold at which the average value of the quantization error becomes zero, thereby obtaining a correspondence relationship between the gradation values and the optimal threshold as shown in FIG. 5. Table information of this correspondence relationship is stored in the storage unit 20, and in threshold determination process S303, the halftone processing unit 13A refers to the table information and determines the optimal threshold corresponding to the gradation value Data[x,y] of the pixel of interest P(x,y) as the threshold EdThreshold(Data[x,y]).
[0029] Next, in a gradation value correction processing step S304, the halftone processing unit 13A corrects the gradation value of the pixel of interest P(x,y) by adding an integrated error DiffusedError[x,y] obtained by accumulating errors diffused from multiple pixels P surrounding the pixel of interest P(x,y) that have been converted to gradation values of the second number of gradations in an error diffusion processing step S307, which will be described later, to the gradation value Data[x,y] of the pixel of interest P(x,y). The corrected gradation value CorrectData[x,y] is calculated by CorrectData[x,y]=Data[x,y]+DiffusedError[x,y].
[0030] Next, in a tone number conversion processing step S305, the halftone processing unit 13A compares the tone value CorrectData[x,y] corrected in step S304 with the threshold EdThreshold(Data[x,y]) determined in step S303 for the pixel of interest P(x,y), and converts it to a tone value Data2[x,y] of the second tone number based on the comparison result. Specifically, if CorrectData[x,y]>EdThreshold(Data[x,y]), the halftone processing unit 13A sets Data2[x,y]=255 (dot on), and if CorrectData[x,y]≦EdThreshold(Data[x,y]), the halftone processing unit 13A sets Data2[x,y]=0 (dot off).
[0031] Next, in error calculation processing step S306, the halftone processing unit 13A calculates the error Error[x,y] between the gradation value CorrectData[x,y] corrected in step S304 and the gradation value Data2[x,y] of the second gradation level converted in step S305 for the target pixel P(x,y). That is, Error[x,y]=CorrectData[x,y]-Data2[x,y].
[0032] Next, in an error diffusion processing step S307, the halftone processing unit 13A diffuses the error Error[x, y] calculated in step S306 to a plurality of pixels P surrounding the pixel of interest P(x, y) to update the integrated error DiffusedError. As shown in the figure, the halftone processing unit 13A diffuses Error[x,y] by multiplying it by 1 / 4, 1 / 8, 1 / 16, 1 / 8, 1 / 4, 1 / 8, and 1 / 16 for seven pixels P, namely, pixel P(x+1,y), pixel P(x+2,y), pixel P(x-2,y+1), pixel P(x-1,y+1), pixel P(x,y+1), pixel P(x+1,y+1), and pixel P(x+2,y+1), which are located around the pixel of interest P(x,y), and updates each integrated error DiffusedError as shown in the following equations (1) to (7). DiffusedError[x+1,y]=DiffusedError[x+1,y]+Error[x,y] / 4…(1) DiffusedError[x+2,y]=DiffusedError[x+2,y]+Error[x,y] / 8…(2) DiffusedError[x-2,y+1]=DiffusedError[x-2,y+1]+Error[x,y] / 16…(3) DiffusedError[x-1,y+1]=DiffusedError[x-1,y+1]+Error[x,y] / 8…(4) DiffusedError[x,y+1]=DiffusedError[x,y+1]+Error[x,y] / 4…(5) DiffusedError[x+1,y+1]=DiffusedError[x+1,y+1]+Error[x,y] / 8…(6) DiffusedError[x+2,y+1]=DiffusedError[x+2,y+1]+Error[x,y] / 16…(7)
[0033] Next, if x≠n-1 in step S308, the halftone processing unit 13A sets x=x+1 in step S309 and performs the processes from step S302 onwards again. That is, if x≠n-1 in step S308, the halftone processing unit 13A performs the processes from step S302 onwards for the pixel P(x+1,y) adjacent to the pixel P(x,y) on the right.
[0034] Furthermore, if x=n-1 in step S308, and y≠m-1 in step S310, the halftone processing unit 13A sets x=0 and y=y+1 in step S311 and repeats the processes from step S302 onwards. That is, if x=n-1 in step S308, the halftone processing unit 13A performs the processes from step S302 onwards for pixel P(0,y+1) at the left end of the next raster, since pixel P(x,y) is located at the right end.
[0035] Furthermore, if y=m-1 in step S310, the halftone processing unit 13A ends the halftone processing. That is, if y=m-1 in step S310, the pixel P(x, y) is located in the lower right corner, and therefore the tone number conversion process has been completed for all pixels P shown in FIG. 4, and so the halftone processing unit 13A ends the halftone processing.
[0036] In a typical error diffusion method, the threshold value compared with the gradation value CorrectData[x,y] in step S305 is set to a value near the median of 127.5. However, in the halftone processing of this comparative example, the threshold value EdThreshold(Data[x,y]) is set to a value less than 127.5 when the gradation value Data[x,y] of the pixel of interest P(x,y) is lower than 128, and set to a value greater than 127.5 when the gradation value Data[x,y] is 128 or higher. This reduces dot generation delays and trailing artifacts. In particular, by setting an optimal threshold value for each gradation value Data[x,y], as shown in Figure 5, when multiple pixels P with the same gradation value exist in a two-dimensional space, the delay is adjusted to an appropriate amount according to the dot density, improving dot generation delays and significantly improving the reproducibility of low-density lines and edges in low-density areas. For example, if the number of gradations is 256 (the range of gradation values is 0 to 255) and the gradation value Data[x,y] is 16, the density of the dots formed is about 1 dot in an area of 4x4 pixels, and a delay in dot generation of about 2 pixels can be said to be an appropriate amount of delay. Note that in the following, for example, if the number of gradations is 256 (the range of gradation values is 0 to 255), A gradation value of 16, etc., when the gradation value is within the range (range), may be written as a gradation value of 16 / 255, etc.
[0037] However, for thin lines with a thickness of about one to two pixels, even a delay of two pixels can cause the line area to end before dot generation begins, resulting in the disappearance of the thin line. Specifically, the error diffusion method described in Patent Document 1 was applied to investigate the reproducibility (dot-ON rate on the thin line) of one-pixel-wide thin lines at four different angles, as shown in FIG. 7, for thin line gradation values in the range of 32 / 255 or less. The results were as shown in FIG. 8. In FIG. 7, L1 is a horizontal (0°) thin line, and L2, L3, and L4 are thin lines tilted 45°, 90°, and 135° counterclockwise from the horizontal (0°), respectively. In this investigation of the reproducibility of low-density thin lines at different angles, as indicated by the white circles in FIG. 8, the optimal threshold values shown in FIG. 5 were used according to the gradation value of the thin line. Furthermore, an appropriate amount of random noise was added to the gradation value Data[x,y] of each pixel P(x,y) to prevent the generation of regular dot patterns.
[0038] As shown in Figure 8, of the four types of thin lines, only the 135° thin line is reproduced at a dot density close to the input gradation value, while the 0° and 45° thin lines disappear with no dots generated when the input gradation value is 32 / 255 or less, and the 90° thin line also disappears with no dots generated when the input gradation value is 20 / 255 or less. In either case, significant anisotropy occurs in areas with dot densities of around 10% or less, and although the difference is smaller with thin lines that are two pixels wide, the same tendency remains.
[0039] One solution to this problem is the method shown in Patent Document 1, in which the threshold is reduced to below the optimal threshold in low-density areas, causing an overcorrection state to speed up dot generation, which has the effect of speeding up dot generation at edge portions and preventing line disappearance, but excessive correction can cause errors to accumulate, resulting in side effects such as tailing. Therefore, the halftone processing of this embodiment determines the optimal threshold by taking into account not only the gradation value of pixel P but also the edge angle.
[0040] 1-3. Halftone processing in this embodiment 9 is a flowchart showing the procedure of halftone processing of this embodiment. The halftone processing of this embodiment is processing for converting each pixel P(x, y) having a gradation value of 0 to 255 into a gradation value of 0 or 255, and is performed by the halftone processing unit 13 shown in FIG.
[0041] 9, in step S321, the halftone processing unit 13 initializes both coordinates x and y to 0. Then, in step S322, the halftone processing unit 13 sets pixel P(x, y) included in the first image data 23 as a pixel of interest (pixel to be processed), and performs processing from step S323 onwards on pixel P(x, y).
[0042] First, in an edge angle detection processing step S323, the halftone processing unit 13 functions as the edge angle detection processing unit 131 shown in FIG. 1, and the edge angle detection processing unit 131 detects the angle of a thin line included in the first image data 23. The detected thin line has a width of, for example, one or two pixels. The edge angle detection processing unit 131 may apply a plurality of filters to the thin line, each of which detects a plurality of angles in the range of 0° to 180°, and detect the angle of the thin line based on the application results of the plurality of filters. Specifically, in the edge angle detection processing step S323, the edge angle detection processing unit 131 detects the edge angle angle_type of the pixel of interest P(x, y) as follows:
[0043] First, the edge angle detection processing unit 131 classifies the directions of thin lines and edges into four directions centered at 0°, 45°, 90°, and 135° counterclockwise, with the x direction (main scanning direction) set as 0°, and then calculates the edge strength in each direction for the pixel of interest P(x, y) using four types of edge detection filters separated by 45° as shown in Fig. 10. , F0 is an example of a filter that detects a 0° edge, F45 is an example of a filter that detects a 45° edge, F90 is an example of a filter that detects a 90° edge, and F45 is an example of a filter that detects a 135° edge. In each filter, the shaded position corresponds to the position of the pixel of interest P(x, y).
[0044] The edge angle detection processing unit 131 calculates the edge strengths in four directions of the pixel of interest P(x,y) by multiplying the gradation values of the pixel of interest P(x,y) and its neighboring pixels P by the coefficients at each corresponding position of the filter and calculating the sum. That is, the edge angle detection processing unit 131 calculates the edge strength in the 0° direction edge_level_00, the edge strength in the 45° direction edge_level_45, the edge strength in the 90° direction edge_level_90, and the edge strength in the 135° direction edge_level_135 using the following equations (8) to (11). edge_level_00=Data[x-1,y]+Data[x,y]+Data[x+1,y]-(Data[x-1,y-1]+Data[x,y-1]+Data[x+1,y-1])…(8) edge_level_45=Data[x-1,y+1]+Data[x,y]+Data[x+1,y-1]-(Data[x-2,y+1]+Data[x-1,y]+Data[x,y-1])…(9) edge_level_90=Data[x,y-1]+Data[x,y]+Data[x,y+1]-(Data[x-1,y-1]+Data[x-1,y]+Data[x-1,y+1])…(10) edge_level_135=Data[x-1,y-1]+Data[x,y]+Data[x+1,y+1]-(Data[x-2,y-1]+Data[x-1,y]+Data[x,y+1])…(11)
[0045] Then, the edge angle detection processing unit 131 determines the maximum value of the edge strengths edge_level_00, edge_level_45, edge_level_90, and edge_level_135 in the four directions of the pixel of interest P(x, y) as the edge strength edge_level of the pixel of interest P(x, y) using the following equation (12). edge_level=max(edge_level_00,edge_level_45,edge_level_90,edge_level_135)…(12)
[0046] Furthermore, the edge angle detection processing unit 131 determines the maximum angle among the edge strengths edge_level_00, edge_level_45, edge_level_90, and edge_level_135 in the four directions of the pixel of interest P(x, y) as the edge angle angle_type of the pixel of interest P(x, y). That is, if edge_level=edge_level_00, angle_type=0 (angle 0°); if edge_level=edge_level_45, angle_type=1 (angle 45°); if edge_level=edge_level_90, angle_type=2 (angle 90°); and if edge_level=edge_level_135, angle_type=3 (angle 135°). For example, if the pixel of interest P(x, y) is a pixel on a thin line with an angle of 45°, the edge strength edge_level_45 is maximum, and the edge angle angle_type=1 (angle 45°) is obtained.
[0047] If two of the four edge strength directions have the maximum edge strength, the intermediate angle between the two angles corresponding to the two directions may be set as the edge angle angle_type. For example, if both of the two edge strengths edge_level_45 and edge_level_90 are maximum, the edge angle angle_type may be set to 1.5 (angle 67.5° (= (45° + 90°) / 2)). Furthermore, the detected angles are not limited to four types, 0°, 45°, 90°, and 135°, but may be two, three, five, or more. Alternatively, only one type of angle at which thin lines tend to disappear may be detected.
[0048] 1 in threshold determination processing step S324, the threshold determination processing unit 132 determines an error diffusion threshold for each pixel included in the first image data 23 based on the angle of the thin line detected in step S321. Specifically, in threshold determination processing step S324, the threshold determination processing unit 132 determines a threshold EdThreshold(angle_type) for the pixel of interest P(x,y) based on the edge angle angle_type of the pixel of interest P(x,y) detected in step S321. In particular, based on the results of the preliminary investigation described below, in threshold determination processing step S324, the threshold determination processing unit 132 preferably determines an error diffusion threshold for each pixel based on the angle of the thin line detected in step S321 and the gradation value of each pixel included in the first image data 23. Specifically, it is preferable that the threshold determination processing unit 132 determines the threshold EdThreshold(Data[x,y],angle_type) for the pixel of interest P(x,y) based on the gradation value Data[x,y] and edge angle angle_type of the pixel of interest P(x,y).
[0049] Patent Document 1 discloses that lowering the threshold value enables edge enhancement, which accelerates dot generation at low dot densities, i.e., low densities. Therefore, an investigation was conducted into the threshold value required for edge enhancement to the extent that the dot-ON rate on a thin line approximately matches the four input gradation values of 16 / 255, 20 / 255, 24 / 255, and 32 / 255 for thin lines in four directions at angles of 0°, 45°, 90°, and 135°, resulting in the graph shown in Figure 11. That is, the graph in Figure 11 shows the threshold value required for reproducing a thin line at any angle with approximately the same dot density as the input gradation value when combining the four input gradation values of 16 / 255, 20 / 255, 24 / 255, and 32 / 255 with the four edge angles of 0°, 45°, 90°, and 135°. 11, TH16 indicates the threshold value for each edge angle when the input gradation value is 16 / 255 with a black circle, TH20 indicates the threshold value for each edge angle when the input gradation value is 20 / 255 with a black circle, TH24 indicates the threshold value for each edge angle when the input gradation value is 24 / 255 with a black circle, and TH32 indicates the threshold value for each edge angle when the input gradation value is 32 / 255 with a black circle. Note that for TH16, TH20, TH24, and TH32, the optimal threshold values shown in FIG. 8 are indicated by white circles.
[0050] From the graph shown in Fig. 11, for example, when the input gradation value is 16 / 255, the thresholds to be set are 45°, 0°, 90°, and 135°, in ascending order. The difference between the optimum threshold indicated by the white circle in Fig. 11 and the threshold to be set is the amount of edge enhancement by threshold manipulation, and the edge enhancement by threshold manipulation will be stronger in this order. Also, when comparing in 90° increments in Fig. 11, it can be seen that stronger edge enhancement is required at 0° between 0° and 90°, and at 45° between 45° and 135°.
[0051] Therefore, table information of the correspondence between gradation values and edge angles, as shown in Figure 11, is stored in the memory unit 20, and the threshold determination processing unit 132 can refer to the table information in the threshold determination processing step S324 and determine the threshold corresponding to the gradation value Data[x,y] and edge angle angle_type of the target pixel P(x,y) as the threshold EdThreshold(Data[x,y],angle_type).
[0052] In the threshold determination process step S324, the gradation value of the thin line for which the threshold determination processing unit 132 determines the threshold in accordance with the edge angle angle_type may be equal to or less than a predetermined value. For example, if thin lines with a gradation value of 32 or less are likely to disappear, the predetermined value may be set to 32. In other words, if the gradation value Data[x,y] of the target pixel P(x,y) is equal to or less than a predetermined value, the threshold determination processing unit 132 determines the gradation value Data[x,y] of the target pixel P(x,y) and the edge angle angle_type. The threshold EdThreshold(Data[x,y],angle_type) is determined based on the edge angle angle_type, and if the gradation value Data[x,y] of the target pixel P(x,y) is greater than a predetermined value, the threshold EdThreshold(Data[x,y]) may be determined based on the gradation value Data[x,y] of the target pixel P(x,y), as in the halftone processing of the comparative example.
[0053] Furthermore, the threshold determination processing unit 132 may determine a threshold for an edge angle angle_type not defined in the table information from the thresholds for the multiple defined edge angles by linear interpolation, etc. For example, when the gradation value Data[x,y] of the pixel of interest P(x,y) is 18 / 255, the threshold determination processing unit 132 can determine the average value of the threshold when the input gradation value is 16 / 255 and the threshold when the input gradation value is 20 / 255 as the threshold EdThreshold(Data[x,y],angle_type).
[0054] 1 in a tone value correction process step S325, the halftone processing unit 13 functions as the tone value correction processing unit 133 shown in Fig. 1, and the tone value correction processing unit 133 corrects the tone value of the target pixel P(x,y) by adding an integrated error DiffusedError[x,y] obtained by accumulating errors diffused from multiple pixels P surrounding the target pixel P(x,y) that have been converted to tone values of the second number of tones in an error diffusion process step S328, which will be described later, to the tone value Data[x,y] of the target pixel P(x,y). The corrected tone value CorrectData[x,y] is calculated by CorrectData[x,y] = Data[x,y] + DiffusedError[x,y].
[0055] 1 in a tone number conversion processing step S326, the tone number conversion processing unit 134 compares the tone value CorrectData[x,y] corrected in step S325 with the threshold EdThreshold(Data[x,y],angle_type) determined in step S324 for the pixel of interest P(x,y), and converts it to a tone value Data2[x,y] of the second tone number based on the comparison result. Specifically, the halftone processing unit 13 sets Data2[x,y]=255 (dot on) if CorrectData[x,y]>EdThreshold(Data[x,y],angle_type), and sets Data2[x,y]=0 (dot off) if CorrectData[x,y]≦EdThreshold(Data[x,y],angle_type).
[0056] 1 in error calculation processing step S327, the error calculation processing unit 135 calculates the error Error[x,y] between the gradation value CorrectData[x,y] corrected in step S325 and the gradation value Data2[x,y] of the second gradation level converted in step S326 for the pixel of interest P(x,y). That is, Error[x,y] = CorrectData[x,y] - Data2[x,y].
[0057] 1 in an error diffusion processing step S328, the error diffusion processing unit 13 diffuses the error Error[x,y] calculated in step S327 to multiple pixels P surrounding the pixel of interest P(x,y) to update the accumulated error DiffusedError. As an example, as shown in FIG. 6, the error diffusion processing unit 136 updates the accumulated error DiffusedError for seven pixels P surrounding the pixel of interest P(x,y), namely, pixel P(x+1,y), pixel P(x+2,y), pixel P(x-2,y+1), pixel P(x-1,y+1), pixel P(x,y+1), pixel P(x+1,y+1), and pixel P(x+2,y+1), using the above-described formulas (1) to (7).
[0058] Next, if x≠n-1 in step S329, the halftone processing unit 13 sets x=x+1 in step S330 and repeats the processes from step S322 onwards. That is, if x≠n-1 in step S329, the halftone processing unit 13 performs the processes from step S322 onwards for the pixel P(x+1,y) adjacent to the pixel P(x,y) on the right.
[0059] Furthermore, if x=n-1 in step S329, and if y≠m-1 in step S331, the halftone processing unit 13 sets x=0 and y=y+1 in step S332 and repeats the processes from step S322 onwards. That is, if x=n-1 in step S329, the halftone processing unit 13 performs the processes from step S322 onwards for pixel P(0,y+1) at the left end of the next raster, since pixel P(x,y) is located at the right end.
[0060] Furthermore, if y=m-1 in step S331, the halftone processing unit 13 ends the halftone processing. That is, if y=m-1 in step S331, the pixel P(x, y) is located in the lower right corner, and therefore the tone number conversion process has been completed for all pixels P shown in FIG. 4, and so the halftone processing unit 13 ends the halftone processing.
[0061] The thresholds shown in FIG. 11 are thresholds for reproducing a thin line with a width of one pixel against a white background (input tone value 0) at a dot density corresponding to the input tone value. However, a thin line with a width of one pixel against a white background is the most difficult condition to reproduce. If this can be reproduced, thin lines with a width of at least two pixels will not disappear. Therefore, the halftone processing of this embodiment uses a threshold value EdThreshold(Data[x,y],angle_type) optimized for thin lines with a width of one pixel against a white background. However, if it is sufficient to reproduce thin lines with a width of two pixels or more, a threshold value optimized for thin lines with a width of two pixels or more may be used. Also, different threshold values may be set depending on the width of the thin line. For example, the edge detection filter F90W shown in FIG. 12 is a filter that can detect the left edge of a line with a width of two pixels or more and a 90° angle with twice the edge strength of a thin line with a width of one pixel. For example, by using the filter F90 shown in FIG. 10 and the filter F90W shown in FIG. 12 together, it becomes possible to detect edge angles and set threshold values that distinguish between line widths of one pixel and two or more pixels.
[0062] Furthermore, if the difference between the threshold EdThreshold(Data[x,y]) used in the halftone processing of the comparative example and the threshold EdThreshold(Data[x,y],angle_type) used in the halftone processing of this embodiment is defined as the edge enhancement threshold manipulation amount EdThreshEnh(Data[x,y],angle_type), then EdThreshold(Data[x,y],angle_type) = EdThreshold(Data[x,y]) - EdThreshEnh(Data[x,y],angle_type). This edge emphasis threshold manipulation amount EdThreshEnh(Data[x,y],angle_type) may be further changed to EdThreshEnh(Data[x,y],angle_type,edge_level), which is a function of the edge strength edge_level obtained by the above-mentioned equation (12), and the edge emphasis threshold manipulation amount EdThreshEnh(Data[x,y],angle_type,edge_level) may be reduced if the edge strength edge_level is smaller than a predetermined value, or may be set to zero if it is equal to or smaller than the predetermined value.
[0063] Furthermore, although the above has been explained using an example in which the dot occurrence rate on a thin line is made equal to the input gradation value, it is also possible to perform edge emphasis in the true sense of the word, by making the dot occurrence rate on a thin line greater than the input gradation value.
[0064] For example, the halftone processing unit 13 may execute an edge enhancement processing step before the edge angle detection processing step S323 in Fig. 9, and increase the input tone value of the thin line itself. In the edge enhancement processing step, the halftone processing unit 13 adds the edge enhancement control amount EdgeEnhance() to the gradation value Data[x,y] of the target pixel P(x,y) as shown in equation (13) to calculate the edge-enhanced gradation value EnhData[x,y]. EnhData[x,y]=Data[x,y]+EdgeEnhance()…(13)
[0065] The edge enhancement operation amount EdgeEnhance() is obtained by multiplying the edge strength EdgeLevel of the pixel of interest P(x, y) by an enhancement control coefficient k for controlling the degree of edge enhancement, as in equation (14). EdgeEnhance()=EdgeLevel×k…(14)
[0066] The emphasis control coefficient k may be a fixed value, or it may be a function of the gradation value Data[x, y] to increase emphasis in the gradation range where thin lines are desired to be emphasized, or it may be a function of the edge strength EdgeLevel to not perform emphasis below a certain edge strength.
[0067] The edge strength EdgeLevel of the pixel of interest P(x, y) is obtained by, for example, equation (15) using the edge detection filter F1 shown in FIG. EdgeLevel=Data[x,y]×4-(Data[x,y-1]+Data[x-1,y]+Data[x+1,y])+Data[x,y+1]…(15)
[0068] Alternatively, the halftone processing unit 13 may calculate the edge strength EdgeLevel of the pixel of interest P(x, y) using edge detection filters F2, F3, etc. shown in Fig. 13. In each filter shown in Fig. 13, the hatched position corresponds to the position of the pixel of interest P(x, y).
[0069] In this way, the halftone processing unit 13 executes an edge emphasis processing step, and can directly control the dot occurrence rate on thin lines by increasing the input tone value itself.
[0070] As another method for performing edge enhancement in the true sense of the word, the halftone processor 13 may further increase the edge enhancement threshold manipulation amount EdThreshEnh(Data[x,y],angle_type). With this method, it is necessary to separately investigate the correspondence between the edge enhancement threshold manipulation amount EdThreshEnh(Data[x,y],angle_type) and the actual increase in the dot occurrence rate, but it is possible to qualitatively increase the dot occurrence rate.
[0071] Furthermore, in the edge angle detection processing step S323, the edge angle detection processing unit 131 may detect eight types of edge angles angle_type by adding four types of filters that detect edges at angles intermediate between 0° and 45° to the four types of filters F0, F45, F90, and F135 shown in Fig. 10 that detect edges at angles of 0°, 45°, 90°, and 135°. As an example, the edge detection filter F0-45 shown in Fig. 14 is a filter that detects edges at angles intermediate between 0° and 45°, and the filter F45-90 shown in Fig. 14 is a filter that detects edges at angles intermediate between 45° and 90°. Note that in each filter shown in Fig. 14, the hatched position corresponds to the position of the pixel of interest P(x, y).
[0072] Furthermore, in the edge angle detection process S323, when detecting the edge of a low-density thin line using the four types of filters shown in Fig. 10, the edge strength on the upstream side in the x direction is a positive value, and the edge strength on the downstream side in the x direction is a negative value, so only the upstream edge is detected. In order to prevent the disappearance of thin lines, it is sufficient to emphasize only one of the edges, and since it is the upstream edge that causes a delay in dot generation in the error diffusion method, it is desirable to give priority to detecting the upstream edge. However, it is of course also possible to detect and emphasize the downstream edge. In that case, an edge detection filter such as that shown in Fig. 15 can be used as an example. This makes it possible to detect both left and right edges with the same edge strength. In Figure 15, F0LR is an example of a filter that detects both 0° edges, F45LR is an example of a filter that detects both 45° edges, F90LR is an example of a filter that detects both 90° edges, and F45LR is an example of a filter that detects both 135° edges. In each filter, the shaded position corresponds to the position of the pixel of interest P(x, y).
[0073] 1-4.Effects As described above, in the image processing device 1 of the first embodiment, the halftone processing unit 13 detects the edge angle angle_type of each pixel P(x, y) as the angle of a thin line included in the first image data 23, determines a threshold EdThreshold(angle_type) for each pixel P(x, y) based on the edge angle angle_type, and converts the first image data 23 into second image data 24, which is halftone image data, using error diffusion. In particular, the halftone processing unit 13 can detect multiple angles, such as angles at which thin lines are likely to disappear and angles at which thin lines are unlikely to disappear, using multiple filters, and can therefore set an appropriate threshold EdThreshold(angle_type) for each pixel P(x, y) according to the angle of the thin line. Therefore, according to the image processing device 1 of the first embodiment, the halftone processing unit 13 sets an appropriate threshold EdThreshold(angle_type) for each pixel P(x, y) according to the edge angle angle_type, thereby reducing differences in reproducibility due to the angle of the thin line and generating halftone image data that is less susceptible to degradation in image quality.
[0074] Furthermore, according to the image processing device 1 of the first embodiment, the halftone processing unit 13 sets an appropriate threshold EdThreshold(Data[x,y],angle_type) for each pixel P(x,y) according to the edge angle angle_type and the gradation value Data[x,y], thereby reducing the difference in reproducibility due to the angle of thin lines, suppressing delays in dot generation and the occurrence of tailing, and generating halftone image data that is less likely to cause degradation in image quality.
[0075] For example, the printer 2 can form dots on the medium M based on the halftone image data generated by the image processing device 1, thereby reproducing thin lines with a width of one or two pixels and thin lines with low gradation values.
[0076] 2. Second embodiment In the following, the second embodiment will be described mainly with respect to the differences from the first embodiment, with the same components as those in the first embodiment being given the same reference numerals and explanations that overlap with those in the first embodiment being omitted or simplified.
[0077] In the image processing device 1 of the first embodiment, the halftone processing unit 13 determined the threshold value of the error diffusion method for the thin line based on the angle of the thin line, but in the image processing device 1 of the second embodiment, the halftone processing unit 13 increases the gradation value of the thin line according to the angle of the thin line, and converts the first image data 23 with the increased gradation value of the thin line into second image data 24 using the error diffusion method.
[0078] Fig. 16 is a block diagram showing the configuration of an image processing device 1 according to the second embodiment. As shown in Fig. 16, in the image processing device 1 according to the second embodiment, the halftone processing unit 13 includes an edge angle detection processing unit 131, a threshold determination processing unit 132, a tone value correction processing unit 133, a tone number conversion processing unit 134, an error calculation processing unit 135, an error diffusion processing unit 136, and an edge enhancement processing unit 137, and halftone processing is performed by each of these units performing their respective processes.
[0079] Fig. 17 is a flowchart showing the procedure of halftone processing according to the second embodiment. As shown in Fig. 17, in step S341, the halftone processing unit 13 initializes both coordinates x and y to 0. Then, in step S342, the halftone processing unit 13 sets pixel P(x, y) included in the first image data 23 as a pixel of interest (pixel to be processed), and performs the processes from step S343 onwards on pixel P(x, y).
[0080] First, in threshold determination processing step S343, the halftone processing unit 13 functions as the threshold determination processing unit 132 shown in Fig. 16, and the threshold determination processing unit 132 determines a threshold value of the error diffusion method for each pixel based on the gradation value of each pixel included in the first image data 23. Specifically, in threshold determination processing step S343, the threshold determination processing unit 132 determines a threshold EdThreshold(Data[x,y]) for the pixel of interest P(x,y) based on the gradation value Data[x,y] of the pixel of interest P(x,y). The processing of this threshold determination processing step S343 is similar to the processing of threshold determination processing step S303 in Fig. 3, and therefore a detailed description thereof will be omitted.
[0081] Next, in an edge angle detection processing step S344, the halftone processing unit 13 functions as the edge angle detection processing unit 131 shown in FIG. 16, and the edge angle detection processing unit 131 detects the angle of a thin line included in the first image data 23. The detected thin line has a width of, for example, one pixel or two pixels. The edge angle detection processing unit 131 may apply multiple filters to the thin line, each of which detects a multiple angle in the range of 0° to 180°, and detect the angle of the thin line based on the application results of the multiple filters. Specifically, in the edge angle detection processing step S344, the edge angle detection processing unit 131 detects the edge angle angle_type of the pixel of interest P(x, y). The processing in this edge angle detection processing step S344 is similar to the processing in the edge angle detection processing step S323 of FIG. 9, and therefore a detailed description thereof will be omitted.
[0082] 16 in edge enhancement processing step S345, and the edge enhancement processing unit 137 increases the gradation value of the thin line according to the angle of the thin line detected in step S344. Specifically, in edge enhancement processing step S345, the edge enhancement processing unit 137 adds the edge enhancement operation amount EdgeEnhance(angle_type, edge_level) to the gradation value Data[x, y] of the target pixel P(x, y) as in equation (16) to calculate the edge-enhanced gradation value EnhData[x, y]. EnhData[x,y]=Data[x,y]+EdgeEnhance(angle_type,edge_level)…(16)
[0083] The edge enhancement control amount EdgeEnhance(angle_type, edge_level) is obtained by multiplying the edge strength edge_level of the pixel of interest P(x, y) by an enhancement control coefficient k[angle_type] for each angle, which controls the degree of edge enhancement, as shown in equation (17). The edge strength edge_level can be calculated, for example, by the above equations (8) to (12). EdgeEnhance(angle_type,edge_level)=EdgeLevel×k[angle_type]…(17)
[0084] The enhancement control coefficient k[angle_type] is increased as the angle makes it more difficult to reproduce thin lines, increasing the input gradation value of the thin lines. For example, k[0] = 1 (angle 0°), k[1] = 1.5 (angle 45°), k[2] = 0.5 (angle 90°), k[3] = 0 (angle 135°). In addition, the edge enhancement operation amount EdgeEnhance(angle_type, edge_level) is further increased by the EdgeEnhance(angle_type, edge_level) which is a function of the gradation value Data[x,y] of the target pixel P(x,y). , Data[x, y]), so that the emphasis control coefficient k can be changed to an optimum value depending not only on the edge angle angle_type but also on the gradation value Data[x, y].
[0085] In the edge angle detection processing step S344, the gradation value of the thin line that the edge angle detection processing unit 131 increases in accordance with the edge angle angle_type may be equal to or less than a predetermined value. For example, if thin lines with a gradation value of 32 or less are likely to disappear, the predetermined value may be set to 32.
[0086] Furthermore, in the edge angle detection processing step S344, the edge angle detection processing unit 131 may detect only the edge strength edge_level_45 at an angle of 45°, at which thin lines are most likely to disappear. In this case, in the edge enhancement processing step S345, the edge enhancement processing unit 137 may calculate the gradation value EnhData[x,y] in which the angle of 45° is edge-enhanced using equation (18). The edge enhancement operation amount EdgeEnhance() is calculated using the above-mentioned equation (14). EnhData[x,y]=Data[x,y]+EdgeEnhance()+edge_level_45…(18)
[0087] Furthermore, in the edge angle detection processing step S344, the edge angle detection processing unit 131 may detect only the edge strength edge_level_45 at an angle of 45° at which a thin line is most likely to disappear, and the edge strength edge_level_0 at an angle of 0° at which it is next most likely to disappear. In this case, in the edge enhancement processing step S345, the edge enhancement processing unit 137 may calculate the gradation value EnhData[x,y] by equation (19) such that the angle of 45° is edge-enhanced and the angle of 0° is edge-enhanced to a lesser extent than the angle of 45°. EnhData[x,y]=Data[x,y]+EdgeEnhance()+edge_level_45+edge_level_00×0.5…(19)
[0088] Next, in gradation value correction processing step S346, halftone processing unit 13 functions as gradation value correction processing unit 133 shown in Fig. 16, and gradation value correction processing unit 133 adds integrated error DiffusedError[x,y] to the gradation value Data[x,y] of target pixel P(x,y) to correct the gradation value of target pixel P(x,y). The processing of this gradation value correction processing step S346 is similar to the processing of gradation value correction processing step S325 in Fig. 9, so a detailed description thereof will be omitted.
[0089] Next, in tone number conversion processing step S347, the halftone processing unit 13 functions as the tone number conversion processing unit 134 shown in Fig. 16, and the tone number conversion processing unit 134 compares the tone value CorrectData[x,y] corrected in step S346 for the pixel of interest P(x,y) with the threshold EdThreshold(Data[x,y]) determined in step S343, and converts it into a tone value Data2[x,y] of the second tone number based on the comparison result. The processing of this tone number conversion processing step S347 is similar to the processing of tone number conversion processing step S326 in Fig. 9, so a detailed description thereof will be omitted.
[0090] Next, in error calculation processing step S348, halftone processing unit 13 functions as error calculation processing unit 135 shown in Fig. 16, and error calculation processing unit 135 calculates the error Error[x,y] between the gradation value CorrectData[x,y] corrected in step S346 and the gradation value Data2[x,y] of the second gradation number converted in step S347 for the pixel of interest P(x,y). The processing of this error calculation processing step S348 is the same as the processing of error calculation processing step S327 in Fig. 9, so a detailed description thereof will be omitted.
[0091] Next, in an error diffusion processing step S349, the halftone processing unit 13 functions as the error diffusion processing unit 136 shown in FIG. 16, and the error diffusion processing unit 136 calculates the error diffusion coefficient calculated in step S348. The error Error[x,y] is diffused to multiple pixels P surrounding the pixel of interest P(x,y) to update the accumulated error DiffusedError. The processing in this error diffusion processing step S349 is similar to the processing in the error diffusion processing step S328 in Fig. 9, and therefore a detailed description thereof will be omitted.
[0092] Next, if x≠n-1 in step S350, the halftone processing unit 13 sets x=x+1 in step S351 and repeats the processes from step S342 onwards. That is, if x≠n-1 in step S350, the halftone processing unit 13 repeats the processes from step S342 onwards for pixel P(x+1,y) adjacent to the pixel P(x,y) on the right.
[0093] Furthermore, if x=n-1 in step S350, and y≠m-1 in step S352, the halftone processing unit 13 sets x=0 and y=y+1 in step S353 and repeats the processes from step S342 onwards. That is, if x=n-1 in step S350, the halftone processing unit 13 performs the processes from step S342 onwards for pixel P(0,y+1) at the left end of the next raster, since pixel P(x,y) is located at the right end.
[0094] Furthermore, if y=m-1 in step S352, the halftone processing unit 13 ends the halftone processing. That is, if y=m-1 in step S352, the pixel P(x, y) is located in the lower right corner, and therefore the tone number conversion process has been completed for all pixels P shown in FIG. 4, and so the halftone processing unit 13 ends the halftone processing.
[0095] If the threshold for each pixel P(x,y) were set to a constant value such as the median in the threshold determination process S343, an extremely high level of edge enhancement would be required in the edge enhancement process S345, which would affect neighboring pixels and raise concerns about side effects such as trailing. In contrast, in the present embodiment, the threshold determination process S343 uses a threshold EdThreshold(Data[x,y]) that corresponds to the gradation value Data[x,y] of each pixel P(x,y) so as to hasten the generation of dots in low-density areas. This means that the edge enhancement in the edge enhancement process S345 can be relatively small, making it less likely to cause side effects such as trailing.
[0096] The other configurations and functions of the image processing device 1 of the second embodiment are the same as those of the image processing device 1 of the first embodiment, and therefore a description thereof will be omitted.
[0097] As described above, in the image processing device 1 of the second embodiment, the halftone processing unit 13 detects the edge angle angle_type of each pixel P(x,y) as the angle of a thin line included in the first image data 23, increases the gradation value Data[x,y] of each pixel P(x,y) according to the edge angle angle_type, and then converts the first image data 23 into second image data 24, which is halftone image data, using error diffusion. In particular, the halftone processing unit 13 can detect multiple angles, such as angles at which thin lines are likely to disappear and angles at which thin lines are unlikely to disappear, using multiple filters. Therefore, the halftone processing unit 13 can appropriately increase the gradation value Data[x,y] of each pixel P(x,y) according to the edge angle angle_type and apply the error diffusion method. Therefore, according to the image processing device 1 of the second embodiment, the halftone processing unit 13 appropriately increases the gradation value Data[x,y] of each pixel P(x,y) according to the edge angle angle_type and applies the error diffusion method, thereby reducing differences in reproducibility due to the angle of the thin line and generating halftone image data that is less susceptible to degradation in image quality.
[0098] Furthermore, according to the image processing device 1 of the second embodiment, the halftone processing unit 13 sets an appropriate threshold EdThreshold(Data[x,y]) for each pixel P(x,y) according to the gradation value Data[x,y], thereby preventing delays in dot generation and the occurrence of tailing. This makes it possible to generate halftone image data that is less susceptible to deterioration in image quality.
[0099] For example, the printer 2 can form dots on the medium M based on the halftone image data generated by the image processing device 1, thereby reproducing thin lines with a width of one or two pixels and thin lines with low gradation values.
[0100] 3. Variations The present invention is not limited to the present embodiment, and various modifications are possible within the scope of the present invention.
[0101] For example, an edge emphasis processing step S345 in the flowchart of Fig. 17 may be added after the edge angle detection processing step S323 and before the gradation value correction processing step S325 to the flowchart of Fig. 9 in the first embodiment. In other words, the first embodiment and the second embodiment may be combined.
[0102] Furthermore, in the above embodiments, the first image data 23 was bitmap data in which the gradation value Data[x,y] of each pixel P(x,y) was specified, but it may be image data written in various page description languages. Image data written in a page description language includes various commands, such as for drawing a line by specifying the coordinates of the start and end points, the gradation value, and the thickness, so the edge angle detection processing unit 131 can analyze the commands and detect the angle of the thin line. For example, if the coordinate values of the start and end points of the thin line are (x0,y0) and (x1,y1), respectively, the angle of the thin line can be calculated by arctan((y1-y0) / (x1-x0)).
[0103] In addition, in the above embodiments, the main scanning direction of the error diffusion process is fixed to the right, but the main scanning direction of the error diffusion process may be changed to the right or left alternately or randomly for each raster. If the ratio of right and left directions is 1:1, threshold setting and edge emphasis may be performed without distinguishing between 45° thin lines and 135° thin lines.
[0104] Furthermore, the image processing device 1 in each of the above embodiments generates second image data 24 corresponding to an image formed on a medium M by a printer 2, but it may also generate second image data 24 corresponding to an image formed on a display, electronic paper, etc.
[0105] In addition, in the image processing device 1 of each of the above embodiments, part of the configuration realized by hardware may be replaced with software (computer program), or at least part of the configuration realized by software may be replaced with hardware. The software (computer program) may be stored in a computer-readable information storage medium. The information storage medium may be a storage device such as a flexible disk, a CD-ROM, various types of RAM or ROM, or a hard disk.
[0106] The present invention includes configurations that are substantially the same as the configurations described in this embodiment, for example, configurations with the same functions, methods, and results, or configurations with the same purpose and effects. The present invention also includes configurations in which non-essential parts of the configurations described in this embodiment are replaced. The present invention also includes configurations that achieve the same effects or purposes as the configurations described in this embodiment. The present invention also includes configurations in which publicly known technology is added to the configurations described in this embodiment.
[0107] The above-described embodiment and modifications are merely examples, and the present invention is not limited to these. For example, the embodiments and modifications can be combined as appropriate.
[0108] The following can be derived from the above-described embodiment and modifications.
[0109] One aspect of the image processing device is 1. An image processing device that converts first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, an edge angle detection processing unit that detects angles of thin lines included in the first image data; and a threshold determination processing unit that determines a threshold value for the error diffusion method for each pixel included in the first image data based on the angle of the thin line.
[0110] This image processing device detects the angle of thin lines included in the first image data, determines a threshold value for each pixel included in the first image data based on the angle of the thin lines, and converts the first image data into second image data, which is halftone image data, using an error diffusion method. Therefore, with this image processing device, by setting an appropriate threshold value for each pixel according to the angle of the thin lines, it is possible to reduce differences in reproducibility due to the angle of the thin lines and generate halftone image data that is less likely to deteriorate in image quality.
[0111] In one aspect of the image processing device, The threshold determination processing unit The threshold value for each pixel may be determined based on the angle of the thin line and the gradation value of each pixel.
[0112] According to this image processing device, by setting an appropriate threshold value for each pixel according to the angle of the thin line and the gradation value of each pixel, it is possible to reduce the difference in reproducibility due to the angle of the thin line, suppress delays in dot generation and the occurrence of tailing, and generate halftone image data that is less likely to cause a degradation in image quality.
[0113] In one aspect of the image processing device, The edge angle detection processing unit A plurality of filters may be applied to the thin line, each of which detects a plurality of angles in the range of 0° to 180°, and the angle of the thin line may be detected based on the results of applying the plurality of filters.
[0114] This image processing device uses multiple filters to detect multiple angles, such as angles at which thin lines are likely to disappear and angles at which they are unlikely to disappear, making it possible to set an appropriate threshold value for each pixel according to the angle of the thin line.
[0115] In one aspect of the image processing device, The thin lines may be one or two pixels wide.
[0116] This image processing device can generate halftone image data that reproduces thin lines with a width of one or two pixels.
[0117] In one aspect of the image processing device, The gradation value of the thin line may be equal to or less than a predetermined value.
[0118] This image processing device can generate halftone image data that reproduces thin lines with low gradation values.
[0119] Another aspect of the image processing device is The first image data having a first number of gradations is converted into a second image data having a number of gradations less than the first number of gradations by using an error diffusion method. An image processing device for converting into second image data with two gradations, an edge angle detection processing unit that detects angles of thin lines included in the first image data; an edge enhancement processing unit that increases the gradation value of the thin line according to the angle of the thin line; Equipped with The first image data in which the tone value of the thin line is increased is converted into the second image data using an error diffusion method.
[0120] This image processing device detects the angle of thin lines included in the first image data, increases the gradation value of the thin lines according to the angle of the thin lines, and then uses error diffusion to convert the first image data into second image data, which is halftone image data. Therefore, with this image processing device, by appropriately increasing the gradation value of the thin lines according to the angle of the thin lines and applying error diffusion, it is possible to reduce the difference in reproducibility due to the angle of the thin lines and generate halftone image data that is less likely to deteriorate in image quality.
[0121] Another aspect of the image processing device is The image processing device may further include a threshold determination processing unit that determines a threshold value for the error diffusion method for each pixel based on a tone value of the pixel included in the first image data.
[0122] According to this image processing device, by setting an appropriate threshold value for each pixel according to the gradation value, it is possible to suppress delays in dot generation and the occurrence of tailing, and generate halftone image data that is less likely to cause a degradation in image quality.
[0123] In another aspect of the image processing device, The edge angle detection processing unit A plurality of filters may be applied to the thin line, each of which detects a plurality of angles in the range of 0° to 180°, and the angle of the thin line may be detected based on the results of applying the plurality of filters.
[0124] This image processing device uses multiple filters to detect multiple angles, such as angles at which thin lines are likely to disappear and angles at which they are unlikely to disappear, and therefore can apply error diffusion by appropriately increasing the tone value of the thin lines according to their angles.
[0125] In another aspect of the image processing device, The thin lines may be one or two pixels wide.
[0126] This image processing device can generate halftone image data that reproduces thin lines with a width of one or two pixels.
[0127] In another aspect of the image processing device, The gradation value of the thin line may be equal to or less than a predetermined value.
[0128] This image processing device can generate halftone image data that reproduces thin lines with low gradation values.
[0129] One aspect of the image processing method includes: 1. An image processing method for converting first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, comprising: Detecting an angle of a thin line included in the first image data; A threshold value of the error diffusion method for the thin line is determined based on the angle of the thin line.
[0130] This image processing method detects the angle of thin lines included in the first image data, determines a threshold value for each pixel included in the first image data based on the angle of the thin lines, and converts the first image data into second image data, which is halftone image data, using an error diffusion method. Therefore, according to this image processing method, by setting an appropriate threshold value for each pixel according to the angle of the thin lines, it is possible to reduce the difference in reproducibility due to the angle of the thin lines and generate halftone image data that is less likely to deteriorate in image quality.
[0131] Another aspect of the image processing method is 1. An image processing method for converting first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations using an error diffusion method, comprising: Detecting an angle of a thin line included in the first image data; increasing the gradation value of the thin line in accordance with the angle of the thin line; The first image data in which the tone value of the thin line is increased is converted into the second image data using an error diffusion method.
[0132] In this image processing method, the angle of thin lines included in the first image data is detected, the tone value of the thin lines is increased according to the angle of the thin lines, and then the first image data is converted into second image data, which is halftone image data, using an error diffusion method. Therefore, according to this image processing method, by appropriately increasing the tone value of the thin lines according to the angle of the thin lines and applying the error diffusion method, it is possible to reduce the difference in reproducibility due to the angle of the thin lines and generate halftone image data that is less likely to deteriorate in image quality. [Explanation of symbols]
[0133] 1...image processing device, 2...printer, 3...external device, 10...processing unit, 11...resolution conversion processing unit, 12...color conversion processing unit, 13...halftone processing unit, 14...rasterization processing unit, 20...storage unit, 21...image processing program, 22...input image data, 23...first image data, 24...second image data, 25...color conversion table, 30...communication unit, 40...operation unit, 50...display unit, 131...edge angle detection processing unit, 132...threshold value determination processing unit, 133... Gradation value correction processing unit, 134... Gradation number conversion processing unit, 135... Error calculation processing unit, 136... Error diffusion processing unit, 137... Edge emphasis processing unit, F0, F45, F90, F135... Filter, F90W... Filter, F1, F2, F3... Filter, F0-45, F45-90... Filter, F0LR, F45LR, F90LR, F135LR... Filter, M... Medium, P... Pixel, TH16, TH20, TH24, TH32... Threshold
Claims
1. 1. An image processing device that converts first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations by using an error diffusion method, an edge angle detection processing unit that detects angles of thin lines included in the first image data; a threshold value determination processing unit that determines a threshold value of the error diffusion method for each pixel included in the first image data based on the angle of the thin line, 1. An image processing device comprising:
2. The threshold determination processing unit determining the threshold value for each pixel based on the angle of the thin line and the gradation value of each pixel; 2. The image processing device according to claim 1, wherein:
3. The edge angle detection processing unit applying a plurality of filters to the thin line, each of which detects a plurality of angles in a range of 0° to 180°, and detecting the angle of the thin line based on the application results of the plurality of filters; 2. The image processing device according to claim 1, wherein:
4. the thin lines are one or two pixels wide; 2. The image processing device according to claim 1, wherein:
5. The gradation value of the thin line is equal to or less than a predetermined value.
2. The image processing device according to claim 1, wherein:
6. 1. An image processing device that converts first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations by using an error diffusion method, an edge angle detection processing unit that detects angles of thin lines included in the first image data; an edge enhancement processing unit that increases the gradation value of the thin line according to the angle of the thin line; Equipped with The first image data in which the gradation value of the thin line is increased is converted into the second image data using an error diffusion method.
1. An image processing device comprising:
7. a threshold determination processing unit that determines a threshold value of the error diffusion method for each pixel based on a gradation value of the pixel included in the first image data; 7. The image processing device according to claim 6,
8. The edge angle detection processing unit applying a plurality of filters to the thin line, each of which detects a plurality of angles in a range of 0° to 180°, and detecting the angle of the thin line based on the application results of the plurality of filters; 7. The image processing device according to claim 6,
9. the thin lines are one or two pixels wide; 7. The image processing device according to claim 6,
10. The gradation value of the thin line is equal to or less than a predetermined value.
7. The image processing device according to claim 6,
11. 1. An image processing method for converting first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations, using an error diffusion method, Detecting an angle of a thin line included in the first image data; an error diffusion threshold value for the thin line based on the angle of the thin line;
12. 1. An image processing method for converting first image data having a first number of gradations into second image data having a second number of gradations that is smaller than the first number of gradations, using an error diffusion method, Detecting an angle of a thin line included in the first image data; increasing the gradation value of the thin line in accordance with the angle of the thin line; The first image data in which the gradation value of the thin line is increased is converted into the second image data using an error diffusion method. An image processing method comprising:
Citation Information
Patent Citations
Image processing device and image processing method
JP3360391B2