Hhalo suppression method, device, equipment, medium and product during tone mapping

By calculating the target probability and weight value of each pixel, brightness value correction and mapping are performed, solving the problem of numerous noise points in halo removal in existing technologies and achieving a high-quality halo suppression effect.

CN121544488APending Publication Date: 2026-02-17VERISILICON MICROELECTRONICS (SHANGHAI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511713191.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing techniques often introduce noise points when removing halos during the generation of high dynamic range images, affecting image quality.

Method used

By calculating the target probability of each pixel, the halo region is determined based on the pixel dynamic range weight value and brightness weight value. The dynamic range is used to adjust the bias parameter and distance weight to refine the halo to each pixel, and brightness value correction and mapping are performed to achieve halo suppression.

Benefits of technology

It effectively suppresses the brightness value of the halo area, reduces noise points, and improves image quality and visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544488A_ABST
    Figure CN121544488A_ABST
Patent Text Reader

Abstract

The invention provides a halo suppression method and device during tone mapping, equipment, a medium and a product, and relates to the technical field of image processing. The halo suppression method during tone mapping comprises the following steps: acquiring a dynamic range compression curve of an image to be processed; calculating the target probability of each pixel point based on the pixel value of each pixel point in the to-be-processed image; the target probability represents the probability of whether the pixel point belongs to halo; based on the target probability of each pixel point, correcting the initial brightness value of the pixel point to obtain an updated brightness value of each pixel point; wherein the probability that the pixel point belongs to the halo is positively correlated with the amplification of the updated brightness value obtained by correction relative to the initial brightness value; and determining a respective mapping brightness value from the dynamic range compression curve based on the updated brightness value of each pixel point to obtain an output image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of image processing, and more specifically, to a method, apparatus, device, medium, and product for suppressing halos during tone mapping. Background Technology

[0002] In existing technologies, the generation of high dynamic range (HDR) images mainly relies on the synthesis of multiple frames with different exposure levels. However, existing methods tend to introduce noise points from different images when removing halos, resulting in a large number of noise points in the final output image and affecting the final image quality. Summary of the Invention

[0003] This application provides a method, apparatus, device, medium, and product for suppressing halos during tone mapping, so as to suppress halos in images and reduce introduced noise points.

[0004] In a first aspect, this application provides a halo suppression method for tone mapping, comprising: acquiring a dynamic range compression curve of an image to be processed; calculating a target probability for each pixel based on the pixel value of each pixel in the image to be processed; the target probability representing the probability of whether a pixel belongs to a halo; correcting the initial brightness value of each pixel based on the target probability of each pixel to obtain an updated brightness value for each pixel; wherein the probability of a pixel belonging to a halo is positively correlated with the increase in the updated brightness value obtained after correction compared to the initial brightness value; and determining the mapped brightness value of each pixel from the dynamic range compression curve based on the updated brightness value of each pixel to obtain an output image.

[0005] In this embodiment, when determining the mapped brightness value from the dynamic range compression curve based on the updated brightness value, the larger the updated brightness value, the greater the compression of the determined mapped brightness value. Since the brightness of a halo is often higher than that of other areas of the image, pixels with a higher target probability experience a greater increase in their corresponding updated brightness value, resulting in greater compression during subsequent mapping. This effectively suppresses the brightness values ​​of pixels in the halo region, achieving the effect of halo suppression.

[0006] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, calculating the target probability of each pixel based on the pixel value of each pixel in the image to be processed includes: calculating a pixel dynamic range weight value and a brightness weight value for each pixel based on the pixel value; wherein, the pixel dynamic range weight value is positively correlated with the similarity between the dynamic range of the region where the pixel is located and the dynamic range of the halo region; the brightness weight value is positively correlated with the probability that the brightness value of the pixel belongs to the brightness range of the halo; and the target probability is obtained based on the pixel dynamic range weight value and the brightness weight value; wherein, the pixel dynamic range weight value and the brightness weight value are positively correlated with the target probability.

[0007] In this embodiment, the similarity between each pixel and the halo region pixels is determined from the two dimensions of dynamic range and brightness by using pixel dynamic range weight value and brightness weight value respectively. Thus, the probability of each pixel belonging to the halo region can be accurately determined by the weights of these two dimensions, thereby improving the accuracy of the obtained target probability.

[0008] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the pixel dynamic range weight value of each pixel is calculated based on the pixel value of each pixel, including: dividing the image to be processed into multiple sub-image regions; obtaining the dynamic range of each sub-image region; calculating the dynamic range weight corresponding to each sub-image region according to the dynamic range and a preset dynamic range adjustment bias parameter; wherein the dynamic range is positively correlated with the dynamic range weight; the probability that the sub-image region includes a halo is positively correlated with the dynamic range weight; the dynamic range adjustment bias parameter characterizes the reference dynamic range of the halo region; for sub-image regions within a first preset range centered on the target sub-image region, obtaining the distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range; wherein the distance between the pixel and the sub-image region is positively correlated with the distance weight; calculating the pixel dynamic range weight value corresponding to each pixel based on all the distance weights corresponding to each pixel and the dynamic range weight corresponding to each sub-image region within the first preset range; wherein the distance weight between the pixel and the sub-image region is negatively correlated with the influence of the sub-image region on the pixel dynamic range weight value.

[0009] In this embodiment, the probability that each sub-image region includes a halo is represented by a dynamic range weight. Then, a distance weight is used to refine the dynamic range weight belonging to the sub-image region to each pixel, thereby obtaining the pixel dynamic range weight value corresponding to each pixel. Subsequently, the probability that each pixel belongs to the halo can be determined based on the pixel dynamic range weight.

[0010] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the dynamic range weight corresponding to each sub-image region is calculated based on the dynamic range and the preset dynamic range adjustment bias parameter, including: calculating the difference between the dynamic range and the dynamic range adjustment bias parameter to obtain the dynamic range difference value corresponding to each sub-image region; mapping the dynamic range difference value to a specified interval to obtain the dynamic range weight.

[0011] In this embodiment, since the dynamic range adjustment bias parameter characterizes the reference dynamic range of the halo region, the dynamic range difference can reflect the difference in dynamic range between each sub-image region and the halo region. Because the dynamic range of the halo region is relatively large, a larger dynamic range difference indicates a higher probability of halo presence in that sub-image region. Mapping the dynamic range difference to a specified interval facilitates subsequent calculations.

[0012] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the dynamic range weight corresponding to each sub-image region is calculated based on the dynamic range and the preset dynamic range adjustment bias parameter. This includes: calculating the dynamic range weight using a preset dynamic range weight calculation formula, wherein the dynamic range weight calculation formula is: dyStre = ((dyBin - dyBinBase) × dyBinSlope) >> normalizeShift; where dyStre represents the dynamic range weight, dyBin represents the dynamic range, dyBinBase represents the dynamic range adjustment bias parameter, dyBinSlope represents the dynamic range adjustment slope parameter, and >> normalizeShift represents normalization.

[0013] In this embodiment of the application, the dynamic range difference can be adjusted by adjusting the bias parameter through dynamic range adjustment, and the subsequent normalization can map it to a specified interval for subsequent calculation.

[0014] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within a first preset range, the pixel dynamic range weight value corresponding to each pixel is calculated, including: calculating the pixel dynamic range weight value using a preset pixel dynamic range weight value calculation formula, wherein the pixel dynamic range weight value calculation formula is: dyStreWeight(x,y) = Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, dyStre(n) represents the dynamic range weight of the nth sub-image region, and K represents the number of sub-image regions within the first preset range.

[0015] In this embodiment, the dynamic range weight is interpolated by the distance weight, so that the farther the distance represented by the distance weight is, the smaller its influence on the final pixel dynamic range weight value. Thus, the pixel dynamic range weight value of each pixel is determined based on the dynamic range of multiple sub-image regions around the pixel, thereby improving the accuracy of the pixel dynamic range weight value.

[0016] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, obtaining the distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range includes: for sub-image regions within the first preset range centered on the target sub-image region, obtaining the horizontal distance weight and vertical distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range; wherein, the greater the horizontal distance between a pixel and the sub-image region, the greater the corresponding horizontal distance weight; the greater the vertical distance between a pixel and the sub-image region, the greater the corresponding vertical distance weight; and obtaining the distance weight corresponding to each pixel based on the horizontal distance weight and vertical distance weight corresponding to each pixel.

[0017] In this embodiment of the application, the horizontal distance weight and the vertical distance weight are used to represent the horizontal distance and the vertical distance with the sub-image region, respectively, and the distance weight can be accurately obtained based on the horizontal distance weight and the vertical distance weight.

[0018] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, obtaining the distance weight corresponding to each pixel based on the horizontal distance weight and the vertical distance weight corresponding to each pixel includes: calculating the distance weight using a preset distance weight calculation formula, wherein the distance weight calculation formula is: Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, w h The weight representing the lateral distance of a pixel from the nth image patch, w v The vertical distance weight of a pixel from the nth image block is represented by α, which is a preset distance weight adjustment coefficient.

[0019] In this embodiment, the horizontal and vertical distance weights are multiplied to ensure that the product reflects the distance between a pixel and a sub-image region. The magnitude of the product is mapped to a desired range using α, facilitating subsequent calculations.

[0020] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, a brightness weight value for each pixel is calculated based on the pixel value of each pixel in each sub-image region, including: calculating the brightness weight value based on the target intensity of dehalo removal and the initial brightness value; wherein, the closer the initial brightness value is to the target intensity of dehalo removal, the larger the brightness weight value; the target intensity of dehalo removal represents the brightness value of the pixel belonging to the halo.

[0021] In this embodiment, since the target intensity of halo removal represents the brightness value of the pixel that belongs to the halo, the pixel whose brightness is closer to this target intensity is more likely to belong to the halo.

[0022] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the brightness weight value is calculated based on the target intensity for halo removal and the initial brightness value, including: calculating the brightness weight value based on a preset brightness weight value calculation formula, wherein the brightness weight value calculation formula is: lumaWeight = Where, lumaWeight represents the brightness weight value, sigma is the preset distribution variance, luma is the initial brightness value, and glLuma is the target intensity for halo removal; the distribution variance represents the variance calculated from the brightness values ​​of pixels within the preset halo region.

[0023] In this embodiment, by setting the distribution variance, the formula for calculating the brightness weight value is represented by a Gaussian distribution. When the initial brightness value equals the target intensity for halo removal, the brightness weight value is at its maximum value of 1. The greater the difference between the initial brightness value and the target intensity for halo removal, the smaller the calculated brightness weight value. This ensures that the brightness weight value reflects the similarity between the brightness value of a pixel and the brightness value of the halo.

[0024] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, the initial brightness value of each pixel is corrected based on the target probability of each pixel to obtain an updated brightness value for each pixel. This includes: obtaining a filtered brightness value for each pixel, wherein the filtered brightness value is obtained by filtering the initial brightness value; wherein the filtering process is a filtering method that considers pixel value differences; obtaining a correction amount corresponding to each pixel based on the filtered brightness value and the target probability; wherein the larger the target probability, the larger the corresponding correction amount; and obtaining the updated brightness value for each pixel based on the initial brightness value and the correction amount.

[0025] In this embodiment of the application, since the higher the target probability, the greater the corresponding correction amount, the greater the increase of the final calculated updated brightness value compared to the initial brightness value.

[0026] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, before obtaining the correction amount corresponding to each pixel based on the filtered brightness value and the target probability corresponding to each pixel, the method further includes: performing inter-frame smoothing processing on the target probability corresponding to each pixel to obtain a new target probability; correspondingly, obtaining the correction amount corresponding to each pixel based on the filtered brightness value and the target probability corresponding to each pixel includes: obtaining the correction amount corresponding to each pixel based on the filtered brightness value and the new target probability corresponding to each pixel.

[0027] In this embodiment of the application, by performing inter-frame smoothing processing on the target probability, the visual effect of the image can change smoothly after the halo removal is performed using this scheme, thereby improving the user's viewing experience.

[0028] In conjunction with the technical solution provided in the first aspect above, in some possible implementations, obtaining the updated brightness value of each pixel based on the initial brightness value and the correction amount corresponding to each pixel includes: calculating the sum of the initial brightness value and the correction amount corresponding to each pixel to obtain the intermediate brightness value corresponding to each pixel; and weighting and summing the initial brightness value and the intermediate brightness value corresponding to each pixel based on a preset weight to obtain the updated brightness value.

[0029] In this embodiment, the initial brightness value and the intermediate brightness value are weighted and summed using a preset weight, thereby adjusting the de-halo effect. That is, the greater the proportion of the intermediate brightness value in the weighted summation process, the better the de-halo effect.

[0030] This application provides a halo suppression device for tone mapping, comprising: an acquisition module and a processing module. The acquisition module is used to acquire the dynamic range compression curve of an image to be processed. The processing module is used to calculate the target probability of each pixel based on the pixel value of each pixel in the image to be processed; the target probability represents the probability of whether a pixel belongs to a halo; the initial brightness value of each pixel is corrected based on the target probability of each pixel to obtain an updated brightness value of each pixel; wherein, the probability of a pixel belonging to a halo is positively correlated with the increase of the updated brightness value obtained after correction compared to the initial brightness value; and the mapped brightness value of each pixel is determined from the dynamic range compression curve based on the updated brightness value of each pixel to obtain an output image.

[0031] Thirdly, this application provides an electronic device, including: a memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to execute the method described in the first aspect and / or in combination with any possible implementation of the first aspect.

[0032] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, performs the methods described in the first aspect and / or in combination with any possible implementation of the first aspect.

[0033] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, implements the method described in the first aspect and / or in combination with any possible implementation of the first aspect. Attached Figure Description

[0034] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a flowchart illustrating a first type of halo suppression method during tone mapping, as shown in an embodiment of this application. Figure 2 This is a schematic flowchart illustrating the second type of halo suppression method during tone mapping in an embodiment of this application; Figure 3 This is a comparison image showing the first original image and the halo suppression using this method, as illustrated in the embodiments of this application. Figure 4 This is a comparison image showing a second original image and a halo suppression using this method, as illustrated in an embodiment of this application. Figure 5 This is a comparison image showing a third original image and a halo suppression using this method, as illustrated in the embodiments of this application. Figure 6 This is a structural block diagram of a halo suppression device for tone mapping, as shown in an embodiment of this application. Figure 7 This is a structural block diagram of an electronic device shown in an embodiment of this application. Detailed Implementation

[0036] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0037] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., in the description of this application are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0038] The technical solution of this application will now be described in detail with reference to the accompanying drawings.

[0039] Please see Figure 1 , Figure 1 This is a flowchart illustrating a halo suppression method during tone mapping as shown in this application. The following will combine... Figure 1 The steps involved are explained.

[0040] S100: Obtain the dynamic range compression curve of the image to be processed.

[0041] The dynamic range compression curve of the image to be processed can be pre-acquired and stored on local storage media, and retrieved in real time when needed. Alternatively, it can be calculated in real time when required.

[0042] In one implementation, the global dynamic range compression curve of the image to be processed can be used as the dynamic range compression curve obtained in S100. This method treats the image to be processed as a whole for calculating the dynamic range compression curve.

[0043] Alternatively, the image to be processed can be divided into M×N equal-sized sub-image regions, and the dynamic range compression curve of each sub-image region can be used as the dynamic range compression curve obtained in S100. In this method, the dynamic range compression curve of the image to be processed includes M×N curves, where M and N are both positive integers.

[0044] Optionally, the global dynamic range compression curve of the image to be processed can be obtained first, and then the dynamic range compression curve of each sub-image region can be obtained. The dynamic range compression curve of each sub-image region is then fused with the global dynamic range compression curve to obtain the fused dynamic range compression curve for each sub-image region. The fused dynamic range compression curve is used as the dynamic range compression curve obtained in S100.

[0045] The methods for calculating the dynamic range compression curve are well known to those skilled in the art; for example, they can be histogram equalization, etc. For the sake of brevity, they will not be elaborated here.

[0046] For example, one could first perform global histogram statistics on the image to be processed, and then perform histogram statistics on each sub-image region, obtaining the histogram distribution, cumulative information, and feature information of each sub-image region, such as average image brightness and flatness. The flatness of the image is related to the information richness of the current sub-image region, and the flatness is calculated from the histogram distribution.

[0047] The initial dynamic range compression curve can be obtained by accumulating the distribution array of the histogram distribution. The average brightness and flatness of the image are obtained from previous calculations. Parameters such as stretching limit parameters and brightness concern arrays are user-defined and adjustable. The initial dynamic range compression curve Y can be further refined using adjustable parameters, such as average brightness of image blocks, block flatness, stretching limit parameters, and brightness concern arrays. The stretching degree of the dynamic range compression curve Y is determined by the flatness and brightness of each block. The stretching limit parameters are divided into upper and lower stretching limits, which control the final stretching degree of the generated dynamic range compression curve. The brightness concern array determines whether a certain brightness range receives special attention during adaptive curve generation, thereby preserving the final contrast of that bright area after dynamic range compression.

[0048] The examples provided are for illustrative purposes only and should not be construed as limiting the scope of this application.

[0049] S200: Calculate the target probability of each pixel based on the pixel value of each pixel in the image to be processed; the target probability represents the probability of whether a pixel belongs to the halo.

[0050] In one implementation, the target probability of each pixel can be calculated by inputting the pixel value of each pixel in the image to be processed into a pre-trained target probability model to obtain the target probability of each pixel.

[0051] The target probability model can be trained using a pre-set training dataset. This dataset can include the pixel values ​​of each pixel in multiple images, as well as the target probability for each image. The method of training the model using a training dataset is well-known to those skilled in the art and will not be elaborated upon here for the sake of brevity.

[0052] In one implementation, the target probability of each pixel can be calculated based on its pixel value in the image to be processed by: firstly, calculating the pixel dynamic range weight value and brightness weight value for each pixel based on its pixel value; then, obtaining the target probability based on the pixel dynamic range weight value and brightness weight value; wherein the pixel dynamic range weight value and brightness weight value are positively correlated with the target probability.

[0053] The pixel dynamic range weight value is positively correlated with the similarity between the dynamic range of the region where the pixel is located and the dynamic range of the halo region. That is, the larger the pixel dynamic range weight value, the greater the similarity between the dynamic range of the region where the pixel is located and the dynamic range of the halo region.

[0054] The brightness weight value is positively correlated with the probability that the brightness value of the pixel belongs to the brightness range of the halo. That is, the larger the brightness weight value, the greater the probability that the brightness value of the pixel belongs to the brightness range of the halo.

[0055] The brightness range of a halo is defined as the brightness range of pixels within the area where the halo is located when a halo appears in an image.

[0056] By using pixel dynamic range weight values ​​and brightness weight values, the similarity between each pixel and the pixels in the halo region is determined from the two dimensions of dynamic range and brightness, respectively. Thus, the probability of each pixel belonging to the halo region can be accurately determined by the weights of these two dimensions, thereby improving the accuracy of the obtained target probability.

[0057] In one implementation, the image to be processed can be divided into multiple sub-image regions. Then, the dynamic range of each sub-image region is obtained. Next, based on the dynamic range of the sub-image regions and a preset dynamic range, bias parameters are adjusted to calculate the dynamic range weight corresponding to each sub-image region. The pixel dynamic range weight value for each pixel is: the dynamic range weight of the sub-image region in which that pixel resides.

[0058] Dynamic range refers to the ratio of brightness between the brightest and darkest areas recorded simultaneously.

[0059] Optionally, the image to be processed can be divided into multiple sub-image regions of the same size.

[0060] The dynamic range can be calculated using any existing method that can calculate the dynamic range of an image; no specific method is restricted here.

[0061] For example, it can be calculated using the formula: dyBin = (Curve[binEnd[N]] + Curve [binEnd[N-1]]-Curve [binStart[N]] - Curve [binStart[N-1]])>>1.

[0062] Where dyBin represents the dynamic range, Curve[] represents the dynamic range compression curve of the current image, binEnd[N] represents the last array of the histogram distribution of the current image (the array corresponding to the maximum brightness), binEnd[N-1] represents the second-to-last array of the histogram distribution of the current image (the array corresponding to the second-to-last maximum brightness), binStart[N] represents the first array of the histogram distribution of the current image (the array corresponding to the minimum brightness), and binStart[N-1] represents the second array of the histogram distribution of the current image (the array corresponding to the second minimum brightness). >>1 indicates shifting right by one bit.

[0063] The calculation method for the dynamic range compression curve has been clearly described above, and will not be repeated here for the sake of brevity.

[0064] The dynamic range adjustment bias parameter characterizes the reference dynamic range of the halo region. The larger the dynamic range weight, the greater the probability that the sub-image region includes the halo.

[0065] Optionally, the dynamic range adjustment bias parameter can be calculated by performing dynamic range calculation on the halo region, and the calculated dynamic range of the halo region can be used as the dynamic range adjustment bias parameter.

[0066] Alternatively, the dynamic range can be calculated for each of the pre-acquired images, including those with halos, and then the average of these dynamic ranges can be calculated to obtain the dynamic range adjustment bias parameter.

[0067] The dynamic range adjustment bias parameter can also be obtained in other ways, as long as it can characterize the reference dynamic range of the halo region.

[0068] In one implementation, the dynamic range weight of each sub-image region can be calculated based on the dynamic range of the sub-image region and a preset dynamic range adjustment bias parameter. This can be achieved by calculating the difference between the dynamic range of the sub-image region and the dynamic range adjustment bias parameter, and using the difference as the dynamic range weight of the sub-image region.

[0069] Optionally, the dynamic range weights for each sub-image region can be calculated based on its dynamic range and a preset dynamic range adjustment bias parameter. This can be achieved by first calculating the difference between the dynamic range of each sub-image region and the dynamic range adjustment bias parameter, thus obtaining the dynamic range difference for each sub-image region. This dynamic range difference is then mapped to a specified interval to obtain the dynamic range weights.

[0070] The dynamic range difference can be mapped to a specified interval through methods such as normalization or mapping function mapping.

[0071] For example, the dynamic range weight of each sub-image region can be calculated by adjusting the bias parameter based on the dynamic range of the sub-image region and a preset dynamic range. This can be expressed by the formula: dyStre = ((dyBin - dyBinBase) × dyBinSlope) >> normalizeShift. This formula is used to calculate the dynamic range weight of each sub-image region.

[0072] Wherein, dyStre represents the dynamic range weight, dyBin represents the dynamic range of the sub-image region, dyBinBase represents the dynamic range adjustment bias parameter, dyBinSlope represents the dynamic range adjustment slope parameter (used to adjust the slope during normalization so that the slopes of different features or datasets are comparable), and >>nomalizeShift represents normalization.

[0073] The specific value of dyBinSlope can be set according to actual needs; there are no restrictions on its specific value here.

[0074] For example, normalizeShift = inputBitDepth - 10. Where inputBitDepth is the number of bits in the input image.

[0075] In one implementation, the method for calculating the dynamic range weight value of each pixel based on its pixel value can be as follows: First, the image to be processed is divided into multiple sub-image regions. Then, the dynamic range of each sub-image region is obtained. Afterward, the bias parameter is adjusted according to the dynamic range of the sub-image region and a preset dynamic range to calculate the dynamic range weight corresponding to each sub-image region.

[0076] Then, for each sub-image region within a first preset range centered on the target sub-image region, the distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range is obtained. The distance weight is positively correlated with the distance between a pixel and a sub-image region; that is, the farther the pixel is from the sub-image region, the greater its distance weight.

[0077] Finally, based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within the first preset range, the pixel dynamic range weight value is calculated. The distance weight between a pixel and a sub-image region is negatively correlated with the influence of that sub-image region on the pixel dynamic range weight value. That is, the larger the distance weight between a pixel and a sub-image region, the smaller the influence of that sub-image region on the pixel dynamic range weight value.

[0078] The dynamic range of a sub-image region is positively correlated with its dynamic range weight. The probability that a sub-image region includes a halo is also positively correlated with its dynamic range weight. The dynamic range adjustment bias parameter characterizes the reference dynamic range of the halo region. In other words, the larger the dynamic range of a sub-image region, the larger its corresponding dynamic range weight; and the larger the dynamic range weight, the greater the probability that the sub-image region includes a halo.

[0079] The probability of each sub-image region including a halo is represented by dynamic range weights. Then, distance weights are used to refine the dynamic range weights belonging to the sub-image region to each pixel, thus obtaining the pixel dynamic range weight value. Subsequently, the probability of each pixel belonging to the halo can be determined based on the pixel dynamic range weights.

[0080] The method of dividing the image to be processed into multiple sub-image regions, obtaining the dynamic range of each sub-image region, and calculating the dynamic range weight of each sub-image region is the same as described above, and will not be repeated here for the sake of brevity.

[0081] In one implementation, the distance weight can be obtained by calculating the distance from a pixel to each sub-image region and then mapping that distance to a specified interval.

[0082] The distance from a pixel to a sub-image region can be the distance from a pixel to the center of the sub-image region (such as the center pixel).

[0083] The distance between two adjacent pixels can be used as a unit distance for quantizing pixel distance.

[0084] Mapping distance to a specified interval can be done through processing methods such as normalization. The specific range of the specified interval can be set according to actual needs and is not limited to 0-1.

[0085] Optionally, the distance weights between each pixel in the target sub-image region and each sub-image region within the first preset range can also be obtained as follows: First, for the sub-image regions within the first preset range centered on the target sub-image region, obtain the horizontal and vertical distance weights between each pixel in the target sub-image region and each sub-image region within the first preset range; wherein, the greater the horizontal distance between the pixel and the sub-image region, the greater the corresponding horizontal distance weight; the greater the vertical distance between the pixel and the sub-image region, the greater the corresponding vertical distance weight.

[0086] Then, based on the horizontal and vertical distance weights corresponding to each pixel, the distance weights corresponding to each pixel are obtained.

[0087] The first preset range can be set according to actual needs, for example, it can be a region consisting of 3×3 sub-images centered on the target sub-image region.

[0088] The horizontal distance weight between a pixel and a sub-image region refers to the horizontal coordinate distance from the pixel to the center of the sub-image region in the pixel coordinate system.

[0089] The vertical distance weight between a pixel and a sub-image region refers to the vertical distance from the pixel to the center of the sub-image region in the pixel coordinate system.

[0090] In one implementation, the distance weight corresponding to each pixel can be obtained based on the horizontal and vertical distance weights corresponding to each pixel by calculating the distance weight using a preset distance weight calculation formula. The distance weight calculation formula is as follows: .

[0091] Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, w h The weight representing the lateral distance of a pixel from the nth image patch, w v The vertical distance weight of a pixel from the nth image block is represented by α, which is a preset distance weight adjustment coefficient. The value of α can be set according to actual needs, and its specific value is not restricted here.

[0092] Alternatively, the distance weight for each pixel can be obtained by adding the square of the horizontal distance weight to the square of the vertical distance weight, based on the horizontal and vertical distance weights corresponding to each pixel. .

[0093] The methods for obtaining the distance weight for each pixel based on the horizontal and vertical distance weights are not limited to the two methods mentioned above.

[0094] In one implementation, the pixel dynamic range weight value corresponding to each pixel can be calculated based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within a first preset range. This can be achieved by calculating the pixel dynamic range weight value using a preset pixel dynamic range weight value calculation formula: dyStreWeight(x,y) = .

[0095] Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, dyStre(n) represents the dynamic range weight of the nth sub-image region, and K represents the number of sub-image regions within the first preset range.

[0096] Alternatively, the pixel dynamic range weight value for each pixel can be calculated based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within the first preset range. This can be achieved by calculating the pixel dynamic range weight value using a preset formula: dyStreWeight(x,y) = The pixel dynamic range weight values ​​are calculated by weighted summation.

[0097] Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, dyStre(n) represents the dynamic range weight of the nth sub-image region, and K represents the number of sub-image regions within the first preset range.

[0098] In one implementation, the brightness weight value of each pixel is calculated based on the pixel value of each pixel in each sub-image region by calculating the brightness weight value based on the target intensity of halo removal and the initial brightness value. The closer the initial brightness value is to the target intensity of halo removal, the larger the brightness weight value; the target intensity of halo removal represents the brightness value of the pixel belonging to the halo.

[0099] Since the target intensity for halo removal represents the brightness value of the pixel belonging to the halo, the closer the brightness of a pixel is to this target intensity, the greater the probability that it belongs to the halo.

[0100] The target intensity for dehaling can be calculated based on the brightness values ​​of the pixels included in the halo region of a preset sample image. For example, it can be the average brightness value of the pixels in the halo region. Alternatively, it can be the mode of the brightness values ​​of all pixels in the halo region (i.e., the brightness value that appears most frequently in the halo region).

[0101] Optionally, the initial brightness value corresponding to each pixel in the image to be processed can be calculated as follows: the initial brightness value is calculated based on a preset brightness calculation formula, which is: Luma = rWeight ×R + gWeight ×G + bWeight × B.

[0102] Wherein, Luma represents the initial brightness, R represents the pixel value of the R channel of a pixel, G represents the pixel value of the G channel of a pixel, B represents the pixel value of the B channel of a pixel, and rWeight, gWeight, and bWeight are preset brightness weights.

[0103] Optionally, the brightness weight value can be calculated based on the preset distribution variance, the target intensity after halo removal, and the initial brightness value. This can be done by calculating the brightness weight value using a preset formula: lumaWeight = .

[0104] Where, lumaWeight represents the brightness weight value, sigma is the preset distribution variance, Luma is the initial brightness value, and glLuma is the target intensity for halo removal; the distribution variance represents the variance of the brightness values ​​of pixels within the preset halo region.

[0105] By setting the distribution variance, the formula for calculating the brightness weight value is represented by a Gaussian distribution. When the initial brightness value equals the target intensity for halo removal, the brightness weight value is at its maximum of 1. The greater the difference between the initial brightness value and the target intensity for halo removal, the smaller the calculated brightness weight value. This ensures that the brightness weight value reflects the similarity between the brightness value of a pixel and the brightness value of the halo.

[0106] Optionally, the brightness weight value can also be calculated based on the preset distribution variance, the target intensity after halo removal, and the initial brightness value as follows: lumaWeight = This curve is a Laplace distribution curve.

[0107] Where, lumaWeight represents the brightness weight value, Luma is the initial brightness value, glLuma is the target intensity for dehaling, and b is a scale parameter greater than 0, used to control the steepness of the curve. The smaller b is, the more concentrated the curve becomes.

[0108] S300: Based on the target probability of each pixel, the initial brightness value of the pixel is corrected to obtain the updated brightness value of each pixel.

[0109] Specifically, the probability that a pixel belongs to a halo is positively correlated with the increase in the corrected updated brightness value compared to the initial brightness value. In other words, the higher the probability that a pixel belongs to a halo, the greater the increase in the corrected updated brightness value compared to the initial brightness value.

[0110] In one implementation, the updated brightness value of each pixel is obtained by correcting its initial brightness value based on the target probability of that pixel. This can be achieved by: acquiring a filtered brightness value for each pixel, which is obtained by filtering the initial brightness value; wherein the filtering process considers pixel value differences. Then, based on the filtered brightness value and target probability of each pixel, a correction amount is obtained for each pixel; where a higher target probability corresponds to a larger correction amount. Finally, the updated brightness value of each pixel is obtained based on its initial brightness value and the correction amount.

[0111] Since the higher the target probability, the larger the corresponding correction amount, the greater the increase in the final calculated updated brightness value compared to the initial brightness value.

[0112] Optionally, the filtered brightness value can be obtained by filtering the pixels. The filtering process can be a filtering method that takes into account the differences in pixel values, such as bilateral filtering or weighted guided image filtering.

[0113] Taking bilateral filtering as an example, the method for filtering pixels can be expressed by the formula: Calculated.

[0114] Where f(A) is the filtered brightness value of the output pixel A, g(B) is the initial brightness value of pixel B, Ω is the neighborhood window centered on pixel A, and pixel B is the other pixels in the neighborhood window besides pixel A. This indicates that pixel B is within the neighborhood window represented by Ω, where w is the filter kernel, x is the x-coordinate of pixel B, and y is the y-coordinate of pixel B.

[0115] The filter kernel of a bilateral filter consists of a product of two parts: the spatial kernel and the spatial kernel. The range kernel ψ. Both filter kernels are typically Gaussian functions.

[0116] ; ; ; Where, σ d Let σ be the standard deviation of the Gaussian function in the spatial domain. r Let be the standard deviation of the Gaussian function with respect to the range. BA represents the distance between pixel B and pixel A within a neighborhood window centered at pixel A. This represents the difference between the initial brightness value of pixel B and the initial brightness value of pixel A. Spatial domain filtering coefficients are determined by the spatial distance between pixels; the smaller the distance, the larger the coefficient. Range filtering coefficients are determined by the similarity between pixels; the closer the pixel values, the larger the coefficient.

[0117] By employing a bilateral filtering method, this scheme is applicable to image processing with ultra-high dynamic range (20 bits and above).

[0118] The specific implementation of bilateral filtering is well known to those skilled in the art, and will not be elaborated here for the sake of brevity.

[0119] Optionally, the correction amount for each pixel can be obtained by multiplying the filtered brightness value and target probability for each pixel. That is, correction amount = filtered brightness value × target probability. In this case, the target probability represents the probability that a pixel belongs to the halo; the higher the target probability, the higher the probability that the pixel belongs to the halo.

[0120] Alternatively, the correction amount for each pixel can be obtained based on the filtered brightness value and target probability: calculate the filtered brightness value divided by the target probability to get the correction amount for each pixel. That is, correction amount = filtered brightness value ÷ target probability. In this case, the target probability represents the probability that a pixel does not belong to the halo; the higher the target probability, the lower the probability that the pixel belongs to the halo.

[0121] In one implementation, the updated brightness value of each pixel can be obtained based on the initial brightness value and correction amount corresponding to each pixel by calculating the sum of the initial brightness value and correction amount corresponding to each pixel to obtain the updated brightness value corresponding to each pixel.

[0122] Alternatively, the updated brightness value for each pixel can be obtained by calculating the sum of the initial brightness value and the correction value for each pixel to obtain the intermediate brightness value for each pixel. Then, based on preset weights, the initial brightness value and the intermediate brightness value for each pixel are weighted and summed to obtain the updated brightness value.

[0123] By using preset weights to perform a weighted summation of the initial and intermediate brightness values, the de-halo effect can be adjusted. In other words, the greater the weight of the intermediate brightness value during the weighted summation, the better the de-halo effect.

[0124] In this way, the calculation method for updating the brightness value can be expressed as: lumagalred(x,y) =glareLuma(x,y)× deglareWeight +(1- deglareWeight)×luma(x,y).

[0125] Here, lumagalred(x,y) represents the updated brightness value, glareLuma(x,y) represents the intermediate brightness value, deglareWeight represents the preset weight, and luma(x,y) represents the initial brightness value.

[0126] The calculation method for the intermediate brightness value can be expressed as: glareLuma(x,y) = luma(x,y) +(lumaFiltered(x,y)×lumaWeight(x,y)×dyStreWeight(x,y)).

[0127] Here, lumaFiltered(x,y) represents the filtered brightness value, lumaWeight(x,y) represents the brightness weight value, and dyStreWeight(x,y) represents the pixel dynamic range weight value.

[0128] Alternatively, the intermediate brightness value can be calculated as: glareLuma(x,y) = luma(x,y) +(lumaFiltered(x,y)×lumaWeight(x,y)×dyStreWeight(x,y))>>nomalizeShift.

[0129] Among them, >>nomalizeShift is a mapping function used to map the correction amount to a preset range.

[0130] In video processing, each frame of the image is processed using steps S100-S400.

[0131] To improve the visual smoothness of video images after halo removal, in one implementation, before obtaining the correction amount for each pixel based on the filtered brightness value and target probability corresponding to each pixel, inter-frame smoothing processing can be performed on the target probability corresponding to each pixel to obtain a new target probability.

[0132] Accordingly, the correction amount for each pixel is obtained based on the filtered brightness value and target probability of each pixel as follows: the correction amount for each pixel is obtained based on the filtered brightness value and the new target probability of each pixel.

[0133] By performing inter-frame smoothing on the target probability, the visual effect of the image can change smoothly after dehaling using this scheme, thus improving the user's viewing experience.

[0134] The correction amount for each pixel is obtained based on the filtered brightness value and the new target probability, which is the same as the method described above for obtaining the correction amount for each pixel based on the filtered brightness value and the target probability. For the sake of brevity, it will not be repeated here.

[0135] Optionally, the target probability corresponding to each pixel can be smoothed across frames to obtain a new target probability. This can be achieved using the following inter-frame smoothing formula: dyStreWeight(x,y)' × lumaWeight(x,y)' = × dyStreWeight(x,y)×lumaWeight(x,y)+ × dyStreWeight(x,y)×lumaWeight(x,y).

[0136] Where lumaFiltered(x,y) represents the filtered brightness value, lumaWeight(x,y) represents the brightness weight value, dyStreWeight(x,y)×lumaWeight(x,y) is the target probability, and dyStreWeight(x,y)'×lumaWeight(x,y)' is the new target probability. Tfilt_W represents the smoothing weight.

[0137] The value of Tfilt_W can be set according to actual needs. Tfilt_W can be any value in the range of 0-1, such as 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.85, etc. The value of Tfilt_W is not limited to the example given here.

[0138] S400: Based on the updated brightness value of each pixel, the corresponding mapped brightness value is determined from the dynamic range compression curve to obtain the output image.

[0139] After obtaining the updated brightness value of each pixel, the updated brightness value of each pixel can be mapped based on the dynamic range compression curve of the image to be processed obtained in S100, thus obtaining the mapped brightness value of each pixel. The mapped brightness value of each pixel is then used as the brightness value of the image to be processed to obtain the output image.

[0140] If the dynamic range compression curve of the image to be processed includes the dynamic range compression curves of M×N sub-image regions, then during mapping, each pixel is mapped through the dynamic range compression curve corresponding to its own sub-image region.

[0141] To facilitate understanding of the halo suppression method in tone mapping described above, the following will combine... Figure 2 This will be illustrated with examples. The halo suppression method for tone mapping provided in this application is not limited to... Figure 2 As shown in the diagram.

[0142] First, the image to be processed is divided into M×N equal-sized sub-image regions. The histogram of each sub-image region is calculated, and the dynamic range compression curve for each sub-image region is also calculated.

[0143] Next, the dynamic range of each sub-image region is calculated. The calculation method is: dyBin = (Curve[binEnd[N]] + Curve [binEnd[N-1]] - Curve [binStart[N]] - Curve [binStart[N-1]])>>1.

[0144] The dynamic range weight of each sub-image region is calculated by adjusting the bias parameters based on the dynamic range of the sub-image region and the preset dynamic range. The calculation method is: dyStre = ((dyBin - dyBinBase) × dyBinSlope) >> normalizeShift.

[0145] For a sub-image region within a 3×3 area centered on the target sub-image region, obtain the distance weight between each pixel in the target sub-image region and each sub-image region within a first preset range. The distance weight is calculated as follows: , This represents the distance weight between a pixel and the nth sub-image region.

[0146] Based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within the first preset range, the pixel dynamic range weight value corresponding to each pixel is calculated. The calculation method is: dyStreWeight(x,y) = .

[0147] While calculating the dynamic range of each sub-image region, the initial brightness value of each pixel in the image to be processed is also calculated. The initial brightness value can be expressed as: Luma = rWeight ×R + gWeight ×G + bWeight ×B.

[0148] Then, based on the target intensity after halo removal and the initial brightness value, the brightness weight value is calculated. The brightness weight value can be expressed as: lumaWeight = .

[0149] Given the initial brightness value of each pixel in the image to be processed, a bilateral filtering process is performed on the initial brightness value of the pixel to obtain the filtered brightness value of each pixel, lumaFiltered(x,y).

[0150] After obtaining the pixel dynamic range weight value and the brightness weight value, the target probability is obtained based on the pixel dynamic range weight value and the brightness weight value.

[0151] Next, inter-frame smoothing is performed on the target probability to obtain a new target probability. The calculation method for inter-frame smoothing can be expressed as: dyStreWeight(x,y)' × lumaWeight(x,y)' = × dyStreWeight(x,y)×lumaWeight(x,y)+ × dyStreWeight(x,y) × lumaWeight(x,y).

[0152] Then, based on the filtered brightness value and the new target probability for each pixel, the correction amount for each pixel is obtained. The correction amount can be calculated as: lumaFiltered(x,y) × dyStreWeight(x,y)' × lumaWeight(x,y)'.

[0153] Then, the intermediate brightness value is calculated based on the correction amount and the initial brightness value. The calculation method of the intermediate brightness value can be expressed as: glareLuma(x,y) = luma(x,y) + lumaFiltered(x,y) × dyStreWeight(x,y)' × lumaWeight(x,y)'.

[0154] Then, based on the preset weights, the initial brightness value and the intermediate brightness value corresponding to each pixel are weighted and summed to obtain the updated brightness value. The calculation method of the updated brightness value can be expressed as: lumagalred(x,y) =glareLuma(x,y)× deglareWeight +(1- deglareWeight)×luma(x,y).

[0155] Finally, based on the updated brightness value of each pixel, the corresponding mapped brightness value is determined from the dynamic range compression curve to obtain the output image.

[0156] The parameters of each formula and the specific implementation of each step have been clearly described above, and will not be repeated here for the sake of brevity.

[0157] To more intuitively demonstrate the halo removal effect of this solution, the following will combine... Figures 3-5 Please provide an explanation.

[0158] Figure 3 The image on the left is the initial image, that is, the image before halo removal. Figure 3 The image on the right shows the image after halo removal using this method. This method effectively reduces the halo effect produced by the headlights.

[0159] Figure 4 The image on the left is the initial image, that is, the image before halo removal. Figure 4 The image on the right shows the image after halo removal using this method. This method effectively reduces the halo effect produced by traffic lights.

[0160] Figure 5 The image on the left is the initial image, that is, the image before halo removal. Figure 5 The image on the right shows the image after halo removal using this method. This method effectively reduces the halo effect produced by streetlights.

[0161] This solution can be set in TM (Tone Mapping), with low requirements for input and output. It can be used as a standalone image module or as a feature module, and has relatively low computational complexity.

[0162] Based on the same technical concept, this application also provides a halo suppression device for tone mapping, such as... Figure 6 As shown, the halo suppression device 100 for tone mapping includes an acquisition module 110 and a processing module 120.

[0163] The acquisition module 110 is used to acquire the dynamic range compression curve of the image to be processed.

[0164] The processing module 120 is used to calculate the target probability of each pixel based on the pixel value of each pixel in the image to be processed; the target probability represents the probability of whether the pixel belongs to the halo; the initial brightness value of the pixel is corrected based on the target probability of each pixel to obtain the updated brightness value of each pixel; wherein, the probability of the pixel belonging to the halo is positively correlated with the increase of the updated brightness value obtained after correction compared with the initial brightness value; and the mapped brightness value of each pixel is determined from the dynamic range compression curve based on the updated brightness value of each pixel to obtain the output image.

[0165] The processing module 120 is specifically used to calculate the pixel dynamic range weight value and the brightness weight value of each pixel based on the pixel value of each pixel; wherein, the pixel dynamic range weight value is positively correlated with the similarity between the dynamic range of the region where the pixel is located and the dynamic range of the halo region; the brightness weight value is positively correlated with the probability that the brightness value of the pixel belongs to the brightness range of the halo; and the target probability is obtained based on the pixel dynamic range weight value and the brightness weight value; wherein, the pixel dynamic range weight value and the brightness weight value are positively correlated with the target probability.

[0166] The processing module 120 is specifically used to divide the image to be processed into multiple sub-image regions; obtain the dynamic range of each sub-image region; calculate the dynamic range weight corresponding to each sub-image region based on the dynamic range of each sub-image region and a preset dynamic range adjustment bias parameter; wherein the dynamic range is positively correlated with the dynamic range weight; the probability that the sub-image region includes a halo is positively correlated with the dynamic range weight; the dynamic range adjustment bias parameter characterizes the reference dynamic range of the halo region; for sub-image regions within a first preset range centered on the target sub-image region, obtain the distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range; wherein the distance between the pixel and the sub-image region is positively correlated with the distance weight; calculate the pixel dynamic range weight value corresponding to each pixel based on all the distance weights corresponding to each pixel and the dynamic range weight corresponding to each sub-image region within the first preset range; wherein the distance weight between the pixel and the sub-image region is negatively correlated with the influence of the sub-image region on the pixel dynamic range weight value.

[0167] The processing module 120 is specifically used to calculate the difference between the dynamic range and the dynamic range adjustment bias parameter to obtain the dynamic range difference value corresponding to each sub-image region; and to map the dynamic range difference value to a specified interval to obtain the dynamic range weight.

[0168] The processing module 120 is specifically used to calculate the dynamic range weight using a preset dynamic range weight calculation formula. The dynamic range weight calculation formula is: dyStre = ((dyBin - dyBinBase) × dyBinSlope) >> normalizeShift; where dyStre represents the dynamic range weight, dyBin represents the dynamic range, dyBinBase represents the dynamic range adjustment bias parameter, dyBinSlope represents the dynamic range adjustment slope parameter, and >> normalizeShift represents normalization.

[0169] Processing module 120 is specifically used to calculate the pixel dynamic range weight value using a preset pixel dynamic range weight value calculation formula, wherein the pixel dynamic range weight value calculation formula is: dyStreWeight(x,y) = Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, dyStre(n) represents the dynamic range weight of the nth sub-image region, and K represents the number of sub-image regions within the first preset range.

[0170] The processing module 120 is specifically used to obtain, for a sub-image region within a first preset range centered on the target sub-image region, the horizontal distance weight and vertical distance weight of each pixel in the target sub-image region and each sub-image region within the first preset range; wherein, the greater the horizontal distance of a pixel from the sub-image region, the greater the corresponding horizontal distance weight; the greater the vertical distance of a pixel from the sub-image region, the greater the corresponding vertical distance weight; and based on the horizontal distance weight and vertical distance weight corresponding to each pixel, obtain the distance weight corresponding to each pixel.

[0171] Processing module 120 is specifically used to calculate the distance weight using a preset distance weight calculation formula, wherein the distance weight calculation formula is: Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, w h The weight representing the lateral distance of a pixel from the nth image patch, w v The vertical distance weight of a pixel from the nth image block is represented by α, which is a preset distance weight adjustment coefficient.

[0172] The processing module 120 is specifically used to calculate the brightness weight value based on the target intensity of the dehalogenation and the initial brightness value; wherein, the closer the initial brightness value is to the target intensity of the dehalogenation, the larger the brightness weight value is; the target intensity of the dehalogenation represents the brightness value of the pixel point belonging to the halo.

[0173] Processing module 120 is specifically used to calculate the brightness weight value based on a preset brightness weight value calculation formula, wherein the brightness weight value calculation formula is: lumaWeight = Where, lumaWeight represents the brightness weight value, sigma is the distribution variance, Luma is the initial brightness value, and glLuma is the target intensity for halo removal; the distribution variance represents the variance calculated from the brightness values ​​of pixels within the preset halo region.

[0174] The processing module 120 is specifically used to obtain the filtered brightness value of each pixel, which is obtained by filtering the initial brightness value; wherein the filtering is a filtering method that considers the differences in pixel values; based on the filtered brightness value corresponding to each pixel and the target probability, a correction amount corresponding to each pixel is obtained; wherein the larger the target probability, the larger the corresponding correction amount; based on the initial brightness value corresponding to each pixel and the correction amount, the updated brightness value of each pixel is obtained.

[0175] The processing module 120 is also used to perform inter-frame smoothing processing on the target probability corresponding to each pixel to obtain a new target probability; and to obtain the correction amount corresponding to each pixel based on the filtered brightness value corresponding to each pixel and the new target probability.

[0176] The processing module 120 is specifically used to calculate the sum of the initial brightness value and the correction amount corresponding to each pixel to obtain the intermediate brightness value corresponding to each pixel; based on the preset weight, the initial brightness value and the intermediate brightness value corresponding to each pixel are weighted and summed to obtain the updated brightness value.

[0177] The halo suppression device 100 for tone mapping provided in this application embodiment has the same implementation principle and technical effect as the aforementioned halo suppression method embodiment for tone mapping. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned halo suppression method embodiment for tone mapping.

[0178] Please see Figure 7 This is an electronic device 200 provided in an embodiment of this application. The electronic device 200 includes: a processor 210 and a memory 220.

[0179] The memory 220 and processor 210 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 220 is used to store computer programs, such as those containing... Figure 6The software functional module shown is the halo suppression device 100 for tone mapping. The halo suppression device 100 for tone mapping includes at least one software functional module that can be stored as software or firmware in the memory 220 or embedded in the operating system (OS) of the electronic device 200. The processor 210 is used to execute executable modules stored in the memory 220, such as the software functional module or computer program included in the halo suppression device 100 for tone mapping. At this time, the processor 210 is used to acquire the dynamic range compression curve of the image to be processed; calculate the target probability of each pixel based on the pixel value of each pixel in the image to be processed; the target probability represents the probability of whether a pixel belongs to a halo; correct the initial brightness value of each pixel based on the target probability of each pixel to obtain an updated brightness value for each pixel; wherein the probability of a pixel belonging to a halo is positively correlated with the increase in the updated brightness value obtained after correction compared to the initial brightness value; and determine the respective mapped brightness value from the dynamic range compression curve based on the updated brightness value of each pixel to obtain the output image.

[0180] The memory 220 can be, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0181] Processor 210 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including data processing cores such as GPUs (Graphics Processing Units), CPUs (Central Processing Units), AI (Artificial Intelligence), NPUs (Neural Network Processing Units), ISPs (Image Signal Processors), DPUs (Display Processing Units), VPUs (Video Processing Units), and DSPs (Digital Signal Processors). It can also be a processor chip used in scenarios involving large-scale data computation. The above are merely examples and should not be construed as limiting this application.

[0182] Among them, the aforementioned electronic devices 200 include, but are not limited to, personal computers, servers, etc.

[0183] This application also provides a computer-readable storage medium (hereinafter referred to as the storage medium) storing a computer program. When the computer program is run by a computer, such as the electronic device 200 described above, it executes the halo suppression method for tone mapping as described above. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

[0184] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the halo suppression method for tone mapping as described above.

[0185] The computer program product can be a software product that can store computer programs, such as a software installation package or a script file.

[0186] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for suppressing halos during tone mapping, characterized in that, include: Obtain the dynamic range compression curve of the image to be processed; Based on the pixel value of each pixel in the image to be processed, the target probability of each pixel is calculated; The target probability characterizes the probability of whether a pixel belongs to the halo; The initial brightness value of each pixel is corrected based on the target probability of each pixel to obtain the updated brightness value of each pixel; wherein, the probability of a pixel belonging to a halo is positively correlated with the increase of the updated brightness value obtained after correction compared with the initial brightness value; The mapped brightness value of each pixel is determined from the dynamic range compression curve based on the updated brightness value of each pixel, and the output image is obtained.

2. The method according to claim 1, characterized in that, The step of calculating the target probability of each pixel based on the pixel value of each pixel in the image to be processed includes: Based on the pixel value of each pixel, calculate the pixel dynamic range weight value and the brightness weight value for each pixel; the pixel dynamic range weight value is positively correlated with the similarity between the dynamic range of the region where the pixel is located and the dynamic range of the halo region; the brightness weight value is positively correlated with the probability that the brightness value of the pixel belongs to the brightness range of the halo. The target probability is obtained based on the pixel dynamic range weight value and the brightness weight value; wherein the pixel dynamic range weight value and the brightness weight value are positively correlated with the target probability.

3. The method according to claim 2, characterized in that, Based on the pixel value of each pixel, calculate the pixel dynamic range weight value for each pixel, including: The image to be processed is divided into multiple sub-image regions; Obtain the dynamic range of each sub-image region; Based on the preset dynamic range adjustment bias parameter and the dynamic range, the dynamic range weight corresponding to each sub-image region is calculated; wherein, the dynamic range is positively correlated with the dynamic range weight; the probability that the sub-image region includes a halo is positively correlated with the dynamic range weight; the dynamic range adjustment bias parameter characterizes the reference dynamic range of the halo region; For a sub-image region within a first preset range centered on the target sub-image region, obtain the distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range; wherein, the distance between a pixel and a sub-image region is positively correlated with the distance weight; Based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within the first preset range, the pixel dynamic range weight value corresponding to each pixel is calculated; wherein, the distance weight between the pixel and the sub-image region is negatively correlated with the influence of the sub-image region on the pixel dynamic range weight value.

4. The method according to claim 3, characterized in that, Based on the dynamic range and the preset dynamic range adjustment bias parameters, the dynamic range weight corresponding to each sub-image region is calculated, including: Calculate the difference between the dynamic range and the dynamic range adjustment bias parameter to obtain the dynamic range difference value corresponding to each sub-image region; The dynamic range difference is mapped to a specified interval to obtain the dynamic range weight.

5. The method according to claim 3, characterized in that, Based on the dynamic range and the preset dynamic range adjustment bias parameters, the dynamic range weight corresponding to each sub-image region is calculated, including: The dynamic range weight is calculated using a preset dynamic range weight calculation formula, which is as follows: dyStre= ((dyBin- dyBinBase)×dyBinSlope)>>nomalizeShift; Where dyStre represents the dynamic range weight, dyBin represents the dynamic range, dyBinBase represents the dynamic range adjustment bias parameter, dyBinSlope represents the dynamic range adjustment slope parameter, and >>normalizeShift represents normalization.

6. The method according to claim 3, characterized in that, Based on all distance weights corresponding to each pixel and the dynamic range weights corresponding to each sub-image region within the first preset range, the pixel dynamic range weight value corresponding to each pixel is calculated, including: The pixel dynamic range weight value is calculated using a preset formula, which is as follows: dyStreWeight(x,y) = ; Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, dyStre(n) represents the dynamic range weight of the nth sub-image region, and K represents the number of sub-image regions within the first preset range.

7. The method according to claim 3, characterized in that, Obtaining the distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range includes: For a sub-image region within a first preset range centered on the target sub-image region, obtain the horizontal distance weight and vertical distance weight between each pixel in the target sub-image region and each sub-image region within the first preset range; wherein, the greater the horizontal distance between the pixel and the sub-image region, the greater the corresponding horizontal distance weight; the greater the vertical distance between the pixel and the sub-image region, the greater the corresponding vertical distance weight. The distance weight corresponding to each pixel is obtained based on the horizontal distance weight and the vertical distance weight corresponding to each pixel.

8. The method according to claim 7, characterized in that, The process of obtaining the distance weight corresponding to each pixel based on the horizontal and vertical distance weights includes: The distance weight is calculated using a preset distance weight calculation formula, which is as follows: Among them, w d (n) represents the distance weight of a pixel from the nth sub-image region, w h The weight representing the lateral distance of a pixel from the nth image patch, w v The vertical distance weight of a pixel from the nth image block is represented by α, which is a preset distance weight adjustment coefficient.

9. The method according to claim 2, characterized in that, Based on the pixel value of each pixel in each sub-image region, calculate the brightness weight value of each pixel, including: The brightness weight value is calculated based on the target intensity of halo removal and the initial brightness value; wherein, the closer the initial brightness value is to the target intensity of halo removal, the larger the brightness weight value is; the target intensity of halo removal represents the brightness value of the pixel belonging to the halo.

10. The method according to claim 9, characterized in that, Based on the target intensity for halo removal and the initial brightness value, the brightness weight value is calculated, including: The brightness weight value is calculated based on a preset brightness weight value calculation formula, which is as follows: lumaWeight = ; Wherein, lumaWeight represents the brightness weight value, sigma is the preset distribution variance, Luma is the initial brightness value, and glLuma is the target intensity for halo removal; the distribution variance represents the variance calculated from the brightness values ​​of pixels within the preset halo region.

11. The method according to any one of claims 1-10, characterized in that, The initial brightness value of each pixel is corrected based on the target probability of that pixel to obtain the updated brightness value of each pixel, including: The filtered brightness value of each pixel is obtained, which is obtained by filtering the initial brightness value; wherein, the filtering process is a filtering method that takes into account the differences in pixel values. Based on the filtered brightness value and the target probability corresponding to each pixel, the correction amount corresponding to each pixel is obtained; wherein, the larger the target probability, the larger the corresponding correction amount. The updated brightness value of each pixel is obtained based on the initial brightness value and the correction amount corresponding to each pixel.

12. The method according to claim 11, characterized in that, Before obtaining the correction amount for each pixel based on the filtered brightness value and the target probability corresponding to each pixel, the method further includes: The target probability corresponding to each pixel is smoothed between frames to obtain a new target probability. Accordingly, based on the filtered brightness value and the target probability corresponding to each pixel, the correction amount corresponding to each pixel is obtained, including: Based on the filtered brightness value corresponding to each pixel and the new target probability, the correction amount corresponding to each pixel is obtained.

13. The method according to claim 11, characterized in that, Based on the initial brightness value and the correction amount corresponding to each pixel, the updated brightness value of each pixel is obtained, including: Calculate the sum of the initial brightness value and the correction amount corresponding to each pixel to obtain the intermediate brightness value corresponding to each pixel; Based on preset weights, the initial brightness value and the intermediate brightness value corresponding to each pixel are weighted and summed to obtain the updated brightness value.

14. A halo suppression device for tone mapping, characterized in that, include: The acquisition module is used to acquire the dynamic range compression curve of the image to be processed; The processing module is used to calculate the target probability of each pixel based on the pixel value of each pixel in the image to be processed; The target probability characterizes the probability of whether a pixel belongs to the halo; The initial brightness value of each pixel is corrected based on the target probability of each pixel to obtain the updated brightness value of each pixel; wherein, the probability of a pixel belonging to a halo is positively correlated with the increase of the updated brightness value obtained after correction compared with the initial brightness value; based on the updated brightness value of each pixel, the respective mapped brightness value is determined from the dynamic range compression curve to obtain the output image.

15. An electronic device, characterized in that, include: A memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to execute the method as described in any one of claims 1-13.

16. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a computer, performs the method as described in any one of claims 1-13.

17. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-13.