Rapid HDR image tone mapping method
Technical Field
The invention relates to the field of image processing, in particular to a fast HDR image tone mapping method.
Background
An HDR image is an image with a high dynamic range. Such images cannot be displayed perfectly in many current display devices, that is, when the current display devices display such images, parts of the areas are too dark or too bright, so that details of the areas are lost, which is similar to photo underexposure and overexposure. The reason for this is that HDR images have a high dynamic range, which is lower than that of many current display devices.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a fast HDR image tone mapping method. The tone mapped HDR image may be made well displayable in current low dynamic range display devices.
In order to solve the above technical problem, an embodiment of the present invention provides a fast HDR image tone mapping method, including the following steps:
s1: converting HDR image H into luminance image Lh;
S2: the luminance image L is referenced by a predetermined percentile phCutting off;
s3: for the image LhNormalization processing is carried out to ensure that the pixel value range of the obtained image I is [0,1 ]]To (c) to (d);
s4: using power functions L1=IαTransforming the image I to obtain a transformed image L1Wherein α < 1, preferably 0.5;
s5: using power functions L2=IβTransforming the image I to obtain a transformed image L2Wherein β > 1, preferably 2;
s6: using the formula L ═ 1-Lh)×L1+Lh×L2Fusing to obtain an image L;
s7: restoring the image color information using the following formula to obtain an LDR image [ R ]l Gl Bl]T:
Wherein R is
h、G
h、B
hThree components of an HDR image;
s8: for LDR image [ R ]l Gl Bl]TGamma correction is performed.
Further, the step S1 is performed by the following formula: l ish=0.2989Rh+0.5870Gh+0.1140Bh。
Further, in the step S2, the predetermined percentile p is used to take a value range of [90,99], preferably 98.
Further, the step S3 performs the normalization process using the following equation:
wherein
Representing the smallest pixel value of the entire image,
this represents taking the maximum value for image I (x, y).
Further, the step S8 uses a power function S-rγGamma correction is performed, where Gamma < 1, preferably 0.6.
The embodiment of the invention has the following beneficial effects: the method has the characteristics of simplicity, rapidness and good effect, so that the HDR image after tone mapping can be well displayed on the current low dynamic range display equipment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below.
The fast HDR image tone mapping method provided by the embodiment of the invention firstly converts a color HDR image into a brightness image, and then carries out truncation and normalization processing. The luminance image is then transformed with different power functions to enhance the details of the dark and bright regions, respectively. And finally, fusing the transformed images, recovering the color information of the images, and then performing Gamma correction. Let the three components of the HDR image be [ R ]h Gh Bh]TThe three components of the LDR image after conversion are [ R ]l Gl Bl]TThe whole tone mapping conversion process is specifically as follows:
1. converting HDR image H into luminance image LhI.e. Lh=0.2989Rh+0.5870Gh+0.1140Bh。
2. The luminance image L is referenced by a predetermined percentile phAnd (4) performing truncation, wherein p is preferably 98, namely sequencing the pixel values of the whole image to obtain the 98 th percentile of the pixel values of the whole image, and replacing the pixel values which are greater than the 98 th percentile by the 98 th percentile. The mathematical expression is as follows:
where (x, y) is the coordinates of the image pixel.
3. For the image LhNormalization processing is carried out to obtain an image of the image IThe prime number is in the range of [0, 1%]In the meantime. The formula used is as follows:
wherein
Representing the smallest pixel value of the entire image.
This represents taking the maximum value for image I (x, y).
4. Using power functions L1=IαTransforming the image I, wherein alpha is less than 1, so as to enhance the details of the dark area of the image I and obtain a transformed image L1Preferably L1=I0.5。
5. Using power functions L2=IβTransforming the image I, wherein beta is more than 1, so as to enhance the details of the bright area of the image I and obtain a transformed image L2Preferably L2=I2。
6. Using the formula L ═ 1-Lh)×L1+Lh×L2And fusing to obtain an image L.
7. Restoring the image color information by the following formula to obtain an LDR image [ Rl Gl Bl]T:
8. Using power function s-rγFor LDR image [ R ]l Gl Bl]TGamma correction is performed, preferably s ═ r0.6Namely:
the HDR image after tone mapping can be well displayed on the current low dynamic range display equipment after the processing of the method of the invention.
While the invention has been described in connection with what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not to be limited to the disclosed embodiment, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.