Image processing method and device

By acquiring differential images and dividing area images, evaluating halo parameter values for tone mapping, the problem of edge artifacts in high dynamic range images is solved, and a more natural and clear image effect is achieved.

CN120374469APending Publication Date: 2025-07-25VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510424059.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, edge artifacts are prone to occur when shooting high dynamic range images, especially in scenes with large light ratios, it is difficult for ordinary images to retain the details of the bright and dark parts at the same time, resulting in unreal image effects.

Method used

By acquiring the first image and the differential image, dividing the image into multiple area images, determining the mapping curve of the area image, and evaluating the halo parameter value according to the area image correlation around the pixel point, and performing tone mapping processing in combination with the differential image and the halo parameter value to reduce the generation of edge artifacts.

Benefits of technology

It effectively reduces the appearance of edge artifacts, improves the visual comfort and quality of the image, and makes the image present a better visual effect on the display device and conforms to the human eye's viewing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374469A_ABST
    Figure CN120374469A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, and belongs to the technical field of image processing. The method comprises the steps that a first image and a difference image are acquired, and the difference image is used for representing the difference between the first image and an image obtained after initial movie mapping is carried out on the first image; the first image is divided into a plurality of area images, a mapping curve of each area image is determined, and the pixel value of each pixel point in the first image is associated with a preset number of area images around the pixel point; according to a mapping curve of a preset number of first area images associated with each pixel point, determining a halo parameter value of each pixel point, the halo parameter value being used for representing a halo appearing degree of each pixel point after initial shadow mapping; and according to the difference image and the halo parameter value of each pixel point, performing shadow mapping processing on the first image to obtain a second image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of image processing, and particularly relates to an image processing method and apparatus thereof. Background Art

[0002] With the continuous development of electronic devices, the function of capturing High Dynamic Range (HDR) images has now been widely popularized. The principle is to obtain HDR images with high bit depths through multi-frame exposure, and then restore the highlight information and dark area details in the high dynamic environment. Subsequently, the high-bit-depth images are compressed into low-bit-depth Standard Dynamic Range (SDR) images through tone mapping for screen display.

[0003] Generally, HDR images need to be captured only in scenes with a large light ratio, such as backlit portrait scenes and indoor window scenes during the day. In these scenes with a large light ratio, it is difficult to clearly capture the details of both the bright and dark parts in a normal image, so HDR images need to be captured to better present the picture. In order to make the image effect better and closer to what the human eye sees, a method called Local Contrast Enhancement (LCE) is used.

[0004] However, after enhancing the contrast, some unrealistic phenomena are likely to appear at the edges between light and dark, and this phenomenon is called edge artifacts. Therefore, there is an urgent need to improve the edge artifact phenomenon of images currently. Summary of the Invention

[0005] The purpose of the embodiments of this application is to provide an image processing method and apparatus thereof, which can improve the edge artifact phenomenon of images.

[0006] In a first aspect, the embodiments of this application provide an image processing method, which includes:

[0007] Obtain a first image and a difference image, where the difference image is used to represent the difference between the first image and the image obtained after initial tone mapping of the first image;

[0008] Divide the first image into multiple regional images, and determine the mapping curve of each regional image. The pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point;

[0009] Determine the halo parameter value of each pixel point according to the mapping curves of a preset number of first regional images associated with each pixel point. The halo parameter value is used to represent the degree of halo appearance of each pixel point after initial tone mapping;

[0010] Perform tone mapping processing on the first image according to the differential image and the halation parameter values of each pixel point to obtain a second image.

[0011] In a second aspect, an embodiment of the present application provides an image processing apparatus, which includes:

[0012] An acquisition module, configured to acquire a first image and a differential image, where the differential image is used to characterize the difference between the first image and an image obtained after performing initial tone mapping on the first image;

[0013] A partitioning module, configured to partition the first image into multiple regional images and determine the mapping curve of each regional image, where the pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point;

[0014] A determination module, configured to determine the halation parameter value of each pixel point according to the mapping curves of a preset number of first regional images associated with each pixel point, where the halation parameter value is used to characterize the degree of halation that appears at each pixel point after initial tone mapping;

[0015] A processing module, configured to perform tone mapping processing on the first image according to the differential image and the halation parameter values of each pixel point to obtain a second image.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0018] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect.

[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0020] In an embodiment of the present application, by obtaining a first image and a differential image, where the differential image is used to characterize the difference between the first image and the image obtained after performing an initial tone mapping on the first image, the first image is divided into multiple regional images, and the mapping curves of each regional image are determined. The pixel values of each pixel point in the first image are associated with a preset number of regional images around the pixel point. The tone change of the pixel point is affected by the surrounding regions. This association method takes into account the context information of the pixel point, making the subsequent processing of the pixel point more accurate. According to the mapping curves of the preset number of first regional images associated with each pixel point, the degree of halation that each pixel point appears after the initial tone mapping can be evaluated, that is, the halation parameter value is obtained. The mapping curve of the regional image reflects the tone change of the regional image. If the tone change of the surrounding region of the pixel point is drastic, then the possibility of the pixel point appearing halation is relatively large, and the corresponding halation parameter value is relatively high. In this way, the regional images prone to edge artifacts can be accurately identified. The differential image provides the change information of the image after the initial tone mapping, and the halation parameter value clarifies the degree of halation that each pixel point appears. By combining the differential image and the halation parameter values of each pixel point to perform tone mapping processing on the first image to obtain a second image, over-enhancing the contrast in the regional images prone to edge artifacts can be avoided, thereby reducing the generation of edge artifacts. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present application;

[0022] Figure 2a is a schematic diagram of a regional image provided by an embodiment of the present application;

[0023] Figure 2b is a schematic diagram of the regional images around a pixel point provided by an embodiment of the present application;

[0024] Figure 2c is a schematic diagram of an attenuation coefficient provided by an embodiment of the present application;

[0025] Figure 2d is a schematic diagram of an attenuation mapping curve provided by an embodiment of the present application;

[0026] Figure 2e is a schematic diagram of an attenuation curve provided by an embodiment of the present application;

[0027] Figure 3 is a flowchart of an image processing method provided by an embodiment of the present application;

[0028] Figure 4 is a structural diagram of an image processing device provided by an embodiment of the present application;

[0029] Figure 5 is one of the schematic diagrams of the hardware structure of the electronic device according to an embodiment of the present application;

[0030] Figure 6 is the second of the schematic diagrams of the hardware structure of the electronic device according to an embodiment of the present application. Detailed implementation manners

[0031] Next, the technical solutions of the embodiments of the present application will be clearly described in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.

[0033] Next, the technical terms related to the embodiments of the present application will be described:

[0034] HDR: It is an image processing technology aimed at presenting a wider range of brightness values and color details by expanding the dynamic range of an image or video. It can simultaneously retain rich information in both highlight and shadow areas, preventing the highlights from being overexposed and the shadows from being underexposed, thus making the image look closer to what the human eye sees in the real world.

[0035] SDR: It is the traditional standard for the dynamic range of images and videos, which has a relatively narrow brightness and color range. In SDR, the brightness of an image is usually limited within a certain range, and the color performance is not as rich as that of HDR.

[0036] LCE: It is an image processing technology that mainly focuses on enhancing the contrast of local regions in an image rather than making a unified contrast adjustment for the entire image. By analyzing different regions of the image, it can specifically improve the clarity and layering of local details.

[0037] Halo: Halo is a defect that appears during the image processing process, manifested as an unnatural bright or dark halo around the edges of objects in the image. This phenomenon makes the edges of the objects look unnatural and affects the overall quality and realism of the image.

[0038] Difference (Diff) Image: The Diff image is obtained by performing a difference operation on two images, mainly showing the difference information between the two images. The difference operation usually subtracts the grayscale values or color values of corresponding pixels. In the resulting difference image, a pixel value of zero indicates that the pixel at that position is the same in both images, while a non-zero value indicates a difference.

[0039] The image processing method provided by the embodiments of this application can be applied to at least the following application scenarios, which will be described below.

[0040] Currently, the function of taking HDR photos is very common in electronic devices. By using the multi-frame exposure method to obtain a high-bit HDR photo, the information of highlights in a high-dynamic range environment and the details of dark areas can be restored. Exposure is the process of light entering the camera to make the photo sensitive. Multi-frame exposure means taking several photos. Some photos have a longer exposure time, making bright areas brighter, and some photos have a shorter exposure time, making dark areas darker. Then, by combining multiple photos, a high-bit HDR photo is obtained. The bit can be understood as a numerical value representing information such as color. The higher the bit, the more and richer information can be represented.

[0041] In real-world scenarios, some places are extremely bright, such as the sun or lights, while some places are extremely dark, such as in shadows. This is a high-dynamic range environment. HDR photos can display the information of these extremely bright places, such as the degree of brightness and color, and the details of extremely dark places, such as the shape and texture of objects in the dark areas, with a better effect than ordinary photos. The information in high-bit images is very rich, but the screens of electronic devices generally support low-bit image display, such as mobile phone screens and computer screens. Therefore, the high-bit image needs to be compressed to a low-bit SDR image through tone mapping for screen display, and at the same time, through the LCE algorithm, the information presented in the photo is made closer to what the human eye sees.

[0042] Generally, scenes with a large light ratio require taking HDR photos. For example, in backlit portrait scenes and indoor window scenes during the day, the light ratio is the brightness difference between the brightest and darkest parts of the picture. In some scenes, the brightness difference between the brightest and darkest places is extremely large, which is a scene with a large light ratio. When taking a backlit portrait, there is a very bright light source behind the person, while the parts facing the camera, such as the face, are relatively dark. Also, during the day indoors, the area near the window is very bright, but other areas far from the window inside the room are relatively dark. In these scenes with a large light ratio, it is difficult for ordinary photos to clearly capture the details of both the bright and dark parts at the same time, so HDR photos need to be taken to better present the picture.

[0043] To make the photo look better and closer to what the human eye sees, LCE is used to divide the photo into small regions, i.e., blocks, and then a sliding window of a fixed size is moved over these blocks. Every time it reaches a block, contrast enhancement is performed on this block, that is, the bright areas in this block become brighter and the dark areas become darker, making it look clearer and more layered.

[0044] However, when there is exactly a boundary between very bright and very dark parts in a block, for example, half of a block is a particularly bright area and the other half is a particularly dark area, after processing this block to enhance the contrast, some unrealistic phenomena are likely to appear at the bright-dark edge. This phenomenon is called edge artifact, also known as halo phenomenon. Halo means a halo or a ring, describing a strange phenomenon that looks like there is a halo.

[0045] In view of the problems in the related technology, the embodiments of the present application provide an image processing method and its device, which can improve the edge artifact phenomenon of the image.

[0046] The following will combine the accompanying drawings and specifically illustrate the image processing method provided by the embodiments of the present application through specific embodiments and their application scenarios.

[0047] Figure 1 It is a flowchart of an image processing method provided by the embodiments of the present application.

[0048] As Figure 1 shown, the image processing method may include step 110 - step 140. This method is applied to an image processing device and is specifically as follows:

[0049] Step 110, obtain a first image and a difference image, where the difference image is used to represent the difference between the first image and the image obtained after performing an initial tone mapping on the first image;

[0050] First image: refers to the original image that needs to be subjected to tone mapping processing, and is the starting input image data of the entire image processing process.

[0051] Difference image: used to represent the difference between the first image and the image obtained after performing an initial tone mapping on the first image. It records the partial information of the image that has changed after the initial tone mapping operation. By comparing the differences between the two, it provides a data basis for subsequent processing and helps to adjust the image more targeted.

[0052] The principle of obtaining the first image and the difference image is as follows: First, the first image to be processed is obtained, and then an initial tone mapping process is performed on the first image to obtain a preliminarily processed image. By calculating the difference between the original first image and the preliminarily processed image, a difference image is generated. This difference calculation can be based on the comparison of information such as the brightness and color of pixel points, so as to obtain difference image data that can reflect the changes between the two.

[0053] By obtaining the first image and the difference image, it provides the basic data for subsequent processing. The difference image can clearly show the changes in the image after the initial tone mapping, enabling subsequent processing to optimize and adjust these changes in a targeted manner.

[0054] Among them, the relationship between the first image and the difference image can be expressed by the following formula (1):

[0055] I SDRori = I HDR - Y ori (1)

[0056] I HDR is the first image, and Y ori is the difference image.

[0057] Step 120: Divide the first image into multiple regional images, and determine the mapping curve of each regional image. The pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point;

[0058] Regional image: It is multiple sub-image blocks obtained by dividing the first image. By dividing the image into multiple regions, the characteristics of different regions can be analyzed and processed separately, so as to more finely control the tone change of the image.

[0059] Mapping curve: For each regional image, there is a corresponding mapping curve. It describes the conversion relationship between the original tone and the tone after tone mapping processing of the pixel points in this regional image. The tone of the regional image can be adjusted and controlled through the mapping curve.

[0060] Dividing the first image into multiple regional images is to analyze and process different parts of the image more carefully. Each regional image has its unique characteristics, such as brightness distribution, texture, etc. By determining the mapping curve of each regional image, personalized tone mapping processing can be performed according to the characteristics of different regions. The pixel value of each pixel point in the first image is associated with a preset number of regional images around it, considering that the tone change of the pixel point is not only related to itself, but also affected by the surrounding area. In this way, the context information of the pixel point can be considered more comprehensively, making the determination of the mapping curve more accurate and reasonable.

[0061] Step 130, determining a halo parameter value of each pixel point according to a mapping curve of a preset number of first area images associated with each pixel point, wherein the halo parameter value is used to characterize the degree of halo appearing at each pixel point after initial tone mapping;

[0062] Halo parameter value: used to characterize the degree of halo at each pixel after the initial tone mapping. Halo is usually a visual effect that may appear during the image tone processing, such as the bright edge phenomenon caused by excessive edge enhancement. The halo parameter value quantifies the degree of this halo phenomenon at each pixel, so as to correct and optimize the image later.

[0063] The halo parameter value is determined based on the mapping curves of a preset number of first area images associated with each pixel. Since the mapping curves of different area images reflect the change of the tone of the area, by comprehensively considering the mapping curves of multiple area images around the pixel, the possibility and degree of halo appearing at the pixel after the initial tone mapping can be evaluated. For example, if the tone of the surrounding area changes more dramatically, the possibility of halo appearing at the pixel is greater, so a correspondingly higher halo parameter value can be determined for it.

[0064] By determining the halo parameter value of each pixel, the degree of halo at the pixel can be quantified. This allows accurate correction and optimization of the halo problem in the subsequent tone mapping process, reducing the occurrence of halo in the image and improving the visual comfort and quality of the image.

[0065] Step 140: Perform tone mapping processing on the first image according to the difference image and the halo parameter value of each pixel point to obtain a second image.

[0066] Tone mapping: It is an image processing technology that aims to map the brightness range of a high dynamic range image to the display range of a low dynamic range image, while retaining the image details and visual effects as much as possible, so that the image presents better visual quality on the display device.

[0067] The first image is tone mapped according to the difference image and the halo parameter value of each pixel. The difference image provides information about the change of the image after the initial tone mapping, while the halo parameter value reflects the situation of halo appearing at the pixel. Combining the information of the two, the first image can be further adjusted to correct the unreasonable changes caused by the initial tone mapping while reducing the occurrence of halo phenomenon, thereby obtaining a second image with better quality.

[0068] By performing tone mapping on the first image based on the difference image and the halo parameter value, the changes after the initial tone mapping and the halo problem are comprehensively considered, and a higher-quality second image can be obtained. In this way, the tone of the image can be effectively improved, the adverse effects caused by the tone mapping process can be reduced, and the image can present a better visual effect on the display device, meeting the user's requirements for image quality.

[0069] Taking the first image as an HDR image and the image obtained after performing the initial tone mapping on the first image as an SDR image for illustration, after the camera finishes shooting in the HDR mode, it is a high-bit image. During the local contrast adjustment process of compressing it into a low-bit image, the halo phenomenon is likely to occur. The first image is the original high-bit HDR image. Performing the initial tone mapping on it is a preliminary attempt at converting to a low-bit image. The difference image reflects the difference between the images before and after the initial tone mapping, which contains the information about the possible halo generated due to local contrast adjustment. By comparing the images before and after the initial tone mapping, the regions with drastic tone changes in the image can be found, and these regions are often the places where the halo is likely to appear.

[0070] The first image is divided into multiple regional images, and each regional image has its unique tone characteristics. Determining the mapping curves of each regional image is for personalized tone adjustment of different regions. Since each pixel is associated with a preset number of surrounding regional images, the tone change of the pixel will be affected by the surrounding regions. This association method takes into account the context information of the pixel, making the subsequent processing of the pixel more accurate.

[0071] According to the mapping curves of the preset number of first regional images associated with each pixel, the degree of halo occurrence of each pixel after the initial tone mapping can be evaluated, that is, the halo parameter value can be obtained. The mapping curve of the regional image reflects the tone change of the region. If the tone change of the surrounding region of the pixel is drastic, then the possibility of the pixel having a halo is relatively high, and the corresponding halo parameter value is also higher. In this way, the blocks prone to halo can be accurately identified.

[0072] The difference image provides the change information of the image after the initial tone mapping, and the halo parameter value clarifies the degree of halo occurrence of each pixel. Combining the two to perform tone mapping on the first image, for the blocks with a higher halo parameter value, that is, the blocks prone to halo, attenuation processing will be performed during local contrast enhancement. This can avoid excessive contrast enhancement in these regions, thereby reducing the generation of halo.

[0073] Therefore, it is possible to more reasonably brighten the high - light area and darken the dark area, making the tone at the boundary between the high - light area and the dark area more in line with the human eye's perception. The finally obtained second image reduces the halo phenomenon while restoring the details of the dark area and the high - light area, improving the user experience when viewing photos.

[0074] In a possible embodiment, in step 130, it may specifically include the following steps:

[0075] For any one of the pixel points, according to the mapping curves of a preset number of regional images associated with the pixel point, determine the mapping values of the central points of each of the regional images;

[0076] For any one of the central points, determine the absolute value of the difference between the mapping value of the central point and the mapping values of the central points of its adjacent regional images, obtaining a plurality of mapping differences;

[0077] Determine the maximum value among the plurality of mapping differences as the halo parameter value.

[0078] Since each regional image has a corresponding mapping curve, which describes the conversion relationship of the tones of the pixel points within the region. Because the central point is in the middle position of the region and is affected by the comprehensive influence of the surrounding pixels, the central point of the regional image can, to a certain extent, represent the overall tone characteristics of the region. By calculating the mapping value of the central point after tone mapping through the mapping curve, a representative value of the tone change in the region can be obtained. In this way, for a plurality of regional images associated with a pixel point, a plurality of such representative mapping values can be obtained, providing basic data for subsequent analysis of the halo situation.

[0079] For example, the mapping curve of a regional image is a function for tone mapping according to brightness. Substituting the original brightness value of the central point into this function can obtain the brightness value of the central point after tone mapping, that is, the mapping value of the central point.

[0080] The halo phenomenon usually appears at the boundaries where the tone changes are relatively drastic between different regions in an image. By calculating the absolute value of the difference between the mapping value of a central point and the mapping values of the central points of adjacent regional images, the degree of tone change between adjacent regions can be measured. The use of the absolute value is to ensure that the obtained difference is a positive number, accurately reflecting the magnitude of the difference between the two central points' mapping values regardless of which one is larger or smaller. Performing such calculations for each central point can obtain a plurality of such mapping differences, which reflect the tone change situations between different regions.

[0081] Among multiple mapping differences, the maximum value represents the situation where the tonal change between adjacent regions is the most drastic. Since the halation phenomenon often appears where the tonal change is the most obvious, using this maximum value as the halation parameter value for the pixel can well quantify the possibility and degree of halation occurring after the initial tonal mapping. The larger the maximum value, the more drastic the tonal change in the surrounding area of the pixel, the higher the possibility of halation, and the larger the corresponding halation parameter value.

[0082] As Figure 2a shown, it is a schematic diagram of dividing the first image into multiple regional images. Figure 2a The side length of each small regional image is N. Taking the preset number as 4 for illustration, the tonal mapping process is carried out in units of 2N * 2N. Here, f(X) is used to represent the mapping curve of each 2N * 2N regional image.

[0083] As Figure 2b shown, the four overlapping 2N * 2N regional images are respectively denoted as A, B, C, and D. Among them, f(A) refers to the mapping curve of the 2N * 2N regional image centered at point A, and f(D) refers to the mapping curve of the 2N * 2N regional image centered at point D. By analogy, the mapping curves of the 2N * 2N regional images centered at points B and C are f(B) and f(C) respectively. The mapping curve of each regional image is usually related to the content of that regional image.

[0084] Among them, the determination method of the halation parameter value can be expressed by the following formula two:

[0085] Z = MAX{|f(A) - f(B)|, |f(A) - f(C)|, |f(B) - f(D)|, |f(C) - f(D)|} (2)

[0086] Z is the halation parameter value, which is the difference between the mapping value of the center point and the mapping values of the center points of its adjacent regional images, including: f(A) - f(B), f(A) - f(C), f(B) - f(D), and f(C) - f(D).

[0087] Using the mapping value of the center point to represent the tonal change situation of the region can simplify the analysis of the regional tone and at the same time capture the main characteristics of the regional tone. In this way, without considering the complex situations of all pixel points within the region, the key information of the regional tonal change can be quickly obtained, improving the processing efficiency.

[0088] By calculating the difference in the mapped values of adjacent central points, the degree of tonal change between adjacent regions can be accurately captured. This is very effective for detecting the boundaries of regions where halos may occur, because halos usually appear in places where the tonal changes are relatively large. This method can quantify the tonal differences between regions and provide reliable data support for subsequent determination of halo parameter values.

[0089] Determining the maximum value among multiple mapping differences as the halo parameter value can highlight the situation where halos are most likely to occur. The obtained halo parameter value can accurately reflect the degree of halo occurrence at pixel points, enabling targeted adjustment of pixel points according to this parameter value during subsequent tone mapping processing, effectively reducing the occurrence of halo phenomena and improving the overall quality and visual effect of the image.

[0090] In a possible embodiment, as Figure 3 shown, in step 140, it may specifically include the following steps:

[0091] Step 210, determining the attenuation curve for each of the pixel points according to the halo parameter values of each of the pixel points;

[0092] Step 220, performing tone mapping processing on the first image according to the difference image and the attenuation curves of each of the pixel points to obtain a second image.

[0093] Attenuation curve: In image processing, it is used to describe the relationship between the degree of tone adjustment of a pixel point and the halo parameter value. Through the attenuation curve, the tone of a pixel point can be adjusted to different degrees according to the halo parameter value to reduce the influence of halos.

[0094] Regarding step 210: The halo parameter value reflects the degree of halo occurrence at a pixel point after initial tone mapping. Different halo parameter values correspond to different halo influence situations. In order to process each pixel point in a targeted manner, it is necessary to determine a suitable attenuation curve for it.

[0095] The larger the halo parameter value, the more severely the pixel point is affected by the halo. Then, the corresponding attenuation curve will result in a greater degree of tone adjustment for the pixel point to reduce the visual effect of the halo; conversely, the smaller the halo parameter value, the smaller the degree of tone adjustment corresponding to the attenuation curve. The determination of the attenuation curve can be based on some preset function models, such as linear functions, non-linear functions, etc. Taking the halo parameter value as the input, the parameters of the attenuation curve are obtained through function calculation, thereby determining the specific attenuation curve.

[0096] Involves step 220: The differential image records the difference information between the first image after initial tone mapping and the original image, which provides information on which parts of the image have changed and the degree of change after the initial processing. The attenuation curve of each pixel provides a specific rule for tone adjustment of each pixel. When performing tone mapping processing, the information of the differential image and the attenuation curve of the pixel are combined to adjust each pixel in the first image.

[0097] For pixels in the differential image that show large changes and have a high halo parameter value, a large adjustment is made according to their corresponding attenuation curves; for pixels with small changes and a low halo parameter value, a small adjustment is made. This can correct the unreasonable changes caused by the initial tone mapping while effectively reducing the halo phenomenon, thereby obtaining a second image with better quality.

[0098] Thus, according to the halo parameter values of each pixel, the attenuation curve of each pixel is determined, and a suitable attenuation curve is determined for each pixel, realizing personalized processing of pixels. Since the halo influence degrees of different pixels are different, by separately determining the attenuation curves for them, the tone of each pixel can be adjusted more accurately, avoiding the problem of over-processing or under-processing of some pixels that may be caused by unified processing, and improving the accuracy and pertinence of image processing.

[0099] Combining the differential image and the attenuation curve for tone mapping processing of the first image comprehensively considers the change situation and halo problem after the initial image processing. This can effectively improve the tone of the image, reduce the unreasonable changes caused by the initial tone mapping, and at the same time minimize the occurrence of the halo phenomenon to make the finally obtained second image more natural and clear visually, enhancing the overall quality and viewing effect of the image.

[0100] In a possible embodiment, in step 210, it may specifically include the following steps:

[0101] Step 310, respectively determine the attenuation coefficient values of each pixel according to the halo parameter values of each pixel;

[0102] Step 320, respectively determine the attenuation curves of each pixel according to the attenuation coefficient values of each pixel and the mapping curves of a preset number of regional images associated with each pixel.

[0103] The halo parameter value has quantified the degree of halo for each pixel after the initial tone mapping. In order to adjust the tone of the pixel to reduce the effect of halo, a coefficient is needed to control the adjustment amplitude, that is, the attenuation coefficient value. This mapping can be achieved through a linear function or a nonlinear function. The appropriate function form is determined based on actual conditions and experience. In this way, pixels with different halo degrees will get different attenuation coefficient values, thereby providing different adjustment amplitude basis for subsequent tone adjustment.

[0104] Each pixel is associated with a preset number of regional images, and the mapping curves of these regional images describe the conversion relationship of the tone of the pixels in the region. The attenuation coefficient value determines the amplitude of the pixel tone adjustment. Combining the attenuation coefficient value with the mapping curve of the regional image is to determine its attenuation curve based on the tone changes of the area around the pixel and the adjustment amplitude required for the pixel.

[0105] For each pixel, the mapping curves of the image in its associated area and the attenuation coefficient value can be transformed in some form to obtain an attenuation curve suitable for the pixel. This attenuation curve can be used to guide the adjustment of the tone of the pixel, so as to reduce the halo effect while maintaining the original features and details of the image as much as possible.

[0106] Therefore, by determining the attenuation coefficient value according to the halo parameter value, quantitative control of the pixel tone adjustment amplitude is achieved. Since the halo degree of different pixels is different, the obtained attenuation coefficient value is also different, which makes the subsequent pixel tone adjustment more precise and accurate. It can give corresponding degrees of adjustment for different degrees of halo problems, avoiding the problem of over-adjustment or under-adjustment caused by using the same adjustment amplitude for all pixels, and improving the quality and effect of image processing.

[0107] The attenuation curve is determined by combining the attenuation coefficient value of the pixel and the mapping curve of the associated area image, taking into account the tone characteristics of the area around the pixel and the halo of the pixel itself. The attenuation curve determined in this way can more accurately reflect the tone adjustment method actually required for each pixel, while reducing the halo phenomenon, better retaining the details and original tone characteristics of the image. For example, for pixels at the edge of the image with severe halo, the appropriate attenuation curve can reduce the halo while maintaining the clarity and natural transition of the edge, making the final image more natural and realistic visually, improving the overall quality and viewing value of the image.

[0108] Wherein, step 310 may specifically include the following steps:

[0109] In the case where the halo parameter value is greater than the first threshold value and less than the second threshold value, determining the attenuation coefficient value according to the halo parameter value, and the halo parameter value is inversely proportional to the attenuation coefficient value; or,

[0110] When the halo parameter value is greater than or equal to a second threshold, the attenuation coefficient value is determined as a target attenuation value.

[0111] The first threshold is a pre-set limit. When the halo parameter value is greater than the first threshold and less than the second threshold, it means that the degree of halo at the pixel point has reached a level that requires a certain degree of tone adjustment. The halo parameter value and the attenuation coefficient value are set to be in an inverse relationship because the more severe the halo is, the more significant the tone adjustment is required to effectively reduce the halo effect, but it cannot be adjusted excessively, so the attenuation coefficient value should be smaller.

[0112] For example, this relationship can be realized by an inverse proportional function y=xk, where x is the halo parameter value, y is the attenuation coefficient value, and k is a constant. In this way, different degrees of halo can correspond to different attenuation coefficients, thereby achieving differentiated adjustment of pixel tone.

[0113] The second threshold is a value greater than the first threshold. When the halo parameter value exceeds the second threshold, it means that the halo phenomenon of the pixel is very serious. At this time, if the attenuation coefficient value is determined according to the inverse proportional relationship, it may cause excessive tone adjustment and destroy the original characteristics of the image. Therefore, the attenuation coefficient value is fixed to the target attenuation value. The target attenuation value is an appropriate value determined by experience or experiment. It can effectively reduce severe halo while trying to maintain the basic information and visual effects of the image and avoid the negative effects caused by excessive adjustment.

[0114] As the halo parameter value Z increases, the halo phenomenon gradually intensifies, such as Figure 2c As shown, when Z is less than Z1, the mapping diagram of the attenuation coefficient k and Z indicates that the halo phenomenon is very weak or there is no halo phenomenon. At this time, the attenuation coefficient k is 1, that is, there is no need to process the first image through the attenuation coefficient value.

[0115] When Z is between Z1 and Z2, the attenuation coefficient k decreases as Z increases. That is, when the halo parameter value is greater than the first threshold and less than the second threshold, the attenuation coefficient value is determined according to the halo parameter value, and the halo parameter value is inversely proportional to the attenuation coefficient value. The first threshold is Z1, and the second threshold is Z2.

[0116] When Z is greater than Z2, it indicates that the halo phenomenon is very serious, and the attenuation coefficient is k1 at this time, that is, when the halo parameter value is greater than the second threshold, the attenuation coefficient value is determined as the target attenuation value. The target attenuation value is k1.

[0117] Therefore, by setting the first threshold and establishing an inverse relationship between the halo parameter value and the attenuation coefficient value, the fine processing of the halo pixels of different degrees is achieved, and the attenuation coefficient is dynamically adjusted according to the specific halo parameter value, so as to make appropriate tone adjustment. In this way, the details and original tones of the image can be retained as much as possible while reducing the halo, avoiding the problem of insufficient or excessive adjustment that may be caused by using the same processing method for all pixels, and improving the accuracy and flexibility of image processing.

[0118] When the halo parameter value exceeds the second threshold, the attenuation coefficient value is fixed to the target attenuation value, which can effectively deal with severe halo conditions. This avoids the problem of over-adjustment caused by severe halo, and ensures that while reducing severe halo, the image will not lose its original features and details due to over-adjustment. This processing method enhances the stability and reliability of image processing, so that the final processed image can maintain good visual effects in various halo conditions.

[0119] Therefore, by setting different thresholds and adopting different attenuation coefficient determination methods, targeted tone adjustment can be performed according to the different degrees of pixel halo, thereby improving the quality and adaptability of image processing.

[0120] Among them, step 320 may specifically include the following steps:

[0121] Determine the attenuation mapping curve of each pixel point according to the attenuation coefficient value of each pixel point and the mapping curves of a preset number of regional images associated with each pixel point;

[0122] A bilateral filtering process is performed on the attenuation mapping curve of each pixel point to obtain the attenuation curve of each pixel point.

[0123] Attenuation mapping curve: It is a curve preliminarily determined based on the attenuation coefficient value of the pixel point and the mapping curve of its associated regional image, and is used to describe the preliminary adjustment rules of the pixel point tone.

[0124] Bilateral filtering: This is a nonlinear filtering method that can preserve the edge information of the image while smoothing the image. In image processing, bilateral filtering takes into account the spatial distance of pixels and the difference in pixel values, and performs filtering operations on the image, making the relationship between adjacent pixels smoother and more natural without blurring the edges of the image.

[0125] The attenuation coefficient value of each pixel determines the amplitude of the tone adjustment for that pixel, while the mapping curve of the associated regional image reflects the tone conversion relationship of the area around that pixel. Combining the attenuation coefficient value with the mapping curve of the regional image is to adjust the mapping curve of the regional image according to the halation adjustment requirements of the pixel itself and the tone characteristics of its surrounding area.

[0126] In the initially determined attenuation mapping curve, there may be some discontinuities or noises caused by local halation conditions or calculation errors. These discontinuities and noises may have an adverse impact on subsequent tone mapping processing, such as causing the image to appear jagged or having unnatural transitions. Bilateral filtering processing smooths the attenuation mapping curve by considering the spatial position of the pixels and the differences in pixel values. Spatially, it performs weighted averaging on the attenuation mapping curve values of adjacent pixels; in terms of pixel values, it adjusts the weighting coefficients according to the differences in pixel values, so that the edges and detail information of the curve can be retained during the smoothing process. The resulting attenuation curve is smoother and more natural, which can reduce halation while ensuring a more natural tone transition in the image and avoiding discontinuous or abrupt effects.

[0127] Among them, the determination method of the attenuation mapping curve of the pixel can be expressed by the following formula three:

[0128]

[0129] k is the attenuation coefficient value, f(A), f(B), f(C), f(D) are the mapping curves of the regional image associated with the pixel, and d A , d B , d C , d D are the distances from the center points of the four regional images associated with the pixel to the pixel P in the overlapping area.

[0130] As Figure 2d shown, Figure 2d used to characterize that there are strong edges in the attenuation mapping curves of each of the said pixels, Figure 2d the left side of the position pointed by the arrow in Figure 2d is black and the right side is white, indicating that the Z values of two adjacent sub-blocks differ greatly. If convolution is directly performed, the resulting attenuation curve will also have a large jump near this dividing line, resulting in brightness blocks in the finally obtained second image due to block processing, which is called block effect. Therefore, a bilateral filter needs to be applied to Figure 2d to obtain a smooth attenuation curve. The attenuation curve f”(X), as Figure 2e shown.

[0131] Thus, by combining the attenuation coefficient value and the mapping curve of the regional image to determine the attenuation mapping curve, the halo situation of the pixel itself and the tone characteristics of its surrounding area can be fully considered, realizing personalized adjustment of the pixel tone. Due to different halo parameter values and associated regions, different pixels will obtain different attenuation mapping curves, thus more accurately adjusting the tone of each pixel and improving the pertinence and accuracy of image processing.

[0132] Perform bilateral filtering on the attenuation mapping curve, effectively removing the noise and discontinuous parts in the curve and making the attenuation curve smoother. This helps to achieve natural transition of the image tone in subsequent tone mapping processing and avoid jagged or unnatural tone changes. At the same time, bilateral filtering can retain the edge information of the curve, so that while reducing the halo, the details and edges of the image will not be overly blurred, ensuring the clarity and visual quality of the image. The finally obtained second image is more natural and smooth in tone, reduces the halo phenomenon, and improves the overall viewing effect.

[0133] In a possible embodiment, step 220 may specifically include the following steps:

[0134] Convolve the difference image and the attenuation curves of each pixel point to obtain an attenuated difference image;

[0135] Subtract the first image from the attenuated difference image to obtain a second image.

[0136] The difference image records the difference information between the first image after initial tone mapping and the original image, and the attenuation curves of each pixel point are adjustment rules determined according to the halo situation of the pixel point and the tone characteristics of its surrounding area.

[0137] Convolution is a mathematical operation. In image processing, it can combine the difference image and the attenuation curve to achieve specific processing of the image. By convolving the difference image and the attenuation curve, the corresponding pixel values in the difference image can be adjusted according to the attenuation curve of each pixel point.

[0138] Specifically, the convolution operation will perform weighted summation of the pixel value at each pixel position in the difference image and the corresponding coefficients of the attenuation curve in its neighborhood to obtain a new pixel value. In this way, the unreasonable changes caused by the initial tone mapping in the original difference image will be attenuated according to the halo situation of the pixel point, obtaining an attenuated difference image and reducing the factors that may cause adverse effects such as halos.

[0139] In image processing, the difference image represents the difference between the image after a certain processing and the original image. By subtracting the first image from the attenuated difference image, a reverse adjustment is actually performed on the first image. Since the attenuated difference image has been adjusted according to the halation situation of the pixel points, the subtraction operation can correct the unreasonable changes generated in the initial tone mapping process to a certain extent and reduce the halation phenomenon at the same time.

[0140] For example, if the initial tone mapping causes the brightness of a certain area to increase too much and the value of this area in the difference image is positive, then after the subtraction operation, the brightness of this area will decrease accordingly; conversely, if the initial tone mapping causes the brightness of a certain area to decrease too much and the value of this area in the difference image is negative, the brightness of this area will increase after the subtraction operation. In this way, the tone of the image can be made more natural, and finally a second image with better quality can be obtained. The determination method of the second image can be specifically represented by the following formula (4) and formula (5):

[0141] Y new = f”(X) * Y ori (4)

[0142] I SDRnew = I HDR - Y new (5)

[0143] f”(X) is the attenuation curve, Y ori is the difference image, Y new is the attenuated difference image;

[0144] I SDRnew is the second image.

[0145] By combining the difference image and the attenuation curve through the convolution operation, a personalized adjustment of the pixel values in the difference image is realized. Attenuating the difference image according to the halation situation of each pixel point can specifically reduce the tone changes that may cause the halation phenomenon, avoiding the problems of over-adjustment or under-adjustment that may occur in the unified processing of the entire image. In this way, the subsequent tone adjustment can be more accurate, improving the quality and effect of image processing.

[0146] Subtracting the first image from the attenuated difference image effectively corrects the unreasonable changes generated in the initial tone mapping process. While reducing the halation phenomenon, the original details and features of the image are retained as much as possible. The finally obtained second image is more natural and balanced in tone, and the visual effect is significantly improved, meeting the user's requirements for high-quality image processing.

[0147] In an embodiment of the present application, by obtaining a first image and a difference image, where the difference image is used to represent the difference between the first image and the image obtained after performing an initial tone mapping on the first image, the first image is divided into multiple regional images, and the mapping curve of each regional image is determined. The pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point. The tone change of the pixel point is affected by the surrounding regions. This association method takes into account the context information of the pixel point, making the subsequent processing of the pixel point more accurate. According to the mapping curves of the preset number of first regional images associated with each pixel point, the degree of halation that each pixel point appears after the initial tone mapping can be evaluated, that is, the halation parameter value is obtained. The mapping curve of the regional image reflects the tone change of the regional image. If the tone change of the surrounding region of the pixel point is drastic, then the possibility of the pixel point appearing halation is relatively large, and the corresponding halation parameter value is also higher. In this way, the regional images prone to edge artifacts can be accurately identified. The difference image provides the change information of the image after the initial tone mapping, and the halation parameter value clarifies the degree of halation that each pixel point appears. By combining the difference image and the halation parameter values of each pixel point to perform tone mapping processing on the first image, a second image can be obtained, which can avoid over-enhancing the contrast in the regional images prone to edge artifacts, thereby reducing the generation of edge artifacts.

[0148] For the image processing method provided in the embodiment of the present application, the execution subject may be an image processing device. In the embodiment of the present application, taking the image processing device executing the image processing method as an example, the image processing device provided in the embodiment of the present application is described.

[0149] Figure 4 FIG. 7 is a block diagram of an image processing device provided in an embodiment of the present application. The device 400 includes:

[0150] An obtaining module 410, configured to obtain a first image and a difference image, where the difference image is used to represent the difference between the first image and the image obtained after performing an initial tone mapping on the first image;

[0151] A dividing module 420, configured to divide the first image into multiple regional images, and determine the mapping curve of each of the regional images. The pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point;

[0152] A determining module 430, configured to determine the halation parameter value of each pixel point according to the mapping curves of the preset number of first regional images associated with each pixel point. The halation parameter value is used to represent the degree of halation that each pixel point appears after the initial tone mapping;

[0153] A processing module 440, configured to perform tone mapping processing on the first image according to the differential image and the halation parameter values of each of the pixel points, so as to obtain a second image.

[0154] In a possible embodiment, the determining module 430 is specifically configured to:

[0155] For any one of the pixel points, determine the mapping values of the central points of each of the regional images according to the mapping curves of a preset number of regional images associated with the pixel point;

[0156] For any one of the central points, determine the absolute value of the difference between the mapping value of the central point and the mapping values of the central points of its adjacent regional images, so as to obtain a plurality of mapping differences;

[0157] Determine the maximum value among the plurality of mapping differences as the halation parameter value.

[0158] In a possible embodiment, the processing module 440 is specifically configured to:

[0159] Determine the attenuation curves of each of the pixel points according to the halation parameter values of each of the pixel points;

[0160] Perform tone mapping processing on the first image according to the differential image and the attenuation curves of each of the pixel points, so as to obtain a second image.

[0161] In a possible embodiment, the processing module 440 is specifically configured to:

[0162] Determine the attenuation coefficient values of each of the pixel points respectively according to the halation parameter values of each of the pixel points;

[0163] Determine the attenuation curves of each of the pixel points respectively according to the attenuation coefficient values of each of the pixel points and the mapping curves of a preset number of regional images associated with each of the pixel points.

[0164] In a possible embodiment, the processing module 440 is specifically configured to:

[0165] Determine the attenuation mapping curves of each of the pixel points respectively according to the attenuation coefficient values of each of the pixel points and the mapping curves of a preset number of regional images associated with each of the pixel points;

[0166] Perform bilateral filtering processing on the attenuation mapping curves of each of the pixel points to obtain the attenuation curves of each of the pixel points.

[0167] In an embodiment of the present application, by obtaining a first image and a differential image, where the differential image is used to characterize the difference between the first image and the image obtained after initial tone mapping of the first image, the first image is divided into a plurality of regional images, and the mapping curves of the respective regional images are determined. The pixel values of each pixel point in the first image are associated with a preset number of regional images around the pixel point. The tone change of the pixel point is affected by the surrounding regions. This association method takes into account the context information of the pixel point, making the subsequent processing of the pixel point more accurate. According to the mapping curves of the preset number of first regional images associated with each pixel point, the degree of halation that each pixel point appears after initial tone mapping can be evaluated, that is, the halation parameter value is obtained. The mapping curve of the regional image reflects the tone change of the regional image. If the tone change of the surrounding region of the pixel point is drastic, then the possibility of the pixel point having halation is relatively high, and the corresponding halation parameter value is also relatively high. In this way, the regional images prone to edge artifacts can be accurately identified. The differential image provides the change information of the image after initial tone mapping, and the halation parameter value clarifies the degree of halation that each pixel point appears. By combining the differential image and the halation parameter values of each pixel point to perform tone mapping processing on the first image, a second image can be obtained, which can avoid over-enhancing the contrast in the regional images prone to edge artifacts, thereby reducing the generation of edge artifacts.

[0168] The image processing device in the embodiment of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiment of the present application does not make specific limitations.

[0169] The image processing apparatus according to an embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

[0170] The image processing apparatus provided by the embodiments of the present application can implement each process implemented by the above method embodiments. To avoid repetition, it will not be described in detail here.

[0171] Optionally, as Figure 5 shown, an embodiment of the present application further provides an electronic device 510, including a processor 511, a memory 512, a program or instruction stored on the memory 512 and executable on the processor 511. When the program or instruction is executed by the processor 511, it implements each step of any of the above image processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described in detail here.

[0172] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0173] Figure 6 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.

[0174] The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610, etc.

[0175] Those skilled in the art can understand that the electronic device 600 may further include a power source (such as a battery) for supplying power to each component. The power source may be logically connected to the processor 610 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 6 The structure of the electronic device shown in

[0176] does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be described in detail here.

[0177] Among them, the processor 610 is used to obtain a first image and a differential image, and the differential image is used to characterize the difference between the first image and the image obtained after initial tone mapping of the first image;

[0177] The processor 610 is further used to divide the first image into multiple regional images and determine the mapping curve of each regional image. The pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point;

[0178] The processor 610 is further configured to determine the halation parameter value of each of the pixel points according to the mapping curves of a preset number of first regional images associated with each of the pixel points, where the halation parameter value is used to characterize the degree of halation that appears after the initial tone mapping of each of the pixel points;

[0179] The processor 610 is further configured to perform tone mapping processing on the first image according to the differential image and the halation parameter values of each of the pixel points to obtain a second image.

[0180] Optionally, for any one of the pixel points, the processor 610 is further configured to determine the mapping value of the center point of each of the regional images according to the mapping curves of a preset number of regional images associated with the pixel point;

[0181] The processor 610 is further configured to, for any one of the center points, determine the absolute value of the difference between the mapping value of the center point and the mapping value of the center point of the adjacent regional image to obtain a plurality of mapping differences;

[0182] The processor 610 is further configured to determine the maximum value among the plurality of mapping differences as the halation parameter value.

[0183] Optionally, the processor 610 is further configured to determine the attenuation curve of each of the pixel points according to the halation parameter values of each of the pixel points;

[0184] The processor 610 is further configured to perform tone mapping processing on the first image according to the differential image and the attenuation curves of each of the pixel points to obtain a second image.

[0185] Optionally, the processor 610 is further configured to determine the attenuation coefficient value of each of the pixel points according to the halation parameter values of each of the pixel points;

[0186] The processor 610 is further configured to determine the attenuation curve of each of the pixel points according to the attenuation coefficient value of each of the pixel points and the mapping curves of a preset number of regional images associated with each of the pixel points.

[0187] Optionally, the processor 610 is further configured to determine the attenuation mapping curve of each of the pixel points according to the attenuation coefficient value of each of the pixel points and the mapping curves of a preset number of regional images associated with each of the pixel points;

[0188] The processor 610 is further configured to perform bilateral filtering processing on the attenuation mapping curve of each of the pixel points to obtain the attenuation curve of each of the pixel points.

[0189] In an embodiment of the present application, by obtaining a first image and a difference image, where the difference image is used to characterize the difference between the first image and the image obtained after performing an initial tone mapping on the first image, the first image is divided into a plurality of regional images, and mapping curves of each regional image are determined. Pixel values of each pixel point in the first image are associated with a preset number of regional images around the pixel point. The tone change of the pixel point is affected by the surrounding regions. This association method takes into account the context information of the pixel point, making subsequent processing of the pixel point more accurate. According to the mapping curves of the preset number of first regional images associated with each pixel point, the degree of halation that each pixel point exhibits after the initial tone mapping can be evaluated, that is, a halation parameter value is obtained. The mapping curve of the regional image reflects the tone change of the regional image. If the tone change of the surrounding region of the pixel point is drastic, then the possibility of halation occurring at this pixel point is relatively high, and the corresponding halation parameter value is also relatively high. In this way, the regional images prone to edge artifacts can be accurately identified. The difference image provides the change information of the image after the initial tone mapping, and the halation parameter value clarifies the degree of halation of each pixel point. By combining the difference image and the halation parameter values of each pixel point to perform tone mapping processing on the first image, a second image can be obtained, which can avoid over-enhancing the contrast in the regional images prone to edge artifacts, thereby reducing the generation of edge artifacts.

[0190] It should be understood that in an embodiment of the present application, the input unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042. The graphics processor 6041 processes the image data of static pictures or video images obtained by an image capture device (such as a camera) in a video image capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also referred to as a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. The other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, and an action bar, which will not be elaborated here. The memory 609 may be used to store software programs and various data, including but not limited to application programs and operating systems. The processor 610 may integrate an application processor and a modulation and demodulation processor. Among them, the application processor mainly processes the operating system, user interfaces, and application programs, etc., and the modulation and demodulation processor mainly processes wireless communications. It can be understood that the above modulation and demodulation processor may not be integrated into the processor 610.

[0191] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 609 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.

[0192] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 610 either.

[0193] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above embodiment of the image processing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0194] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.

[0195] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above-mentioned embodiment of the image processing method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0196] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0197] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above-mentioned embodiment of the image processing method and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0198] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described method may be executed in an order different from that described, and various steps may be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0199] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0200] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. An image processing method, characterized in that, The method includes: Obtaining a first image and a difference image, where the difference image is used to characterize the difference between the first image and an image obtained after performing an initial tone mapping on the first image; Dividing the first image into a plurality of regional images, and determining a mapping curve for each of the regional images, where the pixel value of each pixel point in the first image is associated with a preset number of regional images around the pixel point; Determining a halo parameter value for each pixel point according to the mapping curves of a preset number of first regional images associated with each pixel point, where the halo parameter value is used to characterize the degree of halo appearance of each pixel point after the initial tone mapping; Performing tone mapping processing on the first image according to the difference image and the halo parameter values of each pixel point to obtain a second image.

2. The method according to claim 1, characterized in that, The determining a halo parameter value for each pixel point according to the mapping curves of a preset number of first regional images associated with each pixel point includes: For any one of the pixel points, determining a mapping value of the center point of each of the regional images according to the mapping curves of a preset number of regional images associated with the pixel point; For any one of the center points, determining the absolute value of the difference between the mapping value of the center point and the mapping values of the center points of its adjacent regional images to obtain a plurality of mapping differences; Determining the maximum value among the plurality of mapping differences as the halo parameter value.

3. The method according to claim 1, wherein The performing tone mapping processing on the first image according to the difference image and the halo parameter values of each pixel point to obtain a second image includes: Determining an attenuation curve for each pixel point according to the halo parameter values of each pixel point; Performing tone mapping processing on the first image according to the difference image and the attenuation curves of each pixel point to obtain a second image.

4. The method according to claim 3, wherein The determining an attenuation curve for each pixel point according to the halo parameter values of each pixel point includes: Respectively determining an attenuation coefficient value for each pixel point according to the halo parameter values of each pixel point; Respectively determining an attenuation curve for each pixel point according to the attenuation coefficient values of each pixel point and the mapping curves of a preset number of regional images associated with each pixel point.

5. The method according to claim 4, characterized in that The respectively determining an attenuation curve for each pixel point according to the attenuation coefficient values of each pixel point and the mapping curves of a preset number of regional images associated with each pixel point includes: Respectively determining an attenuation mapping curve for each pixel point according to the attenuation coefficient values of each pixel point and the mapping curves of a preset number of regional images associated with each pixel point; Performing bilateral filtering processing on the attenuation mapping curves of each pixel point to obtain an attenuation curve for each pixel point.

6. An image processing apparatus, characterized in that, The apparatus includes: An obtaining module, configured to obtain a first image and a difference image, where the difference image is used to characterize the difference between the first image and an image obtained after performing an initial tone mapping on the first image; A partitioning module, configured to partition the first image into a plurality of regional images, and determine the mapping curves of the respective regional images, wherein the pixel values of the respective pixel points in the first image are associated with a preset number of regional images around the pixel points; A determining module, configured to determine the halation parameter values of the respective pixel points according to the mapping curves of the preset number of first regional images associated with the respective pixel points, where the halation parameter values are used to characterize the degree of halation of the respective pixel points after initial tone mapping; A processing module, configured to perform tone mapping processing on the first image according to the difference image and the halation parameter values of the respective pixel points to obtain a second image.

7. The device according to claim 6, characterized in that, The determining module is specifically configured to: For any one of the pixel points, determine the mapping values of the center points of the respective regional images according to the mapping curves of the preset number of regional images associated with the pixel point; For any one of the center points, determine the absolute value of the difference between the mapping value of the center point and the mapping values of the center points of the adjacent regional images to obtain a plurality of mapping differences; Determine the maximum value among the plurality of mapping differences as the halation parameter value.

8. The device according to claim 6, characterized in that, The processing module is specifically configured to: Determine the attenuation curves of the respective pixel points according to the halation parameter values of the respective pixel points; Perform tone mapping processing on the first image according to the difference image and the attenuation curves of the respective pixel points to obtain a second image.

9. The device according to claim 8, characterized in that The processing module is specifically configured to: Respectively determine the attenuation coefficient values of the respective pixel points according to the halation parameter values of the respective pixel points; Respectively determine the attenuation curves of the respective pixel points according to the attenuation coefficient values of the respective pixel points and the mapping curves of the preset number of regional images associated with the respective pixel points.

10. The device according to claim 9, characterized in that, The processing module is specifically configured to: Respectively determine the attenuation mapping curves of the respective pixel points according to the attenuation coefficient values of the respective pixel points and the mapping curves of the preset number of regional images associated with the respective pixel points; Perform bilateral filtering processing on the attenuation mapping curves of the respective pixel points to obtain the attenuation curves of the respective pixel points.