CN110633065B - Image adjusting method and device and computer readable storage medium - Google Patents
Image adjusting method and device and computer readable storage medium Download PDFInfo
- Publication number
- CN110633065B CN110633065B CN201910711739.6A CN201910711739A CN110633065B CN 110633065 B CN110633065 B CN 110633065B CN 201910711739 A CN201910711739 A CN 201910711739A CN 110633065 B CN110633065 B CN 110633065B
- Authority
- CN
- China
- Prior art keywords
- channel
- histogram
- information entropy
- blue
- green
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
- G06F3/147—Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
Abstract
The invention discloses an image adjusting method and device and a computer readable storage medium, wherein the method comprises the following steps: extracting a red channel, a blue channel and a green channel of an image, and respectively carrying out histogram statistics on the red channel, the blue channel and the green channel; respectively calculating the histogram information entropies of a red channel, a blue channel and a green channel; carrying out weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel according to the histogram statistical result; and accumulating the histogram according to the weighted fusion result to obtain red channel mapping, blue channel mapping and green channel mapping, thereby outputting an adjusted image. The invention performs fusion according to the information entropy weight of each channel, can effectively retain the image details of the dominant hue channel, and can also perform contrast enhancement on the dark state details of other channels.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image adjustment method and apparatus, and a computer-readable storage medium.
Background
In the LCE algorithm, mixed histogram statistics is carried out on gray scale values of three channels of the image R, G, B, and when an input image has obvious dominant hue, the histogram statistics can be influenced by the other two channels, so that the histogram statistics occupies a larger gray scale range. In R, G, B a hybrid histogram statistics of three channel gray level values, if pixels below the gray level of 50 of the original image occupy about 164 gray levels, the image detail of the dominant tone channel is suppressed.
Therefore, the image processing technology of the existing LCE algorithm has defects and needs to be improved.
Disclosure of Invention
The invention provides an image adjusting method and device and a computer readable storage medium, which solve the problem that the image details of an obvious dominant hue channel are inhibited in the prior art.
In one aspect, the present invention provides an image adjusting method, including:
extracting a red channel, a blue channel and a green channel of an image, and respectively carrying out histogram statistics on the red channel, the blue channel and the green channel;
respectively calculating the histogram information entropy of the red channel, the blue channel and the green channel;
carrying out weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel according to the histogram statistical result;
and accumulating the histogram according to the weighted fusion result to obtain red channel mapping, blue channel mapping and green channel mapping, thereby outputting the adjusted image.
In the image adjusting method of the present invention, the calculating the histogram information entropies of the red channel, the blue channel, and the green channel respectively includes:
calculating the histogram information entropy of the red channel:
P Ri probability of occurrence of ith gray scale in red channel;
calculating the histogram information entropy of the green channel:
P Gi is the probability of the ith gray level in the green channel;
calculating the information entropy of the blue channel histogram:
P Bi the probability of occurrence of the ith gray level in the blue channel.
In the image adjusting method of the present invention, the performing weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel, and the histogram information entropy of the green channel according to the histogram statistical result includes:
carrying out weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel:
Hist R histogram statistics for the red channel, hist G Histogram statistics for the green channel, hist B Is histogram statistic of blue channel, alpha R The value is taken according to the discrete degree of the gray level in the red channel, alpha G Taking a value according to the discrete degree of the gray scale in the green channel, alpha B And taking values according to the discrete degree of the gray scale in the blue channel.
In the image adjusting method of the present invention, α R Is the standard deviation of the gray level in the red channel, alpha G Is the standard deviation of the gray scale in the green channel, alpha B Is the standard deviation of the gray scale in the blue channel.
In one aspect, the present invention provides an image adjusting apparatus, comprising:
the statistical module is used for extracting a red channel, a blue channel and a green channel of an image and respectively carrying out histogram statistics on the red channel, the blue channel and the green channel;
the calculation module is used for calculating the histogram information entropies of the red channel, the blue channel and the green channel respectively;
the weighting module is used for carrying out weighting fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel according to the histogram statistical result;
and the mapping module is used for accumulating the histogram according to the weighted fusion result to obtain red channel mapping, blue channel mapping and green channel mapping so as to output the adjusted image.
In the image adjusting apparatus of the present invention, the calculation module includes:
and the red channel calculation sub-module is used for calculating the histogram information entropy of the red channel:
P Ri probability of occurrence of ith gray scale in red channel;
and the green channel calculation sub-module is used for calculating the histogram information entropy of the green channel:
P Gi is the probability of the ith gray level in the green channel;
the blue channel calculation submodule is used for calculating the information entropy of the blue channel histogram:
P Ri is the probability of the ith gray occurrence in the blue channel.
In the image adjusting apparatus of the present invention, the weighting module performs weighting fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel, and the histogram information entropy of the green channel:
Hist R histogram statistics for the red channel, hist G Histogram statistics for the green channel, hist B Is histogram statistic of blue channel, alpha R Taking a value according to the degree of dispersion of the gray level in the red channel, alpha G Taking a value according to the discrete degree of the gray scale in the green channel, alpha B And taking values according to the discrete degree of the gray scale in the blue channel.
In the image adjusting apparatus of the present invention, α R Is the standard deviation of the gray level in the red channel, alpha G Is the standard deviation of the gray scale in the green channel, alpha B Is the standard deviation of the gray scale in the blue channel.
In one aspect, a computer-readable storage medium having computer instructions stored thereon is provided, wherein the instructions, when executed by a processor, implement an image adjustment method.
The invention has the following beneficial effects:
fusion is carried out according to the information entropy weight of each channel, so that the image details of the dominant hue channel can be effectively reserved, and the contrast enhancement can be carried out on the dark state details of other channels.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a flowchart of an image adjustment method according to an embodiment of the present invention;
FIG. 2 is a comparison graph of histogram statistics;
FIG. 3 is a comparison graph of index parameters provided by an embodiment of the present invention.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of an image adjusting method according to an embodiment of the present invention, where the image adjusting method includes steps S1 to S4:
s1, extracting a red channel, a blue channel and a green channel of an image, and respectively carrying out histogram statistics on the red channel, the blue channel and the green channel; referring to fig. 2, fig. 2 is a comparison graph of histogram statistics, where the histogram statistics is performed according to the gray scale values of the sub-pixels in each color channel, and in the graph, the obvious dominant hue is a red channel, and the histogram statistics is affected by the other two channels.
S2, respectively calculating the histogram information entropies of the red channel, the blue channel and the green channel; wherein, include:
calculating the histogram information entropy of the red channel:
P Ri probability of occurrence of ith gray scale in red channel;
calculating the histogram information entropy of the green channel:
P Gi is the probability of the ith gray level in the green channel;
calculating the information entropy of the blue channel histogram:
P Bi the probability of occurrence of the ith gray level in the blue channel.
Entropy R 、Entropy G 、Entropy B Respectively, R, G, B channel histogram information entropy (not information entropy statistics for the image itself or individual channels).
S3, carrying out weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel according to the histogram statistical result; weighting and fusing the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel:
Hist R histogram statistics for the red channel, hist G Histogram statistics for the green channel, hist B Is histogram statistic of blue channel, alpha R Taking a value according to the degree of dispersion of the gray level in the red channel, alpha G Taking a value according to the discrete degree of the gray scale in the green channel, alpha B And taking values according to the discrete degree of the gray scale in the blue channel. That is, α is an exponential parameter for representing the gray level distribution of the sub-pixels in each channel.
The alpha index parameter may be in accordance with Encopy R 、Entropy G 、Entropy B And (4) taking a value according to the dispersion degree, wherein the alpha index parameter can take a larger value when the dispersion degree is larger, and the alpha index parameter can take a smaller value otherwise. The calculation method can be, for example, the standard deviation (also commonly called mean square error) obtained by dividing the three values by the minimum value, but is not limited to this calculation method, and the standard deviation is a measure of the dispersion degree of the data mean. A large standard deviation, representing a large difference between the majority of the values and their mean values; a smaller standard deviation indicates that these values are closer to the mean. Referring to fig. 3, fig. 3 is an index parameter comparison diagram provided in the embodiment of the present invention, and the cumulative value histogram effect when the α index parameter takes values of 1, 3, and 5 is compared with the original cumulative value histogram. Wherein, the gray scales occupied by the alpha index parameter values of 1, 3 and 5 at the 50 gray scales are as follows in sequence: 152. 126, 103.
And S4, accumulating the histogram according to the weighted fusion result to obtain red channel mapping, blue channel mapping and green channel mapping, and outputting the adjusted image.
The method carries out single histogram statistics on R, G, B channels, carries out information entropy calculation on each channel histogram to obtain information characteristics of three channels, and finally carries out histogram weighted fusion through the information entropy characteristics of the three channels.
The image adjusting apparatus provided in the embodiment of the present invention has been described in detail in the embodiment of the image adjusting method, and reference may be made to part of the description of the embodiment of the method for relevant points. In addition, with the change of the use scene, the image adjusting method can also make corresponding adjustment, and the image adjusting device can also adopt different functional components to readjust. And will not be described in detail herein.
In addition, the present invention also provides a computer readable storage medium, on which computer instructions are stored, wherein the instructions are executed by a processor to implement the image adjusting method.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (9)
1. An image adjustment method, comprising:
extracting a red channel, a blue channel and a green channel of an image, and respectively carrying out histogram statistics on the red channel, the blue channel and the green channel;
respectively calculating the histogram information entropy of the red channel, the blue channel and the green channel;
carrying out weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel according to the histogram statistical result;
and accumulating the histogram according to the weighted fusion result to obtain red channel mapping, blue channel mapping and green channel mapping, thereby outputting the adjusted image.
2. The image adjustment method according to claim 1, wherein the calculating the histogram information entropies of the red channel, the blue channel and the green channel respectively comprises:
calculating the histogram information entropy of the red channel:
P Ri probability of occurrence of ith gray scale in red channel;
calculating the histogram information entropy of the green channel:
P Gi is the probability of the ith gray level in the green channel;
calculating the information entropy of the blue channel histogram:
P Bi is the probability of the ith gray occurrence in the blue channel.
3. The image adjustment method according to claim 2, wherein the weighted fusion of the histogram information entropy of the red channel, the histogram information entropy of the blue channel, and the histogram information entropy of the green channel according to the histogram statistic result includes:
carrying out weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel:
Hist R histogram statistics for the red channel, hist G Histogram statistics for the green channel, hist B Is histogram statistic of blue channel, alpha R Taking a value according to the degree of dispersion of the gray level in the red channel, alpha G Taking a value according to the discrete degree of the gray scale in the green channel, alpha B And taking values according to the discrete degree of the gray scale in the blue channel.
4. The image adjustment method according to claim 3, wherein α is R Is the standard deviation of the gray scale in the red channel, alpha G Is the standard deviation of the gray scale in the green channel, alpha B Is the standard deviation of the gray levels in the blue channel.
5. An image adjusting apparatus, comprising:
the statistical module is used for extracting a red channel, a blue channel and a green channel of an image and respectively carrying out histogram statistics on the red channel, the blue channel and the green channel;
the calculation module is used for respectively calculating the histogram information entropies of the red channel, the blue channel and the green channel;
the weighting module is used for carrying out weighting fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel and the histogram information entropy of the green channel according to the histogram statistical result;
and the mapping module is used for accumulating the histogram according to the weighting fusion result to obtain red channel mapping, blue channel mapping and green channel mapping so as to output the adjusted image.
6. The image adjusting apparatus according to claim 5, wherein the calculating means comprises:
and the red channel calculation sub-module is used for calculating the histogram information entropy of the red channel:
P Ri probability of occurrence of ith gray scale in red channel;
and the green channel calculation sub-module is used for calculating the histogram information entropy of the green channel:
P Gi is the probability of the ith gray level in the green channel;
the blue channel calculation submodule is used for calculating the information entropy of the blue channel histogram:
P Bi is the probability of the ith gray occurrence in the blue channel.
7. The image adjusting apparatus according to claim 6, wherein the weighting module performs weighted fusion on the histogram information entropy of the red channel, the histogram information entropy of the blue channel, and the histogram information entropy of the green channel:
Hist R histogram statistics for the red channel, hist G Histogram statistics for the green channel, hist B Is histogram statistic of blue channel, alpha R The value is taken according to the discrete degree of the gray level in the red channel, alpha G Taking values according to the discrete degree of the gray scale in the green channel, alpha B And taking values according to the discrete degree of the gray scale in the blue channel.
8. The image adjusting apparatus according to claim 7, wherein α is R Is the standard deviation of the gray level in the red channel, alpha G Is the standard deviation of the gray scale in the green channel, alpha B Is the standard deviation of the gray scale in the blue channel.
9. A computer-readable storage medium having computer instructions stored thereon, wherein the instructions, when executed by a processor, implement the image adjustment method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910711739.6A CN110633065B (en) | 2019-08-02 | 2019-08-02 | Image adjusting method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910711739.6A CN110633065B (en) | 2019-08-02 | 2019-08-02 | Image adjusting method and device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110633065A CN110633065A (en) | 2019-12-31 |
CN110633065B true CN110633065B (en) | 2022-12-06 |
Family
ID=68970286
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910711739.6A Active CN110633065B (en) | 2019-08-02 | 2019-08-02 | Image adjusting method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110633065B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104715465A (en) * | 2013-12-13 | 2015-06-17 | 厦门美图移动科技有限公司 | Image enhancement method with automatic contrast ratio adjustment |
CN107918928A (en) * | 2017-11-10 | 2018-04-17 | 中国科学院上海高等研究院 | A kind of color rendition method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104282002B (en) * | 2014-09-22 | 2018-01-30 | 厦门美图网科技有限公司 | A kind of quick beauty method of digital picture |
-
2019
- 2019-08-02 CN CN201910711739.6A patent/CN110633065B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104715465A (en) * | 2013-12-13 | 2015-06-17 | 厦门美图移动科技有限公司 | Image enhancement method with automatic contrast ratio adjustment |
CN107918928A (en) * | 2017-11-10 | 2018-04-17 | 中国科学院上海高等研究院 | A kind of color rendition method |
Also Published As
Publication number | Publication date |
---|---|
CN110633065A (en) | 2019-12-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100467610B1 (en) | Method and apparatus for improvement of digital image quality | |
US8472717B2 (en) | Foreground image separation method | |
CN109274985B (en) | Video transcoding method and device, computer equipment and storage medium | |
US20140254928A1 (en) | Method and image processing device for image dynamic range compression with local contrast enhancement | |
CN108446705A (en) | The method and apparatus of image procossing | |
CN110443800B (en) | Video image quality evaluation method | |
CN108806638B (en) | Image display method and device | |
CN111311513A (en) | Method and apparatus for unifying color styles of images and computer storage medium | |
CN110248170A (en) | Image color method of adjustment and device | |
CN111079637B (en) | Method, device, equipment and storage medium for segmenting rape flowers in field image | |
CN112541868A (en) | Image processing method, image processing device, computer equipment and storage medium | |
CN114723044B (en) | Error compensation method, device, chip and equipment for in-memory computing chip | |
CN111163301B (en) | Color adjustment method, device and computer readable storage medium | |
WO2022120799A9 (en) | Image processing method and apparatus, electronic device, and storage medium | |
CN110633065B (en) | Image adjusting method and device and computer readable storage medium | |
Fry et al. | Bridging the gap between imaging performance and image quality measures | |
CN115660997B (en) | Image data processing method and device and electronic equipment | |
WO2023284528A1 (en) | Image enhancement method and apparatus, computer device, and storage medium | |
CN114666584B (en) | Encoding method, device, equipment and medium based on high-frequency zero setting | |
CN109417616B (en) | Method and apparatus for image processing | |
Schaefer et al. | A hybrid color quantization algorithm incorporating a human visual perception model | |
CN115293989A (en) | Image enhancement method integrating MsRcR and automatic color gradation | |
KR20190058753A (en) | Image processing method and image processor performing the same | |
JP4486661B2 (en) | Dynamic contrast enhancement circuit and enhancement method | |
Zeggari et al. | Perceptual image quality assessment based on gradient similarity and Ruderman operator |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 9-2 Tangming Avenue, Guangming New District, Shenzhen City, Guangdong Province Applicant after: TCL Huaxing Photoelectric Technology Co.,Ltd. Address before: 9-2 Tangming Avenue, Guangming New District, Shenzhen City, Guangdong Province Applicant before: Shenzhen China Star Optoelectronics Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |