Local self-adaptive tone mapping method
By performing logarithmic transformation and local variance calculation on image brightness, adjusting the filter window size of the bilateral filter, decomposing and processing the image basic layer and detail layer, the problem of poor local adaptability of the tone mapping method based on bilateral filtering is solved, and the image hierarchy and contrast are improved.
Patent Information
- Application Number
- CN202311453205.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2043-11-01
AI Technical Summary
The tone mapping method based on bilateral filtering has poor local adaptability, resulting in insufficient image hierarchy and low contrast.
A locally adaptive tone mapping method is proposed. By logarithmic transformation of image brightness, local variance is calculated, filtering window size of the bilateral filter, decompose the image basic layer and detail layer, and obtain the enhanced brightness map by compressing the basic layer and enhancement detail layer.
The problem of poor local adaptability in the prior art is effectively overcome, and the sense of layering and contrast of the image is improved, so that the image after tone mapping is more in line with the perception of the human eye.
Smart Images

Figure CN119941598A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a local adaptive tone mapping method. Background Art
[0002] With the development of computer graphics, people have higher and higher requirements for the dynamic range of images. It has been widely used in the fields of security and automotive, such as backlit face scenes and car light scenes. For standard dynamic range images, since the dynamic range of the scene is greater than the dynamic range of the sensor, the dynamic range of the obtained image is insufficient, and the image is overexposed or underexposed, which cannot meet the market demand. Therefore, the technology to expand the dynamic range of images is also constantly developing, which is usually called the tone mapping method. The main idea of the tone mapping method is based on the Retinex theory, which believes that the image information perceived by the human eye contains the illumination information of the scene and the reflection information of the object. The illumination information reflects the dynamic range of the scene, which is usually called the base layer of the image, and the reflection information reflects the real content of the scene, which is usually called the detail layer of the image. By compressing the illumination information and enhancing the reflection information, a wide dynamic range image that is more in line with the perception of the human eye can be obtained. The main difficulty of this type of method is how to better decompose the base layer and detail layer of the image. At present, the most widely used tone mapping method is the tone mapping algorithm based on bilateral filtering. This method uses bilateral filtering to decompose the illumination information and reflection information of the image, but the method has weak adaptability and poor local adjustability.
[0003] In the prior art, the tone mapping method based on bilateral filtering has the problem of poor local adaptability and cannot take into account every area in the image. Specifically, the image base layer obtained by decomposition has the problem of excessive smoothing of large edges of the image and insufficient smoothness of small details. As a result, the image after tone mapping has insufficient layering and low image contrast. Summary of the invention
[0004] In order to solve the above problems, the purpose of this application is to solve the problem of poor local adaptability of the tone mapping method based on bilateral filtering. The manifestation in the image is that the image layering is not enough and the contrast is low.
[0005] Specifically, the present invention provides a local adaptive tone mapping method, the method comprising the following steps:
[0006] S1, input image, extract image brightness:
[0007] Y=0.2989*R+0.5870*G+0.1140*B,
[0008] Where Y is the image brightness, R, G, and B represent the RGB three-channel data of the image respectively;
[0009] S2, perform logarithmic transformation on the image brightness. The specific method is to find the logarithm of Y with base 10:
[0010] logY=log10(Y);
[0011] S3, calculate the local variance D of each pixel of logY, where the local window size is M*M, the unit of M is pixel, and 3<=M<=81. The pixel matrix with the current pixel as the center and M / 2 as the radius is represented by logYLocal, and the calculation method of the local variance D is as follows:
[0012]
[0013]
[0014] S4, according to the variance D, adjust the filter window size N of the bilateral filter. The larger D is, the smaller the filter window is. The relationship between the two can be defined by yourself, including using:
[0015]
[0016]
[0017] Among them, N min and N max Indicates the minimum and maximum values of the window size, ε indicates the adjustment coefficient; round() indicates rounding;
[0018] S5, the output of bilateral filtering is used as the base layer logYBase, logY minus the base layer equals the detail layer logYDetail
[0019] logYDetail=logY–logYBase;
[0020] S6, compress the base layer, enhance the detail layer, and add them together to get the enhanced brightness map logYEn:
[0021] logYEn=f(logYBase)+α*logYDetail,
[0022] Where f(·) represents the mapping curve. The curve can be defined according to the needs. Because the human eye is more sensitive to the details in the dark area, it is usually in the shape of gamma. Users can also adjust it according to their needs. α represents the enhancement coefficient. The larger the value, the stronger the image details.
[0023] S7, calculate the exponential of logYEn with base 10, convert the logarithmic domain brightness back to the linear domain, and obtain the enhanced brightness YEn:
[0024] YEn=10logYEn ;
[0025] S8, according to the RGB three-channel values and Y of the original image, and the enhanced YEn, restore the image color to obtain the tone-mapped image:
[0026]
[0027]
[0028]
[0029] In the step S3, for an image of 1080P size, 81*81 is used.
[0030] In step S4, N min =31, N max =101,ε=0.01.
[0031] In step S6, α=1.2.
[0032] Therefore, the advantages of the present application are: the method is simple and can effectively overcome the defects of the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0034] Figure 1 It is a schematic diagram of the process of the present application method.
[0035] Figure 2 It is a flowchart of a specific embodiment of the method of the present application.
[0036] Figure 3 It is a schematic diagram of the mapping curve in step S6 of the method of the present application. DETAILED DESCRIPTION
[0037] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.
[0038] like Figure 1As shown, the present application proposes a locally adaptive tone mapping method, which mainly includes: extracting an image brightness map Y, performing a logarithmic transformation on Y to obtain logY, calculating the variance information of logY, adjusting the filter window and filter coefficient of the bilateral filter according to the variance information, and then obtaining the base layer of the image, subtracting the base layer from the logY to obtain the detail layer of the image, compressing the base layer, enhancing the detail layer, and then adding the processed base layer and detail layer to obtain an enhanced image, performing an exponential transformation on the enhanced image, and color restoration to obtain a tone mapped image.
[0039] Specific implementation as Figure 2 As shown, including:
[0040] S1, input image, extract image brightness:
[0041] Y=0.2989*R+0.5870*G+0.1140*B
[0042] Where Y is the image brightness, R, G, and B represent the RGB three-channel data of the image respectively;
[0043] S2, logarithmic transformation of image brightness:
[0044] logY=log10(Y)
[0045] S3, calculate the image variance D of logY, the window size is M*M, for 1080P size images, this article uses 81*81;
[0046] S4, according to the variance D, adjust the filter window size N of the bilateral filter. The larger D is, the smaller the filter window is. The relationship between the two can be defined by yourself. This article uses:
[0047]
[0048] Among them, N min and N max Indicates the minimum and maximum values of the window size, ε indicates the adjustment coefficient, and this article uses N min =31, N max =101, ε=0.01;
[0049] S5, the output of bilateral filtering is used as the base layer logYBase, logY minus the base layer equals the detail layer logYDetail
[0050] logYDetail=logY–logYBase;
[0051] S6, compress the base layer, enhance the detail layer, and add them together to get the enhanced brightness map:
[0052] logYEn=f(logYBase)+α*logYDetail
[0053] Where f(·) represents the mapping curve. The curve can be defined according to the needs. Because the human eye is more sensitive to the details of the dark area, it is usually in the shape of gamma. The user can also adjust it according to the needs. α represents the enhancement coefficient. The larger the value, the stronger the image details. In this paper, α = 1.2. The mapping curve can be used as follows Figure 3 The curve shown;
[0054] S7, calculate the exponential of logYEn with base 10, convert the logarithmic domain brightness back to the linear domain, and obtain the enhanced brightness YEn:
[0055] YEn=10 logYEn ;
[0056] S8, according to the RGB three-channel values and Y of the original image, and the enhanced YEn, restore the image color to obtain the tone-mapped image:
[0057]
[0058]
[0059]
[0060] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A local adaptive tone mapping method, characterized in that: The method comprises the following steps: S1, input image, extract image brightness: Y=0.2989*R+0.5870*G+0.1140*B, Where Y is the image brightness, R, G, and B represent the RGB three-channel data of the image respectively; S2, perform logarithmic transformation on the image brightness. The specific method is to find the logarithm of Y with base 10: logY=log10(Y); S3, calculate the local variance D of each pixel of logY, where the local window size is M*M, the unit of M is pixel, and 3<=M<=81. The pixel matrix with the current pixel as the center and M / 2 as the radius is represented by logYLocal, and the calculation method of the local variance D is as follows: S4, according to the variance D, adjust the filter window size N of the bilateral filter. The larger D is, the smaller the filter window is. The relationship between the two can be defined by yourself, including using: Among them, N min and N max Indicates the minimum and maximum values of the window size, ε indicates the adjustment coefficient; round() indicates rounding; S5, the output of bilateral filtering is used as the base layer logYBase, logY minus the base layer equals the detail layer logYDetail logYDetail=logY–logYBase; S6, compress the base layer, enhance the detail layer, and add them together to get the enhanced brightness map logYEn: logYEn=f(logYBase)+α*logYDetail, Where f(·) represents the mapping curve. The curve can be defined according to the needs. Because the human eye is more sensitive to the details in the dark area, it is usually in the shape of gamma. Users can also adjust it according to their needs. α represents the enhancement coefficient. The larger the value, the stronger the image details. S7, calculate the exponential of logYEn with base 10, convert the logarithmic domain brightness back to the linear domain, and obtain the enhanced brightness YEn: YEn=10 logYEn ; S8, according to the RGB three-channel values and Y of the original image, and the enhanced YEn, restore the image color to obtain the tone-mapped image:
2. A locally adaptive tone mapping method according to claim 1, characterized in that: In the step S3, for an image of 1080P size, 81*81 is used.
3. A locally adaptive tone mapping method according to claim 1, characterized in that: In step S4, N min =31, N max =101,ε=0.
01.
4. The locally adaptive tone mapping method according to claim 1, characterized in that: In the step S6, α=1.2.
Citation Information
Patent Citations
Brightness stratification-based quick trilateral filter tone mapping method
CN101908207A
Tone mapping method based on edge preservation total variation model
CN102938837A
Tone mapping method of high dynamic range image
CN111105359A
Brightness control for spatially adaptive tone mapping of high dynamic range (HDR) images
US20180047141A1