Layer decomposition tone mapping method
Through the layer decomposition tone mapping method combined with sgn function gradient minimization optimization and bilateral filtering, the problem of unclear separation of the basic layer and the detail layer is solved, and the clear retention of the large edge of the image and the richness of the detail levels are achieved, and the dynamic range and contrast of the image are improved.
Patent Information
- Application Number
- CN202410058337.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2025-07-18
AI Technical Summary
The existing layer decomposition tone mapping method has the problem of unclear separation of the base layer and the detail layer, and the base layer contains some details, resulting in uneven enhancement of the output image details, unclear large edges, and insufficient sense of detail hierarchy cannot be further separated.
The basic layer and detail layer were extracted using the sgn function gradient minimization optimization method, combined with gamma curve tone mapping and bilateral filtering processing, tone mapping and detail enhancement of the basic layer and detail layer respectively, and color was restored through anti-logarithmic processing.
Effectively separate the basic layer and the detail layer, keep the large edges of the original image clear, filter small details, and enrich the sense of detail hierarchy, and enhance the dynamic range and contrast of the image.
Smart Images

Figure CN120339418A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and particularly relates to a layer decomposition tone mapping method. Background Art
[0002] In nature, the dynamic range of natural scenes can reach 9 orders of magnitude, the dynamic range that the human eye can perceive can reach 5 orders of magnitude, while ordinary computer display devices can at most display images with a dynamic range of 2 orders of magnitude, resulting in a narrow dynamic range of the output image, and problems such as image distortion, detail loss, and poor light and dark effects. The tone mapping method can control dynamic range compression and restore as many rich details and high contrast of the input image as possible. Layer decomposition tone mapping decomposes the input image I into a base layer and a detail layer through an optimization method. The base layer contains the basic brightness information and content structure of the image, and the detail layer contains the details of the image. Then, tone mapping processing is performed on the base layer to increase the dynamic range of the image, and finally, detail enhancement processing is performed on the detail layer to increase the contrast of the image.
[0003] Currently, the mainstream layer decomposition method is to use bilateral filtering on the original image to separate the base layer and the detail layer of the input image, and process the base layer and the detail layer separately, and then perform an addition operation on the processed base layer and detail layer.
[0004] Using bilateral filtering as a layer decomposition method to separate the base layer and the detail layer has certain defects:
[0005] 1. The separation of the base layer and the detail layer is not clean. The base layer contains some details, and these details will be processed through the mapping curve and will not be processed through detail enhancement, resulting in uneven detail enhancement degree of the output image;
[0006] 2. The large edges of the base layer are not well maintained, the large edges of the output image are not clear enough, and it will cause the problem of double edges;
[0007] 3. It is impossible to further separate the detail layer to improve the detail level of the output image.
[0008] In view of this, there is an urgent need in the current market for a layer decomposition tone mapping method to overcome the defects of existing layer decomposition technologies, so as to meet the market requirements. Summary of the Invention
[0009] In order to solve the above problems, the purpose of this application is to provide a layer decomposition tone mapping method.
[0010] Specifically, the technical solution of the present invention provides a layer decomposition tone mapping method, and the method includes:
[0011] S1. Input an image;
[0012] S2. Calculate the luminance map of the input image;
[0013] S3. Convert the luminance map to the logarithmic domain, and after quantization, obtain the logarithmic-domain luminance map of the image;
[0014] S4. Perform sgn function gradient minimization optimization on the luminance map obtained in S2, and extract the base layer and the detail layer;
[0015] S5. Perform tone mapping processing of the gamma curve on the base layer;
[0016] S6. Perform bilateral filtering operation on the detail layer;
[0017] S7. Perform linear detail enhancement on the detail layer obtained after the bilateral filtering operation in S6;
[0018] S8. Synthesize the base layer obtained after the tone mapping processing in S5 and the detail layer obtained after the linear detail enhancement in S7 to obtain an image with the dynamic range of the logarithmic-domain luminance map compressed;
[0019] S9. Perform antilogarithm processing on the image with the dynamic range of the logarithmic-domain luminance map compressed obtained in S8;
[0020] S10. Perform color reconstruction on the image after the antilogarithm processing in S9 to obtain the pixel values of the R channel, G channel, and B channel after color restoration.
[0021] According to a preferred embodiment, step S2 is based on the three color components of the input image, respectively represented as R in , G in , B in , and calculate the luminance map of the input image. The calculation formula is as follows:
[0022] Y in = R in * 0.299 + G in * 0.587 + B in * 0.114.
[0023] According to a preferred embodiment, in step S3, the luminance map is converted to the logarithmic domain, and the obtained logarithmic-domain image data is quantized to 12 bits to obtain the logarithmic-domain luminance map. The formula of the logarithmic-domain luminance map is as follows:
[0024]
[0025] Among them, represents the floor function; log 10 (·) represents the logarithm function with base 10.
[0026] According to a preferred embodiment, step S4 includes:
[0027] S41. Establish a sgn function gradient minimization bi-objective programming model and its reconstruction model; since the model is non-convex and discontinuous, the alternating direction method of multipliers (ADMM) is used to split the model into an S estimator sub-problem containing a quadratic programming term and a sgn gradient minimization estimator sub-problem containing a sgn gradient term, and the optimal solution is obtained by iterative alternation;
[0028] S42. Model the S estimator sub-problem and obtain an S estimator sub-problem solver;
[0029] S43. Model the sgn gradient minimization estimator sub-problem and obtain a sgn gradient term solver;
[0030] S44. Use the sgn function gradient minimization optimization method for the luminance map obtained in S2, use the S estimator sub-problem solver to iteratively obtain the optimal solution of the quadratic programming term for multiple times, use the sgn gradient term solver to iteratively obtain the optimal solution of the gradient term for multiple times, obtain a similarity parameter factor greater than a preset similarity parameter factor by iteratively controlling the similarity degree of the auxiliary variables, and extract the base layer and the detail layer under the similarity parameter factor.
[0031] According to a preferred embodiment, in step S41, the formula of the sgn function gradient minimization bi-objective programming model is as follows:
[0032]
[0033] where I is the input logarithmic domain luminance map, S is the output image, λ is the edge control factor, is the horizontal gradient of pixel S p and is the vertical gradient of pixel S p , |·| is the absolute value function, ∑(·) is the summation function, and sgn(·) is the step function;
[0034] Auxiliary variables h p and v p are introduced to replace and respectively to reconstruct the model. The formula of the reconstruction model is as follows:
[0035]
[0036] where β is the similarity parameter factor, which controls the similarity degree between the auxiliary variables h p and v p and .
[0037] According to a preferred embodiment, in step S42, the equation for modeling the S estimation sub-problem is as follows:
[0038]
[0039] where I is the input logarithmic-domain luminance map, S is the output image, is the horizontal gradient of pixel S p , is the vertical gradient of pixel S p , h p and v p are auxiliary variables, and β is the similarity parameter factor;
[0040] The equation for the S estimation sub-problem solver is as follows:
[0041]
[0042] where, represents the Fourier transform of variable x, represents the inverse Fourier transform of variable x, represents the complex conjugate of the Fourier transform of variable x.
[0043] According to a preferred embodiment, in step S43, the equation for modeling the sgn gradient minimization estimation sub-problem is as follows:
[0044]
[0045] where S is the output image, is the horizontal gradient of pixel S p , is the vertical gradient of pixel S p , h p and v p are auxiliary variables, λ is the edge control factor, β is the similarity parameter factor, and sgn(·) is the step function;
[0046] The expression of the sgn gradient term solver is:
[0047]
[0048]
[0049] where E p represents the result obtained after a single pixel point p is calculated by the solver. The solution that makes E p reach the maximum or minimum value is the optimal solution.
[0050] According to a preferred embodiment, in step S44, the sgn function gradient minimization optimization method is as follows:
[0051] S441. Perform algorithm initialization, input the logarithmic domain luminance map, similarity parameter factor, and set threshold: i←0, S i ←L in ,β←β 0’ ;
[0052] S442. Implement quadratic programming term solution: Take S←S i ,Use the sgn gradient minimization estimator sub-problem solver to solve the logarithmic domain luminance map to obtain the optimal solution of the quadratic programming term, that is, the auxiliary variable
[0053] S443. Utilize the optimal solution of the quadratic programming term to implement the sgn gradient term solution: Take the auxiliary variable of the optimal solution of the quadratic programming term Use the quadratic programming term solver to calculate the model for estimating the sub-problem of S, and obtain the optimal solution S of the quadratic programming term i+1 ;
[0054] S444. Update the iterative similarity parameter factor: β←κβ, i←i + 1, and execute step S445;
[0055] S445. Determine whether the cut-off condition is satisfied: Determine whether the similarity parameter factor is greater than or equal to the threshold β≥β max ,If satisfied, then take S←S i ,Execute step S446, otherwise, continue to execute step S442;
[0056] S446. Extract the base layer and the detail layer with the gradient term optimal solution where the similarity parameter factor is greater than or equal to the threshold: B Y1 ←S, D Y1 ←L in -B Y1 ,Execute step S447;
[0057] S447. Output the base layer B Y1 and the detail layer D Y1 。
[0058] Among them, the input of the sgn function gradient minimization optimization method includes: input image L in 、Smoothing parameter λ, iterative similarity parameter factor, and set thresholds β0, β max 、Iterative convergence parameter κ. S i Is the optimal solution of the quadratic programming term in the i-th iteration where i∈N, Is the optimal solution of the sgn gradient term of the pixel point p∈S in the i-th iteration where i∈N i 。
[0059] According to a preferred embodiment, in step S5, tone mapping processing of a gamma curve is performed on the base layer, and its expression is as follows:
[0060]
[0061] where the variable γ is an adjustment coefficient that controls the dynamic range compression intensity. Usually, γ < 1. The smaller the value, the greater the dynamic range compression intensity, and B L1 represents the base layer extracted in step S4.
[0062] According to a preferred embodiment, in step S6, bilateral filtering processing is performed on the detail layer extracted in step S4 to obtain a processed detail layer; the formula of the bilateral filter is as follows:
[0063]
[0064]
[0065]
[0066]
[0067] D L3 = D L1 - D L2 ;
[0068] where D L1 represents the detail layer extracted in step S4, σ s and σ r are respectively the spatial domain filtering coefficient and the range domain filtering coefficient, which respectively control the spatial domain filtering intensity and the range domain filtering intensity; s is any pixel point of the detail layer D L1 ; Ω s is the neighborhood of the pixel point s; p is any pixel point of Ω s ; f(·) is the spatial domain filter; g(·) is the range domain filter.
[0069] According to a preferred embodiment, in step S7, linear enhancement processing with different intensities is performed on the detail layer after bilateral filtering processing to obtain a detail layer after linear enhancement processing. The algorithm is as follows:
[0070]
[0071]
[0072] where D L2 , D L3 is the detail layer after bilateral filtering processing in step S6, and θ and η are respectively the detail layer DL2 and D L3 detail enhancement factor of
[0073] According to a preferred embodiment, in step S8, the result obtained by performing tone mapping on S5 is combined with the result obtained by performing linear enhancement on S7 to obtain an image L with a compressed dynamic range of the logarithmic domain luminance map map ; The arithmetic expression of the combination is as follows:
[0074]
[0075] where is the base layer obtained by performing tone mapping of the gamma curve in step S5, is the detail layer obtained after performing linear enhancement with different intensities in step S7.
[0076] According to a preferred embodiment, in step S9, an antilogarithm process is performed on the image with a compressed dynamic range obtained in S8 to map the logarithmic domain luminance image back to the linear domain; the arithmetic expression for mapping back to the linear domain is as follows:
[0077]
[0078] where L map is the image with a compressed dynamic range obtained in step S8, and arglog 10 (·) is the antilogarithm function of log 10 (·).
[0079] According to a preferred embodiment, in step S10, the result Y map obtained by mapping the logarithmic domain luminance image back to the linear domain in step S9 is restored to the RGB color space to obtain the pixel values of the R channel, G channel, and B channel after color restoration; the method for restoring to the RGB color space is as follows:
[0080]
[0081] where R map , G map , B map respectively represent the pixel values of the R, G, and B channels after color restoration, y ∈ [0, 2] is the saturation adjustment factor. When y < 1, the saturation decreases. When y ≡ 1, the saturation remains unchanged. When y > 1, the saturation increases. Y map is the result obtained by mapping the logarithmic domain luminance image back to the linear domain in step S9.
[0082] Thus, a layer decomposition tone mapping method of the present invention has at least the following advantages:
[0083] 1. Using the optimization method as the layer decomposition method can effectively separate the base layer and the detail layer. The base layer can effectively preserve the large edges of the original image and filter out small details, and the detail layer has rich detail levels.
[0084] 2. Applying bilateral filtering to the detail layer can separate details of different intensities, and different intensity enhancement parameters are used for details of different intensities, thereby enhancing the detail level of the output image. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention.
[0086] Figure 1 It is a schematic flowchart of a layer decomposition tone mapping method of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0087] In order to more clearly understand the technical content and advantages of the present invention, the present invention will be further described in detail below with reference to the drawings.
[0088] A layer decomposition tone mapping method of the present invention, please refer to Figure 1 the schematic flowchart shown. The embodiments of this patent include the following steps:
[0089] S1. Input an RGB in image;
[0090] S2. Calculate the luminance map Y in of the input RGB image; in ;
[0091] S3. Convert the luminance map Y in to the logarithmic domain, and after quantization, obtain the logarithmic domain luminance map L in of the RGB image; in ;
[0092] S4. Perform gradient minimization optimization of the sgn function on the logarithmic domain luminance map L in to extract the base layer B L1 and the detail layer D L1 ;
[0093] S5. Perform tone mapping processing of the gamma curve on the base layer B L1 to obtain
[0094] S6. Perform bilateral filtering operation on the detail layer D L1 to obtain the detail layer D L2 , D L3 ;
[0095] S7.Detail layer D L2 , D L3 Perform linear detail enhancement to obtain detail layers
[0096] S8. Synthesis Get the logarithmic domain brightness map L in The dynamic range of the compressed image L map ;
[0097] S9.ToL map Perform antilogarithmic processing to obtain Y map ;
[0098] S10. Color reconstruction Y map , get RGB map .
[0099] Among them, step S1 is the algorithm input, inputting an RGB color space RGB in Image, size is M×N×3, which can be regarded as a three-dimensional array of size [M, N, 3]; image RGB in By color component R in , G in , B in The pixel value range of each color component is [0, 255], the size is M, N, and it can be regarded as a two-dimensional array of size [M, N].
[0100] Step S2 is based on the input image RGB in The three color components R in , G in , B in , calculate the image RGB in Brightness map Y in , the calculation formula is as follows:
[0101] Y in =R in *0.299+G in *0.587+B in *0.114 (1)
[0102] Step S3: Brightness map Y in Convert to the logarithmic domain. In order to retain data accuracy, the obtained logarithmic domain image data is quantized to 12 bits to obtain the logarithmic domain brightness map L in The corresponding formula is:
[0103]
[0104] in, Represents the floor function; log 10 (·) represents the logarithmic function with base 10.
[0105] Step S4 performs sgn function gradient minimization optimization on the logarithmic domain luminance map L in to extract the base layer B L1 and the detail layer D L1 . The process of sgn function gradient minimization includes using the sgn function to count the non-zero horizontal gradient and vertical gradient of the current pixel point of the image, taking the sum of the non-zero gradient count values of the input image I as the second objective term of the model, controlling the output to retain large edges while filtering out small details.
[0106] S4 further includes the following steps:
[0107] S41. Establish a sgn function gradient minimization bi-objective programming model and its reconstruction model; since the model is non-convex and discontinuous, the alternating direction method of multipliers (ADMM) is used to split the model into an S estimation sub-problem containing a quadratic programming term and a sgn gradient minimization estimation sub-problem containing a sgn gradient term, and the optimal solution is obtained by iterative alternation;
[0108] S42. Model the S estimation sub-problem and obtain a solver;
[0109] S43. Model the sgn gradient minimization estimation sub-problem and obtain a solver;
[0110] S44. Is the sgn function gradient minimization optimization method.
[0111] Specifically, the sgn function gradient minimization bi-objective programming model described in step S41 above:
[0112]
[0113] where I is the input logarithmic domain luminance map L in , S is the output image, representing the base layer B L1 , λ is the edge control factor, the larger λ is, the fewer edges S has, is the horizontal gradient of pixel point S p , is the vertical gradient of pixel point S p , |·| is the absolute value function, ∑(·) is the summation function, and sgn(·) is the step function.
[0114] S41 is a bi-objective programming model. After reconstructing the model, the model is decomposed into two sub-problems, S42 and S43. S42 and S43 give the models and solvers of the two sub-problems. S44 uses the ADMM algorithm to solve S41, and S44 is the solution method of S41.
[0115] Obviously, the sgn function gradient minimization bi-objective programming model of the above formula (3) is a non-convex bi-objective programming model, which contains two terms: the first term (S p -I p ) 2 is a quadratic convex function, which forces the base layer B L1 to be infinitely close to the input logarithmic domain luminance map L in , and D L1 =I p -S p is the image detail layer, and this term can effectively control the detail intensity of the detail layer; the second term is a non-convex function term, which counts the non-zero gradient pixel points of the input image and controls the number of edges of the base layer B L1 ; the second term and the first term cooperate with each other, so that the large edges of the input image L in are effectively retained on the base layer B L1 , while filtering out the small details and small edges of the image; the parameter λ is an edge control parameter, which controls the edge retention degree of the base layer B L1 .
[0116] Due to the existence of the sgn function, the sgn function gradient minimization bi-objective programming model of the above formula (3) is forced to be non-convex and the solution set is globally discontinuous. Therefore, auxiliary variables h p and v p are introduced to replace and respectively to reconstruct the model. The arithmetic expression of the reconstructed model is as follows:
[0117]
[0118] Among them, β is a similarity parameter factor, which controls the similarity degree between the auxiliary variables h p and v p and .
[0119] The S estimation sub-problem of the above step S42 is modeled and solved by a quadratic programming term solver. The specific establishment method is as follows:
[0120] The arithmetic expression for modeling the S estimation sub-problem is as follows:
[0121]
[0122] Equation (5) is a quadratic convex function with a global optimal solution, and can be solved by the fast Fourier transform to obtain a solver. The arithmetic expression of the solver is as shown in Equation (6):
[0123]
[0124] Among them, Denotes the Fourier transform of the variable x, Denotes the inverse Fourier transform of the variable x, Denotes the complex conjugate of the Fourier transform of the variable x.
[0125] For the above step S43, the sgn gradient minimization estimator sub-problem modeling and the sgn gradient term solver should be carried out according to the following formula.
[0126] The arithmetic expression of the sgn gradient minimization estimator sub-problem modeling is as follows:
[0127]
[0128] Solve using the splitting method. For a single pixel point p in S, Equation (8) can be obtained:
[0129]
[0130] Equation (9) is a sufficient condition for Equation (8), which can make E p achieve the minimum value At the same time, Equation (9) is the sgn gradient term solver, and its expression is:
[0131]
[0132] The above uses the splitting method to solve Equation (7), where Equation (7) is the model of the gradient minimization estimator sub-problem. In the model, each pixel point p in S is processed, and finally the obtained results are summed; the splitting method processes each pixel point in S separately to obtain Equation (8); each pixel point p in S is calculated and summed through Equation (8) to obtain Equation (7); Equation (8) is the calculation model of a single pixel point p, and Equation (9) is the solver of model Equation (8);
[0133] Ep’ represents the optimal solution obtained after the solver of Equation (9) for a single pixel point p; the sum of the optimal solutions of all pixel points p in S is Equation (7);
[0134] Equation (9) is the solver. The solution that makes Ep reach the extreme value is called the optimal solution. Therefore, both Ep and are optimal.
[0135] In the above step S44, the sgn function gradient minimization optimization method is as follows:
[0136] S441. Initialization: i←0, S i ←L in , β←β 0’ ;
[0137] S442. Take S←S i, solve Equation (8) using the above Equation (9) to obtain
[0138] S443. Take Solve Equation (5) using the above Equation (6) to obtain the optimal solution S of the quadratic programming term i+1 ;
[0139] S444. β ← κβ, i ← i + 1, execute step S445;
[0140] S445. If β ≥ β max , then take S ← S i , execute step S446; otherwise, execute step S442;
[0141] S446. B Y1 ← S, D Y1 ← L in - B Y1 , execute step S447;
[0142] S447. Output B Y1 , D Y1 .
[0143] Among them, the input of the sgn function gradient minimization optimization method includes: the input image L in , the smoothing parameter λ, the iterative similarity parameter factor, and the set threshold β0, β max , the iterative convergence parameter k. S i Is the optimal solution of the quadratic programming term in the i-th iteration where i ∈ N, Is the optimal solution of the sgn gradient term of the pixel point p ∈ S in the i-th iteration where i ∈ N i .
[0144] The sgn function gradient minimization optimization method described above takes the parameters L in , λ, β0, β max , κ as the input, and outputs the base layer B Y1 And the detail layer D Y1 : Step S441 executes algorithm initialization; Step S442 realizes quadratic programming term solution; Step S443 realizes sgn gradient term solution; Step S444 updates iterative parameters; Step S445 determines whether the cut-off condition is satisfied. If satisfied, execute step S446, otherwise, continue to execute steps S442 to S444; Step S446 obtains the base layer and the detail layer; Step S447 outputs the base layer B Y1 And the detail layer D Y1 , and the algorithm ends.
[0145] The above step S5 performs tone mapping processing of the gamma curve on the base layer B L1 to obtain The arithmetic formula is as follows:
[0146]
[0147] The variable γ is a regulation coefficient that controls the dynamic range compression intensity. Usually, γ < 1. The smaller the value, the greater the dynamic range compression intensity.
[0148] In step S6, bilateral filtering is performed on the detail layer D L1 to obtain the detail layer D L2 , D L3 ; The bilateral filter algorithm is as follows:
[0149]
[0150]
[0151]
[0152]
[0153] D L3 = D L1 - D L2 (15)
[0154] Among them, σ s and σ r are the spatial domain filtering coefficient and the range domain filtering coefficient respectively, controlling the spatial domain filtering intensity and the range domain filtering intensity; f(·) is the spatial domain filter; g(·) is the range domain filter.
[0155] In the said step S7, different intensity linear enhancement processing is performed on the detail layer D L2 , D L3 to obtain the detail layer The arithmetic formula is expressed as follows:
[0156]
[0157]
[0158] Among them, θ and η are the detail enhancement coefficients of the detail layer D L2 and D L3 respectively;
[0159] In the said step S8, the result obtained by performing tone mapping processing on S5 is synthesized with the result obtained by performing linear enhancement processing on S7, that is, synthesized to obtain the logarithm domain luminance map L in with the dynamic range compressed image L map . Its arithmetic formula is as follows:
[0160]
[0161] In the described step S9, for the image L with the compressed dynamic range obtained in S8 map Perform antilogarithm processing to map the logarithmic domain luminance image back to the linear domain to obtain Y map . The calculation formula is as follows:
[0162]
[0163] where arglog 10 (·) is the antilogarithm function of log 10 (·).
[0164] In the described step S10, the result Y obtained in step S9 of mapping the logarithmic domain luminance image back to the linear domain map is restored to the RGB color space to obtain RGB map , that is, the pixel values of the R channel, G channel, and B channel after color restoration. The algorithm expression is as follows:
[0165]
[0166] where R map , G map , B map respectively represent the pixel values of the R, G, and B channels after color restoration, y ∈ [0, 2] is the saturation adjustment factor. When y < 1, the saturation decreases. When y ≡ 1, the saturation remains unchanged. When y > 1, the saturation increases.
[0167] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A layer decomposition tone mapping method, characterized in that, It includes the following steps: S1. Input an image; S2. Calculate the luminance map of the input image; S3. Convert the luminance map to the logarithmic domain, and after quantization, obtain the logarithmic-domain luminance map of the image; S4. Perform sgn function gradient minimization optimization on the luminance map obtained in S2, and extract the base layer and the detail layer; S5. Perform tone mapping processing of the gamma curve on the base layer; S6. Perform a bilateral filtering operation on the detail layer; S7. Perform linear detail enhancement on the detail layer obtained after the bilateral filtering operation in S6; S8. Synthesize the base layer obtained after the tone mapping processing in S5 and the detail layer obtained after the linear detail enhancement in S7 to obtain an image with a compressed dynamic range of the logarithmic-domain luminance map; S9. Perform antilogarithmic processing on the image with a compressed dynamic range of the logarithmic-domain luminance map obtained in S8; S10. Perform color reconstruction on the image after the antilogarithmic processing in S9 to obtain the pixel values of the R channel, G channel, and B channel after color restoration.
2. The layer decomposition tone mapping method according to claim 1, wherein, The step S2 is based on three color components of the input image, respectively represented as R in , G in , B in , and calculates a luminance map of the input image. The calculation formula is as follows: Y in = R in * 0.299 + G in * 0.587 + B in * 0.114。 3. The layer decomposition tone mapping method according to claim 1, wherein In the step S3, convert the luminance map to the logarithmic domain, quantize the obtained logarithmic-domain image data to 12 bits to obtain the logarithmic-domain luminance map; the formula of the logarithmic-domain luminance map is as follows: Among them, represents the floor function; log 10 (·) represents the common logarithm function.
4. A layer decomposition tone mapping method according to claim 1, characterized in that The step S4 includes: S41. Establish a sgn function gradient minimization bi-objective programming model and its reconstruction model; since the model is non-convex and discontinuous, use the alternating direction method of multipliers (ADMM) to split the model into an S-estimation sub-problem containing a quadratic programming term and a sgn gradient minimization estimation sub-problem containing a sgn gradient term, and iteratively alternate to obtain the optimal solution; S42. Model the S-estimation sub-problem and obtain an S-estimation sub-problem solver; S43. Model the sgn gradient minimization estimation sub-problem and obtain a sgn gradient term solver; S44. Use the sgn function gradient minimization optimization method for the luminance map obtained in S2, use the S-estimation sub-problem solver to iteratively obtain the optimal solution of the quadratic programming term multiple times, use the sgn gradient term solver to iteratively obtain the optimal solution of the gradient term multiple times, and obtain a similarity parameter factor greater than the preset similarity parameter factor by iteratively controlling the similarity degree of the auxiliary variable, and extract the base layer and the detail layer under the similarity parameter factor.
5. A layer decomposition tone mapping method according to claim 4, wherein In the step S41, the formula of the sgn function gradient minimization bi-objective programming model is as follows: Where, I is the input logarithmic domain luminance map, S is the output image, λ is the edge control factor, is the horizontal gradient of pixel point S p , is the vertical gradient of pixel point S P , |·| is the absolute value function, ∑(·) is the summation function, and sgn(·) is the step function; Introduce auxiliary variables h p and v p respectively replace and to reconstruct the model, and the calculation formula of the reconstructed model is as follows: Among them, β is the similarity parameter factor that controls the auxiliary variable h p and v p and the degree of similarity; In the step S42, the formula for modeling the S-estimation sub-problem is as follows: where I is the input logarithmic domain luminance map, and S is the output image, is the horizontal gradient of pixel point S p , is the vertical gradient of pixel point S p , h p and v p are auxiliary variables, and β is the similarity parameter factor; The formula of the S-estimation sub-problem solver is as follows: Among them, represents the Fourier transform of variable x, represents the inverse Fourier transform of variable x, represents the complex conjugate of the Fourier transform of variable x; In the step S43, the formula for modeling the sgn gradient minimization estimation sub-problem is as follows: where S is the output image, is the horizontal gradient of pixel point S p , is the vertical gradient of pixel point S p , h p and v p are auxiliary variables, λ is the edge control factor, β is the similarity parameter factor, and sgn(·) is the step function; The expression of the sgn gradient term solver is: Among them, E p represents the result obtained after the single pixel point p is calculated by the solver. Let E p The solution that reaches the maximum or minimum value is the optimal solution; In the step S44, the sgn function gradient minimization optimization method is as follows: S441. Perform algorithm initialization, input the logarithmic domain luminance map, similarity parameter factor, and set threshold: i ← 0, S i ← L in , β ← β0; S442. Implement the solution of the quadratic programming term: Let s ← S i , and use the sgn gradient minimization estimator subproblem solver to solve the quadratic programming term optimal solution for the logarithmic domain luminance map, that is, the auxiliary variable S443. Use the optimal solution of the quadratic programming term to achieve the solution of the sgn gradient term: Take the auxiliary variable of the optimal solution of the quadratic programming term Use a quadratic programming term solver to calculate the model that models the S estimator subproblem, and obtain the optimal solution S of the quadratic programming term i+1 ; S444. Update the iterative similarity parameter factor: β←κβ, i←i + 1, and execute step S445; S445. Determine whether the cut-off condition is satisfied: Determine whether the similarity parameter factor is greater than or equal to the threshold value β≥β max , if satisfied, then take S←S i , execute step S446, otherwise, continue to execute step S442; S446. Extract the base layer and the detail layer with the optimal solution of the gradient term where the similarity parameter factor is greater than or equal to the threshold: B Y1 ←S, D Y1 ←L in -B Y1 , perform step S447; S447. Output the base layer B Y1 and the detail layer D Y1 ; Among them, the input of the sgn function gradient minimization optimization method includes: the input image L in , the smoothing parameter λ, the iterative similarity parameter factor, and the set thresholds β0, β max , the iterative convergence parameter κ; S i is the optimal solution of the quadratic programming term in the i-th iteration, where i ∈ N, is the optimal solution of the sgn gradient term of the pixel point p ∈ S in the i-th iteration, where i ∈ N. i 6. A layer decomposition tone mapping method according to claim 1, characterized in that In the step S5, perform tone mapping processing of the gamma curve on the base layer, and its expression is as follows: Among them, the variable γ is a regulation coefficient that controls the dynamic range compression intensity. Usually, γ < 1 is taken. The smaller the value, the greater the dynamic range compression intensity, B L1 represents the base layer extracted in step S4.
7. A layer decomposition tone mapping method according to claim 1, characterized in that In step S6, bilateral filtering is performed on the detail layer extracted in step S4 to obtain the processed detail layer; the algorithm expression of the bilateral filter is as follows: D L3 = D L1 - D L2 ; Among them, D L1 represents the detail layer extracted in step S4, σ s and σ r are the spatial domain filtering coefficient and the range domain filtering coefficient respectively, controlling the spatial domain filtering intensity and the range domain filtering intensity; s is any pixel point of the detail layer D L1 ; Ω s is the neighborhood of the pixel point s; p is any pixel point of Ω s ; f(·) is the spatial domain filter; g(·) is the range domain filter.
8. A layer decomposition tone mapping method according to claim 1, characterized in that, In step S7, linear enhancement processing with different intensities is performed on the detail layer after bilateral filtering to obtain the detail layer after linear enhancement processing, and the algorithm expression is as follows: D L2* = θ * D L2 ; D L3* = η * D L3 ; Among them, D L2 , D L3 is the detail layer after bilateral filtering in step S6, and θ and η are the detail enhancement coefficients of the detail layers D L2 and D L3 respectively.
9. The layer decomposition tone mapping method according to claim 1, characterized in that In the said step S8, the result obtained by performing tone mapping on S5 is synthesized with the result obtained by performing linear enhancement on S7 to obtain an image L with a compressed dynamic range of the logarithmic domain luminance map map ; The synthetic arithmetic expression is as follows: L map = B L1* + D L2* + D L3* ; Among them, B L1* is the base layer obtained by performing tone mapping processing of the gamma curve in step S5, and D L2* , D L3* is the detail layer obtained after performing linear enhancement processing with different intensities in step S7.
10. A layer decomposition tone mapping method according to claim 1, characterized in that, In step S9, inverse logarithm processing is performed on the image with compressed dynamic range obtained in S8 to map the logarithmic domain brightness image back to the linear domain; the algorithm expression for mapping back to the linear domain is as follows: Among them, L map is the image with compressed dynamic range obtained in step S8, and arglog 10 (·) is the antilogarithm function of log 10 (·).
11. A layer decomposition tone mapping method according to claim 1, wherein In the step S10, the result Y of mapping the logarithmic domain luminance image back to the linear domain obtained in the step S9 is map restored to the RGB color space to obtain the pixel values of the R channel, G channel, and B channel after color restoration; The algorithm expression for restoring to the RGB color space is as follows: Among them, R map , G map , B map respectively represent the pixel values of the R, G, and B channels after color restoration. y ∈ [0, 2] is the saturation adjustment factor. When y < 1, the saturation decreases; when y ≡ 1, the saturation remains unchanged; when y > 1, the saturation increases. Y map is the result of mapping the logarithmic domain luminance image back to the linear domain obtained in step S9.