A color correction and naturalness restoration method for multiple images with uneven brightness
Through adaptive brightness improvement and contrast-enhanced illuminance components, combined with color consistency optimization and multi-band mixing, using Retinex theory and block Wallis transform, the problem of intensity difference between SAR images is solved and the visual quality and contrast of the image are improved.
Patent Information
- Application Number
- CN202410007322.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-01-03
AI Technical Summary
When the existing technology eliminates intensity differences between SAR images, it is difficult to take into account color consistency and image quality, resulting in poor visual effects after splicing.
Using a combination model, through adaptive brightness improvement and contrast-enhanced illuminance components, combined with color consistency optimization strategies and multi-band mixing, the Retinex theory is used to retain detailed information, and the intensity difference between images is further eliminated through block Wallis transformation.
It effectively eliminates color differences and intensity unevenness between images, improves the visual quality and contrast of images, and achieves uniform transition between images.
Smart Images

Figure CN117974502B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of color correction in image processing, and in particular to a method for color correction and naturalness restoration of multiple images with uneven brightness. Background Art
[0002] Synthetic aperture radar (SAR) is not affected by weather and can observe the earth all day and all weather. Therefore, this technology plays an important role in environmental monitoring, resource exploration, disaster assessment and other fields. When conducting large-scale analysis and research on SAR images, due to the limited coverage of a single image, it is usually necessary to seamlessly combine multiple images into a mosaic image. However, seasonal differences, radar wave signal attenuation, noise, and various gain errors can cause obvious intensity differences between images. Radiation inconsistency seriously reduces the visual quality of the stitched image. Therefore, an algorithm to eliminate the intensity difference between images is proposed, so that images at different times and in different regions have consistent intensity after stitching, which is extremely important in large-scale mapping, environmental monitoring and other fields.
[0003] However, most of the current color consistency optimization methods focus on eliminating significant intensity differences between SAR images, thus ignoring the issue of image enhancement. That is, when the visual quality of the original image is poor, these methods may not be able to produce visually appealing results. Some algorithms also propose to use image enhancement as a pre-processing or post-processing of global color correction. However, post-processing may destroy global color consistency, while pre-processing cannot guarantee the quality of the image after global color correction. Therefore, these algorithms cannot take into account both reducing color differences and improving image quality. To solve this problem, Li et al. adopted a global energy optimization framework to simultaneously optimize image contrast and color consistency. However, enhancing image contrast will inevitably amplify the color differences between images. Therefore, it is not easy for this method to set appropriate weights to balance the two. Summary of the invention
[0004] In view of the defects of the prior art, the present invention proposes a combined model to eliminate the global and local intensity differences, and uses the proposed fixed weight strategy to improve the result of multi-band mixing, thereby enhancing the effect of the block-based Wallis color uniformity method. At the same time, based on the Retinex theory, only the illumination component of the image is enhanced and the color consistency optimization is performed, which effectively retains the detail information of the image and achieves a uniform transition of intensity between images.
[0005] In order to achieve the above object, the present invention provides a method for color correction and naturalness restoration of multiple images with uneven brightness, comprising the following steps:
[0006] (1) Obtain at least two images to be processed, and decompose each of the images to be processed into illumination components and reflectivity component R;
[0007] (2) For each image to be processed, the illumination component Perform adaptive brightness improvement and contrast enhancement to obtain the enhanced illumination component To improve the naturalness of the illumination component;
[0008] (3) Using a color consistency optimization strategy to eliminate the illumination components of the multiple enhanced images to be processed The intensity difference between
[0009] (4) The illumination component of each optimized image to be processed is and its corresponding reflectivity component R are synthesized into an enhanced image;
[0010] (5) performing multi-band blending on all the enhanced images to generate a mosaic;
[0011] (6) Based on the mosaic, a block-by-block Wallis transform is used to further eliminate the intensity differences between the enhanced images to obtain each processed image.
[0012] Furthermore, in step 1, decomposing the image to be processed into an illumination component and a reflectivity component is specifically as follows:
[0013] (1.1) using Gaussian filtering to extract the low-frequency information LI of the image to be processed, that is, to obtain the illumination component;
[0014] (1.2) The result of Gaussian filtering the high-frequency information of the image to be processed is used as a weighted graph W. The weighted graph W is calculated as follows:
[0015] W(x,y)=(|I(x,y)-L I (x, y)|)*G(x, y)
[0016] Where: I(x, y) and L I (x, y) represent the image to be processed and the low-frequency information L of the image to be processed respectively. I The pixel value at point (x, y) on the image; G represents the convolution kernel used by the Gaussian filter;
[0017] (1.3) The weighted graph W is normalized based on the maximum and minimum values to generate a normalized weighted graph W N ;
[0018] (1.4) Based on the normalized weighted graph W N, and obtain the corrected illumination component
[0019]
[0020] (1.5) According to the corrected illumination component Obtaining a reflectivity component R of the image to be processed;
[0021]
[0022] Furthermore, in step 2, the adaptive brightness improvement of the illumination component of each image to be processed is specifically performed as follows:
[0023] A nonlinear function with self-adjusting parameters is used to improve the brightness of the image;
[0024]
[0025] α is calculated using the sigmoid function as follows:
[0026]
[0027] in: I max Represents the illumination component of the image to be processed The maximum value in I N is the illumination component of the image to be processed Normalized intensity image; is the illumination component after brightness improvement; is the value of the pixel located at (x, y) in the illumination component of the image to be processed after brightness improvement; α is an adaptive parameter.
[0028] Furthermore, the contrast enhancement of the illumination component of each of the images to be processed in step 2 is specifically performed as follows:
[0029] (2.1) Using context and gradient to construct the illumination component of the image to be processed after brightness improvement The histogram of , based on which the probability density function p is calculated o (·);
[0030] (2.2) Define the uniform probability density function p u (·);
[0031]
[0032] Where: l represents the gray level, and its value range is [0,255];
[0033] (2.3) Based on the probability density function po (·) and uniform probability density function p u (·) Get the final probability density function p r (·);
[0034] p r (l) = w·p o (l)+(1-w)·p u (l)
[0035] Where: w is the weight coefficient;
[0036] The calculation process of w is as follows:
[0037]
[0038]
[0039]
[0040] Where: h represents the size of the filter window;
[0041] (2.4) Calculate the final probability density function p r The cumulative distribution function c of (·) r (·);
[0042]
[0043] (2.5) According to the above cumulative distribution function, the enhanced illumination component of the image to be processed is obtained:
[0044]
[0045] in: Indicates rounding down.
[0046] Furthermore, in step 3, a color consistency optimization strategy is used to eliminate the illumination components of the multiple enhanced images to be processed. The strength differences between them are as follows:
[0047] (3.1) calculating two cumulative distribution functions in the overlapping area between two illumination components of all enhanced images to be processed;
[0048] (3.2) Take the equal probability quantiles of the two cumulative distribution functions as the color correspondence, and construct the color term based on this color correspondence;
[0049]
[0050] in: and represents the illumination component of the image to be processed after the i-th and j-th enhancements; K represents the number of extracted color correspondences; ||·||2 represents the L2 norm; represents the k-th probability quantile of two cumulative distribution functions; f i is the color remapping function;
[0051] (3.3) Based on the M anchor points of the color remapping function, construct a regularization term;
[0052]
[0053] in: is the coordinate of the anchor point of the color remapping function;
[0054] (3.4) According to the color term and the regularization term, a cost function is obtained;
[0055]
[0056]
[0057] (3.5) Based on the convex quadratic programming, the cost function is solved and the color remapping function f is solved. i , for the illumination component Perform color correction.
[0058] Furthermore, in step 4, the illumination component of each color-corrected image to be processed is multiplied by its corresponding reflectivity component to generate an enhanced image.
[0059] Furthermore, in step 5, multi-band mixing is performed on all the enhanced images to generate a mosaic image, specifically:
[0060] (5.1) calculating the Gaussian pyramid of the first and second enhanced images;
[0061] (5.2) calculating the Laplacian pyramid of the first and second enhanced images according to the Gaussian pyramid;
[0062] (5.3) for each layer of the Laplacian pyramid of the first and second enhanced images, determine the weights of pixels in the overlapping area between the images at the same layer by a weight determination strategy;
[0063] (5.4) performing weighted fusion on the images at the same layer based on the weights of the above pixels; then upsampling the fused images at each layer to the same size as the fused images at the zeroth layer, and finally superimposing all the upsampling results and the fused images at the zeroth layer together to generate a mosaic of the first and second enhanced images;
[0064] (5.5) If there are other enhanced images, the mosaic of the first and second enhanced images and the third enhanced image are used as the new first and second enhanced images, and weighted fusion is performed according to steps (5.1) to (5.4), and so on, until all the enhanced images are mosaicked together to obtain the final mosaic of the enhanced images.
[0065] Furthermore, the weight determination strategy is specifically as follows:
[0066] (5.3.1) Assume that the size of the overlapping area of the two images is M*N. Starting from the 0th row of pixels in the overlapping area, the column indices of pixels with non-zero values are recorded in order from left to right until all rows of pixels are processed; the column indices of adjacent non-zero pixels in each row of pixels form a set, and n sets are obtained;
[0067]
[0068] Where: p j >q j-1 +1,j∈{2,3,…,n};x i , p i ,q i They are all column indexes; i represents the i-th set; n represents the number of sets;
[0069] (5.3.2) Determine the weights of pixels in the rth row whose values are not zero according to the following method;
[0070] Assume that condition 1 is p i =0 or I(r, p i -1)=0; condition 2 is q i =N or I(r,q i +1)=0;
[0071] Where: I(r, p i -1) is the pth row in the rth row i -1 column of pixels; I(r,q i +1) is the qth row in the rth row i +1 column of pixels;
[0072] a) If both condition 1 and condition 2 are met, the column index is in the interval [p i ,qi The weight distribution of pixels in ] is:
[0073]
[0074] b) If condition 1 is met and condition 2 is not met, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is:
[0075] W(x i )=(x i -p i ) / l
[0076] c) If condition 2 is met and condition 1 is not met, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is:
[0077] W(x i )=1-(x i -p i ) / l
[0078] d) If neither condition 1 nor condition 2 is true, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is:
[0079]
[0080] Where: l = q i -p i , t=(p i +q i ) / 2.
[0081] (5.3.3) Starting from the 0th column of pixels in the overlapping area, the row indexes of pixels with non-zero values are recorded in order from top to bottom until all columns of pixels are processed; the weights of pixels with non-zero values in each column of pixels are determined by the method in step (5.3.2);
[0082] (5.3.4) Add the weights determined in step (5.3.2) and step (5.3.3) and take the average, and use this average as the weight of the pixel.
[0083] Furthermore, in step 6, based on the mosaic, a block-by-block Wallis transform is used to further eliminate the intensity difference between the enhanced images, specifically:
[0084] (6.1) For each enhanced image, find its corresponding range in the mosaic to obtain its corresponding reference image; use Gaussian filtering to process the reference image and the enhanced image to decompose them into high-frequency and low-frequency information respectively;
[0085] (6.2) using the same image block division strategy to perform block processing on the low-frequency information of the reference image and the enhanced image and calculate the mean and standard deviation of each image block;
[0086] (6.3) calculating the statistics of the four corner points of each of the image blocks and using bilinear interpolation to calculate the statistics of each pixel in each of the image blocks based on the statistics of the four corner points of the image blocks;
[0087] (6.4) performing a Wallis transform on each pixel in the low-frequency information of the enhanced image based on the statistics of each pixel, so as to eliminate obvious intensity differences between the low-frequency information;
[0088]
[0089] Where: I in (r, c) and I out (r, c) are the pixel values at the midpoint (r, c) of the low-frequency information of the enhanced image and the low-frequency information of the enhanced image after transformation; the mean values of the low-frequency information of the enhanced image and the low-frequency information of the reference image are m in and m r , and the standard deviations are s in and r ;
[0090] (6.5) Superimposing the transformed low-frequency information of the enhanced image with its corresponding high-frequency information to generate a final result image.
[0091] Beneficial effects of the present invention:
[0092] In terms of eliminating local color differences, the present invention proposes a weighting strategy for multi-band mixing and improves the effect of the block-based Wallis color uniformity method using the results of multi-band mixing. Experimental results show that this method effectively eliminates obvious seams between images. At the same time, based on the Retinex theory, image enhancement and color consistency optimization are performed only on the illumination component of the image, effectively retaining the detailed information of the image. The combination of the two eliminates global and local intensity differences and achieves a uniform transition of intensity between images. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 The figure is a schematic diagram of the overall structure of a method for color correction and naturalness restoration of multiple images with uneven brightness according to an embodiment of the present invention.
[0094] Figure 2 A schematic diagram of a weighting strategy according to an embodiment of the present invention.
[0095] Among them: (a) is the overlapping area of two images; (b), (c), (d) and (e) are four cases of pixel weight distribution.
[0096] Figure 3 FIG. 4 is a schematic diagram of the experimental results of an embodiment of the present invention on 402 Sentinel-1 images.
[0097] Among them: (a) original image; (b) and (c) are images generated using CCGP (color correction with gradient preservation) and CACCC (contrast-aware color consistency correction), respectively; (d) image generated by the present invention. DETAILED DESCRIPTION
[0098] The specific implementation of the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0099] like Figure 1 As shown, the present invention provides a method for color correction and naturalness restoration of multiple images with uneven brightness. First, the image to be processed is decomposed into an illumination component and a reflectance component. Secondly, the illumination component is adaptively improved in brightness and contrast enhanced to improve the naturalness of the illumination component. Then, a color consistency optimization strategy is adopted to eliminate the intensity difference between the illumination components. Next, the reflectance component and the optimized illumination component are synthesized into an enhanced image. After that, these images are multi-band mixed to generate a mosaic. Finally, based on the mosaic, a block-based Wallis transform is used to further eliminate the intensity difference between the enhanced images. Based on the Retinex theory, this method only performs color consistency optimization and contrast enhancement on the illumination component of the image, thereby improving the contrast of the image while eliminating the global intensity difference. In addition, this method uses multi-band mixing and block-based Wallis transform to effectively reduce the local color difference between images, thereby eliminating the obvious seams between images.
[0100] The specific implementation steps are as follows:
[0101] S101, obtaining at least two images to be processed, and decomposing each of the images to be processed into illumination components and reflectivity component R;
[0102] (1) Use Gaussian filtering to extract the low-frequency information L of the image to be processed I , that is, the illumination component is obtained.
[0103] (2) The result of Gaussian filtering of the high-frequency information of the image to be processed is used as the weighted graph W. The calculation of the weighted graph W is as follows:
[0104] W(x,y)=(|I(x,y)-L I (x, y)|*G(x, y)
[0105] Where: I(x, y) and L I (x, y) represent the image to be processed and the low-frequency information L of the image to be processed respectively. I The pixel value at point (x, y) on the graph; G represents the convolution kernel used by the Gaussian filter.
[0106] (3) Normalize the weighted graph W based on the maximum and minimum values to generate the normalized weighted graph W N ;
[0107] (4) Based on the normalized weighted graph W N , and obtain the corrected illumination component
[0108]
[0109] (5) According to the corrected illumination component Obtaining the reflectivity component R of the image to be processed;
[0110]
[0111] S102: for each image to be processed, the illumination component Perform adaptive brightness improvement and contrast enhancement to obtain the enhanced illumination component To improve the naturalness of the illumination component;
[0112] (1) For each image to be processed, the illumination component The specific steps for improving adaptive brightness are as follows:
[0113] The following nonlinear function with self-adjusting parameters is used to improve the brightness of the image.
[0114]
[0115] in: I max Represents the illumination component of the image to be processed The maximum value in I N is the illumination component of the image to be processed Normalized intensity image; is the illumination component after brightness improvement; is the value of the pixel at (x, y) in the illumination component of the image to be processed after brightness improvement; α is an adaptive parameter, which is calculated using the sigmoid function, as follows:
[0116]
[0117] (2) Contrast enhancement of the illumination component of each image to be processed is specifically performed as follows:
[0118] (2.1) Using context and gradient to construct the illumination component of the image to be processed after brightness improvement The histogram of , based on which the probability density function p is calculated o (·).
[0119] (2.2) Define the uniform probability density function p u (·);
[0120]
[0121] Where: l represents the gray level, and its value range is [0,255].
[0122] (2.3) Based on the probability density function p o (·) and uniform probability density function p u (·) Get the final probability density function p r (·);
[0123] p r (l) = w·p o (l)+(1-w)·p u (l)
[0124] Where: w is the weight coefficient;
[0125] The calculation process of w is as follows:
[0126]
[0127]
[0128]
[0129] Where: h represents the size of the filter window.
[0130] (2.4) Calculate the final probability density function p r The cumulative distribution function c of (·) r (·);
[0131]
[0132] (2.5) According to the above cumulative distribution function, the illumination component of the enhanced image to be processed is obtained:
[0133]
[0134] in: Indicates rounding down.
[0135] S103: Using a color consistency optimization strategy to eliminate the illumination components of the multiple enhanced images to be processed The intensity difference between
[0136] (1) Calculate two cumulative distribution functions in the overlapping area between the illumination components of the enhanced image to be processed.
[0137] (2) taking the equal probability quantiles of the two cumulative distribution functions as the color correspondence, and constructing the color term based on this color correspondence;
[0138]
[0139] in: and represents the illumination component of the i-th and j-th enhanced images to be processed; K represents the number of extracted color correspondences; ||·||2 represents the L2 norm; represents the k-th probability quantile of two cumulative distribution functions; f i is the color remapping function;
[0140] (3) constructing a regularization term based on the M anchor points of the color remapping function;
[0141]
[0142] in: The coordinates of the anchor point for the color remapping function.
[0143] (4) Obtain the cost function based on the color term and the regularization term;
[0144]
[0145]
[0146] (5) Solving the cost function based on convex quadratic programming, based on the solved color remapping function f i , contrast component Perform color correction.
[0147] S104: Optimize the illumination component of each image to be processed and its corresponding reflectivity component R are synthesized into an enhanced image;
[0148] S105, performing multi-band mixing on all the enhanced images to generate a mosaic;
[0149] (1) Calculate the Gaussian pyramids of the first and second enhanced images.
[0150] The first and second enhanced images A and B are processed with a Gaussian kernel of size 5×5 to construct a 5-layer Gaussian pyramid, where each layer has only one image, and the results are recorded as and
[0151] (2) Based on the Gaussian pyramid, calculate the Laplacian pyramid of the first and second enhanced images.
[0152] The Laplacian pyramid of the image is calculated according to the following formula:
[0153]
[0154] The results are recorded as: and
[0155] (3) For each layer of the Laplacian pyramid of the first and second enhanced images, the weights of the pixels in the overlapping area between the images at the same layer are determined by a weight determination strategy.
[0156] The specific weighting strategy is:
[0157] (3.1) Assume that the size of the overlapping area of the two images is M*N (e.g. Figure 2 (a), starting from the 0th row of pixels in the overlapping area, the column indices of pixels with non-zero values are recorded in order from left to right until all rows of pixels are processed; the column indices of adjacent non-zero pixels in each row of pixels form a set, and n sets are obtained;
[0158]
[0159] Where: p j >q j-1 +1,j∈{2,3,…,n};x i , p i ,q i They are all column indices; i represents the i-th set; n represents the number of sets.
[0160] For example, the column indices of the pixels in row 0 whose values are not zero are: 6, 7, 8, 9, 25, 26, 27, 29, 30, 31. Then there are three sets: {6, 7, 8, 9}, {25, 26, 27}, {29, 30, 31}.
[0161] (3.2) Determine the weights of the pixels whose values are not zero in the r-th row of pixels according to the following method;
[0162] Assume that condition 1 is p i =0 or I(r, p i -1)=0; condition 2 is q i =N or I(r,q i +1)=0;
[0163] Where: I(r, p i -1) is the pth row in the rth row i -1 column of pixels; I(r,q i +1) is the qth row in the rth row i +1 column of pixels;
[0164] a) If both condition 1 and condition 2 are met, the column index is in the interval [p i ,q i The weight distribution of the pixels in ] is (as Figure 2 (b)):
[0165]
[0166] b) If condition 1 is met and condition 2 is not met, the column index is in the interval [p i ,q i The weight distribution of the pixels in ] is (as Figure 2 (c)):
[0167] W(x i )=(x i -p i ) / l
[0168] c) If condition 2 is met and condition 1 is not met, the column index is in the interval [p i ,q i The weight distribution of the pixels in ] is (as Figure 2 (d) as shown below:
[0169] W(x i )=1-(x i -p i ) / l
[0170] d) If neither condition 1 nor condition 2 is true, the column index is in the interval [p i ,q iThe weight distribution of the pixels in ] is (as Figure 2 (e) as shown below):
[0171]
[0172] Where: l = q i -p i , t=(p i +q i ) / 2.
[0173] (3.3) Starting from the 0th column of pixels in the overlapping area, the row indices of pixels with non-zero values are recorded in order from top to bottom until all column pixels are processed; the weights of pixels with non-zero values in each column of pixels are determined using the method in step (3.2) in the same way.
[0174] (3.4) Add the weights determined in step (3.2) and step (3.3) and take the average, and use this average as the weight of the pixel.
[0175] (4) Based on the weights of the above pixels, the images at the same layer are weighted fused; then the fused images at each layer are upsampled to the same size as the fused images at the zeroth layer, and finally all the upsampled results and the fused images at the zeroth layer are superimposed together to generate a mosaic of the first and second enhanced images.
[0176] (5) If there are other enhanced images, the mosaic of the first and second enhanced images and the third enhanced image are used as the new first and second enhanced images, and weighted fusion is performed according to steps (1) to (4), and so on, until all enhanced images are mosaicked together to obtain a final mosaic of enhanced images.
[0177] Subsequent images are weighted fused with the previous mosaic in sequence until all enhanced images are weighted fused to obtain the final enhanced image mosaic.
[0178] S106 , based on the mosaic, using a block-by-block Wallis transform to further eliminate intensity differences between the enhanced images, to obtain each processed image to be processed.
[0179] (1) For each enhanced image, find its corresponding range in the mosaic to obtain its corresponding reference image; use Gaussian filtering to process the reference image and the enhanced image and decompose them into high-frequency and low-frequency information respectively.
[0180] (2) The same image block division strategy is used to divide the low-frequency information of the reference image and the enhanced image into blocks and calculate the mean and standard deviation of each image block.
[0181] (3) Calculating the statistics of the four corner points of each of the image blocks and using bilinear interpolation to calculate the statistics of each pixel in each image block based on the statistics of the four corner points of the image blocks.
[0182] (4) Based on the statistics of each pixel, Wallis transform is performed on each pixel in the low-frequency information of the enhanced image to eliminate the obvious intensity difference between the low-frequency information;
[0183]
[0184] Where: I in (r, c) and I out (r, c) are the pixel values at the midpoint (r, c) of the low-frequency information of the enhanced image and the low-frequency information of the transformed enhanced image respectively; the mean values of the low-frequency information of the enhanced image and the low-frequency information of the reference image are m in and m r , and the standard deviations are s in and r .
[0185] (5) Superimposing the low-frequency information of the transformed enhanced image with its corresponding high-frequency information to generate the final result image.
[0186] The experimental results are as follows Figure 3 As shown in the figure. The gray box in the figure marks the area with significant color difference and low contrast. The indicators for evaluating the performance of various algorithms are: CD (Color Distance), AG (Average Gradient) and PCQI (Patch-based Contrast Quality Index). The indicators CD and PCQI are described in detail below.
[0187] The indicator CD is used to evaluate the effect of various methods in eliminating color differences between images. The smaller the CD value, the smaller the color difference between images. Its formula is as follows:
[0188]
[0189] In the formula Represents image I p with I q The kth color correspondence between . K represents the number of color correspondences, which is usually set to 16. and Respectively represent the overlapping area I pq and I qp The probability of the cumulative distribution function is the k / (K+1) quantile. pqIndicates that it is located in image I p In and Image I q Overlapping area. qp Represents similar meaning.
[0190] The PCQI index is used to compare the contrast changes and structural similarities of two images. In other words, the PCQI value can measure the contrast enhancement and structural similarity of the result image relative to the original image. The higher the PCQI value, the better the image quality. The formula is as follows:
[0191]
[0192] Here, both images X and Y are divided into N non-overlapping patches. i and i are patches located at the same position in image x and Y respectively. c (x i ,y i ) is used to evaluate patch x i Relative to patch y i The degree of contrast enhancement. s (x i ,y i ) is used to compare the structural similarity between patches.
[0193] After comparing with the two existing algorithms, it is found that the method proposed in the present invention performs best in terms of performance. The specific data are shown in the following table:
[0194]
[0195] Although specific embodiments of the present invention are described above, those skilled in the art should understand that these are merely examples and that various changes or modifications may be made to these embodiments without departing from the principles and essence of the present invention. Therefore, the scope of protection of the present invention is limited by the appended claims.
Claims
1. A method for color correction and naturalness restoration of multiple images with uneven brightness, characterized in that: The steps include: (1) Obtain at least two images to be processed, and decompose each of the images to be processed into illumination components and reflectivity component R; (2) For each image to be processed, the illumination component Perform adaptive brightness improvement and contrast enhancement to obtain the enhanced illumination component To improve the naturalness of the illumination component; (3) Using a color consistency optimization strategy to eliminate the illumination components of the multiple enhanced images to be processed The intensity difference between (4) The illumination component of each optimized image to be processed is and the corresponding reflectivity component R are synthesized into an enhanced image; (5) performing multi-band blending on all the enhanced images to generate a mosaic; (5.1) calculating the Gaussian pyramid of the first and second enhanced images; (5.2) calculating the Laplacian pyramid of the first and second enhanced images according to the Gaussian pyramid; (5.3) for each layer of the Laplacian pyramid of the first and second enhanced images, determine the weights of pixels in the overlapping area between the images at the same layer by a weight determination strategy; (5.4) performing weighted fusion on the images at the same layer based on the weights of the above pixels; then upsampling the fused images at each layer to the same size as the fused images at the zeroth layer, and finally superimposing all the upsampling results and the fused images at the zeroth layer together to generate a mosaic of the first and second enhanced images; (5.5) If there are other enhanced images, the mosaic of the first and second enhanced images and the third enhanced image are used as new first and second enhanced images, and weighted fusion is performed according to steps (5.1) to (5.4), and so on, until all the enhanced images are mosaicked together to obtain a final mosaic of the enhanced images; (6) Based on the mosaic, a block-by-block Wallis transform is used to further eliminate the intensity differences between the enhanced images to obtain each processed image.
2. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 1, characterized in that: In the step (1), the image to be processed is decomposed into an illumination component and a reflectivity component as follows: (1.1) Using Gaussian filtering to extract the low-frequency information L of the image to be processed I , that is, the illumination component is obtained; (1.2) The result of Gaussian filtering the high-frequency information of the image to be processed is used as a weighted graph W. The weighted graph W is calculated as follows: W(x,y)=(|I(x,y)-L I (x,y)|)*G(x,y) Where: I(x, y) and L I (x, y) represent the image to be processed and the low-frequency information L of the image to be processed respectively. I The pixel value at point (x, y) on the image; G represents the convolution kernel used by the Gaussian filter; (1.3) The weighted graph W is normalized based on the maximum and minimum values to generate a normalized weighted graph W N ; (1.4) Based on the normalized weighted graph W N , and obtain the corrected illumination component (1.5) According to the corrected illumination component Obtaining a reflectivity component R of the image to be processed; 3. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 1, characterized in that: The adaptive brightness improvement of the illumination component of each image to be processed in step (2) is specifically performed as follows: A nonlinear function with self-adjusting parameters is used to improve the brightness of the image; α is calculated using the sigmoid function as follows: in: I max Represents the illumination component of the image to be processed The maximum value in I N is the illumination component of the image to be processed Normalized intensity image; is the illumination component after brightness improvement; is the value of the pixel located at (x, y) in the illumination component of the image to be processed after brightness improvement; α is an adaptive parameter.
4. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 3, characterized in that: The contrast enhancement of the illumination component of each image to be processed in step (2) is specifically performed as follows: (2.1) Using context and gradient to construct the illumination component of the image to be processed after brightness improvement The histogram of , based on which the probability density function p is calculated o (·); (2.2) Define the uniform probability density function p u (·); Where: l represents the gray level, and its value range is [0, 255]; (2.3) Based on the probability density function p o (·) and uniform probability density function p u (·) Get the final probability density function p r (·); p r (l)=w·p o (l)+(1-w)·p u (l) Where: w is the weight coefficient; The calculation process of w is as follows: Where: h represents the size of the filter window; (2.4) Calculate the final probability density function p r The cumulative distribution function c of (·) r (·); (2.5) According to the above cumulative distribution function, the enhanced illumination component of the image to be processed is obtained: in: Indicates rounding down.
5. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 1, characterized in that: In the step (3), a color consistency optimization strategy is used to eliminate the illumination components of the multiple enhanced images to be processed. The strength differences between them are as follows: (3.1) calculating two cumulative distribution functions in the overlapping area between two illumination components of all enhanced images to be processed; (3.2) Take the equal probability quantiles of the two cumulative distribution functions as the color correspondence, and construct the color term based on this color correspondence; in: and represents the illumination component of the image to be processed after the i-th and j-th enhancements; K represents the number of extracted color correspondences; ||·||2 represents the L2 norm; represents the k-th probability quantile of two cumulative distribution functions; f i is the color remapping function; (3.3) Based on the M anchor points of the color remapping function, construct a regularization term; in: is the coordinate of the anchor point of the color remapping function; (3.4) According to the color term and the regularization term, a cost function is obtained; (3.5) Based on the convex quadratic programming, the cost function is solved and the color remapping function f is solved. i , for the illumination component Perform color correction.
6. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 1, characterized in that: In the step (4), the illumination component of each color-corrected image to be processed is multiplied by its corresponding reflectivity component to generate an enhanced image.
7. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 1, characterized in that: The weight determination strategy is specifically as follows: (5.3.1) Assume that the size of the overlapping area of the two images is M*N. Starting from the 0th row of pixels in the overlapping area, the column indices of pixels with non-zero values are recorded in order from left to right until all rows of pixels are processed; the column indices of adjacent non-zero pixels in each row of pixels form a set, and n sets are obtained; Where: p j >q j-1 +1,j∈{2,3,…,n};x i , p i ,q i They are all column indexes; i represents the i-th set; n represents the number of sets; (5.3.2) Determine the weights of the pixels in the rth row whose values are not zero according to the following method; Assume that condition 1 is p i =0 or I(r, p i -1)=0; condition 2 is q i =N or I(r,q i +1)=0; Where: I(r, p i -1) is the pth row in the rth row i -1 column of pixels; I(r,q i +1) is the qth row in the rth row i +1 column of pixels; a) If both condition 1 and condition 2 are met, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is: b) If condition 1 is met and condition 2 is not met, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is: W(x i )=(x i -p i ) / l c) If condition 2 is met and condition 1 is not met, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is: W(x i )=1-(x i -p i ) / l d) If neither condition 1 nor condition 2 is true, the column index is in the interval [p i ,q i The weight distribution of pixels in ] is: Where: l = q i -p i , t=(p i +q i ) / 2; (5.3.3) Starting from the 0th column of pixels in the overlapping area, the row indexes of pixels with non-zero values are recorded in order from top to bottom until all columns of pixels are processed; the weights of pixels with non-zero values in each column of pixels are determined by the method in step (5.3.2); (5.3.4) Add the weights determined in step (5.3.2) and step (5.3.3) and take the average, and use this average as the weight of the pixel.
8. The method for color correction and naturalness restoration of multiple images with uneven brightness according to claim 1, characterized in that: In step (6), based on the mosaic, a block-by-block Wallis transform is used to further eliminate the intensity difference between the enhanced images, specifically: (6.1) For each enhanced image, find its corresponding range in the mosaic to obtain its corresponding reference image; use Gaussian filtering to process the reference image and the enhanced image to decompose them into high-frequency and low-frequency information respectively; (6.2) using the same image block division strategy to perform block processing on the low-frequency information of the reference image and the enhanced image and calculate the mean and standard deviation of each image block; (6.3) calculating the statistics of the four corner points of each of the image blocks and using bilinear interpolation to calculate the statistics of each pixel in each of the image blocks based on the statistics of the four corner points of the image blocks; (6.4) performing a Wallis transform on each pixel in the low-frequency information of the enhanced image based on the statistics of each pixel, so as to eliminate obvious intensity differences between the low-frequency information; Where: I in (r, c) and I out (r, c) are the pixel values at the midpoint (r, c) of the low-frequency information of the enhanced image and the low-frequency information of the enhanced image after transformation; the mean values of the low-frequency information of the enhanced image and the low-frequency information of the reference image are m in and m r , and the standard deviations are s in and r ; (6.5) Superimposing the transformed low-frequency information of the enhanced image with its corresponding high-frequency information to generate a final result image.
