CN110633065A - 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
- CN110633065A CN110633065A CN201910711739.6A CN201910711739A CN110633065A CN 110633065 A CN110633065 A CN 110633065A CN 201910711739 A CN201910711739 A CN 201910711739A CN 110633065 A CN110633065 A CN 110633065A
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 230000004927 fusion Effects 0.000 claims abstract description 21
- 238000013507 mapping Methods 0.000 claims abstract description 20
- 238000004364 calculation method Methods 0.000 claims description 12
- 239000006185 dispersion Substances 0.000 claims description 8
- 241001270131 Agaricus moelleri Species 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Analysis (AREA)
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 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. 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, the mixed histogram statistics is performed on the gray scale values of the three channels of the image R, G, B, and when the input image has an obvious dominant hue, the histogram statistics is affected by the other two channels, so that the histogram statistics occupies a larger gray scale range. If the original image 50 is down to gray level, pixels will occupy about 164 gray levels when the blend histogram statistics is performed at R, G, B for three channel gray level values, which will suppress the image detail for the dominant tone channel.
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 adjustment 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:
PRiprobability of occurrence of ith gray scale in red channel;
calculating the histogram information entropy of the green channel:
PGiis the probability of the ith gray level in the green channel;
calculating the information entropy of the blue channel histogram:
PBiis the probability of the ith gray occurrence 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:
HistRhistogram statistics for the red channel, HistGHistogram statistics for the green channel, HistBIs histogram statistic of blue channel, alphaRTaking a value according to the degree of dispersion of the gray level in the red channel, alphaGTaking a value according to the discrete degree of the gray scale in the green channel, alphaBAnd taking values according to the discrete degree of the gray scale in the blue channel.
In the image adjusting method of the present invention, αRIs the standard deviation of the gray level in the red channel, alphaGIs the standard deviation of the gray scale in the green channel, alphaBIs 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 the 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:
PRiprobability 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:
PGiis 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:
PRiis 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:
HistRhistogram statistics for the red channel, HistGHistogram statistics for the green channel, HistBIs histogram statistic of blue channel, alphaRTaking a value according to the degree of dispersion of the gray level in the red channel, alphaGTaking a value according to the discrete degree of the gray scale in the green channel, alphaBAnd taking values according to the discrete degree of the gray scale in the blue channel.
In the image adjusting apparatus of the present invention, αRIs the standard deviation of the gray level in the red channel, alphaGIs the standard deviation of the gray scale in the green channel, alphaBIs 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 adjustment method according to an embodiment of the present invention, where the image adjustment method includes steps S1-S4:
s1, extracting a red channel, a blue channel and a green channel of the 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:
PRiprobability of occurrence of ith gray scale in red channel;
calculating the histogram information entropy of the green channel:
PGiis the probability of the ith gray level in the green channel;
calculating the information entropy of the blue channel histogram:
PBiis the probability of the ith gray occurrence in the blue channel.
EntropyR、EntropyG、EntropyBRespectively representing 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:
HistRhistogram statistics for the red channel, HistGHistogram statistics for the green channel, HistBIs histogram statistic of blue channel, alphaRTaking a value according to the degree of dispersion of the gray level in the red channel, alphaGTaking a value according to the discrete degree of the gray scale in the green channel, alphaBAnd 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 EncopyR、EntropyG、EntropyBAnd (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 is, for example, the standard deviation (also commonly called the mean square error) of the three divided by the minimum, but is not limited to this calculation method, and the standard deviation is a measure of the dispersion degree of the mean value of a set of data. 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 a red channel mapping, a blue channel mapping and a green channel mapping, and outputting the adjusted image.
According to the invention, individual histogram statistics is carried out on R, G, B channels, information entropy calculation is carried out on each channel histogram to obtain information characteristics of three channels, and finally histogram weighted fusion is carried out 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 above 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:
PRiprobability of occurrence of ith gray scale in red channel;
calculating the histogram information entropy of the green channel:
PGiis the probability of the ith gray level in the green channel;
calculating the information entropy of the blue channel histogram:
PBiis 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:
HistRhistogram statistics for the red channel, HistGHistogram statistics for the green channel, HistBIs histogram statistic of blue channel, alphaRTaking a value according to the degree of dispersion of the gray level in the red channel, alphaGTaking a value according to the discrete degree of the gray scale in the green channel, alphaBAccording to grey scale in blue channelAnd taking values according to the discrete degree.
4. The image adjustment method according to claim 3, wherein α isRIs the standard deviation of the gray level in the red channel, alphaGIs the standard deviation of the gray scale in the green channel, alphaBIs the standard deviation of the gray scale 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 the 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.
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:
PRiprobability 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:
PGiis 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:
PBiis 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:
HistRhistogram statistics for the red channel, HistGHistogram statistics for the green channel, HistBIs histogram statistic of blue channel, alphaRTaking a value according to the degree of dispersion of the gray level in the red channel, alphaGTaking a value according to the discrete degree of the gray scale in the green channel, alphaBAnd 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 α isRIs the standard deviation of the gray level in the red channel, alphaGIs the standard deviation of the gray scale in the green channel, alphaBIs 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 true CN110633065A (en) | 2019-12-31 |
CN110633065B 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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104715465A (en) * | 2013-12-13 | 2015-06-17 | 厦门美图移动科技有限公司 | Image enhancement method with automatic contrast ratio adjustment |
US20160086355A1 (en) * | 2014-09-22 | 2016-03-24 | Xiamen Meitu Technology Co., Ltd. | Fast face beautifying method for digital images |
CN107918928A (en) * | 2017-11-10 | 2018-04-17 | 中国科学院上海高等研究院 | A kind of color rendition method |
-
2019
- 2019-08-02 CN CN201910711739.6A patent/CN110633065B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104715465A (en) * | 2013-12-13 | 2015-06-17 | 厦门美图移动科技有限公司 | Image enhancement method with automatic contrast ratio adjustment |
US20160086355A1 (en) * | 2014-09-22 | 2016-03-24 | Xiamen Meitu Technology Co., Ltd. | Fast face beautifying method for digital images |
CN107918928A (en) * | 2017-11-10 | 2018-04-17 | 中国科学院上海高等研究院 | A kind of color rendition method |
Also Published As
Publication number | Publication date |
---|---|
CN110633065B (en) | 2022-12-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Ma et al. | Objective quality assessment for color-to-gray image conversion | |
CN109274985B (en) | Video transcoding method and device, computer equipment and storage medium | |
JP7508135B2 (en) | IMAGE PROCESSING METHOD, IMAGE PROCESSING APPARATUS, ELECTRONIC DEVICE, AND COMPUTER PROGRAM | |
CN108446705B (en) | Method and apparatus for image processing | |
US20140254928A1 (en) | Method and image processing device for image dynamic range compression with local contrast enhancement | |
CN112541868B (en) | Image processing method, device, computer equipment and storage medium | |
KR20040022011A (en) | Method and apparatus for improvement of digital image quality | |
WO2013055492A1 (en) | Use of noise-optimized selection criteria to calculate scene white points | |
CN108806638B (en) | Image display method and device | |
CN112150368A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
CN110310231B (en) | Device and method for converting first dynamic range video into second dynamic range video | |
KR20190073516A (en) | Image processing apparatus, digital camera, image processing program, and recording medium | |
WO2022120799A9 (en) | Image processing method and apparatus, electronic device, and storage medium | |
CN111385437B (en) | Image device and burn-in prevention method | |
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 | |
CN111667418B (en) | Method and apparatus for image processing | |
CN114390266B (en) | Image white balance processing method, device and computer readable storage medium | |
CN108805852B (en) | Method and device for evaluating image spatial noise | |
CN111317426A (en) | Endoscope parameter self-adaptive adjusting method and device | |
CN113891081A (en) | Video processing method, device and equipment | |
CN105631812B (en) | Control method and control device for color enhancement of display image | |
CN109996017B (en) | Image adjusting method and terminal thereof |
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 China Star Optoelectronics 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 |