Wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement method and device
Through the wavelet domain bilateral cumulative probability segmentation technology, the contradiction between image brightness maintenance and contrast enhancement in the prior art is solved, and the image contrast and detail presentation ability is improved while maintaining the consistent image brightness.
Patent Information
- Application Number
- CN202010325785.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-23
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2040-04-23
AI Technical Summary
The existing wavelet histogram equalization method has a contradiction between image brightness maintenance and contrast enhancement, and it is difficult to keep image brightness consistent and improve contrast at the same time, resulting in unclear image details.
The image enhancement method of bilateral accumulation probability segmentation in the wavelet domain is adopted. The wavelet coefficient enhancement process is performed by wavelet decomposition and segmentation of the wavelet histogram, and the enhanced image is output through the wavelet inverse transformation.
It realizes the ability to improve image contrast and detail presentation while maintaining consistent image brightness, and is suitable for consumer electronic products and infrared image processing systems.
Smart Images

Figure CN113112436B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image contrast enhancement, and in particular to a wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement method and device. Background Art
[0002] Global wavelet histogram equalization is one of the commonly used methods for digital image enhancement. Although its algorithm is simple to implement, it is not suitable for image processing fields that require high image brightness. This is because in the wavelet histogram equalization enhancement process, the change in the average brightness of the image before and after image enhancement is too high. In addition, the grayscale is merged, which often leads to the deterioration of the quality of the enhanced image and a large amount of information loss. In some image processing fields (such as consumer electronics and infrared image processing systems), on the one hand, the brightness of the processed image must be kept good with that of the input image, and on the other hand, the processed image must have a good contrast and clear details. In fact, brightness maintenance and contrast enhancement are mutually constrained issues. In other words, if the processed image is required to be consistent with the input image in brightness, the contrast of the enhanced image will be small, the details will be difficult to highlight, and the image visual perception will be unclear. In order to accurately maintain the brightness of the input image, brightness maintenance often makes the output image unable to achieve good contrast enhancement or local over-enhancement, and vice versa. Summary of the invention
[0003] The present invention aims to provide a wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement method and device that overcomes one of the above problems or at least partially solves any of the above problems.
[0004] To achieve the above object, the technical solution of the present invention is specifically implemented as follows:
[0005] On one hand, the present invention provides an image enhancement method of bilateral cumulative probability segmentation, comprising:
[0006] S1, using the db series wavelet base db1 wavelet to perform a layer of wavelet decomposition on the input image I, and obtain the low-frequency sub-image ca, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd;
[0007] S2, rounding the low-frequency sub-image ca to obtain the rounded low-frequency sub-image ca1, and calculating the maximum value Mca of the rounded low-frequency sub-image ca1;
[0008] S3, determine the frequency of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1 in [0, Mca], and obtain the wavelet histogram h, length Mca;
[0009] S4, get the wavelet histogram calculation formula Calculate the probability of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1, where i is the wavelet coefficient, i = 0, 1, 2...Mca, h is the frequency of each wavelet coefficient, set the new low-frequency sub-graph ca2 to be the same as the low-frequency sub-graph ca, and set the value to a zero matrix;
[0010] S5, set the initial value of the segmentation cumulative probability cdfPR, set the variable array hx of the wavelet histogram with the segmentation length Mca, set the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients, set the initial value of the segmentation variable px, where the segmentation variable px varies in the range [0,1];
[0011] S6, cyclically calculating the first cumulative probability cdfp1 from the first preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the first cumulative probability cdfp1 is: Loop variable i=1:Mca, when the first cumulative probability cdfp1 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented first wavelet histogram array hx1;
[0012] S7, cyclically calculating the second cumulative probability cdfp2 from the second preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the second cumulative probability cdfp2 is: Loop variable i=Mca:-1:1, when the second cumulative probability cdfp2 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented second wavelet histogram array hx2, where L is the total number of wavelet coefficients, and the first preset direction is opposite to the second preset direction;
[0013] S8, update the variable array hx, where the variable array hx = hx1 + hx2, update the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients, where Determine whether the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px. If the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px, set cdfPR=cdfPR+preset value, and return to step S6. Otherwise, stop the loop operation until the first wavelet histogram array hx1 and the second wavelet histogram array hx2 are obtained, in which the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is greater than or equal to the initial value of the segmentation variable px, and execute step S9.
[0014] S9, calculating the remaining third wavelet histogram array hx3, where hx3=h-hx1-hx2;
[0015] S10, remove all non-zero elements of the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, set the common processing array Hx to place the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, and set idx to place the wavelet coefficient indexes of the corresponding wavelet histograms respectively;
[0016] S11, calculate the new wavelet coefficients for the common processing array Hx according to the following formula:
[0017]
[0018] Where i = 1...length(Hx), PX, CPX are the probability and cumulative probability of the common processing array Hx respectively; f(i) is the new wavelet coefficient of the new low-frequency sub-image ca2, and P1 is the adjustment parameter of image details, brightness, and contrast;
[0019] S12, performing wavelet reconstruction on the new low-frequency sub-image ca2, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd to obtain a reconstructed image I1;
[0020] S13, using the formula Convert the reconstructed image I1 to the grayscale display range of [0,255] and output a new enhanced image imageout.
[0021] The value range of P1 is [0,1].
[0022] Among them, P1=0.1.
[0023] The first preset direction is from left to right, and the second preset direction is from right to left.
[0024] Among them, the initial value of the segmentation cumulative probability cdfPR is 0.01, the initial value of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients p0 is 0, the initial value of the segmentation variable px is 0.5, and the preset value is 0.01.
[0025] Another aspect of the present invention provides an image enhancement device for bilateral cumulative probability segmentation, comprising:
[0026] A decomposition module is used to perform a layer of wavelet decomposition on the input image I using the db series wavelet base db1 wavelet to obtain a low-frequency sub-image ca, a first high-frequency sub-image ch, a second high-frequency sub-image cv and a third high-frequency sub-image cd;
[0027] A first calculation module is used to round the low-frequency sub-image ca to obtain the rounded low-frequency sub-image ca1, and calculate the maximum value Mca of the rounded low-frequency sub-image ca1;
[0028] A determination module is used to determine the frequency of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1 in [0, Mca] to obtain a wavelet histogram h with a length of Mca;
[0029] The second calculation module is used to obtain the wavelet histogram calculation formula Calculate the probability of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1, where i is the wavelet coefficient, i = 0, 1, 2...Mca, h is the frequency of each wavelet coefficient, set the new low-frequency sub-graph ca2 to be the same as the low-frequency sub-graph ca, and set the value to a zero matrix;
[0030] The setting module is used to set the initial value of the segmentation cumulative probability cdfPR, set the variable array hx of the wavelet histogram with the segmentation length Mca, set the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients, and set the initial value of the segmentation variable px, where the segmentation variable px varies in the range [0,1];
[0031] The third calculation module is used to cyclically calculate the first cumulative probability cdfp1 from the first preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the first cumulative probability cdfp1 is: Loop variable i=1:Mca, when the first cumulative probability cdfp1 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented first wavelet histogram array hx1;
[0032] The fourth calculation module is used to cyclically calculate the second cumulative probability cdfp2 from the second preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the second cumulative probability cdfp2 is: Loop variable i=Mca:-1:1, when the second cumulative probability cdfp2 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented second wavelet histogram array hx2, where L is the total number of wavelet coefficients, and the first preset direction is opposite to the second preset direction;
[0033] An updating module is used to update the variable array hx, where the variable array hx=hx1+hx2, and to update the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients, where Determine whether the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px. If the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px, set cdfPR=cdfPR+preset value, and return to step S6. Otherwise, stop the loop operation until the first wavelet histogram array hx1 and the second wavelet histogram array hx2 are obtained, in which the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is greater than or equal to the initial value of the segmentation variable px, and execute step S9.
[0034] The fifth calculation module is used to calculate the remaining third wavelet histogram array hx3, where hx3=h-hx1-hx2;
[0035] A placement module is used to remove all non-zero elements of the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, set the common processing array Hx to place the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, and set idx to place the wavelet coefficient indexes of the corresponding wavelet histograms respectively;
[0036] The sixth calculation module is used to calculate the new wavelet coefficients for the common processing array Hx according to the following formula:
[0037]
[0038] Where i = 1...length(Hx), PX, CPX are the probability and cumulative probability of the common processing array Hx respectively; f(i) is the new wavelet coefficient of the new low-frequency sub-image ca2, and P1 is the adjustment parameter of image details, brightness, and contrast;
[0039] A reconstruction module is used to perform wavelet reconstruction on the new low-frequency sub-image ca2, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd to obtain a reconstructed image I1;
[0040] Output module for using formula Convert the reconstructed image I1 to the grayscale display range of [0,255] and output a new enhanced image imageout.
[0041] The value range of P1 is [0,1].
[0042] Among them, P1=0.1.
[0043] The first preset direction is from left to right, and the second preset direction is from right to left.
[0044] Among them, the initial value of the segmentation cumulative probability cdfPR is 0.01, the initial value of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients p0 is 0, the initial value of the segmentation variable px is 0.5, and the preset value is 0.01.
[0045] It can be seen that the wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement method and device provided by the embodiment of the present invention, in the image wavelet domain (i.e., frequency domain), based on the wavelet histogram, can automatically segment the wavelet histogram of the low-frequency sub-image of the input image into three block wavelet histograms according to the characteristics of the input image, perform wavelet coefficient enhancement processing in each block, merge the wavelet low-frequency sub-images, and finally output the enhanced image through the inverse wavelet transform, thereby improving the output image detail presentation capability and noise resistance capability under the condition that the brightness of the input and output images are basically consistent for consumer electronic products and infrared image processing images. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. The accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0047] Figure 1 A flowchart of a method for image enhancement by bilateral cumulative probability segmentation and brightness preservation in wavelet domain provided by an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of the structure of a wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement device provided by an embodiment of the present invention;
[0049] Figure 3 A low-contrast image provided by an embodiment of the present invention - Einstein schematic diagram;
[0050] Figure 4 A low-brightness image-landscape schematic diagram provided by an embodiment of the present invention;
[0051] Figure 5 A schematic diagram of an infrared image provided by an embodiment of the present invention;
[0052] Figure 6 A schematic diagram of a plum blossom, a high-brightness image, provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0054] The invention provides a wavelet domain bilateral cumulative probability segmentation brightness preservation image enhancement method, which utilizes the wavelet histogram cumulative probability forward and reverse segmentation technology in the wavelet domain to segment the wavelet low-frequency sub-image into three wavelet histograms for processing. The algorithm balances the contradiction between brightness preservation and contrast enhancement to the greatest extent, minimizes the brightness error between the output image and the input image, and can achieve image contrast enhancement and clearly present image details. The method can be applied to consumer electronic product images and infrared image processing systems with high brightness preservation requirements.
[0055] Figure 1 FIG. 1 is a flowchart of a method for image enhancement in which bilateral cumulative probability segmentation and brightness preservation in wavelet domain is provided in an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a wavelet domain bilateral cumulative probability segmentation brightness preservation image enhancement method, comprising:
[0056] S1, use the db series wavelet base db1 wavelet to perform a layer of wavelet decomposition on the input image I to obtain a low-frequency sub-image ca, a first high-frequency sub-image ch, a second high-frequency sub-image cv and a third high-frequency sub-image cd.
[0057] Specifically, the input image I is decomposed into one layer of wavelet using the db1 wavelet in the db series wavelet base to obtain a low-frequency sub-image ca and three high-frequency sub-images ch, cv, and cd.
[0058] S2, rounding the low-frequency sub-image ca to obtain the rounded low-frequency sub-image ca1, and calculating the maximum value Mca of the rounded low-frequency sub-image ca1.
[0059] Specifically, the low-frequency sub-image ca is rounded to an integer, and the new sub-image after rounding is ca1, and the maximum value of ca1 is calculated as Mca.
[0060] S3, determining the frequency of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1 in [0, Mca], and obtaining a wavelet histogram h with a length of Mca.
[0061] Specifically, the frequency of occurrence of each wavelet coefficient of ca1 is counted in [0, Mca] (ie, wavelet histogram), the wavelet histogram is h, and the length is Mca.
[0062] S4, get the wavelet histogram calculation formula Calculate the probability of occurrence of each wavelet coefficient of the rounded low-frequency sub-image ca1, where i is the wavelet coefficient, i=0,1,2···Mca, h is the frequency of each wavelet coefficient, and set the new low-frequency sub-image ca2 to be the same as the low-frequency sub-image ca, and set the value to the zero matrix.
[0063] Specifically, using the formula Calculate the probability of occurrence of each wavelet coefficient of ca1, where i = 0·1·2···Mca, set the new low-frequency sub-image ca2 to the same size as ca, and set the value to zero matrix.
[0064] S5, sets the initial value of the segmentation cumulative probability cdfPR, sets the variable array hx of the wavelet histogram with the segmentation length Mca, sets the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients, and sets the initial value of the segmentation variable px, where the segmentation variable px varies in the range [0,1].
[0065] Specifically, in order to facilitate subsequent calculations, the initial value of the segmentation cumulative probability cdfPR is set in advance, the variable array hx of the wavelet histogram with the segmentation length Mca is set, the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients is set, and the initial value of the segmentation variable px is set.
[0066] As an optional implementation of the present invention, the initial value of the segmentation cumulative probability cdfPR is 0.01, the initial value of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the rounded low-frequency sub-graph ca1 is 0, the initial value of the segmentation variable px is 0.5, and the preset value is 0.01. That is, in the specific implementation, the initial value of the segmentation cumulative probability cdfPR can be set to 0.01, the segmented wavelet histogram can be set to the variable array hx(Mca,1) of length Mca, the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the sub-graph ca1, that is, The initial value p0=0, the initial value of the segmentation variable px=0.5, and the px variable range is [0,1].
[0067] S6, cyclically calculating the first cumulative probability cdfp1 from the first preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the first cumulative probability cdfp1 is: The loop variable i=1:Mca, when the first cumulative probability cdfp1 is greater than the initial value of the segmentation cumulative probability cdfPR, the loop is exited and the segmented first wavelet histogram array hx1 is recorded at the same time.
[0068] As an optional implementation of the embodiment of the present invention, the first preset direction is from left to right. In a specific implementation, the cumulative probability cdfp1 is calculated cyclically from the left side to the right side of the probability wavelet histogram p(i) of the low-frequency sub-image ca1, The loop variable i=1:Mca. When the condition cdfp1>cdfPR is met, the loop is exited and the segmented wavelet histogram array hx1(Mca,1) is recorded.
[0069] S7, cyclically calculating the second cumulative probability cdfp2 from the second preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the second cumulative probability cdfp2 is: The loop variable i=Mca:-1:1. When the second cumulative probability cdfp2 is greater than the initial value of the segmentation cumulative probability cdfPR, the loop is exited and the segmented second wavelet histogram array hx2 is recorded, where L is the total number of wavelet coefficients and the first preset direction is opposite to the second preset direction.
[0070] As an optional implementation of the embodiment of the present invention, the second preset direction is from right to left. In a specific implementation, the cumulative probability cdfp2 is calculated cyclically from the right side to the left side (ie, in the reverse direction) of the probability wavelet histogram p(i) of the low-frequency sub-image ca1. The loop variable i=Mca:-1:1, when the condition cdfp2>cdfPR is met, the loop is exited and the segmented wavelet histogram array hx2(Mca,1) is recorded.
[0071] S8, update the variable array hx, where the variable array hx = hx1 + hx2, update the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients, where Determine whether the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px. If the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px, set cdfPR=cdfPR+preset value and return to step S6. Otherwise, stop the loop operation until the first wavelet histogram array hx1 and the second wavelet histogram array hx2 are obtained, in which the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is greater than or equal to the initial value of the segmentation variable px, and execute step S9.
[0072] As an optional implementation of the embodiment of the present invention, the preset value is 0.01.
[0073] In the specific implementation, update hx=hx1+hx2, The judgment condition is p0<px. If p0 is less than px, then cdfPR=cdfPR+0.01, and the process returns to steps S6 and S7 to continue the calculation. Otherwise, the loop operation is stopped.
[0074] S9, calculate the remaining third wavelet histogram array hx3, where hx3=h-hx1-hx2.
[0075] Specifically, through the above steps S6-S8, the segmented wavelet histograms hx1 and hx2 that meet the conditions are found, and then the remaining wavelet histogram hx3=h-hx1-hx2 is calculated.
[0076] S10, remove all non-zero elements of the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, set the common processing array Hx to place the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, and set idx to place the wavelet coefficient indexes of the corresponding wavelet histograms.
[0077] Specifically, all non-zero elements of hx1, hx2 and hx3 are removed, and the common processing arrays Hx and idx are set, that is, Hx=hx1(hx1>0), idx=find(hx1>0), Hx=hx2(hx2>0), idx=find(hx2>0), Hx=hx3(hx3>0), idx=find(hx3>0), idx is used to place the wavelet coefficient index of the corresponding wavelet histogram.
[0078] S11, calculate the new wavelet coefficients for the common processing array Hx according to the following formula:
[0079]
[0080] Where i=1...length(Hx), PX, CPX are the probability and cumulative probability of the common processing array Hx respectively; f(i) is the new wavelet coefficient of the new low-frequency sub-image ca2, and P1 is the adjustment parameter of image details, brightness and contrast.
[0081] As an optional implementation of the embodiment of the present invention, the value range of P1 is [0,1]. Preferably, P1=0.1. P1 can be changed as needed, and P1 can finely adjust the contrast and information entropy of the image. In the actual calculation process, selecting 0.1 can simplify the calculation and increase the calculation speed.
[0082] S12, performing wavelet reconstruction on the new low-frequency sub-image ca2, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd to obtain a reconstructed image I1.
[0083] Specifically, the new low-frequency sub-image ca2 is reconstructed with ch, cv, and cd by wavelet, and the reconstructed image is I1.
[0084] S13, using the formula Convert the reconstructed image I1 to the grayscale display range of [0,255] and output a new enhanced image imageout.
[0085] It can be seen that the wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement method provided by the embodiment of the present invention is based on the wavelet histogram in the image wavelet domain (i.e., frequency domain). The present invention can automatically segment the wavelet histogram of the low-frequency sub-image of the input image into three block wavelet histograms according to the characteristics of the input image, perform wavelet coefficient enhancement processing in each block, merge the wavelet low-frequency sub-images, and finally output the enhanced image through the inverse wavelet transform, thereby improving the output image detail presentation capability and noise resistance capability under the condition that the brightness of the input and output images are basically consistent for consumer electronic products and infrared image processing images.
[0086] Figure 2 The schematic diagram of the structure of the image enhancement device for wavelet domain bilateral cumulative probability segmentation and brightness preservation provided by an embodiment of the present invention is shown. The image enhancement device for wavelet domain bilateral cumulative probability segmentation and brightness preservation provided by an embodiment of the present invention is applied to the above method. The following is only a summary of the structure of the image enhancement device for wavelet domain bilateral cumulative probability segmentation and brightness preservation. For other matters not covered, please refer to the relevant description in the above wavelet domain bilateral cumulative probability segmentation and brightness preservation image enhancement method. Figure 2 The image enhancement device for wavelet domain bilateral cumulative probability segmentation and brightness preservation provided by the embodiment of the present invention comprises:
[0087] A decomposition module is used to perform a layer of wavelet decomposition on the input image I using the db series wavelet base db1 wavelet to obtain a low-frequency sub-image ca, a first high-frequency sub-image ch, a second high-frequency sub-image cv and a third high-frequency sub-image cd;
[0088] A first calculation module is used to round the low-frequency sub-image ca to obtain the rounded low-frequency sub-image ca1, and calculate the maximum value Mca of the rounded low-frequency sub-image ca1;
[0089] A determination module is used to determine the frequency of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1 in [0, Mca] to obtain a wavelet histogram h with a length of Mca;
[0090] The second calculation module is used to obtain the wavelet histogram calculation formula Calculate the probability of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1, where i is the wavelet coefficient, i = 0, 1, 2...Mca, h is the frequency of each wavelet coefficient, set the new low-frequency sub-graph ca2 to be the same as the low-frequency sub-graph ca, and set the value to a zero matrix;
[0091] The setting module is used to set the initial value of the segmentation cumulative probability cdfPR, set the variable array hx of the wavelet histogram with the segmentation length Mca, set the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients, and set the initial value of the segmentation variable px, where the segmentation variable px varies in the range [0,1];
[0092] The third calculation module is used to cyclically calculate the first cumulative probability cdfp1 from the first preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the first cumulative probability cdfp1 is: Loop variable i=1:Mca, when the first cumulative probability cdfp1 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented first wavelet histogram array hx1;
[0093] The fourth calculation module is used to cyclically calculate the second cumulative probability cdfp2 from the second preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the second cumulative probability cdfp2 is: Loop variable i=Mca:-1:1, when the second cumulative probability cdfp2 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented second wavelet histogram array hx2, where L is the total number of wavelet coefficients, and the first preset direction is opposite to the second preset direction;
[0094] An updating module is used to update the variable array hx, where the variable array hx=hx1+hx2, and to update the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-graph ca1 wavelet coefficients, where Determine whether the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px. If the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px, set cdfPR=cdfPR+preset value, and return to step S6. Otherwise, stop the loop operation until the first wavelet histogram array hx1 and the second wavelet histogram array hx2 are obtained, in which the ratio p0 of the total number of low-frequency wavelet coefficients of the segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is greater than or equal to the initial value of the segmentation variable px, and execute step S9.
[0095] The fifth calculation module is used to calculate the remaining third wavelet histogram array hx3, where hx3=h-hx1-hx2;
[0096] A placement module is used to remove all non-zero elements of the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, set the common processing array Hx to place the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, and set idx to place the wavelet coefficient indexes of the corresponding wavelet histograms respectively;
[0097] The sixth calculation module is used to calculate the new wavelet coefficients for the common processing array Hx according to the following formula:
[0098]
[0099] Where i = 1...length(Hx), PX, CPX are the probability and cumulative probability of the common processing array Hx respectively; f(i) is the new wavelet coefficient of the new low-frequency sub-image ca2, and P1 is the adjustment parameter of image details, brightness, and contrast;
[0100] A reconstruction module is used to perform wavelet reconstruction on the new low-frequency sub-image ca2, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd to obtain a reconstructed image I1;
[0101] Output module for using formula Convert the reconstructed image I1 to the grayscale display range of [0,255] and output a new enhanced image imageout.
[0102] As an optional implementation of the embodiment of the present invention, the value range of P1 is [0, 1].
[0103] As an optional implementation of the embodiment of the present invention, P1=0.1.
[0104] As an optional implementation manner of the embodiment of the present invention, the first preset direction is from left to right, and the second preset direction is from right to left.
[0105] As an optional implementation of an embodiment of the present invention, the initial value of the segmentation cumulative probability cdfPR is 0.01, the initial value of the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients is 0, the initial value of the segmentation variable px is 0.5, and the preset value is 0.01.
[0106] It can be seen that the wavelet domain bilateral cumulative probability segmentation brightness-preserving image enhancement device provided by the embodiment of the present invention is based on the wavelet histogram in the image wavelet domain (i.e., frequency domain). The present invention can automatically segment the wavelet histogram of the low-frequency sub-image of the input image into three block wavelet histograms according to the characteristics of the input image, perform wavelet coefficient enhancement processing in each block, merge the wavelet low-frequency sub-images, and finally output the enhanced image through the inverse wavelet transform, thereby improving the output image detail presentation capability and noise resistance capability under the condition that the brightness of the input and output images are basically consistent for consumer electronic products and infrared image processing images.
[0107] The following is a specific example to further illustrate the wavelet domain bilateral cumulative probability segmentation brightness preservation image enhancement method provided by the embodiment of the present invention:
[0108] In the implementation process of the invention, the effect enhancement image is P1=0.1, px=0.5, such as Figure 3 , 4 , 5, and 6.
[0109] In order to better illustrate the positive effects of the present invention, the GHE, BBHE, BHEPL, BHEMHE, MMBEBHE and other algorithms are compared with the present invention in terms of running time, average brightness error (ABME), peak signal-to-noise ratio (PSNR) and other indicators. The data is the average value of processing 20 images. The data table is shown in Table 1.
[0110] GHE BBHE BHEMHE BHEPL MMBEBHE The present invention Time(s) 0.32 0.3934 0.3948 0.4026 1.2258 0.5934 ABME 43.29 13.39 15.79 6.11 4.7129 3.15 E(bit) 6.9949 7.0126 6.9980 7.13 7.0056 7.32 PSNR(dB) 14.57 20.94 19.54 25.46 25.4284 26.28
[0111] Table 1
[0112] From Table 1, it can be seen that the running speed of the present invention is almost the same as that of the classic global wavelet histogram (GHE) algorithm, and the average brightness error (ABME) is the smallest, indicating that the image enhanced by the present invention is basically consistent with the input image in brightness; at the same time, the peak signal-to-noise ratio (PSNR) and information entropy values of the image processed by the present invention are the highest, indicating that the present invention is optimal in noise suppression and information detail compared with other methods.
[0113] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A bilateral cumulative probability segmentation image enhancement method, characterized in that: include: S1, using the db series wavelet base db1 wavelet to perform a layer of wavelet decomposition on the input image I, and obtain the low-frequency sub-image ca, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd; S2, rounding the low-frequency sub-image ca to obtain a rounded low-frequency sub-image ca1, and calculating a maximum value Mca of the rounded low-frequency sub-image ca1; S3, determining the frequency of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1 in [0, Mca], and obtaining a wavelet histogram h with a length of Mca; S4, get the wavelet histogram calculation formula Calculate the probability of occurrence of each wavelet coefficient of the rounded low-frequency sub-image ca1, where i is the wavelet coefficient, i=0, 1, 2...Mca, h is the frequency of each wavelet coefficient, set the new low-frequency sub-image ca2 to be the same as the low-frequency sub-image ca, and set the value to a zero matrix; S5, set the initial value of the segmentation cumulative probability cdfPR, set the variable array hx of the wavelet histogram with the segmentation length Mca, set the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the rounded low-frequency sub-graph ca1, and set the initial value of the segmentation variable px, wherein the segmentation variable px varies in the range [0,1]; S6, cyclically calculating a first cumulative probability cdfp1 from a first preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the first cumulative probability cdfp1 is: Loop variable i=1:Mca, when the first cumulative probability cdfp1 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented first wavelet histogram array hx1; S7, cyclically calculating a second cumulative probability cdfp2 from a second preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the second cumulative probability cdfp2 is: Loop variable i=Mca:-1:1, when the second cumulative probability cdfp2 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented second wavelet histogram array hx2, where L is the total number of wavelet coefficients, and the first preset direction is opposite to the second preset direction; S8, update the variable array hx, wherein the variable array hx=hx1+hx2, update the ratio p0 of the total number of the segmented low-frequency wavelet coefficients to the total number of the rounded low-frequency sub-image ca1 wavelet coefficients, wherein, Determine whether the ratio p0 of the total number of low-frequency wavelet coefficients of the segmentation to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px; if the ratio p0 of the total number of low-frequency wavelet coefficients of the segmentation to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px, set cdfPR=cdfPR+preset value, and return to step S6; otherwise, stop the loop operation until the first wavelet histogram array hx1 and the second wavelet histogram array hx2 are obtained in which the ratio p0 of the total number of low-frequency wavelet coefficients of the segmentation to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is greater than or equal to the initial value of the segmentation variable px, and execute step S9; S9, calculating the remaining third wavelet histogram array hx3, where hx3=h-hx1-hx2; S10, removing all non-zero elements of the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, setting a common processing array Hx to place the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, and setting idx to place the wavelet coefficient indexes of the corresponding wavelet histograms respectively; S11, calculating new wavelet coefficients for the common processing array Hx according to the following formula: Wherein i=1...length(Hx), PX, CPX are the probability and cumulative probability of the common processing array Hx respectively; f(i) is the new wavelet coefficient of the new low-frequency sub-image ca2, and P1 is the adjustment parameter of image details, brightness and contrast; S12, performing wavelet reconstruction on the new low-frequency sub-image ca2, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd to obtain a reconstructed image I1; S13, using the formula Convert the reconstructed image I1 to [0,255] grayscale display range, output new enhanced image imageout; The first preset direction is from left to right, and the second preset direction is from right to left.
2. The method according to claim 1, characterized in that The value range of P1 is [0,1].
3. The method according to claim 2, characterized in that The P1=0.
1.
4. The method according to claim 1, characterized in that: The initial value of the segmentation cumulative probability cdfPR is 0.01, the initial value of the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients is 0, the initial value of the segmentation variable px is 0.5, and the preset value is 0.
01.
5. An image enhancement device for bilateral cumulative probability segmentation, characterized in that: include: A decomposition module is used to perform a layer of wavelet decomposition on the input image I using the db series wavelet base db1 wavelet to obtain a low-frequency sub-image ca, a first high-frequency sub-image ch, a second high-frequency sub-image cv and a third high-frequency sub-image cd; A first calculation module is used to round the low-frequency sub-image ca to obtain a rounded low-frequency sub-image ca1, and calculate a maximum value Mca of the rounded low-frequency sub-image ca1; A determination module, used for determining the frequency of occurrence of each wavelet coefficient of the rounded low-frequency sub-graph ca1 in [0, Mca], and obtaining a wavelet histogram h, with a length of Mca; The second calculation module is used to obtain the wavelet histogram calculation formula Calculate the probability of occurrence of each wavelet coefficient of the rounded low-frequency sub-image ca1, where i is the wavelet coefficient, i=0, 1, 2...Mca, h is the frequency of each wavelet coefficient, set the new low-frequency sub-image ca2 to be the same as the low-frequency sub-image ca, and set the value to a zero matrix; A setting module is used to set the initial value of the segmentation cumulative probability cdfPR, set the variable array hx of the wavelet histogram with the segmentation length Mca, set the initial value p0 of the ratio of the total number of segmented low-frequency wavelet coefficients to the total number of wavelet coefficients of the rounded low-frequency sub-graph ca1, and set the initial value of the segmentation variable px, wherein the segmentation variable px varies in the range [0,1]; The third calculation module is used to cyclically calculate the first cumulative probability cdfp1 from the first preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the first cumulative probability cdfp1 is: Loop variable i=1:Mca, when the first cumulative probability cdfp1 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented first wavelet histogram array hx1; The fourth calculation module is used to cyclically calculate the second cumulative probability cdfp2 from the second preset direction of the probability p(i) of the rounded low-frequency sub-image ca1, wherein the calculation formula of the second cumulative probability cdfp2 is: Loop variable i=Mca:-1:1, when the second cumulative probability cdfp2 is greater than the initial value of the segmentation cumulative probability cdfPR, exit the loop and record the segmented second wavelet histogram array hx2, where L is the total number of wavelet coefficients, the first preset direction is opposite to the second preset direction; the first preset direction is from left to right, and the second preset direction is from right to left; An updating module is used to update the variable array hx, wherein the variable array hx=hx1+hx2, and to update the ratio p0 of the total number of the segmented low-frequency wavelet coefficients to the total number of the rounded low-frequency sub-image ca1 wavelet coefficients, wherein, Determine whether the ratio p0 of the total number of low-frequency wavelet coefficients of the segmentation to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px; if the ratio p0 of the total number of low-frequency wavelet coefficients of the segmentation to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is less than the initial value of the segmentation variable px, set cdfPR=cdfPR+preset value, and return to step S6; otherwise, stop the loop operation until the first wavelet histogram array hx1 and the second wavelet histogram array hx2 are obtained in which the ratio p0 of the total number of low-frequency wavelet coefficients of the segmentation to the total number of wavelet coefficients of the low-frequency sub-graph ca1 after rounding is greater than or equal to the initial value of the segmentation variable px, and execute step S9; A fifth calculation module, used for calculating the remaining third wavelet histogram array hx3, wherein hx3=h-hx1-hx2; A placement module is used to remove all non-zero elements of the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, set a common processing array Hx to place the first wavelet histogram array hx1, the second wavelet histogram array hx2 and the third wavelet histogram array hx3, and set idx to place the wavelet coefficient indexes of the corresponding wavelet histograms respectively; The sixth calculation module is used to calculate the new wavelet coefficients for the common processing array Hx according to the following formula: Wherein i=1...length(Hx), PX, CPX are the probability and cumulative probability of the common processing array Hx respectively; f(i) is the new wavelet coefficient of the new low-frequency sub-image ca2, and P1 is the adjustment parameter of image details, brightness and contrast; A reconstruction module, used for performing wavelet reconstruction on the new low-frequency sub-image ca2, the first high-frequency sub-image ch, the second high-frequency sub-image cv and the third high-frequency sub-image cd to obtain a reconstructed image I1; Output module for using formula The reconstructed image I1 is converted to a grayscale display range of [0, 255], and a new enhanced image imageout is output.
6. The device according to claim 5, characterized in that The value range of P1 is [0,1].
7. The device according to claim 6, characterized in that The P1=0.
1.
8. The device according to claim 5, characterized in that The first preset direction is from left to right, and the second preset direction is from right to left.
9. The device according to claim 5, characterized in that The initial value of the segmentation cumulative probability cdfPR is 0.01, the initial value of the ratio p0 of the total number of segmented low-frequency wavelet coefficients to the total number of rounded low-frequency sub-image ca1 wavelet coefficients is 0, the initial value of the segmentation variable px is 0.5, and the preset value is 0.01.
Citation Information
Patent Citations
Remote sensing image change detection method and device based on DT-CWT (dual-tree complex wavelet transform) and MRF (Markov random field)
CN106971392A
Low-frequency wavelet coefficient interpolation image equalization enhancement method
CN108269246A