CN116739937A - Tone mapping method, tone mapping device, display device and storage medium - Google Patents

Tone mapping method, tone mapping device, display device and storage medium Download PDF

Info

Publication number
CN116739937A
CN116739937A CN202310789503.0A CN202310789503A CN116739937A CN 116739937 A CN116739937 A CN 116739937A CN 202310789503 A CN202310789503 A CN 202310789503A CN 116739937 A CN116739937 A CN 116739937A
Authority
CN
China
Prior art keywords
image
brightness
global
sub
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310789503.0A
Other languages
Chinese (zh)
Inventor
王豪庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fengmi Beijing Technology Co ltd
Original Assignee
Fengmi Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fengmi Beijing Technology Co ltd filed Critical Fengmi Beijing Technology Co ltd
Priority to CN202310789503.0A priority Critical patent/CN116739937A/en
Publication of CN116739937A publication Critical patent/CN116739937A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The application relates to a tone mapping method, a tone mapping device, a display device and a storage medium. The method comprises the following steps: dividing a gray image of a high dynamic range image to be tone-mapped into a plurality of sub-images; respectively carrying out histogram equalization processing on each sub-image, and obtaining a first image according to the sub-images compressed in each global dynamic range; converting the first image into a color image containing brightness channels to obtain a second image; determining a global brightness average value of the second image under the brightness channel, and compressing the global dynamic range of the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image; and determining a target neighborhood range with gentle brightness value change around each pixel point in the third image, and compressing the brightness value at the pixel point according to the local brightness average value in the target neighborhood range to obtain a tone-mapped target image corresponding to the high dynamic range image. The method can improve the image quality after tone mapping.

Description

Tone mapping method, tone mapping device, display device and storage medium
Technical Field
The present application relates to the field of display technologies and image processing technologies, and in particular, to a tone mapping method, a tone mapping apparatus, a display device, and a storage medium.
Background
HDR (high dynamic range) technology has been developed at a high speed in recent years, and has become the mainstream in the image and video fields. Compared with a common image, the HDR image can provide more dynamic range and image details, greatly improves the brightness contrast of the picture details, and better reflects the visual effect in the real environment. However, HDR images cannot be displayed on some lower performance display devices because of higher brightness, deeper depth, and wider color gamut. Currently, some LCD displays typically discretize color channels to 8-bit, and the chromaticity interval is only 255 levels, so that HDR images cannot be displayed on these display devices, for example, some middle-low-end LCD projection devices cannot directly display HDR images like high-end projection devices. Therefore, tone mapping of the HDR image is required to enable the HDR image to adapt to the display of the LDR display device.
In the conventional method, mapping processing is generally performed on each pixel point in the HDR image in a unified manner, so as to map chromaticity, brightness, dynamic range and the like of the HDR image into the labeling range of the LDR display device. However, this method tends to result in some loss of local detail in the image, resulting in poor image quality after tone mapping.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a tone mapping method, apparatus, display device, computer-readable storage medium, and computer program product that can improve image quality.
In a first aspect, the present application provides a tone mapping method. The method comprises the following steps:
converting a high dynamic range image to be tone mapped into a gray image and dividing the gray image into a plurality of sub-images;
respectively carrying out histogram equalization processing on each sub-image so as to carry out global dynamic range compression on gray values of all pixel points in each sub-image, and obtaining a first image according to each sub-image subjected to global dynamic range compression;
converting the first image into a color image containing a brightness channel to obtain a second image;
determining a global brightness average value of the second image under the brightness channel, and performing global dynamic range compression on the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image;
determining a target neighborhood range around each pixel point in the third image, and compressing the brightness value at the pixel point according to the local brightness average value in the target neighborhood range to obtain a tone-mapped target image corresponding to the high dynamic range image; and the brightness value in the target neighborhood range changes smoothly.
In a second aspect, the present application further provides a tone mapping apparatus. The device comprises:
the image dividing module is used for converting the high dynamic range image to be tone-mapped into a gray image and dividing the gray image into a plurality of sub-images;
the histogram equalization module is used for respectively carrying out histogram equalization processing on each sub-image so as to carry out global dynamic range compression on the gray value of each pixel point in each sub-image, and obtaining a first image according to the sub-image after the global dynamic range compression;
the global brightness compression module is used for converting the first image into a color image containing a brightness channel to obtain a second image; determining a global brightness average value of the second image under the brightness channel, and performing global dynamic range compression on the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image;
the local brightness compression module is used for determining a target neighborhood range around each pixel point in the third image, and compressing brightness values at the pixel points according to local brightness average values in the target neighborhood range to obtain a tone-mapped target image corresponding to the high dynamic range image; and the brightness value in the target neighborhood range changes smoothly.
In one embodiment, the histogram equalization module is further configured to determine, for each of the sub-images, a number of gray levels in the sub-image and a number of pixel points corresponding to the gray levels respectively; determining a target gray level of gray values of all pixel points in the sub-image, and determining the total number of the pixel points corresponding to the target gray level and the gray levels lower than the target gray level; for each pixel point in the sub-image, determining the proportion of the total number corresponding to the pixel points to the number of the pixel points in the sub-image, and compressing the gray value of the pixel points according to the product of the proportion and the number of the gray levels to obtain a sub-image after the global dynamic range compression; and obtaining a first image according to each sub-image compressed by the global dynamic range.
In one embodiment, the global luminance compression module is further configured to determine a global luminance average of the second image under the luminance channel; and respectively compressing the brightness value of each pixel point in the second image under the brightness channel according to the global brightness average value to obtain a third image.
In one embodiment, the global brightness compression module is further configured to determine a sum of logarithmic values of brightness values of each pixel point in the second image under the brightness channel; performing index transformation on the sum of the logarithmic values to obtain an index result; and determining the global brightness average value of the second image under the brightness channel according to the ratio of the index result to the number of pixel points in the second image.
In one embodiment, the local luminance compression module is further configured to perform filtering processing on a luminance value at the pixel point by using a gaussian filter for each pixel point in the third image, so as to obtain a luminance response corresponding to the pixel point; the brightness response is used for representing the brightness average value in the scale range of the Gaussian filter around the pixel point; iteratively increasing the scale of the Gaussian filter under the condition that the brightness response is smaller than or equal to a preset threshold value, and returning to execute the step of filtering the brightness value at the pixel point by using the Gaussian filter to obtain the brightness response corresponding to the pixel point and the subsequent steps to obtain a target neighborhood range around the pixel point; and the radius of the target neighborhood range is the maximum value of the scale of the Gaussian filter, which is determined under the condition that the brightness response is smaller than or equal to a preset threshold value.
In one embodiment, the local luminance compression module is further configured to, for each pixel point in the third image, use the luminance response under the scale of the target neighborhood range corresponding to the pixel point as a local luminance average value in the target neighborhood range; and compressing the brightness value at the pixel point according to the local brightness average value to obtain a tone mapped target image corresponding to the high dynamic range image.
In a third aspect, the present application also provides a display apparatus. The display device includes a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the tone mapping method according to the embodiments of the present application.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps in the tone mapping method according to the embodiments of the present application.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, causes the processor to perform the steps of the tone mapping method according to the embodiments of the present application.
According to the tone mapping method, the device, the display equipment, the storage medium and the computer program product, firstly, the gray level image of the high dynamic range image is divided into a plurality of sub-images, histogram equalization processing is carried out on each sub-image, global dynamic range compression is carried out on gray level values of all pixel points in each sub-image, a first image is obtained according to the sub-images after all the global dynamic range compression, global tone mapping of the high dynamic range image is achieved, then the first image is converted into a color image containing a brightness channel, a second image is obtained, global brightness average value of the second image under the brightness channel is determined, global dynamic range compression is carried out on brightness values of the second image under the brightness channel according to the global brightness average value, a third image is obtained, then a target neighborhood range with gentle change of brightness values around the pixel points is determined according to each pixel point in the third image, local brightness average value in the target neighborhood range is compressed, local tone mapping of the image is achieved, local tone mapping of the image is avoided on the basis of global tone mapping, and local detail loss of the image is avoided. In addition, the gray level image is divided into a plurality of sub-images, and each sub-image is subjected to histogram equalization processing, so that detail information in the gray level image can be considered more, the quality of the image obtained by global tone mapping is improved, and the quality of the finally obtained target image is further improved.
Drawings
FIG. 1 is a diagram of an application environment for a tone mapping method in one embodiment;
FIG. 2 is a flow diagram of a tone mapping method in one embodiment;
FIG. 3 is a graph comparing gray level histograms before and after a histogram equalization process in one embodiment;
FIG. 4 is a block diagram of the architecture of a tone mapping apparatus in one embodiment;
fig. 5 is an internal structural view of the display device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The tone mapping method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the display terminal 102 communicates with the computer device 104 via a network. The computer device 104 may send the image to be displayed to the display terminal 102, and if the image to be displayed is a high dynamic range image, the display terminal 102 may execute the tone mapping method in the embodiments of the present application to tone map the high dynamic range image to obtain the target image, and the display device 102 may display the target image. Wherein the display device 102 may be, but is not limited to, any of a projection device, a display, a screen, or the like. The computer device 104 may be a terminal or a server, the terminal may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car devices and the like, and the portable wearable devices may be smart watches, smart bracelets, head-mounted devices and the like. The server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers.
In some embodiments, as shown in fig. 2, a tone mapping method is provided, and the method is applied to the display device 102 in fig. 1 for illustration, and includes the following steps:
step 202, converting the high dynamic range image to be tone mapped into a gray scale image and dividing the gray scale image into a plurality of sub-images.
Among them, a high dynamic range image (HDR image, high Dynamic Range Image) refers to an image having higher dynamic range of luminance and color depth than a conventional image. For example: while the pixel value of each pixel in a conventional image is only 8 bits deep, an HDR image may have a higher depth, e.g., 16 bits, 32 bits, or even higher, to more accurately represent the luminance and color details in the scene.
In some embodiments, the display device may obtain the image to be displayed from a computer device or from local to the display device. In some embodiments, if the image to be displayed is a high dynamic range image, the display device may perform step 202 and subsequent steps.
In some embodiments, the display device may divide the gray scale image into a plurality of sub-images of the same size. Such as: divided into a plurality of sub-images each 8 x 8 in size. In other embodiments, the display device may also divide the gray scale image into a plurality of sub-images of non-uniform size.
In some embodiments, the display apparatus may automatically determine the size of the divided sub-images according to the size of the gray-scale image and the preset number. The preset number is the number of sub-images to be divided.
In other embodiments, the size of the sub-image may be set in advance, and the display device may divide the gray-scale image into a plurality of sub-images conforming to the preset sub-image size according to the preset sub-image size.
Step 204, respectively performing histogram equalization processing on each sub-image to perform global dynamic range compression on the gray value of each pixel point in each sub-image, and obtaining a first image according to each sub-image after global dynamic range compression.
The histogram equalization process is a process of converting the distribution of the gradation histogram of the image into a more uniform distribution. It can be appreciated that global dynamic range compression of gray values of a gray image can be achieved by performing histogram equalization processing on the gray image. As shown in fig. 3, the gray distribution in the gray histogram before the histogram equalization processing is very unbalanced, and the gray distribution in the gray histogram after the histogram equalization processing is more balanced, so that the global dynamic range compression of the gray value in the image is realized.
In some embodiments, the display device may determine, for each sub-image, a gray histogram of the sub-image, then determine a histogram equalization function according to the gray histogram, and map the gray values of the pixels in the sub-image to new gray values according to the histogram equalization function, to obtain a sub-image with compressed global dynamic range. The display device may stitch the compressed sub-images of each global dynamic range to obtain a first image. It will be appreciated that the first image corresponds to an image obtained by global tone mapping of a high dynamic range image.
Step 206, converting the first image into a color image containing brightness channels, and obtaining a second image.
The pixel value of the pixel point in the second image under the brightness channel is the brightness value.
In some embodiments, the display device may convert the first image into a color image of an RGB color space and then convert the color image of the RGB color space into a color image of an XYZ color space, resulting in the second image. Wherein the XYZ color space includes an X channel, a Y channel, and a Z channel. The Y channel is the luminance channel. The pixel value of the pixel point in the color image of the XYZ color space under the Y channel (i.e., luminance channel) is the luminance value.
In some embodiments, the display device may multiply the pixel values of the pixels in the color image of the RGB color space by the transformation matrix to obtain the pixel values of the pixels in the color image of the XYZ color space, i.e. to obtain the second image. Wherein the transformation matrix is a transformation matrix transformed from an RGB color space to an XYZ color space.
In some embodiments, the transformation matrix is:
step 208, determining a global brightness average value of the second image under the brightness channel, and performing global dynamic range compression on the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image.
The global brightness average value is used for representing the average value of brightness values of all pixel points in the second image under the brightness channel.
In some embodiments, the global luminance average may be any one of an average logarithmic value, an arithmetic average value, a geometric average value, or the like of luminance values of respective pixel points in the second image under the luminance channel.
In some embodiments, when the average logarithmic value is used, the display device may determine a sum of logarithmic values of luminance values of each pixel point in the second image under the luminance channel, perform exponential transformation on the sum of logarithmic values to obtain an exponential result, and determine a global luminance average value of the second image under the luminance channel according to a ratio of the exponential result to the number of pixel points in the second image.
Step 210, for each pixel point in the third image, determining a target neighborhood range around the pixel point, and compressing the brightness value at the pixel point according to the local brightness average value in the target neighborhood range to obtain a tone-mapped target image corresponding to the high dynamic range image; the brightness value in the target neighborhood range changes smoothly.
The local luminance average value in the target neighborhood range refers to an average value of luminance values of each pixel point in the target neighborhood range under a luminance channel, that is, a luminance average value in the local range used for representing the target neighborhood range.
In some embodiments, the display device may determine a target neighborhood range of each pixel point, determine a local luminance average value in the target neighborhood range by using an average value of luminance values of each pixel point in the target neighborhood range under the luminance channel, and compress the luminance values at the pixel points according to the local luminance average value in the target neighborhood range to obtain the target image.
In some embodiments, the display device may determine, for each pixel, a maximum neighborhood range in which the brightness value around the pixel changes smoothly, to obtain the target neighborhood range.
In other embodiments, the target neighborhood range may be not the maximum neighborhood range with a gentle change of the brightness value, but the preset neighborhood range is determined as the target neighborhood range when the brightness value in the preset neighborhood range around the pixel point changes smoothly; and under the condition that the brightness value change in the preset neighborhood range around the pixel point is not smooth, determining the maximum neighborhood range with smooth brightness value change around the pixel point as a target neighborhood range.
In some embodiments, the display device may determine compressed luminance values corresponding to the respective pixels according to a ratio between the luminance value at the respective pixel in the third image and the local luminance average value in the corresponding target neighborhood range, and obtain the target image based on the compressed luminance values corresponding to the respective pixels.
In some embodiments, the display device may add the local luminance average value in the target neighborhood range corresponding to each pixel point to 1 to obtain a compression ratio, and then determine the compressed luminance value corresponding to each pixel point according to the ratio between the luminance value at each pixel point in the third image and the corresponding compression ratio.
According to the tone mapping method, firstly, the gray level image of the high dynamic range image is divided into a plurality of sub-images, histogram equalization processing is carried out on each sub-image, global dynamic range compression is carried out on gray level values of each pixel point in each sub-image, a first image is obtained according to the sub-images after the global dynamic range compression, global tone mapping of the high dynamic range image is achieved, then the first image is converted into a color image containing a brightness channel, a second image is obtained, global brightness average value of the second image under the brightness channel is determined, global dynamic range compression is carried out on brightness values of the second image under the brightness channel according to the global brightness average value, a third image is obtained, a target neighborhood range with gentle brightness value changes around each pixel point in the third image is determined, local tone mapping is carried out on brightness values at the pixel points according to the local brightness average value in the target neighborhood range, dynamic range is properly increased, dynamic range is properly achieved for important areas in the image, dynamic range is properly reduced for unimportant parts, local tone mapping is carried out on the global tone mapping, and loss of detail quality is avoided. In addition, the gray level image is divided into a plurality of sub-images, and each sub-image is subjected to histogram equalization processing, so that detail information in the gray level image can be considered more, the quality of the image obtained by global tone mapping is improved, and the quality of the finally obtained target image is further improved.
In some embodiments, performing histogram equalization processing on each sub-image to perform global dynamic range compression on gray values of each pixel point in each sub-image, and obtaining a first image according to each sub-image after global dynamic range compression includes: for each sub-image, determining the number of gray levels in the sub-image and the number of pixel points corresponding to each gray level respectively; determining a target gray level of gray values of all pixel points in the sub-image, and determining the total number of the pixel points corresponding to the target gray level and all gray levels lower than the target gray level; for each pixel point in the sub-image, determining the proportion of the total number corresponding to the pixel points to the number of the pixel points in the sub-image, and compressing the gray values of the pixel points according to the product between the proportion and the number of gray levels to obtain a sub-image compressed in a global dynamic range; and obtaining a first image according to the sub-images compressed by the global dynamic ranges.
In some embodiments, the display device may calculate a gray level histogram of the sub-image to determine the number of gray levels in the sub-image and the number of pixel points to which each gray level corresponds, respectively.
In some embodiments, the display device may multiply the product between the ratio and the number of gray levels by the gray value of the pixel to obtain a compressed gray value corresponding to the pixel, and compress the sub-image based on the compressed gray value corresponding to each pixel.
In some embodiments, the display device may determine a histogram equalization function according to the gray histogram, map the gray value of each pixel point in the sub-image to a new gray value according to the histogram equalization function, and obtain the sub-image after the global dynamic range compression, where the histogram equalization function may be expressed by the following formula:
wherein M and N respectively represent the pixel numbers of the rows and columns of the sub-image, and MN is the pixel point number in the sub-image. L represents the number of gray levels in the sub-image. j represents an index of gray level. n is n j The number of pixel points corresponding to the gray level j is represented. x represents the gray value of the pixel point in the sub-image before the histogram equalization process. k represents an index of a gray level corresponding to the gray value x.I.e. the target gray level kAnd the total number of pixel points corresponding to each gray level lower than the target gray level.
The derivation process of the histogram equalization function is as follows:
regarding the distribution of the gray level of the pixels in the image before and after the histogram equalization process as F (x) and F (y), wherein the random variable x is the gray value before the histogram equalization process, the random variable y is the gray value after the histogram equalization process, and solving the histogram equalization function is to solve the function conversion relation y=t (x) between x and y. Corresponding to: the known conditions are probability density functions f (x) and f (y), f (x) =n k MN, f (y) =1/(L-1), solving for T (x). Wherein M and N are the number of pixels of the rows and columns in the sub-image, N k L is the number of gray levels in the sub-image for the number of pixels corresponding to gray level k in the sub-image. The following derivation is performed according to the above known conditions:
wherein T is -1 (y) is an inverse function of T (x). Simultaneously deriving y from the two sides of the model to obtain:
substituting the above known conditions into the above formula to obtain:
that is to say,
integrating the two sides of the matrix at the same time to obtainI.e. as a histogram equalization function.
In the above embodiment, the number of gray levels in the sub-image and the number of pixel points corresponding to each gray level are determined, the target gray level where the gray value of each pixel point in the sub-image is located is determined, the target gray level and the total number of pixel points corresponding to each gray level lower than the target gray level are determined, for each pixel point in the sub-image, the ratio of the total number of pixel points corresponding to the total number of pixel points to the number of pixel points in the sub-image is determined, the gray value of the pixel point is compressed according to the product between the ratio and the number of gray levels, so as to obtain a sub-image after the global dynamic range compression, and the histogram equalization processing can be effectively and accurately performed on each sub-image.
In some embodiments, determining a global luminance average of the second image under the luminance channel, and performing global dynamic range compression on the luminance value of the second image under the luminance channel according to the global luminance average, to obtain the third image includes: determining a global brightness average value of the second image under the brightness channel; and respectively compressing the brightness value of each pixel point in the second image under the brightness channel according to the global brightness average value to obtain a third image.
In some embodiments, the display device may determine the compressed luminance values corresponding to the pixels respectively according to a ratio between the luminance value of each pixel in the second image under the luminance channel and the global luminance average value, and obtain the third image based on the compressed luminance values corresponding to the pixels respectively.
In some embodiments, the display device may determine, as the compressed luminance value corresponding to each pixel point, a product between a ratio of a luminance value of each pixel point in the second image under the luminance channel and the global luminance average value and a luminance proportionality constant, a specific formula is as follows:
wherein α represents a luminance proportionality constant, L w (x, y) represents the luminance value of the pixel point in the second image under the luminance channel, And (3) representing the global brightness average value, and L (x, y) representing the compressed brightness value corresponding to the pixel point.
In some embodiments, the value of the luminance proportionality constant can determine the magnitude of the luminance of the third image. The value of the luminance proportionality constant may be 0.18 or other values, and is not limited. When the value of the brightness proportionality constant is 0.18, neutral gray in the image can be mapped to 18% gray on the display device, and at the moment, the human eyes feel gray with brightness of the displayed image just between black and white (namely, the brightness is 50%), so that the high-dynamic image can be compressed well on the whole.
In the above embodiment, the global luminance average value of the second image under the luminance channel is determined, and the luminance value of each pixel point in the second image under the luminance channel is compressed according to the global luminance average value to obtain the third image, so that efficient global dynamic range compression of the luminance value of the image can be realized.
In some embodiments, determining the global luminance mean of the second image under the luminance channel comprises: determining the sum of the logarithmic values of the brightness values of all pixel points in the second image under the brightness channel; performing index transformation on the sum of the logarithmic values to obtain an index result; and determining the global brightness average value of the second image under the brightness channel according to the ratio of the index result to the number of the pixel points in the second image.
In some embodiments, the display device may add a correction value to the luminance value of each pixel under the luminance channel to obtain a corrected luminance value, then calculate the logarithm of the corrected luminance value of each pixel, add the logarithms corresponding to each pixel to obtain a sum of logarithmic values, perform exponential transformation on the sum of logarithmic values to obtain an exponential result, and finally determine the global luminance average of the second image under the luminance channel according to the ratio of the exponential result to the number of pixels in the second image. The specific formula is as follows:
wherein L is w (x, y) represents the luminance value of the pixel point in the second image under the luminance channel. Delta represents a correction value. N represents the number of pixels in the second image.Representing the global luminance mean of the second image under the luminance channel.
In the above embodiment, the sum of the logarithmic values of the brightness values of each pixel point in the second image under the brightness channel is determined, the sum of the logarithmic values is subjected to exponential transformation to obtain an exponential result, and the global brightness average value of the second image under the brightness channel can be accurately and efficiently determined according to the ratio of the exponential result to the number of the pixel points in the second image.
In some embodiments, for each pixel in the third image, determining the target neighborhood range around the pixel comprises: for each pixel point in the third image, filtering the brightness value at the pixel point by using a Gaussian filter to obtain a brightness response corresponding to the pixel point; a luminance response characterizing a luminance mean value within a scale range of the gaussian filter around the pixel point; iteratively increasing the scale of the Gaussian filter under the condition that the brightness response is smaller than or equal to a preset threshold value, and returning to execute the step of filtering the brightness value at the pixel point by using the Gaussian filter to obtain the brightness response corresponding to the pixel point and the subsequent step to obtain a target neighborhood range around the pixel point; the radius of the target neighborhood range is the maximum value of the scale of the Gaussian filter determined under the condition that the brightness response is smaller than or equal to a preset threshold value.
In some embodiments, the display device may multiply the brightness value of each pixel point in the third image by the gaussian filter function to obtain the brightness response corresponding to the pixel point, which may be expressed by the following formula:
where L (x, y) represents the luminance value of the pixel point (x, y) in the third image. R (x, y, s) represents a gaussian filter function and s represents the scale of the gaussian filter. V (x, y, s) represents the luminance response corresponding to the pixel point (x, y). The gaussian filter function R (x, y, s) can be expressed by the following formula:
where s represents the scale of the gaussian filter, x and y represent coordinate values of pixel points, and α represents a luminance proportionality constant.
In some embodiments, the display device may perform filtering processing on the luminance value at the pixel point by using a gaussian filter with a minimum scale for each pixel point in the third image to obtain a luminance response corresponding to the pixel point, and then iteratively increase the scale of the gaussian filter when the luminance response is less than or equal to a preset threshold, so as to iteratively perform filtering processing on the luminance value at the pixel point by using the gaussian filter with a new scale to obtain a luminance response corresponding to the pixel point until the luminance response is greater than the preset threshold, and obtain the target neighborhood range around the pixel point. That is, the maximum value s of s obtained when V (x, y, s). Ltoreq.ε max I.e. the radius of the target neighborhood range.
In the above embodiment, the luminance value at the pixel point is filtered by using the gaussian filter, so as to obtain the luminance response corresponding to the pixel point, and under the condition that the luminance response is less than or equal to the preset threshold, the scale of the gaussian filter is iteratively increased, so as to obtain the maximum value of the scale of the gaussian filter determined under the condition that the luminance response is less than or equal to the preset threshold as the radius of the target neighborhood range, thereby accurately determining the target neighborhood range with gentle luminance value variation, and further accurately performing local tone mapping on the image according to the accurate target neighborhood range.
In some embodiments, compressing the luminance value at the pixel point according to the local luminance average value in the target neighborhood range to obtain the tone-mapped target image corresponding to the high dynamic range image includes: for each pixel point in the third image, taking the brightness response of the pixel point under the scale of the target neighborhood range as the local brightness average value in the target neighborhood range; and compressing the brightness value at the pixel point according to the local brightness average value to obtain a tone mapped target image corresponding to the high dynamic range image.
In some embodiments, the display device may determine compressed luminance values corresponding to the respective pixels according to a ratio between the luminance value at the respective pixel in the third image and the luminance response under the scale of the corresponding target neighborhood range, and determine the target image based on the compressed luminance values corresponding to the respective pixels.
In some embodiments, the display device may add the luminance response of the scale of the target neighborhood range corresponding to each pixel point to 1 to obtain a compression ratio, and then determine the compressed luminance value corresponding to each pixel point according to the ratio between the luminance value at each pixel point and the corresponding compression ratio in the third image. The specific formula is as follows:
wherein L is d (x, y) represents the compressed luminance value corresponding to the pixel point (x, y). L (x, y) represents the luminance value before compression corresponding to the pixel point (x, y), V 1 (x,y,s max (x, y)) represents the luminance response at the scale of the target neighborhood range to which the pixel point corresponds. s is(s) max And (x, y) represents the radius of the target neighborhood range corresponding to the pixel point.
In the above embodiment, the luminance values of the pixels are compressed by using the local luminance average value in the range where the luminance change around the pixels is gentle, so that accurate local tone mapping of the image is realized.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the present application also provides a tone mapping apparatus for implementing the tone mapping method mentioned above. The implementation of the solution provided by the device is similar to that described in the above method, so specific limitations in one or more embodiments of the tone mapping device provided below may be referred to above for limitations of the tone mapping method, and will not be repeated here.
In some embodiments, as shown in fig. 4, there is provided a tone mapping apparatus comprising: an image partitioning module 402, a histogram equalization module 404, a global luminance compression module 406, and a local luminance compression module 408, wherein:
the image dividing module 402 is configured to convert a high dynamic range image to be tone mapped into a gray image, and divide the gray image into a plurality of sub-images.
The histogram equalization module 404 is configured to perform histogram equalization processing on each sub-image, so as to perform global dynamic range compression on the gray value of each pixel point in each sub-image, and obtain a first image according to each sub-image after global dynamic range compression.
A global brightness compression module 406, configured to convert the first image into a color image containing brightness channels, to obtain a second image; and determining a global brightness average value of the second image under the brightness channel, and carrying out global dynamic range compression on the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image.
The local brightness compression module 408 is configured to determine, for each pixel point in the third image, a target neighborhood range around the pixel point, and compress, according to a local brightness average value in the target neighborhood range, a brightness value at the pixel point, to obtain a tone-mapped target image corresponding to the high dynamic range image; the brightness value in the target neighborhood range changes smoothly.
In some embodiments, the histogram equalization module 404 is further configured to determine, for each sub-image, a number of gray levels in the sub-image and a number of pixels corresponding to each gray level respectively; determining a target gray level of gray values of all pixel points in the sub-image, and determining the total number of the pixel points corresponding to the target gray level and all gray levels lower than the target gray level; for each pixel point in the sub-image, determining the proportion of the total number corresponding to the pixel points to the number of the pixel points in the sub-image, and compressing the gray values of the pixel points according to the product between the proportion and the number of gray levels to obtain a sub-image compressed in a global dynamic range; and obtaining a first image according to the sub-images compressed by the global dynamic ranges.
In some embodiments, the global luminance compression module 406 is further configured to determine a global luminance average of the second image under the luminance channel; and respectively compressing the brightness value of each pixel point in the second image under the brightness channel according to the global brightness average value to obtain a third image.
In some embodiments, the global luminance compression module 406 is further configured to determine a sum of logarithmic values of luminance values of each pixel point in the second image under the luminance channel; performing index transformation on the sum of the logarithmic values to obtain an index result; and determining the global brightness average value of the second image under the brightness channel according to the ratio of the index result to the number of the pixel points in the second image.
In some embodiments, the local luminance compression module 408 is further configured to perform, for each pixel point in the third image, a filtering process on a luminance value at the pixel point by using a gaussian filter, so as to obtain a luminance response corresponding to the pixel point; a luminance response characterizing a luminance mean value within a scale range of the gaussian filter around the pixel point; iteratively increasing the scale of the Gaussian filter under the condition that the brightness response is smaller than or equal to a preset threshold value, and returning to execute the step of filtering the brightness value at the pixel point by using the Gaussian filter to obtain the brightness response corresponding to the pixel point and the subsequent step to obtain a target neighborhood range around the pixel point; the radius of the target neighborhood range is the maximum value of the scale of the Gaussian filter determined under the condition that the brightness response is smaller than or equal to a preset threshold value.
In some embodiments, the local luminance compression module 408 is further configured to, for each pixel point in the third image, take, as a local luminance average value in the target neighborhood range, a luminance response under the scale of the target neighborhood range corresponding to the pixel point; and compressing the brightness value at the pixel point according to the local brightness average value to obtain a tone mapped target image corresponding to the high dynamic range image.
According to the tone mapping device, firstly, the gray level image of the high dynamic range image is divided into a plurality of sub-images, histogram equalization processing is carried out on each sub-image, global dynamic range compression is carried out on gray level values of each pixel point in each sub-image, a first image is obtained according to the sub-images after the global dynamic range compression, global tone mapping of the high dynamic range image is achieved, then the first image is converted into a color image containing a brightness channel, a second image is obtained, global brightness average value of the second image under the brightness channel is determined, global dynamic range compression is carried out on brightness values of the second image under the brightness channel according to the global brightness average value, a third image is obtained, a target neighborhood range with gentle brightness value changes around each pixel point in the third image is determined, local tone mapping is carried out on brightness values at the pixel points according to the local brightness average value in the target neighborhood range, dynamic range is properly increased, dynamic range is properly achieved for important areas in the image, dynamic range is properly reduced for unimportant parts, local tone mapping is carried out on the global tone mapping, and loss of detail quality is avoided. In addition, the gray level image is divided into a plurality of sub-images, and each sub-image is subjected to histogram equalization processing, so that detail information in the gray level image can be considered more, the quality of the image obtained by global tone mapping is improved, and the quality of the finally obtained target image is further improved.
The various modules in the tone mapping apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the display device, or may be stored in software in a memory in the display device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a display device is provided, the internal structure of which may be as shown in fig. 5. The display device comprises a processor, a memory, a communication interface, a display unit and an input means connected by a system bus. Wherein the processor of the display device is configured to provide computing and control capabilities. The memory of the display device includes a nonvolatile storage medium, an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the display device is used for conducting wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a tone mapping method. The display unit of the display device can be a liquid crystal display screen or an electronic ink display screen, a projection device, an input device of the display device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the display device, an external keyboard, a touch pad or a mouse and the like.
In some embodiments, the display device comprises a projection device. The projection device may project an image onto a projection surface for display.
In other embodiments, the display device may also include a display screen or display device.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the display device to which the present inventive arrangements are applied, and that a particular display device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, a display device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
The user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A tone mapping method, the method comprising:
converting a high dynamic range image to be tone mapped into a gray image and dividing the gray image into a plurality of sub-images;
respectively carrying out histogram equalization processing on each sub-image so as to carry out global dynamic range compression on gray values of all pixel points in each sub-image, and obtaining a first image according to each sub-image subjected to global dynamic range compression;
Converting the first image into a color image containing a brightness channel to obtain a second image;
determining a global brightness average value of the second image under the brightness channel, and performing global dynamic range compression on the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image;
determining a target neighborhood range around each pixel point in the third image, and compressing the brightness value at the pixel point according to the local brightness average value in the target neighborhood range to obtain a tone-mapped target image corresponding to the high dynamic range image; and the brightness value in the target neighborhood range changes smoothly.
2. The method according to claim 1, wherein the performing histogram equalization processing on each of the sub-images to perform global dynamic range compression on gray values of each pixel point in each of the sub-images, and obtaining the first image according to each of the sub-images after global dynamic range compression includes:
determining the number of gray levels in each sub-image and the number of pixel points corresponding to the gray levels respectively;
Determining a target gray level of gray values of all pixel points in the sub-image, and determining the total number of the pixel points corresponding to the target gray level and the gray levels lower than the target gray level;
for each pixel point in the sub-image, determining the proportion of the total number corresponding to the pixel points to the number of the pixel points in the sub-image, and compressing the gray value of the pixel points according to the product of the proportion and the number of the gray levels to obtain a sub-image after the global dynamic range compression;
and obtaining a first image according to each sub-image compressed by the global dynamic range.
3. The method of claim 1, wherein the determining a global luminance average of the second image under the luminance channel and the performing global dynamic range compression on the luminance value of the second image under the luminance channel according to the global luminance average, to obtain the third image comprises:
determining a global luminance mean value of the second image under the luminance channel;
and respectively compressing the brightness value of each pixel point in the second image under the brightness channel according to the global brightness average value to obtain a third image.
4. A method according to claim 3, wherein said determining a global luminance mean of said second image under said luminance channel comprises:
determining the sum of logarithmic values of brightness values of all pixel points in the second image under the brightness channel;
performing index transformation on the sum of the logarithmic values to obtain an index result;
and determining the global brightness average value of the second image under the brightness channel according to the ratio of the index result to the number of pixel points in the second image.
5. The method of claim 1, wherein the determining, for each pixel in the third image, a target neighborhood range around the pixel comprises:
for each pixel point in the third image, filtering the brightness value at the pixel point by using a Gaussian filter to obtain a brightness response corresponding to the pixel point; the brightness response is used for representing the brightness average value in the scale range of the Gaussian filter around the pixel point;
iteratively increasing the scale of the Gaussian filter under the condition that the brightness response is smaller than or equal to a preset threshold value, and returning to execute the step of filtering the brightness value at the pixel point by using the Gaussian filter to obtain the brightness response corresponding to the pixel point and the subsequent steps to obtain a target neighborhood range around the pixel point;
And the radius of the target neighborhood range is the maximum value of the scale of the Gaussian filter, which is determined under the condition that the brightness response is smaller than or equal to a preset threshold value.
6. The method of claim 5, wherein compressing the luminance values at the pixels according to the local luminance average in the target neighborhood range to obtain the tone-mapped target image corresponding to the high dynamic range image comprises:
for each pixel point in the third image, taking the brightness response of the pixel point corresponding to the scale of the target neighborhood range as a local brightness average value in the target neighborhood range;
and compressing the brightness value at the pixel point according to the local brightness average value to obtain a tone mapped target image corresponding to the high dynamic range image.
7. A tone mapping apparatus, said apparatus comprising:
the image dividing module is used for converting the high dynamic range image to be tone-mapped into a gray image and dividing the gray image into a plurality of sub-images;
the histogram equalization module is used for respectively carrying out histogram equalization processing on each sub-image so as to carry out global dynamic range compression on the gray value of each pixel point in each sub-image, and obtaining a first image according to the sub-image after the global dynamic range compression;
The global brightness compression module is used for converting the first image into a color image containing a brightness channel to obtain a second image; determining a global brightness average value of the second image under the brightness channel, and performing global dynamic range compression on the brightness value of the second image under the brightness channel according to the global brightness average value to obtain a third image;
the local brightness compression module is used for determining a target neighborhood range around each pixel point in the third image, and compressing brightness values at the pixel points according to local brightness average values in the target neighborhood range to obtain a tone-mapped target image corresponding to the high dynamic range image; and the brightness value in the target neighborhood range changes smoothly.
8. A display device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. The display device of claim 8, the display device comprising a projection device.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202310789503.0A 2023-06-29 2023-06-29 Tone mapping method, tone mapping device, display device and storage medium Pending CN116739937A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310789503.0A CN116739937A (en) 2023-06-29 2023-06-29 Tone mapping method, tone mapping device, display device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310789503.0A CN116739937A (en) 2023-06-29 2023-06-29 Tone mapping method, tone mapping device, display device and storage medium

Publications (1)

Publication Number Publication Date
CN116739937A true CN116739937A (en) 2023-09-12

Family

ID=87902686

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310789503.0A Pending CN116739937A (en) 2023-06-29 2023-06-29 Tone mapping method, tone mapping device, display device and storage medium

Country Status (1)

Country Link
CN (1) CN116739937A (en)

Similar Documents

Publication Publication Date Title
US11373275B2 (en) Method for generating high-resolution picture, computer device, and storage medium
CN109686342B (en) Image processing method and device
WO2019101005A1 (en) Pixel compensation method and apparatus, and terminal device
CN115115554B (en) Image processing method and device based on enhanced image and computer equipment
CN112541868B (en) Image processing method, device, computer equipment and storage medium
CN112950640A (en) Video portrait segmentation method and device, electronic equipment and storage medium
CN116843566A (en) Tone mapping method, tone mapping device, display device and storage medium
CN116739938A (en) Tone mapping method and device and display equipment
Zhang et al. Multi-scale-based joint super-resolution and inverse tone-mapping with data synthesis for UHD HDR video
CN117112090A (en) Business page theme generation method, device, computer equipment, medium and product
CN110599394A (en) Method and device for processing pictures in online presentation, storage medium and equipment
CN116739937A (en) Tone mapping method, tone mapping device, display device and storage medium
CN116739936A (en) Tone mapping method, tone mapping device, display device and storage medium
CN116805292A (en) Tone mapping method and device and display equipment
CN115082345A (en) Image shadow removing method and device, computer equipment and storage medium
CN116977154B (en) Visible light image and infrared image fusion storage method, device, equipment and medium
CN116932118B (en) Color adjustment method and device for graphic primitive, computer equipment and storage medium
CN118015102A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN110647898A (en) Image processing method, image processing device, electronic equipment and computer storage medium
CN113194267B (en) Image processing method and device and photographing method and device
CN115082357B (en) Video denoising data set generation method and device, computer equipment and storage medium
CN116883257A (en) Image defogging method, device, computer equipment and storage medium
CN116645428A (en) Image display method, device, computer equipment and storage medium
CN117994179A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN114549351A (en) Color correction method, apparatus, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination