CN111784590A - Image processing method, device and system and computer storage medium - Google Patents

Image processing method, device and system and computer storage medium Download PDF

Info

Publication number
CN111784590A
CN111784590A CN201910354426.XA CN201910354426A CN111784590A CN 111784590 A CN111784590 A CN 111784590A CN 201910354426 A CN201910354426 A CN 201910354426A CN 111784590 A CN111784590 A CN 111784590A
Authority
CN
China
Prior art keywords
color value
image
color
processed
boundary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910354426.XA
Other languages
Chinese (zh)
Inventor
戴钰桀
孙志玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910354426.XA priority Critical patent/CN111784590A/en
Publication of CN111784590A publication Critical patent/CN111784590A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The present disclosure relates to an image processing method, apparatus, and system, and a computer-readable storage medium, and relates to the field of image processing. An image processing method, comprising: dividing a histogram of an image to be processed into a plurality of first areas, wherein the image to be processed is a gray image, the abscissa of the histogram is a color value, the ordinate is the number of pixels corresponding to different color values, and the color value is greater than or equal to a first color value and less than or equal to a second color value; determining a plurality of second areas corresponding to the plurality of first areas according to the relationship between the number of pixels in the adjacent first areas; determining a new color value corresponding to each pixel of the image to be processed according to the relationship between the number of the color values in each first area and the number of the color values in the corresponding second area; determining a new image according to the new color value corresponding to each pixel; the new image is halftoned. According to the image output device and the image output method, the output capability and the limited color value space of the image output device are fully utilized, and the image output effect is enhanced.

Description

Image processing method, device and system and computer storage medium
Technical Field
The present disclosure relates to the field of image processing, and in particular, to an image processing method, apparatus, and system, and a computer-readable storage medium.
Background
Binary output equipment is widely applied to information output such as various receipt printing in the fields of POS terminal systems, bank systems, medical instruments, express transportation and the like. Limited by the characteristics of binary output equipment, the current display information mainly comprises numbers and characters, and the image output effect is poor.
Disclosure of Invention
In view of the above technical problem, the present disclosure provides a solution to enhance the output effect of an image.
According to a first aspect of the present disclosure, there is provided an image processing method including: dividing a histogram of an image to be processed into a plurality of first areas, wherein the image to be processed is a gray image, the abscissa of the histogram is a color value, the ordinate is the number of pixels corresponding to different color values, and the color value is greater than or equal to a first color value and less than or equal to a second color value; determining a plurality of second areas corresponding to the plurality of first areas according to the relationship between the number of pixels in the adjacent first areas; determining a new color value corresponding to each pixel of the image to be processed according to the relationship between the number of the color values in each first area and the number of the color values in the corresponding second area; determining a new image according to the new color value corresponding to each pixel; and carrying out halftone processing on the new image.
In some embodiments, dividing the histogram of the image to be processed into a plurality of first regions comprises: determining a plurality of first boundary color values for dividing the histogram into a plurality of first regions according to an output color gradation of an image output apparatus, the output color gradation being obtained by inputting all color values of the histogram to the image output apparatus, the first boundary color values including 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; and dividing the histogram into a plurality of first areas according to the first boundary color values.
In some embodiments, at least one transition color value of an output color gradation of an image output apparatus 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 regions, the transition color value being a critical color value for transition from one color to another color in the output color gradation.
In some embodiments, determining a plurality of second regions corresponding to the plurality of first regions according to a relationship between the numbers of pixels in the adjacent first regions includes: calculating corresponding second boundary color values according to the number of pixels in two adjacent first areas obtained by dividing each first boundary color value and each first boundary color value except the first color value and the second color value, wherein the second boundary color values further comprise the first color values and the second color values; and determining a plurality of second areas corresponding to the plurality of first areas according to the second boundary color value.
In some embodiments, the calculated second boundary color value is positively correlated with a proportion of the number of pixels in a first area of the two adjacent first areas, which is close to the first color value, to a sum of the number of pixels in the two adjacent first areas.
In some embodiments, determining, from the second boundary color values, a plurality of second regions to which the plurality of first regions correspond comprises: the histogram is re-divided into a plurality of second regions according to second boundary color values.
In some embodiments, determining 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 region and the number of color values in the corresponding second region comprises: and determining a new color value corresponding to each pixel of the image to be processed according to the ratio of the number of the color values in each first area to the number of the color values in the corresponding second area.
In some embodiments, determining the new color value corresponding to each pixel of the image to be processed 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 comprises: judging a first area where the color value of each pixel of the image to be processed is located; and rounding the quotient of dividing the color value of each pixel by the proportion to determine a new color value corresponding to each pixel.
In some embodiments, the plurality of first regions includes a first region aB、AGAnd AWThe first boundary color values other than the first color values and the second color values include a division into a first area AB、AGIs first boundary color value VBAnd dividing the first area AG、AWIs first boundary color value VWCalculating a corresponding second boundary color value according to the number of pixels in two adjacent first regions obtained by dividing each first boundary color value and each first boundary color value except the first color value and the second color value comprises: respectively counting the first areas AB、AGAnd AWHas a number of pixels of NB、NGAnd NW(ii) a Determining a first area ABMaximum colour values max for which the number of medium pixels is greater than zeroBThe first region AGHas a minimum color value min with a number of pixels greater than zeroGAnd maximum color value maxGThe first region AWHas a minimum color value min with a number of pixels greater than zeroW(ii) a At maxBAnd minGFor adjacent color values, i.e. minG=maxB+ Δ V the first boundary color value VBCorresponding second boundary color value VNBFirst color value + (V)BFirst color value) × (N)B/(NB+NG) ); at maxBAnd minGNot of adjacent color values, i.e. minG>maxB+ Δ V the first boundary color value VBCorresponding second boundary color value VNB=(minG-maxB)×(NB/(NB+NG)+maxB(ii) a At maxGAnd minWFor adjacent color values, i.e. minW=maxG+ Δ V the first boundary color value VWCorresponding second boundary color value VNW=VW+ (second color value-V)W)×(NG/(NW+NG) ); at maxGAnd minWNot of adjacent color values, i.e. minW>maxG+ Δ V the first boundary color value VWCorresponding second boundary color value VNW=maxG+(mminW-maxG)×(NG/(NW+NG))。
In some embodiments, the image processing method further comprises: and carrying out nonlinear correction on the image to be processed.
In some embodiments, a power function V is utilizedout=VinGamma correction of the image to be processed, VinTo the color value before correction, Voutγ is a correction parameter for the corrected color value.
In some embodiments, the image processing method further comprises: and carrying out size adjustment on the image to be processed.
In some embodiments, the image to be processed is resized according to a maximum output pixel width and pixel height of the image output device.
In some embodiments, in a case where a pixel width of the image to be processed is greater than a maximum output pixel width of the image output device or a pixel height of the image to be processed is greater than a maximum output pixel height of the image output device, the image to be processed is subjected to reduction processing at a reduction scale.
In some embodiments, the smaller 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.
In some embodiments, when the image to be processed is a color image, the image to be processed is subjected to a color removal process to obtain a gray image.
According to a second aspect of the present disclosure, there is provided an image processing apparatus comprising: the dividing module is configured to divide a histogram of an image to be processed into a plurality of first areas, the image to be processed is a gray image, the abscissa of the histogram is a color value, the ordinate is the number of pixels corresponding to different color values, and the color value is greater than or equal to a first color value and less than or equal to a second color value; the first determining module is configured to determine a plurality of second areas corresponding to the plurality of first areas according to the relationship among the pixel numbers in the adjacent first areas; a second determining module configured to determine a new color value corresponding to each pixel of the image to be processed according to 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 determining module configured to determine a new image according to the new color value corresponding to each pixel; a halftone processing module configured to halftone the new image.
According to a third aspect of the present disclosure, there is provided an image processing apparatus comprising: a memory; and a processor coupled to the memory, the processor configured to perform the image processing method of any of the above embodiments based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, there is provided an image processing system comprising: the image processing apparatus according to any of the above embodiments; and an image output device configured to output the image output by the image processing device.
According to a fifth aspect of the present disclosure, there is provided a computer-storable medium having stored thereon computer program instructions which, when executed by a processor, implement the image processing method of any of the above embodiments.
In the embodiment, 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.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 illustrates a flow diagram of an image processing method according to some embodiments of the present disclosure;
FIG. 2 shows an image;
FIG. 3 shows a histogram of the image shown in FIG. 2;
FIG. 4 shows a new image obtained by histogram adjustment of the image shown in FIG. 2;
FIG. 5 shows a histogram of the new image shown in FIG. 4;
FIG. 6 shows a flow diagram of an image processing method according to further embodiments of the present disclosure;
FIG. 7 illustrates a block diagram of an image processing apparatus according to some embodiments of the present disclosure;
FIG. 8 shows a block diagram of an image processing apparatus according to further embodiments of the present disclosure;
FIG. 9 illustrates a block diagram of an image processing system according to some embodiments of the present disclosure;
FIG. 10 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
Detailed Description
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 the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Fig. 1 illustrates a flow diagram of an image processing method according to some embodiments of the present disclosure. As shown in fig. 1, the image processing method includes steps S2 to S10.
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 gray image. In some embodiments, the histogram of the grayscale image is rendered by an OpenCV or other tool, thereby dividing the histogram of the grayscale image into a plurality of first regions. The abscissa of the histogram of the image to be processed is a color value, and the ordinate is the number of pixels corresponding to different color values. The color value, which is the abscissa of the histogram, is equal to or greater than the first color value and equal to or less than the second color value. The first color value is, for example, a minimum color value 0 in the grayscale image, and the second color value is, for example, a maximum color value 255 in the grayscale image.
When the image to be processed is a color image, for example, the image to be processed may be subjected to a color removal process to obtain a corresponding grayscale image. In some embodiments, the images to be processed are combined in multiple channels to achieve a color removal process, thereby converting the images to be processed into grayscale images.
For example, the step S2 is implemented by dividing the histogram of the image to be processed into a plurality of first regions as follows.
First, a plurality of first boundary color values for dividing the histogram into a plurality of first regions is determined according to an output tone scale of the image output apparatus. In some embodiments, the output tone scale is obtained by inputting all color values of the histogram to the image output device. The first boundary color values include a first color value and a 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 a histogram of a gray scale image are input to an image output device to obtain an output tone scale. The first boundary color values include 0 and 255 and boundary color values other than 0-255, such as 60 and 240. The first boundary color values divide the histogram into three first regions according to the first boundary color values 0, 60, 240, 255. It will be appreciated that each first region corresponds to two first boundary colour values.
In some embodiments, at least one transition color value of the output gradation is determined as a first boundary color value other than the first color value and the second color value for dividing the histogram into the plurality of first regions, according to the output gradation of the image output apparatus. A transition color value is a critical color value for a transition from one color to another color in the output color gradation. The critical color value may be determined from the color change to which the human eye is more sensitive. For example, the human eye is sensitive to changes from black to gray, and thus the critical color value for a transition from black to gray can be determined.
For example, the plurality of first regions includes a first region AB、AGAnd AWIn the case of (1), determining the first boundary color values other than the first color values and the second color values based on the output tone scale of the image output apparatus includes dividing the first area aB、AGIs first boundary color value VBAnd dividing the first area AG、AWIs first boundary color value VW. For example, the transition color value for the transition from black to gray in the output color level card is 60, and the first boundary color value V is determinedBIs 60. Analogously, a first boundary color value V for the transition from gray to white is determinedWIs 240.
Then, the histogram is divided into a plurality of first regions according to the first boundary color values.
For example, the plurality of first regions includes a first region AB、AGAnd AWIn the case of (1), the first boundary color values are 0 and VB=60、VWThe histogram is divided into three first regions a, 240, 255B、AGAnd AW. First region ABRespectively 0 and 60, a first region AG60 and 240, respectively, a first region AWAre 240 and 255, respectively. For example, the first boundary color value 60 belongs to the first region ABThe first boundary color value 240 belongs to the first region AW
In step S4, a plurality of second regions corresponding to the plurality of first regions are determined based on the relationship between the numbers of pixels in the adjacent first regions.
For example, a plurality of second regions corresponding to the plurality of first regions are determined according to the relationship between the numbers of pixels in the adjacent first regions in the following manner.
First, the corresponding second boundary color values are calculated according to the number of pixels in two adjacent first regions obtained by dividing each first boundary color value and each first boundary color value except the first color value and the second color value. In some embodiments, the calculated second boundary color value is positively correlated with a proportion of the number of pixels in the first one of the two adjacent first regions that is close to the first color value to a sum of the 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.
For example, the plurality of first regions includes a first region AB、AGAnd AWIn the case of (2), the first boundary color value V is calculated as followsBCorresponding second boundary color value VNBAnd a first boundary color value VWCorresponding second boundary color value VNW
First, the first regions A are counted respectivelyB、AGAnd AWThe number of pixels in is NB、NGAnd NW
Then, a first area A is determinedBMaximum colour values max for which the number of medium pixels is greater than zeroBThe first region AGHas a minimum color value min with a number of pixels greater than zeroGAnd maximum color value maxGThe first region AWHas a minimum color value min with a number of pixels greater than zeroW
Finally, the second boundary color value V is calculated according to the following formulaNBAnd VNW
At maxBAnd minGFor adjacent color values, i.e. minG=maxB+ Δ V the first boundary color value VBCorresponding second boundary color value VNBFirst color value + (V)BFirst color value) × (N)B/(NB+NG))。
At maxBAnd minGNot of adjacent color values, i.e. minG>maxB+ Δ V the first boundary color value VBCorresponding second boundary color value VNB=(minG-maxB)×(NB/(NB+NG)+maxB
At maxGAnd minWFor adjacent color values, i.e. minW=maxG+ Δ V the first boundary color value VWCorresponding second boundary color value VNW=VW+ (second color value-V)W)×(NG/(NW+NG))。
At maxGAnd minWNot of adjacent color values, i.e. minW>maxG+ Δ V the first boundary color value VWCorresponding second boundary color value VNW=maxG+(minW-maxG)×(NG/(NW+NG)). It should be understood that av is the step size of the color value change.
In some embodiments, Δ V — 1, i.e., the step size of the color value change is 1. Next, description will be made with reference to the histogram taking the step size of color value change as an example of 1.
Fig. 2 shows an image. The histogram of the image shown in fig. 2 is plotted, for example, using a tool such as OpenCV (Open Source Computer Vision Library), as shown in fig. 3.
Fig. 3 shows a histogram of the image shown in fig. 2.
As shown in FIG. 3, the first color value is 0, the second color value is 255, and V is determined according to the output tone scale of an image output apparatusBIs 60 at VWTo 240, the first region A shown in FIG. 2 is countedB、AGAnd AWThe number of pixels in is, for example, NB=34560、NG215416 and NW=24。
Min as shown in FIG. 3G=maxB+1,VNBFirst color value + (V)BFirst color value) × (N)B/(NB+NG) V is calculated according to a formula)NBAbout 8.3, rounded down to get VNBIs 8. In the same way, obtain VNWIs 255.
Returning to fig. 1, the following steps of determining a plurality of second regions corresponding to the plurality of first regions according to the relationship between the numbers of pixels in the adjacent first regions in step S4 will be described.
Then, a plurality of second areas corresponding to the plurality of first areas are determined according to the second boundary color values. In some embodiments, the histogram is subdivided into a plurality of second regions according to the second boundary color values. For example, the plurality of first regions includes a first region AB、AGAnd AWIn the case of (2), the first boundary color value VB60 corresponding second boundary color value V NB8, first boundary color value VW240 corresponding second boundary color value VNW255. According to the second boundary colour value V NB8 and VNW255, the histogram is divided into three second regions a'B、A′GAnd A'W. For example, the second boundary color value VNBBelongs to a second region A'B,VNW255 belong to the second region A'W. It will be appreciated that each second region corresponds to two second boundary color values.
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.
For example, the 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.
In some embodiments, a first region in which a color value of each pixel of the image to be processed is located is first determined. For example, a pixel has a color value of 50, and the color value of 50 is in the first area AB. First region ABThe corresponding second region is A'BFirst region ABThe number of intrinsic color values is 60-0+ 1-61, second region A'BThe number of color values in the color filter is 8-0+ 1-9, and the ratio of the number of corresponding color values is 61/9. Finally, the new color value corresponding to the calculated color value 50 is 50/(61/9) according to the ratio 61/9, the calculated quotient is approximately 7.4, and the calculated quotient is rounded down to obtain the new color value 7. And traversing each pixel of the image to be processed, and calculating a new color value corresponding to each pixel according to the method to obtain a new image. It should be understood that in a histogram, the color values of the histogram are the tone scale. The number of color values is the number of color values contained in each first region or second region in the histogram, i.e., the number of color levels in the histogram corresponding to the first region or second region.
Fig. 4 shows a new image obtained by histogram adjustment of the image shown in fig. 2. The histogram is adjusted to step S2 to step S8 as shown in fig. 1. A histogram of the new image shown in fig. 4 is plotted, for example, using tools such as OpenCV, as shown in fig. 5.
Fig. 5 shows a histogram of the new image shown in fig. 4.
Comparing fig. 2 and fig. 3, it is found that the visual effect of fig. 3 is enhanced relative to fig. 2 after histogram adjustment. For example, the lighter gray areas in the image shown in fig. 2 are histogram adjusted to make the boundary lines more distinct in fig. 3, and some areas that appear blurred in fig. 2 are histogram adjusted to make the boundary lines more distinct in fig. 3. Comparing fig. 2 and fig. 3, it can be found more intuitively that, according to the image processing method of the present disclosure, the histogram is adjusted in different regions, so that the expressive power of the image output device on color values in a specific region is improved, the visual effect of a corresponding region of an image is enhanced, and further, the overall output effect of the image is enhanced.
Comparing fig. 4 and fig. 5, it is found that, after histogram adjustment is performed on the image to be processed by the image processing method of the present disclosure, each first region of the histogram can be compressed or stretched, for example, the middle region is stretched, and the two side regions are compressed. The method makes full use of the limited color value space, thereby making full use of the output capability of the image output device, improving the expression of the image output device and enhancing the image output effect. According to the image processing method disclosed by the invention, the histogram is adjusted by regions, the expressive force of the image output device on the color values in the specific region is improved, the visual effect of the corresponding region of the image is enhanced, and the overall output effect of the image is further enhanced.
Returning to fig. 1, in step S8, a new image is determined based on 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 a corresponding new color value, thereby determining a new image.
In step S10, the new image is subjected to halftone processing. The new image may be halftoned using a halftoning technique such as a dither method, an error diffusion method, an iterative method, or the like.
FIG. 6 illustrates a flow diagram of an image processing method according to further embodiments of the present disclosure.
As shown in fig. 6, the image processing method includes: step S0 to step S10. Fig. 6 is different from fig. 1 in that steps S0 to S1 other than steps S2 to S10 of the image processing method of fig. 1 are shown. Only the differences between fig. 6 and fig. 1 will be described below, and the same parts will not be described again.
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 apparatus. For example, in the case where the pixel width of the image to be processed is larger than the maximum output pixel width of the image output apparatus, or the pixel height of the image to be processed is larger than the maximum output pixel height of the image output apparatus, the image to be processed is subjected to reduction processing at a reduction ratio. In some embodiments, the reduction scale is a smaller value of a ratio of a maximum output pixel width of the image output device to a pixel width of the image to be processed, a maximum output pixel height of the image processing device to a pixel height of the image to be processed.
For example, the maximum output pixel width of the image output apparatus is WDevice for measuring the position of a moving objectMaximum output pixel height of HDevice for measuring the position of a moving object(ii) a The pixel width of the image to be processed is WImage of a personPixel height of HImage of a person. At WImage of a person>WDevice for measuring the position of a moving objectOr HImage of a person>HDevice for measuring the position of a moving objectIn the case of (3), the image to be processed is subjected to reduction processing. In some embodiments, the reduction ratio r is taken to be, for example, WDevice for measuring the position of a moving object/WImage of a personAnd HDevice for measuring the position of a moving object/HImage of a personThe image to be processed is reduced according to the reduction ratio r, and the pixel width of the processed image is r × WImage of a personPixel height r × HImage of a person. The maximum output pixel width and the maximum output pixel height of the image output device, the pixel width and the pixel height of the image to be processed, for example, can also be described by other metering means than pixels. .
In step S1, the image to be processed is subjected to nonlinear transformation. The image to be processed is gamma corrected, for example, using a power function. In some embodiments, a power function V is utilizedout=Vin γSubjecting the image to gamma correction, VinTo the color value before correction, Voutγ is a correction parameter for the corrected color value. The output of the image output device has a non-linear characteristic, and the actually output image has a certain deviation in brightness with respect to the image to be processed itself. Such deviations differ from image output device to image output device and remain substantially constant for a relatively long time for one type or for a single image output device. For example, the value of γ can be determined by comparing the image output color value with the standard color value, and the gamma correction is performed on the image to be processed, thereby reducing the deviation between the image actually output by the image output device and the image to be processed itself.
More specifically, for example, the output tone scale of the image output apparatus may be compared with a standard tone scale, the output tone scale and the standard tone scale may be normalized, a gamma curve may be fitted, and the value of γ may be determined.
Fig. 7 illustrates a block diagram of an image processing apparatus according to some embodiments of the present disclosure.
As shown in fig. 7, the image processing apparatus 7 includes: a dividing module 71 configured to divide the histogram of the image to be processed into a plurality of first regions, for example, to perform step S2 shown in fig. 1; a first determining module 72 configured to determine a plurality of second regions corresponding to the plurality of first regions according to the relationship between the numbers of pixels in the adjacent first regions, for example, execute step S4 shown in fig. 1; a second determining module 73 configured to determine a 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 region and the number of color values in the corresponding second region, for example, execute step S6 shown in fig. 1; a third determining module 74 configured to determine a new image according to the new color value corresponding to each pixel, for example, to execute step S8 shown in fig. 1; and a halftone processing module 75 configured to perform halftone processing on the new image, for example, to perform step S10 shown in fig. 1.
The image to be processed is a gray 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 equal to or greater than the first color value and equal to or less than the second color value. The first color value is, for example, a minimum color value 0 in the grayscale image, and the second color value is, for example, a maximum color value 255 in the grayscale image.
FIG. 8 shows a block diagram of an image processing apparatus according to further embodiments of the present disclosure
As shown in fig. 8, the image processing apparatus 8 includes: a memory 81; and a processor 82 coupled to the memory 81, the memory 81 being configured to store instructions for executing the corresponding embodiment of the image processing method. The processor 82 is configured to perform the image processing method in any of the embodiments of the present disclosure based on instructions stored in the memory 81.
FIG. 9 illustrates a block diagram of an image processing system according to some embodiments of the present disclosure.
As shown in fig. 9, the image processing system 9 includes: the image processing apparatus 91 in any of the embodiments of the present disclosure; and an image output device 92 configured to output the image output by the image processing device.
The image processing device 91 includes, for example, an image processor. The image output device 92 includes a monochrome binary color generation device, such as a thermal printer, a thermal fax machine, and the like, and can be applied to information output such as printing of various documents in the fields of POS terminal systems, banking systems, medical instruments, express transportation, and the like. The image processing apparatus 91 executes the image processing method in any embodiment of the present disclosure to process the image to be processed, and obtain a new image. Then, the image processing apparatus 91 inputs a new image to the image output apparatus 92, and the image output apparatus 92 outputs the new image.
FIG. 10 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
As shown in FIG. 10, computer system 100 may be embodied in the form of a general purpose computing device. Computer system 100 includes a memory 1010, a processor 1020, and a bus 1000 that couples various system components.
The memory 1010 may include, for example, system memory, non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), and other programs. The system memory may include volatile storage media such as Random Access Memory (RAM) and/or cache memory. The non-volatile storage medium stores, for example, instructions to perform corresponding embodiments of at least one of the information transmitting method and the information receiving method. Non-volatile storage media include, but are not limited to, magnetic disk storage, optical storage, flash memory, and the like.
The processor 1020 may be implemented as discrete hardware components, such as 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 device, discrete gates or transistors, or the like. Accordingly, each of the modules, such as the judging module and the determining module, may be implemented by a Central Processing Unit (CPU) executing instructions in a memory for performing the corresponding step, or may be implemented by a dedicated circuit for performing the corresponding step.
Bus 1000 may use any of a variety of bus architectures. For example, bus structures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, and Peripheral Component Interconnect (PCI) bus.
The computer system 100 may also include an input-output interface 1030, a network interface 1040, a storage interface 1050, and the like. These interfaces 1030, 1040, 1050 and the memory 1010 and the processor 1020 may be connected by a bus 1000. The input/output interface 1030 may provide a connection interface for an input/output device such as a display, a mouse, and a keyboard. The network interface 1040 provides a connection interface for various networking devices. The storage interface 1040 provides a connection interface for an external storage device such as a floppy disk, a U disk, and an SD card.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable apparatus to produce a machine, such that the execution of the instructions by the processor results in an apparatus that implements the functions specified in the flowchart and/or block diagram block or blocks.
These computer-readable program instructions may also be stored in a computer-readable memory that can direct a computer to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and/or block diagram block or blocks.
The present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
By the image processing method, the image processing device, the image processing system and the computer storage medium in the embodiments, the image is 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.
So far, an image processing method, apparatus and system and a computer-storable medium according to the present disclosure have been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.

Claims (20)

1. An image processing method comprising:
dividing a histogram of an image to be processed into a plurality of first areas, wherein the image to be processed is a gray image, the abscissa of the histogram is a color value, the ordinate is the number of pixels corresponding to different color values, and 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;
determining a plurality of second areas corresponding to the plurality of first areas according to the relationship between the number of pixels in the adjacent first areas;
determining a new color value corresponding to each pixel of the image to be processed according to the relationship between the number of the color values in each first area and the number of the color values in the corresponding second area;
determining a new image according to the new color value corresponding to each pixel;
and carrying out halftone processing on the new image.
2. The image processing method of claim 1, wherein dividing the histogram of the image to be processed into a plurality of first regions comprises:
determining a plurality of first boundary color values for dividing the histogram into a plurality of first regions according to an output color gradation of an image output apparatus, the output color gradation being obtained by inputting all color values of the histogram to the image output apparatus, the first boundary color values including 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;
and dividing the histogram into a plurality of first areas according to the first boundary color values.
3. The image processing method according to claim 2, wherein at least one transition color value of an output color gradation of an image output apparatus 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 regions, according to the output color gradation, the transition color value being a critical color value for transition from one color to another color in the output color gradation.
4. The image processing method according to claim 2, wherein determining a plurality of second regions corresponding to the plurality of first regions according to a relationship between the numbers of pixels in the adjacent first regions comprises:
calculating corresponding second boundary color values according to the number of pixels in two adjacent first areas obtained by dividing each first boundary color value and each first boundary color value except the first color value and the second color value, wherein the second boundary color values also comprise the first color value and the second color value;
and determining a plurality of second areas corresponding to the plurality of first areas according to the second boundary color value.
5. The image processing method according to claim 4, wherein the calculated second boundary color value positively correlates with a proportion of the number of pixels in a first region of the two adjacent first regions that is close to the first color value to a sum of the number of pixels in the two adjacent first regions.
6. The image processing method according to claim 4, wherein determining, from the second boundary color values, a plurality of second regions to which the plurality of first regions correspond comprises:
the histogram is re-divided into a plurality of second regions according to second boundary color values.
7. The image processing method according to claim 1, wherein determining a new color value corresponding to each pixel of the image to be processed according to a relationship between the number of color values in each first region and the number of color values in the corresponding second region comprises:
and determining a new color value corresponding to each pixel of the image to be processed according to the ratio of the number of the color values in each first area to the number of the color values in the corresponding second area.
8. The image processing method of claim 7, wherein determining a new color value corresponding to each pixel of the image to be processed 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 comprises:
judging a first area where the color value of each pixel of the image to be processed is located;
and rounding the quotient of dividing the color value of each pixel by the proportion to determine a new color value corresponding to each pixel.
9. The image processing method according to claim 4,
the plurality of first regions includes a first region AB、AGAnd AWThe first boundary color values other than the first color values and the second color values include a division into a first area AB、AGIs first boundary color value VBAnd dividing the first area AG、AWIs first boundary color value VWCalculating a corresponding second boundary color value according to the number of pixels in two adjacent first regions obtained by dividing each first boundary color value and each first boundary color value except the first color value and the second color value comprises:
respectively counting the first areas AB、AGAnd AWHas a number of pixels of NB、NGAnd NW
Determining a first area ABMaximum colour values max for which the number of medium pixels is greater than zeroBThe first region AGHas a minimum color value min with a number of pixels greater than zeroGAnd maximum color value maxGThe first region AWHas a minimum color value min with a number of pixels greater than zeroW
At maxBAnd minGFor adjacent color values, i.e. minG=maxB+ Δ V the first boundary color value VBCorresponding second boundary color value VNBFirst color value + (V)BFirst color value) × (N)B/(NB+NG));
At maxBAnd minGNot of adjacent color values, i.e. minG>maxB+ Δ V the first boundary color value VBCorresponding second boundary color value VNB=(minG-maxB)×(NB/(NB+NG)+maxB
At maxGAnd minWFor adjacent color values, i.e. minW=maxG+ Δ V the first boundary color value VWCorresponding second boundary color value VNW=VW+ (second color value-V)W)×(NG/(NW+NG));
At maxGAnd minWNot of adjacent color values, i.e. minW>maxG+ Δ V the first boundary color value VWCorresponding second boundary color value VNW=maxG+(minW-maxG)×(NG/(NW+NG))。
10. The image processing method according to claim 1, further comprising: and carrying out nonlinear correction on the image to be processed.
11. The image processing method according to claim 10, wherein a power function V is utilizedout=VinGamma correction of the image to be processed, VinTo the color value before correction, Voutγ is a correction parameter for the corrected color value.
12. The image processing method according to claim 1, further comprising: and carrying out size adjustment on the image to be processed.
13. The image processing method according to claim 12, wherein the image to be processed is resized according to a maximum output pixel width and pixel height of the image output device.
14. The image processing method according to claim 13, wherein in a case where a pixel width of the image to be processed is larger than a maximum output pixel width of the image output device or a pixel height of the image to be processed is larger than a maximum output pixel height of the image output device, the image to be processed is subjected to reduction processing in a reduction scale.
15. The image processing method according to claim 14, wherein a smaller value of a ratio of a maximum output pixel width of the image output device to a pixel width of the image to be processed, and a ratio of a maximum output pixel height of the image output device to a pixel height of the image to be processed is determined as the reduction ratio.
16. The image processing method according to claim 1, wherein, in a case where the image to be processed is a color image, the image to be processed is subjected to a decoloring process to obtain a grayscale image.
17. An image processing apparatus comprising:
the dividing module is configured to divide a histogram of an image to be processed into a plurality of first areas, the image to be processed is a gray image, the abscissa of the histogram is a color value, the ordinate is the number of pixels corresponding to different color values, and the color value is greater than or equal to a first color value and less than or equal to a second color value;
the first determining module is configured to determine a plurality of second areas corresponding to the plurality of first areas according to the relationship among the pixel numbers in the adjacent first areas;
a second determining module configured to determine a new color value corresponding to each pixel of the image to be processed according to 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 determining module configured to determine a new image according to the new color value corresponding to each pixel; a halftone processing module configured to halftone the new image.
18. An image processing apparatus comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the image processing method of any of claims 1 to 16 based on instructions stored in the memory.
19. An image processing system comprising:
the image processing apparatus according to any one of claims 17 to 18; and
and an image output device configured to output the image output by the image processing device.
20. A computer-storable medium having stored thereon computer program instructions which, when executed by a processor, implement the image processing method of any one of claims 1 to 16.
CN201910354426.XA 2019-04-29 2019-04-29 Image processing method, device and system and computer storage medium Pending CN111784590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910354426.XA CN111784590A (en) 2019-04-29 2019-04-29 Image processing method, device and system and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910354426.XA CN111784590A (en) 2019-04-29 2019-04-29 Image processing method, device and system and computer storage medium

Publications (1)

Publication Number Publication Date
CN111784590A true CN111784590A (en) 2020-10-16

Family

ID=72754902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910354426.XA Pending CN111784590A (en) 2019-04-29 2019-04-29 Image processing method, device and system and computer storage medium

Country Status (1)

Country Link
CN (1) CN111784590A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783496A (en) * 2021-02-22 2021-05-11 中国工商银行股份有限公司 Anchor point-based interface dynamic layout method and device, electronic equipment and storage medium
CN113222851A (en) * 2021-05-25 2021-08-06 珠海建轩服装有限公司 Image color gradation simplifying method and device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011198116A (en) * 2010-03-19 2011-10-06 Seiko Epson Corp Apparatus and program for processing image
US20160295076A1 (en) * 2015-03-31 2016-10-06 Brother Kogyo Kabushiki Kaisha Non-Transitory Computer-Readable Medium
CN106210522A (en) * 2016-07-15 2016-12-07 广东欧珀移动通信有限公司 A kind of image processing method, device and mobile terminal
US20170310851A1 (en) * 2016-04-25 2017-10-26 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium
CN108230256A (en) * 2017-11-09 2018-06-29 珠海市魅族科技有限公司 Image processing method, device, computer installation and computer readable storage medium
CN109309826A (en) * 2017-07-27 2019-02-05 Tcl集团股份有限公司 A kind of image color equalization methods and terminal
CN109523564A (en) * 2018-10-19 2019-03-26 北京字节跳动网络技术有限公司 Method and apparatus for handling image

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011198116A (en) * 2010-03-19 2011-10-06 Seiko Epson Corp Apparatus and program for processing image
US20160295076A1 (en) * 2015-03-31 2016-10-06 Brother Kogyo Kabushiki Kaisha Non-Transitory Computer-Readable Medium
US20170310851A1 (en) * 2016-04-25 2017-10-26 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium
CN106210522A (en) * 2016-07-15 2016-12-07 广东欧珀移动通信有限公司 A kind of image processing method, device and mobile terminal
CN109309826A (en) * 2017-07-27 2019-02-05 Tcl集团股份有限公司 A kind of image color equalization methods and terminal
CN108230256A (en) * 2017-11-09 2018-06-29 珠海市魅族科技有限公司 Image processing method, device, computer installation and computer readable storage medium
CN109523564A (en) * 2018-10-19 2019-03-26 北京字节跳动网络技术有限公司 Method and apparatus for handling image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张改英;张讲社;: "一种结合像素空间信息和多维直方图的彩色图像快速分割算法", 工程数学学报, no. 02 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783496A (en) * 2021-02-22 2021-05-11 中国工商银行股份有限公司 Anchor point-based interface dynamic layout method and device, electronic equipment and storage medium
CN113222851A (en) * 2021-05-25 2021-08-06 珠海建轩服装有限公司 Image color gradation simplifying method and device, equipment and storage medium

Similar Documents

Publication Publication Date Title
JP5889431B2 (en) Image processing apparatus and image processing method
US11210765B2 (en) Image processing method and device, storage medium and computer device
US10783837B2 (en) Driving method and driving device of display device, and related device
US10834288B2 (en) Generating image region dot data based on corrected number of dots and determined arrangement priority
CN109309826B (en) Image color balancing method and device, terminal equipment and readable storage medium
CN110969046B (en) Face recognition method, face recognition device and computer-readable storage medium
CN112150368A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111784590A (en) Image processing method, device and system and computer storage medium
CN112396050B (en) Image processing method, device and storage medium
CN105575314A (en) Gray scale processing method, gray scale processing device and display device
EP3451294B1 (en) Luminance-normalised colour spaces
CN111626967A (en) Image enhancement method, image enhancement device, computer device and readable storage medium
JP6115545B2 (en) Image processing apparatus and image processing method
JP2010226260A (en) Image output apparatus, edge enhancement device, and edge enhancement method
JP2020197915A (en) Image processing device, image processing method, and program
US8285036B2 (en) Image processing method, image processing apparatus, and computer-readable storage medium for computer program
CN105427265A (en) Color image contrast enhancement method and system
CN103714523A (en) Image sharpening system and image sharpening method on basis of Kirsch operators
CN110147765B (en) Image processing method and device
CN100525469C (en) Image processing device and method
JP2019046225A (en) Recognition device, recognition program, and recognition method
TWI789158B (en) Image processing method, image processing system, and non-transitory computer readable storage medium
JP2006270897A (en) Image processing device, method and program
CN115330637A (en) Image sharpening method and device, computing device and storage medium
CN109242750B (en) Picture signature method, picture matching method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination