Image processing method, device, system and computer storable medium

By performing histogram division and halftone processing on the image, the shortcomings of the binary output device in the image output effect are solved, and the visual expressiveness and output effect of the image are significantly improved.

CN111784590BActive Publication Date: 2024-09-20BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910354426.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-29
Publication Date
2024-09-20
Estimated Expiration
2039-04-29

AI Technical Summary

Technical Problem

Existing binary output devices have poor image output effects, especially digital and text output, which are more dominant and have poor image output effects.

Method used

By dividing the histogram of the image to be processed into multiple areas, determining new color values ​​based on the number of pixels in adjacent areas, and performing halftone processing on the image, the output capability of the image output device is fully utilized to improve the image output effect. .

Benefits of technology

The image output effect is significantly enhanced, especially in the output of grayscale images, and the visual expression and overall output effect are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111784590B
    Figure CN111784590B
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, device, system and computer storable medium, and relates to the field of image processing. The image processing method comprises: dividing the histogram of an image to be processed into a plurality of first regions, the image to be processed is a grayscale image, the abscissa of the histogram is the color value, the ordinate is the number of pixels corresponding to different color values, the color value is greater than or equal to the first color value and less than or equal to the second color value; according to the relationship between the number of pixels in adjacent first regions, determining the plurality of second regions corresponding to the plurality of first regions; according to the relationship between the number of color values ​​in each first region and the number of color values ​​in the corresponding second region, determining the new color value corresponding to each pixel of the image to be processed; according to the new color value corresponding to each pixel, determining a new image; and performing halftone processing on the new image. According to the present disclosure, the output capacity of the image output device and the limited color value space are fully utilized, and the output effect of the image is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to an image processing method, device, system and computer storable medium. Background Art

[0002] Binary output devices have been widely used in POS terminal systems, banking systems, medical equipment, express delivery and other fields for information output such as various document printing. Limited by the characteristics of binary output devices, the current displayed information is mainly numbers and text, while the image output effect is poor. Summary of the invention

[0003] In view of the above technical problems, the present disclosure proposes a solution to enhance the output effect of images.

[0004] According to a first aspect of the present disclosure, there is provided an image processing method, comprising: dividing a histogram of an image to be processed into a plurality of first regions, the image to be processed being a grayscale image, the abscissa of the histogram being a color value, the ordinate being a number of pixels corresponding to different color values, the color value being greater than or equal to a first color value and less than or equal to a second color value; determining a plurality of second regions corresponding to the plurality of first regions based on a relationship between the numbers of pixels in adjacent first regions; determining a new color value corresponding to each pixel of the image to be processed based on a relationship between the number of color values ​​in each first region and the number of color values ​​in the corresponding second region; determining a new image based on the new color value corresponding to each pixel; and performing halftone processing on the new image.

[0005] In some embodiments, dividing the histogram of the image to be processed into multiple first areas includes: determining multiple first boundary color values ​​for dividing the histogram into multiple first areas according to an output color scale of an image output device, the output color scale is obtained by inputting all color values ​​of the histogram into the image output device, the first boundary color value includes the first color value and the second color value and at least one boundary color value other than the first color value and the second color value; dividing the histogram into multiple first areas according to the first boundary color value.

[0006] In some embodiments, based on the output color scale of the image output device, at least one transition color value of the output color scale is determined as a first boundary color value other than the first color value and the second color value for dividing the histogram into multiple first areas, and the transition color value is a critical color value for transitioning from one color to another in the output color scale.

[0007] In some embodiments, determining the multiple second areas corresponding to the multiple first areas based on the relationship between the numbers of pixels in adjacent first areas includes: calculating the corresponding second boundary color value based on each first boundary color value other than the first color value and the second color value and the number of pixels in two adjacent first areas divided by each first boundary color value, the second boundary color value also including the first color value and the second color value; and determining the multiple second areas corresponding to the multiple first areas based on the second boundary color value.

[0008] In some embodiments, the calculated second boundary color value is positively correlated with the ratio of the number of pixels in the first region close to the first color value in the two adjacent first regions to the total number of pixels in the two adjacent first regions.

[0009] In some embodiments, determining the plurality of second regions corresponding to the plurality of first regions according to the second boundary color value includes: re-dividing the histogram into the plurality of second regions according to the second boundary color value.

[0010] In some embodiments, determining the new color value corresponding to each pixel of the image to be processed based on the relationship between the number of color values ​​in each first area and the number of color values ​​in the corresponding second area includes: determining the new color value corresponding to each pixel of the image to be processed based on the ratio of the number of color values ​​in each first area and the number of color values ​​in the corresponding second area.

[0011] In some embodiments, determining the new color value corresponding to each pixel of the image to be processed based on the ratio of the number of color values ​​in each first area to the number of color values ​​in the corresponding second area includes: determining the first area where the color value of each pixel of the image to be processed is located; and rounding the quotient of the color value of each pixel divided by the ratio to determine the new color value corresponding to each pixel.

[0012] In some embodiments, the plurality of first regions include a first region A B , A G and A W , the first boundary color value other than the first color value and the second color value includes a first area A B , A G The first boundary color value V B and divide the first area A G , A W The first boundary color value V W , according to each first boundary color value other than the first color value and the second color value and the number of pixels in two adjacent first regions divided by each first boundary color value, calculating the corresponding second boundary color value includes: respectively counting the first region A B , A Gand A W The number of pixels is N B 、N G and N W ; Determine the first area A B The maximum color value max in which the number of pixels is greater than zero B , first area A G The minimum color value min in which the number of pixels is greater than zero G and the maximum color value max G , first area A W The minimum color value min in which the number of pixels is greater than zero W ; at max B and min G is the adjacent color value, i.e. min G =max B +ΔV, the first boundary color value V B The corresponding second boundary color value V NB = first color value + (V B -first color value)×(N B / (N B +N G )); at max B and min G Not an adjacent color value, that is, min G >max B +ΔV, the first boundary color value V B The corresponding second boundary color value V NB =(min G -max B )×(N B / (N B +N G )+max B ; at max G and min W is the adjacent color value, i.e. min W =max G +ΔV, the first boundary color value V W The corresponding second boundary color value V NW =V W +(Second color value -V W )×(N G / (N W +N G )); at max G and min W Not an adjacent color value, that is, min W >max G +ΔV, the first boundary color value V W The corresponding second boundary color value V NW=max G +(mmin W -max G )×(N G / (N W +N G )).

[0013] In some embodiments, the image processing method further includes: performing nonlinear correction on the image to be processed.

[0014] In some embodiments, the power function V is used out =V in γ performs gamma correction on the image to be processed, V in is the color value before correction, V out is the corrected color value, and γ is the correction parameter.

[0015] In some embodiments, the image processing method further includes: adjusting the size of the image to be processed.

[0016] In some embodiments, the image to be processed is resized according to the maximum output pixel width and pixel height of the image output device.

[0017] In some embodiments, when the pixel width of the image to be processed is greater than the maximum output pixel width of the image output device, or the pixel height of the image to be processed is greater than the maximum output pixel height of the image output device, the image to be processed is reduced in size according to the reduction ratio.

[0018] In some embodiments, the smaller value of the ratio of the maximum output pixel width of the image output device to the pixel width of the image to be processed and the ratio of the maximum output pixel height of the image output device to the pixel height of the image to be processed is determined as the reduction ratio.

[0019] In some embodiments, when the image to be processed is a color image, the image to be processed is decolorized to obtain a grayscale image.

[0020] According to a second aspect of the present disclosure, there is provided an image processing device, comprising: a division module, configured to divide a histogram of an image to be processed into a plurality of first regions, the image to be processed being a grayscale image, the abscissa of the histogram being a color value, the ordinate being a number of pixels corresponding to different color values, the color value being greater than or equal to a first color value and less than or equal to a second color value; a first determination module, configured to determine a plurality of second regions corresponding to the plurality of first regions based on a relationship between the numbers of pixels in adjacent first regions; a second determination module, configured to determine a new color value corresponding to each pixel of the image to be processed based on a relationship between the number of color values ​​in each first region and the number of color values ​​in the corresponding second region; a third determination module, configured to determine a new image based on the new color value corresponding to each pixel; and a halftone processing module, configured to perform halftone processing on the new image.

[0021] According to a third aspect of the present disclosure, there is provided an image processing device, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the image processing method described in any one of the above embodiments based on instructions stored in the memory.

[0022] According to a fourth aspect of the present disclosure, there is provided an image processing system, comprising: the image processing device described in any one of the above embodiments; and an image output device configured to output an image output by the image processing device.

[0023] According to a fifth aspect of the present disclosure, a computer storable medium is provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the image processing method described in any of the above embodiments is implemented.

[0024] In the above embodiment, the output capability of the image output device and the limited color value space are fully utilized to enhance the output effect of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0026] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0027] Figure 1 A flowchart showing an image processing method according to some embodiments of the present disclosure;

[0028] Figure 2 An image is shown;

[0029] Figure 3 Shows Figure 2 Histogram of the image shown;

[0030] Figure 4 Shows Figure 2 The new image obtained after the histogram of the image shown is adjusted;

[0031] Figure 5 Shows Figure 4 Histogram of the new image shown;

[0032] Figure 6 A flowchart showing an image processing method according to other embodiments of the present disclosure;

[0033] Figure 7 A block diagram showing an image processing apparatus according to some embodiments of the present disclosure;

[0034] Figure 8 A block diagram showing an image processing apparatus according to some other embodiments of the present disclosure;

[0035] Fig. 9 A block diagram showing an image processing system according to some embodiments of the present disclosure;

[0036] Fig.10 A block diagram of a computer system for implementing some embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0037] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0038] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0039] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0040] Technologies, methods, and devices known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and devices should be considered as part of the specification.

[0041] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0042] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0043] Figure 1 FIG. 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. Figure 1 As shown, the image processing method includes steps S2 to S10.

[0044] In step S2, the histogram of the image to be processed is divided into a plurality of first regions. The image to be processed is a grayscale image. In some embodiments, the histogram of the grayscale image is drawn by tools such as OpenCV, and then the histogram of the grayscale image is divided into a plurality of first regions. The abscissa of the histogram of the image to be processed is the color value, and the ordinate is the number of pixels corresponding to different color values. The abscissa of the histogram is the color value, which is greater than or equal to the first color value and less than or equal to the second color value. The first color value is, for example, the minimum color value 0 in the grayscale image, and the second color value is, for example, the maximum color value 255 in the grayscale image.

[0045] When the image to be processed is a color image, for example, the image to be processed can be decolorized to obtain a corresponding grayscale image. In some embodiments, the image to be processed is multi-channel merged to achieve decolorization, thereby converting the image to be processed into a grayscale image.

[0046] For example, step S2 is implemented by dividing the histogram of the image to be processed into a plurality of first regions in the following manner.

[0047] First, according to the output color scale of the image output device, multiple first boundary color values ​​for dividing the histogram into multiple first areas are determined. In some embodiments, the output color scale is obtained by inputting all color values ​​of the histogram into the image output device. The first boundary color value includes the first color value and the second color value and at least one boundary color value other than the first color value and the second color value. For example, all color values ​​0 to 255 of the histogram of the grayscale image are input into the image output device to obtain the output color scale. The first boundary color value includes 0 and 255 and boundary color values ​​other than 0 to 255, such as 60 and 240. The first boundary color value divides the histogram into three first areas according to the first boundary color values ​​0, 60, 240, and 255. It should be understood that each first area corresponds to two first boundary color values.

[0048] In some embodiments, at least one transition color value of the output color scale is determined according to the output color scale of the image output device as a first boundary color value other than the first color value and the second color value for dividing the histogram into a plurality of first regions. The transition color value is a critical color value for transitioning from one color to another color in the output color scale. The critical color value can be determined based on the color changes to which the human eye is more sensitive. For example, the human eye is more sensitive to the change from black to gray, and thus the critical color value for transitioning from black to gray can be determined.

[0049] For example, in the plurality of first regions including the first region AB , A G and A W In the case of, according to the output color scale of the image output device, determining the first boundary color value other than the first color value and the second color value includes dividing the first area A B , A G The first boundary color value V B and divide the first area A G , A W The first boundary color value V W For example, the transition color value from black to gray in the output color scale card is 60, and then the first boundary color value V is determined. B is 60. Similarly, determine the first boundary color value V from gray to white W is 240.

[0050] Then, the histogram is divided into a plurality of first regions according to the first boundary color value.

[0051] For example, in the plurality of first regions including the first region A B , A G and A W In the case of B =60, V W =240, 255, divide the histogram into three first areas A B , A G and A W . First Area A B The two first boundary color values ​​are 0 and 60 respectively. G The two first boundary color values ​​are 60 and 240 respectively. W The two first boundary color values ​​are 240 and 255 respectively. For example, the first boundary color value 60 belongs to the first area A. B , the first boundary color value 240 belongs to the first area A W .

[0052] In step S4, a plurality of second regions corresponding to the plurality of first regions are determined according to the relationship between the numbers of pixels in adjacent first regions.

[0053] For example, a plurality of second regions corresponding to a plurality of first regions may be determined according to the relationship between the numbers of pixels in adjacent first regions in the following manner.

[0054] First, according to each first boundary color value other than the first color value and the second color value and the number of pixels in two adjacent first regions divided by each first boundary color value, the corresponding second boundary color value is calculated. In some embodiments, the calculated second boundary color value is positively correlated with the ratio of the number of pixels in the first region close to the first color value in the two adjacent first regions to the total number of pixels in the two adjacent first regions. The second boundary color value preferably includes the first color value and the second color value.

[0055] For example, in the plurality of first regions including the first region A B , A G and A W In the case of , the first boundary color value V is calculated as follows B The corresponding second boundary color value V NB and the first boundary color value V W The corresponding second boundary color value V NW .

[0056] First, count the first area A B , A G and A W The number of pixels in is N B 、N G and N W .

[0057] Then determine the first area A B The maximum color value max in which the number of pixels is greater than zero B , first area A G The minimum color value min in which the number of pixels is greater than zero G and the maximum color value max G , first area A W The minimum color value min in which the number of pixels is greater than zero W .

[0058] Finally, the second boundary color value V is calculated according to the following formula. NB and V NW .

[0059] At max B and min G is the adjacent color value, i.e. min G =max B +ΔV, the first boundary color value V B The corresponding second boundary color value V NB = first color value + (V B -first color value)×(N B / (N B +N G )).

[0060] At max B and min G Not an adjacent color value, that is, min G >max B +ΔV, the first boundary color value V B The corresponding second boundary color value V NB =(min G -max B )×(N B / (N B +N G )+max B .

[0061] At max G and min W is the adjacent color value, i.e. min W =max G +ΔV, the first boundary color value V W The corresponding second boundary color value V NW =V W +(Second color value -V W )×(N G / (N W +N G )).

[0062] At max G and min W Not an adjacent color value, that is, min W >max G +ΔV, the first boundary color value V W The corresponding second boundary color value V NW =max G +(min W -max G )×(N G / (N W +N G )). It should be understood that ΔV is the step size of the color value change.

[0063] In some embodiments, ΔV=1, that is, the step length of the color value change is 1. In the following, the step length of the color value change is 1 as an example for description in conjunction with the histogram.

[0064] Figure 2 An image is shown. For example, using OpenCV (Open Source Computer Vision Library, open source computer vision library) and other tools to draw Figure 2 The histogram of the image shown is Figure 3 shown.

[0065] Figure 3 Shows Figure 2 Histogram of the image shown.

[0066] like Figure 3 As shown, the first color value is 0, the second color value is 255, and V is determined according to the output color level of an image output device. B 60, V W is 240, and the statistics are as follows Figure 2 The first area A B , A G and A W For example, the number of pixels in B =34560、N G =215416 and N W =24.

[0067] like Figure 3 As shown, min G =max B +1, V NB = first color value + (V B -first color value)×(N B / (N B +N G )), according to the formula, V NB About 8.3, round down to get V NB is 8. Similarly, we get V NW is 255.

[0068] return Figure 1 The following steps are described below: Step S4 is to determine a plurality of second regions corresponding to a plurality of first regions according to the relationship between the numbers of pixels in adjacent first regions.

[0069] Then, according to the second boundary color value, a plurality of second regions corresponding to the plurality of first regions are determined. In some embodiments, according to the second boundary color value, the histogram is re-divided into a plurality of second regions. For example, in the plurality of first regions including the first region A B , A G and A W In the case of the first boundary color value V B =60 corresponding to the second boundary color value V NB =8, the first boundary color value V W =240 corresponding to the second boundary color value V NW =255. According to the second boundary color value V NB =8 and V NW =255, the histogram is divided into three second areas A' B , A′ G and A′ W For example, the second boundary color value V NB =8 belongs to the second area A'B , V NW =255 belongs to the second area A' W It should be understood that each second region corresponds to two second boundary color values.

[0070] In step S6, a new color value corresponding to each pixel of the image to be processed is determined according to the relationship between the number of color values ​​in each first region and the number of color values ​​in the corresponding second region.

[0071] For example, a new color value corresponding to each pixel of the image to be processed is determined according to the ratio of the number of color values ​​in each first region to the number of color values ​​in the corresponding second region.

[0072] In some embodiments, the first region where the color value of each pixel of the image to be processed is located is determined. For example, the color value of a pixel is 50, and the color value 50 is in the first region A. B . First Area A B The corresponding second area is A' B , the first area A B The number of color values ​​in the second area A′ is 60-0+1=61. B The number of color values ​​in is 8-0+1=9, and the ratio of the corresponding number of color values ​​is 61 / 9. Finally, according to the ratio 61 / 9, the new color value corresponding to the color value 50 is calculated to be 50 / (61 / 9), and the calculated quotient is about 7.4. The calculated quotient is rounded down to get the new color value 7. Traverse each pixel of the image to be processed, calculate the new color value corresponding to each pixel according to the above method, and get a new image. It should be understood that in the histogram, the color value of the histogram is the color level. The number of color values ​​is the number of color values ​​contained in each first area or second area in the histogram, that is, the number of color levels corresponding to the first area or the second area in the histogram.

[0073] Figure 4 Shows Figure 2 The image shown is a new image obtained after the histogram is adjusted. The histogram is adjusted as follows Figure 1 Steps S2 to S8 are shown. For example, using tools such as OpenCV to draw Figure 4 The histogram of the new image is shown as Figure 5 shown.

[0074] Figure 5 Shows Figure 4 Histogram of the new image shown.

[0075] contrast Figure 2 and Figure 3 It is found that after histogram adjustment Figure 3 Visual effect relative to Figure 2 For example, Figure 2The lighter gray areas in the image shown are histogram adjusted. Figure 3 The border lines are clearer, and some Figure 2 The blurred area in the image is adjusted by the histogram. Figure 3 The contrast is also clearer. Figure 2 and Figure 3 It can be more intuitively found that according to the image processing method disclosed in the present invention, the histogram is adjusted by region, which improves the expression of the color value in a specific area of ​​the image output device, enhances the visual effect of the corresponding area of ​​the image, and further enhances the overall output effect of the image.

[0076] contrast Figure 4 and Figure 5 It is found that after adjusting the histogram of the image to be processed by the image processing method disclosed in the present invention, each first area of ​​the histogram can be compressed or stretched separately, for example, the middle area is stretched and the areas on both sides are compressed. This method makes full use of the limited color value space, thereby making full use of the output capacity of the image output device, improving the expressiveness of the image output device, and enhancing the output effect of the image. According to the image processing method disclosed in the present invention, the histogram is adjusted by region, which improves the expressiveness of the image output device for the color value in a specific area, enhances the visual effect of the corresponding area of ​​the image, and thus enhances the overall output effect of the image.

[0077] return Figure 1 In step S8, a new image is determined according to the new color value corresponding to each pixel. For example, the color value of each pixel of the image to be processed is modified to the corresponding new color value, thereby determining the new image.

[0078] In step S10, halftone processing is performed on the new image. For example, halftone techniques such as dithering, error diffusion, and iteration can be used to perform halftone processing on the new image.

[0079] Figure 6 A flowchart of an image processing method according to some other embodiments of the present disclosure is shown.

[0080] like Figure 6 As shown, the image processing method includes: step S0 to step S10. Figure 6 and Figure 1 The difference is that it shows Figure 1 The image processing method of step S2 to step S10 and other steps S0 to step S1 will be described below. Figure 6 and Figure 1 The differences are shown below, and the similarities will not be repeated here.

[0081] In step S0, the image to be processed is resized. For example, the image to be processed is resized according to the maximum output pixel width and pixel height of the image output device. For example, when the pixel width of the image to be processed is greater than the maximum output pixel width of the image output device, or the pixel height of the image to be processed is greater than the maximum output pixel height of the image output device, the image to be processed is reduced according to the reduction ratio. In some embodiments, the reduction ratio is the smaller value of the ratio of the maximum output pixel width of the image output device to the pixel width of the image to be processed and the ratio of the maximum output pixel height of the image processing device to the pixel height of the image to be processed.

[0082] For example, the maximum output pixel width of the image output device is W 装置 , the maximum output pixel height is H 装置 ; The pixel width of the image to be processed is W 图像 , pixel height is H 图像 In W 图像 >W 装置 or H 图像 >H 装置 In the case of, the image to be processed is reduced. In some embodiments, the reduction ratio r is, for example, W 装置 / W 图像 and H 装置 / H 图像 The image to be processed is reduced according to the reduction ratio r, and the pixel width of the processed image is r×W 图像 , the pixel height is r×H 图像 The maximum output pixel width and the maximum output pixel height of the image output device, and the pixel width and the pixel height of the image to be processed may also be described by other measurement methods other than pixels.

[0083] In step S1, a nonlinear transformation is performed on the image to be processed. For example, a power function is used to perform gamma correction on the image to be processed. In some embodiments, the power function V is used to perform gamma correction on the image to be processed. out =V in γ Perform gamma correction on the image to be processed, V in is the color value before correction, V outis the corrected color value, and γ is the correction parameter. The output of the image output device has nonlinear characteristics, and the actual output image has a certain deviation in brightness relative to the image to be processed. This deviation varies from image output device to image output device, and for a class or a single image output device, it remains basically stable for a relatively long time. For example, by comparing the image output color value with the standard color value, the value of γ can be determined, and the image to be processed can be gamma corrected to reduce the deviation between the image actually output by the image output device and the image to be processed.

[0084] More specifically, for example, the output color scale of the image output device and the standard color scale may be compared, the output color scale and the standard color scale may be normalized, a gamma curve may be fitted, and the value of γ may be determined.

[0085] Figure 7 A block diagram of an image processing apparatus according to some embodiments of the present disclosure is shown.

[0086] like Figure 7 As shown, the image processing device 7 includes: a division module 71, which is configured to divide the histogram of the image to be processed into a plurality of first regions, for example, performing the following steps: Figure 1 Step S2 shown; the first determination module 72 is configured to determine a plurality of second regions corresponding to a plurality of first regions according to the relationship between the numbers of pixels in adjacent first regions, for example, by performing the following steps: Figure 1 Step S4 shown; the second determination module 73 is configured to determine the new color value corresponding to each pixel of the image to be processed according to the relationship between the number of color values ​​in each first area and the number of color values ​​in the corresponding second area, for example, performing the following steps: Figure 1 Step S6 shown; the third determination module 74 is configured to determine the new image according to the new color value corresponding to each pixel, for example, by performing the following Figure 1 and halftone processing module 75, is configured to perform halftone processing on the new image, for example, performing Figure 1 Shown is step S10.

[0087] The image to be processed is a grayscale image. The abscissa of the histogram is the color value, and the ordinate is the number of pixels corresponding to different color values. The color value, i.e., the abscissa of the histogram, is greater than or equal to the first color value and less than or equal to the second color value. The first color value is, for example, the minimum color value 0 in the grayscale image, and the second color value is, for example, the maximum color value 255 in the grayscale image.

[0088] Figure 8 Block diagram showing an image processing device according to some other embodiments of the present disclosure

[0089] like Figure 8As shown, the image processing device 8 includes: a memory 81; and a processor 82 coupled to the memory 81, the memory 81 is used to store instructions for executing the corresponding embodiments of the image processing method. The processor 82 is configured to execute the image processing method in any of the embodiments of the present disclosure based on the instructions stored in the memory 81.

[0090] Fig. 9 A block diagram of an image processing system according to some embodiments of the present disclosure is shown.

[0091] like Fig. 9 As shown, the image processing system 9 includes: an image processing device 91 in any of the embodiments of the present disclosure; and an image output device 92, which is configured to output the image output by the image processing device.

[0092] The image processing device 91 includes, for example, an image processor. The image output device 92 includes a monochrome binary color rendering device, such as a thermal printer, a thermal fax machine, etc., which can be applied to various document printing and other information output in the fields of POS terminal systems, banking systems, medical instruments, express transportation, etc. The image processing device 91 executes the image processing method in any of the embodiments of the present disclosure, processes the image to be processed, and obtains a new image. Then, the image processing device 91 inputs the new image into the image output device 92, and the image output device 92 outputs the new image.

[0093] Fig.10 A block diagram of a computer system for implementing some embodiments of the present disclosure is shown.

[0094] like Fig.10 As shown, the computer system 100 may be embodied in the form of a general-purpose computing device. The computer system 100 includes a memory 1010, a processor 1020, and a bus 1000 that connects various system components.

[0095] The memory 1010 may include, for example, a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions for executing at least one of the corresponding embodiments of the information sending method and the information receiving method. The non-volatile storage medium includes, but is not limited to, a disk memory, an optical memory, a flash memory, etc.

[0096] The processor 1020 can be implemented by a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc. Discrete hardware components. Accordingly, each module such as the judgment module and the determination module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or can be implemented by a dedicated circuit that executes corresponding steps.

[0097] The bus 1000 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.

[0098] The computer system 100 may also include an input / output interface 1030, a network interface 1040, a storage interface 1050, etc. These interfaces 1030, 1040, 1050, the memory 1010, and the processor 1020 may be connected via a bus 1000. The input / output interface 1030 may provide a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 1040 may provide a connection interface for various networking devices. The storage interface 1040 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.

[0099] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of frames can be implemented by computer-readable program instructions.

[0100] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.

[0101] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to work in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.

[0102] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.

[0103] By means of the image processing method, device, system and computer storable medium in the above-mentioned embodiments, images are processed, the output capability of the image output device and the limited color value space are fully utilized, and the output effect of the image is enhanced.

[0104] So far, the image processing method, device, system and computer storable medium according to the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.

Claims

1. An image processing method, comprising: According to a first boundary color value, a histogram of an image to be processed is divided into a plurality of first regions, the image to be processed is a grayscale image, the abscissa of the histogram is a color value, the ordinate is a number of pixels corresponding to different color values, the color value of the histogram is greater than or equal to a first color value and less than or equal to a second color value, and the first boundary color value includes the first color value, the second color value, and at least one boundary color value other than the first color value and the second color value; Determining a plurality of second regions corresponding to the plurality of first regions according to a relationship between the numbers of pixels in adjacent first regions comprises: Calculate a corresponding second boundary color value according to each first boundary color value other than the first color value and the second color value and the number of pixels in two adjacent first regions divided by each first boundary color value, wherein the second boundary color value also includes the first color value and the second color value; Determining, according to the second boundary color value, a plurality of second areas corresponding to the plurality of first areas; Determining the new color value corresponding to each pixel of the to-be-processed image according to the relationship between the number of color values ​​in each first region and the number of color values ​​in the corresponding second region, comprising: determining the first region where the color value of each pixel of the to-be-processed image is located; determining the ratio of the number of color values ​​in each first region to the number of color values ​​in the corresponding second region; rounding the quotient of the color value of each pixel divided by the ratio to determine the new color value corresponding to each pixel; Determine a new image according to the new color value corresponding to each pixel; The new image is halftoned.

2. The image processing method according to claim 1, wherein: Dividing the histogram of the image to be processed into a plurality of first regions comprises: A plurality of first boundary color values ​​for dividing the histogram into a plurality of first regions are determined according to an output color scale of an image output device, wherein the output color scale is obtained by inputting all color values ​​of the histogram into the image output device.

3. The image processing method according to claim 2, wherein: According to the output color scale of the image output device, at least one transition color value of the output color scale is determined as a first boundary color value other than the first color value and the second color value for dividing the histogram into a plurality of first areas, and the transition color value is a critical color value for transitioning from one color to another color in the output color scale.

4. The image processing method according to claim 1, wherein: The calculated second boundary color value is positively correlated with the ratio of the number of pixels in the first region close to the first color value in the two adjacent first regions to the total number of pixels in the two adjacent first regions.

5. The image processing method according to claim 1, wherein: Determining, according to the second boundary color value, a plurality of second areas corresponding to the plurality of first areas comprises: The histogram is re-divided into a plurality of second regions according to the second boundary color value.

6. The image processing method according to claim 1, wherein: The plurality of first regions include a first region A B , A G and A W , the first boundary color value other than the first color value and the second color value includes a first area A B , A G The first boundary color value V B and divide the first area A G , A W The first boundary color value V W , according to each first boundary color value other than the first color value and the second color value and the number of pixels in two adjacent first regions divided by each first boundary color value, calculating the corresponding second boundary color value comprises: Count the first area A separately B , A G and A W The number of pixels is N B 、N G and N W ; Determine the first area A B The maximum color value max in which the number of pixels is greater than zero B , first area A G The minimum color value min in which the number of pixels is greater than zero G and the maximum color value max G , first area A W The minimum color value min in which the number of pixels is greater than zero W ; At max B and min G is the adjacent color value, i.e. min G =max B +ΔV, the first boundary color value V B The corresponding second boundary color value V NB = first color value + (V B -first color value)×(N B / (N B +N G )); At max B and min G Not an adjacent color value, that is, min G >max B +ΔV, the first boundary color value V B The corresponding second boundary color value V NB =(min G -max B )×(N B / (N B +N G )+max B ; At max G and min W is the adjacent color value, i.e. min W =max G +ΔV, the first boundary color value V W The corresponding second boundary color value V NW =V W +(Second color value -V W )×(N G / (N W +N G )); At max G and min W Not an adjacent color value, that is, min W >max G +ΔV, the first boundary color value V W The corresponding second boundary color value V NW =max G +(min W -max G )×(N G / (N W +N G )).

7. The image processing method according to claim 1, further comprising: Perform nonlinear correction on the image to be processed.

8. The image processing method according to claim 7, wherein: Using the power function V out =V in γ Perform gamma correction on the image to be processed, V in is the color value before correction, V out is the corrected color value, and γ is the correction parameter.

9. The image processing method according to claim 1, further comprising: The image to be processed is resized.

10. The image processing method according to claim 9, wherein: The image to be processed is resized according to the maximum output pixel width and pixel height of the image output device.

11. The image processing method according to claim 10, wherein: When the pixel width of the image to be processed is greater than the maximum output pixel width of the image output device, or the pixel height of the image to be processed is greater than the maximum output pixel height of the image output device, the image to be processed is reduced according to the reduction ratio.

12. The image processing method according to claim 11, wherein: The smaller value of the ratio of the maximum output pixel width of the image output device to the pixel width of the image to be processed and the ratio of the maximum output pixel height of the image output device to the pixel height of the image to be processed is determined as the reduction ratio.

13. The image processing method according to claim 1, wherein: When the image to be processed is a color image, decolorization is performed on the image to be processed to obtain a grayscale image.

14. An image processing device, comprising: a division module, configured to divide a histogram of an image to be processed into a plurality of first regions according to a first boundary color value, the image to be processed being a grayscale image, the abscissa of the histogram being a color value, the ordinate being a number of pixels corresponding to different color values, the color value being greater than or equal to a first color value and less than or equal to a second color value, the first boundary color value including the first color value, the second color value and at least one boundary color value other than the first color value and the second color value; The first determination module is configured to determine a plurality of second regions corresponding to the plurality of first regions according to a relationship between numbers of pixels in adjacent first regions, including: Calculate a corresponding second boundary color value according to each first boundary color value other than the first color value and the second color value and the number of pixels in two adjacent first regions divided by each first boundary color value, wherein the second boundary color value also includes the first color value and the second color value; Determining, according to the second boundary color value, a plurality of second areas corresponding to the plurality of first areas; The second determination module is configured to determine the new color value corresponding to each pixel of the image to be processed according to the relationship between the number of color values ​​in each first area and the number of color values ​​in the corresponding second area, including: determining the first area where the color value of each pixel of the image to be processed is located; determining the ratio of the number of color values ​​in each first area to the number of color values ​​in the corresponding second area; rounding the quotient of the color value of each pixel divided by the ratio to determine the new color value corresponding to each pixel; The third determination module is configured to determine a new image according to a new color value corresponding to each pixel; and the halftone processing module is configured to perform halftone processing on the new image.

15. An image processing device, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the image processing method according to any one of claims 1 to 13 based on instructions stored in the memory.

16. An image processing system, comprising: The image processing device according to any one of claims 14 to 15; as well as The image output device is configured to output the image output by the image processing device.

17. A computer storable medium having computer program instructions stored thereon, which, when executed by a processor, implement the image processing method according to any one of claims 1 to 13.