CN111292263A - Image enhancement method based on color correction and deblurring - Google Patents
Image enhancement method based on color correction and deblurring Download PDFInfo
- Publication number
- CN111292263A CN111292263A CN202010069967.0A CN202010069967A CN111292263A CN 111292263 A CN111292263 A CN 111292263A CN 202010069967 A CN202010069967 A CN 202010069967A CN 111292263 A CN111292263 A CN 111292263A
- Authority
- CN
- China
- Prior art keywords
- image
- channel
- deblurring
- contrast
- value
- 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
- 238000012937 correction Methods 0.000 title claims abstract description 45
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000011084 recovery Methods 0.000 claims abstract description 4
- 238000002834 transmittance Methods 0.000 claims description 11
- 238000001914 filtration Methods 0.000 claims description 2
- 230000000694 effects Effects 0.000 abstract description 4
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013441 quality evaluation Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 210000001525 retina Anatomy 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Of Color Television Signals (AREA)
- Picture Signal Circuits (AREA)
Abstract
The invention discloses an image enhancement method based on color correction and deblurring. The method effectively fuses two stages of color correction and deblurring. In the color correction stage, contrast stretching is firstly carried out on an original image, and in order to solve the problems of excessive contrast stretching or insufficient stretching and the like, the contrast and the color of the image are further optimized and adjusted by gamma correction according to the gray scale world prior, so that the gray scale average values of R, G, B channels of the image tend to be equal. Then, the method introduces a deblurring stage to enhance the details of the image, and uses a dark channel prior to deblurr the image after color correction to obtain a final enhanced image. The underwater image enhancement method provided by the invention has a good overall recovery effect, and can recover the detail information of the image while optimizing the overall contrast and color.
Description
Technical Field
The invention relates to an image enhancement method based on color correction and deblurring, in particular to a special enhancement mechanism for underwater images, and belongs to the technical field of image enhancement.
Background
With the rapid expansion of population and the increasing exhaustion of land resources, people have looked towards the ocean. The sea floor contains huge resources, which are considered by mankind as the "sixth continent" available. The development, utilization and protection of marine resources is a strategic deployment that is profoundly influenced. The theoretical technologies of acquisition, transmission, processing and the like of ocean information are important for reasonably developing, utilizing and protecting ocean resources. The underwater image is an important carrier of ocean information, and the phenomena of color cast (the lowest red light energy is absorbed firstly, so that the underwater image is usually blue-green), low contrast, blur, uneven illumination and the like often occur in the underwater image due to the fact that light is absorbed and scattered when being transmitted underwater. Therefore, the image obtained by people directly shooting at the seabed is usually a degraded image, and the degraded image cannot completely express ocean information and further cannot meet the actual application requirement.
As an increasingly popular research field, underwater image enhancement has wide application prospects in both the industrial and academic fields. The existing underwater image enhancement methods have certain limitations and are difficult to recover the chromaticity and the definition of an image. The enhanced image is too reddish as in the red channel prior algorithm proposed by Adrian Galdran et al; chongyi Li et al propose an algorithm based on minimum information loss and histogram distribution prior, and the enhanced image is too reddish too much; the underwater dark channel first-check algorithm proposed by p.l. drews et al, the enhanced image still turned to cyan, and the red component was not well recovered; the enhancement algorithm proposed by Shaobing Gao et al based on the adaptive retina mechanism has low image contrast and image details are lost after enhancement. Therefore, in order to better develop, utilize and protect ocean resources and meet the requirements of practical applications such as submarine archaeology, underwater robots and the like, an underwater image enhancement method capable of correcting color cast of an image and improving image definition is needed.
Disclosure of Invention
The invention aims to solve the technical problem of degradation of underwater image quality.
In order to solve the technical problems, the technical scheme of the invention is to provide an image enhancement method based on color correction and deblurring, which improves the overall recovery quality of an underwater image by performing color correction and deblurring in stages and mainly comprises the following steps:
the method comprises the following steps: respectively calculating the original image I according to the magnitude relation of the sum of the gray values of different channelsoriR, G, B minimum threshold for contrast stretchAnd a maximum threshold valuec represents one of the R, G, B three channels, i.e., c ∈ { R, G, B }.
Step two: according to a minimum threshold valueAnd a maximum threshold valueDetermining the stretched gray value range of different channels, and then comparing the original image IoriRespectively performing contrast stretching on each channel to obtain a contrast stretched image Ics。
Step three: base ofCalculating gamma correction coefficients gamma of different channels by gray scale world prior and dichotomyc. Firstly, respectively calculating the sum of gray values of each channel of the image after the contrast stretching, and recording the maximum value of the sum as maxval_csThen according to the formulaSolving for gamma by dichotomycM and n are the height and width of the image, respectively,is the ith gray value of a certain channel.
Step four: according to the obtained gamma correction coefficient gammacTo 1, paircsCarrying out gamma correction to obtain an image I after gamma correctiongm。
Step five: due to the image IgmThe problem of detail blurring exists, and the deblurring processing is further carried out. Using dark channel prior to carry out deblurring operation to obtain an image IgmIs provided with a dark channel
Step seven: from the dark channel and the background light, the transmittance t is calculatedc(x) (ii) a The transmittance is then further optimized using guided filtering.
Step eight: according to the formulaRestoring each image channel, where t0Is constant, thereby restoring a clear image.
Aiming at the problem of low quality of underwater images such as color cast, detail blur and the like, the method enhances the original image by stages, sequentially solves the problems of color cast and detail blur, and has the advantages of ring-to-ring buckling and gradual image improvement. In the color correction stage, contrast stretching is firstly carried out on different channels of the original image, and the stretching gray value range of different channels is different due to the improved contrast stretching operation. Since the image after stretching may have the case that the contrast is stretched excessively or stretched insufficiently, after the contrast stretching is completed, the gamma correction is adopted to adjust the global contrast and color, and the gamma correction coefficient is found based on the gray world prior. The method provided by the invention can correct the color cast of the image, improve the definition of the image and better give consideration to the overall contrast, color and detail information of the recovered image.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a flow chart of determining different channel minimum and maximum thresholds;
FIG. 3 is a flow chart for solving for gamma correction coefficients;
FIG. 4 is a comparison of an original underwater image and an enhanced image.
Detailed Description
In order to make the invention more comprehensible, preferred embodiments are described in detail below with reference to the accompanying drawings.
Examples
The present example uses the original underwater image (as shown in fig. 4) provided by Ancuti in 2012CVPR to illustrate the method of the present invention, and fig. 1 shows a flowchart of the method, and the specific implementation steps are as follows:
the method comprises the following steps: separately computing the original images IoriR, G, B minimum threshold for contrast stretchAnd a maximum threshold valuec represents one of the R, G, B three channels, i.e., c ∈ { R, G, B }. As shown in fig. 2, when contrast stretching is performed, in order to obtain a better stretching effect, it is necessary to determine the range of the stretched gradation value, and therefore, before contrast stretching, the stretching is performedThe minimum threshold and the maximum threshold of each channel are determined R, G, B first, and all gray values of each channel are sorted from small to large. Firstly, the sum of gray values of R, G, B channels of the original underwater image is obtained, and the result is expressed as sumR、sumG、sumB(ii) a Then find the maximum value of the three, maxval=max{sumR,sumG,sumB}. Since the underwater image is usually bluish green, maxvalThe value of (A) is generally sumGOr sumB. Therefore, it is necessary to perform processing separately by the following two modes:
mode I: if maxval=sumGIf the underwater image is greenish, the minimum threshold of the G channel is the gray value corresponding to 0.5% of the gray value of the G channel, and the maximum threshold of the G channel is the gray value corresponding to 99.5% of the gray value of the G channel; the minimum threshold value of the R channel is before the grey value of the R channelCorresponding gray value is located, and the maximum threshold value of the R channel is before the gray value of the R channelThe corresponding gray value; the minimum threshold of the B channel is before the grey value of the B channelCorresponding gray value is processed, and the maximum threshold value of the B channel is before the gray value of the B channelAnd the corresponding gray value is processed.
Mode II: if maxval=sumBIf the underwater image is blue, the minimum threshold of the B channel is the gray value corresponding to 0.5% of the gray value of the B channel, and the maximum threshold of the B channel is the gray value corresponding to 99.5% of the gray value of the B channel; the minimum threshold value of the R channel is before the grey value of the R channelCorresponding gray value is located, and the maximum threshold value of the R channel is before the gray value of the R channelThe corresponding gray value; the minimum threshold of the G channel is before the grey value of the G channelCorresponding gray value is located, and the maximum threshold value of the G channel is before the gray value of the G channelAnd the corresponding gray value is processed.
In this example, the image execution mode I used, calculated, G-channel minimum thresholdMaximum threshold of G channelMinimum threshold of R channelMaximum threshold of R channelB channel minimum thresholdB channel maximum threshold
Step two: and determining R, G, B the stretched gray value range of each channel according to the minimum threshold and the maximum threshold of different channel contrast stretching obtained in the step one.The ith gray value of a certain channel can be obtained according to the formula (1)Contrast stretched image
Step three: calculating gamma correction coefficient gammac. As shown in fig. 3, the solution of the gamma correction coefficients requires normalization of the image. The idea here to solve the gamma correction coefficients comes from the gray world prior: for an image with a large amount of color variation, the average gray value of R, G, B components tends to be the same gray value, i.e. the sum of the gray values of three channels should be approximately equal, so as to solve the gamma correction coefficients of different channels. First, the gray values of the R, G, B channels are summed separately for the image after contrast stretching, and the result is expressed as sumR_cs、sumG_cs、sumB_cs(ii) a Then, the maximum value max of the three is obtainedval_cs=max{sumR_cs,sumG_cs,sumB_cs}. Since there are three cases of the maximum value, the following three modes are introduced to process separately:
mode III: if maxval_cs=sumR_csThen, the gamma correction coefficient of the R channel is 1, the gamma correction coefficient of the G channel can be obtained according to equation (2), and the gamma correction coefficient of the B channel can be obtained according to equation (3). Equations (2) and (3) are nonlinear transcendental equations, and can be iteratively solved by using a dichotomy method, and when a certain solution enables the absolute value of the difference value between the left side and the right side of the equation to be less than 100, the solution is considered as the best approximate solution. In the following, the same solution is applied to the mode IV and the mode V, m and n are the height and width of the image,representing the ith gray value of a certain channel.
Mode IV: if maxval_cs=sumG_csThen, the gamma correction coefficient of the G channel is 1, the gamma correction coefficient of the R channel can be obtained according to equation (4), and the gamma correction coefficient of the B channel can be obtained according to equation (5).
And a mode V: if maxval_cs=sumB_csThe gamma correction coefficient of the B channel is 1, the gamma correction coefficient of the R channel can be obtained according to equation (6), and the gamma correction coefficient of the G channel can be obtained according to equation (7).
This example implements mode IV, i.e., the gamma correction coefficient for the G channel is 1; the image used in this example had a height of 384 and a width of 512, and according to equations (4) and (5), the gamma correction coefficient for the R channel was 0.5879 and the gamma correction coefficient for the B channel was 0.8223.
Step four: because the image after the contrast stretching may have the condition of over-stretching or under-stretching, after the contrast stretching, the gamma correction is continuously adopted to correct the global contrast and color, and the image after the gamma correction can be obtained according to the formula (8) and the gamma correction coefficients of different channels obtained in the step three
In the formula (8), A is a constant, and usually A is 1.
Step five: from this step, the deblurring phase is entered. Obtaining dark channel of gamma corrected image according to equation (9)
In expression (9), Ω (x) is a rectangular region having a size of 15 × 15 pixels with x as the center.
Step six: estimation of background light Ac. Selecting pixel points 0.1% before the gray value in the dark channel as candidate pixel points, then calculating the average gray value of the candidate pixel points on the R channel of the gamma corrected image, and marking the average gray value as AR(ii) a Calculating the average gray value of the candidate pixel points on the image G channel after gamma correction, and marking the average gray value as AG(ii) a Calculating the average gray value of the candidate pixel points on the image B channel after gamma correction, and marking the average gray value as AB. In this example, ARIs 245, AGIs 235, ABIs 211.
Step seven: calculating and optimizing the transmittance tc(x) In that respect Formula (10) represents the Jaffe-McGlamry imaging model, Jc(x) Representing clear images without fog, Ic(x) Representing a blurred image. Dark channel prior assumption according to hokeming: in most local areas of outdoor fog-free images, the grey value of at least one channel is very low, even approaching zero, whereby the transmission, J, is calculated according to equation (11)darkRepresenting a dark channel for a fog-free image.
Ic(x)=Jc(x)*tc(x)+Ac*(1-tc(x)) (10)
Jdark=minc(miny∈Ω(x)(Jc(y))≈0 (11)
Both sides of formula (10) are simultaneously divided by AcAnd calculating the minimum value on the local area of each channel to obtain the formula (12):
by substituting formula (11) for formula (12), we obtain:
in order to make the deblurred image more realistic, equation (13) is modified as follows:
in the above formula, ω is a constant and usually 0.95 is taken. The transmittance is obtained from the dark channel obtained in the equation (14), the dark channel obtained in the step five, and the backlight obtained in the step six, and the transmittance obtained at this time is a rough transmittance, and the rough transmittance is filtered by using the guide filter, so that the optimized transmittance is obtained.
Step eight: after obtaining the background light and the optimized transmittance, a solving formula of each channel of the clear image can be derived according to the formula (10):
in the above formula, t0Is constant, and takes a value of 0.1 here in order to prevent the denominator from being zero. And after recovering each image channel, obtaining a final clear image.
In order to illustrate the enhancement effect of the underwater image enhancement method provided by the invention, the original image in the example is scored for objective quality by using an underwater image quality evaluation criterion (UCIQE) provided by Miao Yang et al and an underwater image quality evaluation criterion (UIQM) provided by Karen Panetta et al, wherein the UCIQE score is 0.4263, and the UIQM score is 2.8302; the enhanced images obtained for this example were then scored using UCIQE criteria and UIQM criteria, with a UCIQE score of 0.7164 and a UIQM score of 5.0914. Compared with the UCIQE value and the UIQM value of the original image, the UCIQE value and the UIQM value of the enhanced image are both greatly improved. Fig. 4 is a subjective quality comparison diagram of the original underwater image and the enhanced image, the left image is the original underwater image, and the right image is the enhanced image, so that the visual effect is better in the aspects of color and definition. Compared with the quality of the original image, the quality of the enhanced image obtained by the embodiment is greatly improved, and the enhancement method provided by the invention has a good overall recovery effect.
Claims (1)
1. An image enhancement method based on color correction and deblurring, which improves the overall recovery quality of an underwater image by performing color correction and deblurring in stages, comprises the following steps:
the method comprises the following steps: respectively calculating the original image I according to the magnitude relation of the sum of the gray values of different channelsoriR, G, B minimum threshold for contrast stretchAnd a maximum threshold valuec represents one of the R, G, B three channels, i.e., c ∈ { R, G, B };
step two: according to a minimum threshold valueAnd a maximum threshold valueDetermining the stretched gray value range of different channels, and then comparing the original image IoriRespectively performing contrast stretching on each channel to obtain a contrast stretched image Ics;
Step three: based on gray scale world prior and dichotomy, calculating differenceGamma correction coefficient gamma of channelcFirstly, the sum of the gray values of each channel of the image after the contrast stretching is respectively calculated, and the maximum value of the three is recorded as maxval_csThen according to the formulaSolving for gamma by dichotomycM and n are the height and width of the image, respectively,is the ith gray value of a certain channel;
step four: according to the obtained gamma correction coefficient gammacTo 1, paircsCarrying out gamma correction to obtain an image I after gamma correctiongm;
Step five: due to the image IgmThe method further carries out deblurring treatment, uses dark channel prior to carry out deblurring operation to obtain an image IgmIs provided with a dark channel
Step seven: from the dark channel and the background light, the transmittance t is calculatedc(x) (ii) a Then further optimizing the transmittance using guided filtering;
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010069967.0A CN111292263B (en) | 2020-01-21 | 2020-01-21 | Image enhancement method based on color correction and deblurring |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010069967.0A CN111292263B (en) | 2020-01-21 | 2020-01-21 | Image enhancement method based on color correction and deblurring |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111292263A true CN111292263A (en) | 2020-06-16 |
CN111292263B CN111292263B (en) | 2022-11-04 |
Family
ID=71030707
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010069967.0A Active CN111292263B (en) | 2020-01-21 | 2020-01-21 | Image enhancement method based on color correction and deblurring |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111292263B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104601971A (en) * | 2014-12-31 | 2015-05-06 | 小米科技有限责任公司 | Color adjustment method and device |
CN107609603A (en) * | 2017-10-09 | 2018-01-19 | 济南大学 | A kind of image matching method of multiple color spaces difference fusion |
CN107705258A (en) * | 2017-09-19 | 2018-02-16 | 东华大学 | A kind of underwater picture Enhancement Method of three primary colours joint preequalization and deblurring |
CN107886486A (en) * | 2017-12-01 | 2018-04-06 | 天津大学 | Based on dark channel prior and variation Retinex underwater picture Enhancement Methods |
CN108469302A (en) * | 2018-06-13 | 2018-08-31 | 上海安翰医疗技术有限公司 | Color correction and test device |
-
2020
- 2020-01-21 CN CN202010069967.0A patent/CN111292263B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104601971A (en) * | 2014-12-31 | 2015-05-06 | 小米科技有限责任公司 | Color adjustment method and device |
CN107705258A (en) * | 2017-09-19 | 2018-02-16 | 东华大学 | A kind of underwater picture Enhancement Method of three primary colours joint preequalization and deblurring |
CN107609603A (en) * | 2017-10-09 | 2018-01-19 | 济南大学 | A kind of image matching method of multiple color spaces difference fusion |
CN107886486A (en) * | 2017-12-01 | 2018-04-06 | 天津大学 | Based on dark channel prior and variation Retinex underwater picture Enhancement Methods |
CN108469302A (en) * | 2018-06-13 | 2018-08-31 | 上海安翰医疗技术有限公司 | Color correction and test device |
Also Published As
Publication number | Publication date |
---|---|
CN111292263B (en) | 2022-11-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107767354B (en) | Image defogging algorithm based on dark channel prior | |
CN107507145B (en) | Underwater image enhancement method based on different color space self-adaptive histogram stretching | |
CN106157267B (en) | Image defogging transmissivity optimization method based on dark channel prior | |
CN105761227B (en) | Underwater picture Enhancement Method based on dark channel prior and white balance | |
CN108596853A (en) | Underwater picture Enhancement Method based on bias light statistical model and transmission map optimization | |
Park et al. | Sand-dust image enhancement using successive color balance with coincident chromatic histogram | |
CN108765342A (en) | A kind of underwater image restoration method based on improvement dark | |
CN109118446B (en) | Underwater image restoration and denoising method | |
CN104867121B (en) | Image Quick demisting method based on dark primary priori and Retinex theories | |
CN107705258B (en) | Underwater image enhancement method based on three-primary-color combined pre-equalization and deblurring | |
CN109816608B (en) | Low-illumination image self-adaptive brightness enhancement method based on noise suppression | |
CN111696052B (en) | Underwater image enhancement method and system based on red channel weakness | |
CN110689490A (en) | Underwater image restoration method based on texture color features and optimized transmittance | |
CN107424124B (en) | Image enhancement method and device | |
CN111861896A (en) | UUV-oriented underwater image color compensation and recovery method | |
CN107527325A (en) | A kind of monocular underweater vision Enhancement Method preferential based on dark | |
CN114463211A (en) | Underwater image enhancement method based on turbidity classification | |
CN114972102A (en) | Underwater image enhancement method based on global variable contrast enhancement and local correction | |
CN110930319A (en) | Underwater image sharpening method based on self-adaptive transmissivity estimation | |
CN117541520A (en) | Underwater image enhancement method of low-coupling Retinex model based on optimization algorithm | |
CN111292263B (en) | Image enhancement method based on color correction and deblurring | |
CN115660968A (en) | Low-illumination image enhancement method based on camera imaging principle | |
CN115760640A (en) | Coal mine low-illumination image enhancement method based on noise-containing Retinex model | |
CN115034985A (en) | Underwater image enhancement method | |
CN112907470A (en) | Underwater image recovery method based on Lab color gamut transformation, classification and white balance |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |