CN117011124A - Gain map generation method and device, electronic equipment and medium - Google Patents
Gain map generation method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN117011124A CN117011124A CN202310688228.3A CN202310688228A CN117011124A CN 117011124 A CN117011124 A CN 117011124A CN 202310688228 A CN202310688228 A CN 202310688228A CN 117011124 A CN117011124 A CN 117011124A
- Authority
- CN
- China
- Prior art keywords
- brightness
- pixel point
- gain
- determining
- original image
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000007906 compression Methods 0.000 claims description 35
- 230000006835 compression Effects 0.000 claims description 34
- 238000012545 processing Methods 0.000 abstract description 12
- 230000000875 corresponding effect Effects 0.000 description 30
- 230000006870 function Effects 0.000 description 14
- 238000013507 mapping Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 5
- 238000005282 brightening Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000002596 correlated effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20172—Image enhancement details
- G06T2207/20208—High dynamic range [HDR] image processing
Landscapes
- Image Processing (AREA)
Abstract
The application discloses a method and a device for generating a gain map, electronic equipment and a medium, and belongs to the technical field of image processing. The method comprises the following steps: and acquiring first brightness information of the original image, wherein the first brightness information comprises first brightness of at least one pixel point in the original image, each pixel point in the at least one pixel point corresponds to one first brightness, determining brightness gain of the at least one pixel point in the original image according to the first brightness of the at least one pixel point, and generating a gain map according to the brightness gain of the at least one pixel point and the original image.
Description
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a method and a device for generating a gain map, electronic equipment and a medium.
Background
In image processing, a gain map is an image that describes the brightness gain of different areas of the image. It is typically a gray scale image of the same size as the original image, with each pixel representing the brightness gain of the corresponding region.
In the prior art, after an original image with a high dynamic range is acquired, the original image is usually stored in a standard dynamic range (Standard Dynamic Range, SDR) image, but is limited by early screen display capability and a storage bit width (8 bit) of a current main stream, so that an actual scene look and feel, including brightness look and feel and color look and feel, cannot be accurately displayed when the image is viewed through equipment. To solve this problem, a gain map may be used to enhance the dynamic range of an image as the screen display capability increases. The images are stored in the format of SDR images plus gain map, so that the dynamic adjustment brightness range of SDR images can be adjusted based on the gain map in the subsequent image processing and display process, and the detail and color information of the original images can be restored or enhanced.
However, in the related art, it is necessary to convert an original image into an SDR image by tone mapping and then determine a gain map based on image data of the original image and image data of the SDR image, however, some application scenarios do not have a tone mapping module, which results in that image data of the SDR image cannot be acquired, and thus the gain map cannot be acquired.
Disclosure of Invention
The embodiment of the application aims to provide a method, a device, electronic equipment and a medium for generating a gain map, which can solve the technical problem that the gain map cannot be acquired in the existing scene information incapable of being subjected to tone mapping.
In a first aspect, an embodiment of the present application provides a method for generating a gain map, where the method includes:
acquiring first brightness information of an original image, wherein the first brightness information comprises first brightness of at least one pixel point in the original image, and each pixel point in the at least one pixel point corresponds to one first brightness;
determining the brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
and generating a gain map according to the brightness gain of the at least one pixel point and the original image.
In a second aspect, an embodiment of the present application provides a gain map generating apparatus, where the apparatus includes:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring first brightness information of an original image, the first brightness information comprises first brightness of at least one pixel point in the original image, and each pixel point in the at least one pixel point corresponds to one first brightness;
a determining module, configured to determine a brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
and the generating module is used for generating a gain graph according to the brightness gain of the at least one pixel point and the original image.
In a third aspect, an embodiment of the application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as provided in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method as provided in the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to execute programs or instructions to implement a method as provided in the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement a method as provided in the first aspect.
In the method, the device, the electronic equipment and the medium for generating the gain map, after the first brightness of each pixel point in the original image is acquired, the brightness gain of each pixel point can be determined based on the first brightness of at least one pixel point, and the gain map is generated by the brightness gain of each pixel point and the original image. Compared with the prior art that the gain map can be determined by tone mapping the original image to obtain the SDR image, the method does not need to obtain the image data of the SDR image, and the corresponding gain map can be determined only by a single frame of original image, so that the generation mode of the gain map can be suitable for wider application scenes.
Drawings
FIG. 1 is a flow chart of a method for generating a gain map according to an embodiment of the present application;
Fig. 2 is a schematic structural diagram of a gain map generating apparatus according to another embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to another embodiment of the present application;
fig. 4 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the objects identified by "first," "second," etc. are generally of a type not limited to the number of objects, for example, the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
In the related art, in the prior art, after an original image with a high dynamic range is acquired, the original image is generally stored as a standard dynamic range (Standard Dynamic Range, SDR) image, the original image is required to be converted into the SDR image through tone mapping, and then a gain map is determined based on the image data of the original image and the image data of the SDR image, however, in some application scenarios, there is not necessarily a tone mapping module, such as when the image to be processed is a prosaw, or when the tone-mapped SDR image cannot be acquired in the ISP path, this results in that the image data of the SDR image cannot be acquired, and thus the gain map cannot be acquired based on the image data of the original image and the image data of the SDR image.
In order to solve the technical problems, the application provides a method for generating a gain map. The method for generating the gain map according to the embodiment of the present application is described in detail below with reference to the accompanying drawings by means of specific embodiments and scene information thereof.
As shown in fig. 1, fig. 1 is a flowchart of a method for generating a gain map according to an embodiment of the present application, where the method for generating a gain map according to an embodiment of the present application may include:
S101, acquiring first brightness information of an original image, wherein the first brightness information comprises first brightness of at least one pixel point in the original image, and each pixel point in the at least one pixel point corresponds to one first brightness;
in this embodiment, the original image may be a multi-frame fused image with a high dynamic range, or may be an image with a high dynamic range that has not undergone any image processing or compression, and has a wider brightness range than the standard image. The original image includes at least one pixel, and the first image information includes a first brightness of each pixel in the at least one pixel, where the first brightness of the pixel refers to a brightness level or a gray level of the pixel, and reflects a light intensity or a color brightness represented by the pixel.
For each pixel, the first luminance of the pixel may be determined based on the respective color channels of the pixel, and may be calculated, for example, by the following formula:
wherein Y represents the first luminance of the pixel, R represents the red channel, gr represents the green (red difference) channel, gb represents the green (blue difference) channel, B represents the blue channel, a, B, c, and d represent the weighting coefficients of the color channels, each weighting coefficient is greater than 0, and the sum of the weighting coefficients is 1.
S102, determining the brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
in this embodiment, since the original image is usually an image with a high dynamic range, after the original image with a high dynamic range is obtained, the original image is usually stored as a standard dynamic range (Standard Dynamic Range, SDR) image, since the standard white of the current SDR display is generally 100nit, and the peak brightness of the current flagship machine display screen can reach up to 2000nit, if the SDR standard display is directly used, the real impression of the human eye on the actual scene (particularly, the brightness of the highlight area is not bright enough and the difference between the actual scene is large) can not be restored due to the limited brightness interval of the display, so that the restoration of the detail and the color of the highlight area on the SDR image by combining the peak brightness of the display screen and the gain image is considered, and the real impression of the human eye on the scene is restored.
The SDR image may be subjected to a brightening process based on the brightness gain of each pixel in the original image. The brightness gain is used for representing the brightness degree of the brightness of the pixel points in the SDR image, and the larger the brightness gain is, the higher the brightness degree of the pixel points is.
Because each pixel point in the SDR image is in a lower brightness range, the larger the first brightness of the pixel point in the original image is, the larger the corresponding brightness gain is required, so that the display effect of the original image can be restored as much as possible. The luminance gain of a pixel in the original image may be determined based on the first luminance of the pixel such that the luminance gain of the pixel and the first luminance are positively correlated to ensure a display effect of the display image.
S103, generating a gain graph according to the brightness gain of the at least one pixel point and the original image.
In the application, the gain map refers to a gray image with the same size and the same contour as the original image, and the pixel value of each pixel point on the gain map is used for representing the brightness gain of the pixel point in the SDR image, so that after the brightness gain of the original image and each pixel point is determined, an image with the same size contour as the original image can be generated, and each pixel point is the brightness gain image, namely the gain map.
After the gain map is obtained, brightness adjustment of different degrees can be carried out on different areas of the SDR image by applying the gain map, so that a display image is obtained, and the display effect of the display image is enhanced.
In the application, after the first brightness of each pixel point in the original image is acquired, the brightness gain of each pixel point is determined based on the first brightness of at least one pixel point, and a gain map is generated by the brightness gain of each pixel point and the original image. Compared with the prior art that the gain map can be determined by tone mapping the original image to obtain the SDR image, the method does not need to obtain the image data of the SDR image, and the corresponding gain map can be determined only by a single frame of original image, so that the generation mode of the gain map can be suitable for wider application scenes.
In some embodiments, S102 comprises:
determining compression coefficients of all pixel points in the original image according to image areas of all pixel points in the original image, wherein the original image comprises at least one image area divided based on scene information, and each image area in the at least one image area corresponds to one scene information of the original image;
compressing the first brightness of the at least one pixel point based on the compression coefficient to obtain the second brightness of the at least one pixel point;
and determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the second brightness of the at least one pixel point.
In this embodiment, in the process of obtaining the SDR image by performing dynamic range compression on the original image, the compression degree of the first brightness of each pixel point in the original image may be estimated, so as to obtain the second brightness of each pixel point in the original image, and the brightness gain of each pixel point may be determined based on the first brightness and the second brightness of the pixel point. Since the luminance gain represents a difference between the first luminance and the second luminance, the larger the difference between the first luminance and the second luminance is, the larger the luminance gain is.
The compression coefficient is used for representing the compression degree of the first brightness of each pixel point. The compression coefficient of each pixel point in the original image can be determined according to the scene information in the original image.
For example, a basic coefficient may be determined, an image area to which each pixel point in the original image belongs is identified, then scene information corresponding to the image area is identified, the basic coefficient is adjusted based on the scene information to obtain a compression coefficient of each pixel point, and the compression process is performed on the first brightness of each pixel point based on the compression coefficient to obtain the compressed second brightness. Furthermore, the original image may be divided into at least one image area based on scene information of the original image in advance, each image area corresponding to one type of scene information.
For example, the dynamic range compression may be power exponent compression, in which case the exponent value of the compression function is the compression coefficient, the first exponent may be determined as the base coefficient, if the scene information of the original image to be compressed is recognized as a portrait scene, in which case if the brightness of the background of the portrait is too high, the background will be emphasized too much, and the pictures will not be coordinated enough, so that the first exponent may be reduced to obtain the second exponent, and the second exponent is used as the final compression coefficient, so that a larger second brightness and a smaller brightness gain may be obtained, thereby reducing the brightness of the SDR image.
For another example, the dynamic range compression may be log function compression, where the base value of the log function is the compression coefficient, the first base may be determined as the base coefficient, if the scene information of the original image to be compressed is identified as a portrait scene, and similarly, the brightness gain of the pixel needs to be reduced, so that the first base may be reduced to obtain the second base, and the second base may be used as the final compression coefficient, so that a larger second brightness and a smaller brightness gain may be obtained, and thus the brightness degree of the SDR image is reduced.
In this embodiment, the compression coefficient of the SDR image obtained by compressing the dynamic range of the original image may be estimated by combining the scene information of the original image, so as to determine the compressed second brightness of each pixel, and determine the brightness gain of the pixel based on the first brightness before compression and the compressed second brightness, so as to accurately control the brightness enhancement degree of different areas according to the scenes to which the different areas belong.
In some embodiments, the determining the brightness gain of the at least one pixel according to the first brightness of the at least one pixel and the second brightness of the at least one pixel includes:
calculating the sum of the second brightness and the first value of the target pixel point to obtain a first sum value;
determining a first brightness of the target pixel point and a first ratio of the first sum value as a gain reference of the target pixel point;
determining the brightness gain of the target pixel point according to the gain reference;
wherein the target pixel point is any one of the at least one pixel point.
In this embodiment, the gain reference refers to a reference standard or reference point of brightness gain, and the gain reference of a pixel point may be directly determined as the brightness gain of the pixel point, or may be optimized on the basis of the gain reference, so as to obtain the final brightness gain.
The calculation formula of the gain reference is as follows:
wherein Y represents the first brightness of the target pixel point, Y GTM Representing the second brightness of the target pixel, eps being a first value, eps being a small value, e.g. 1e-6, in order to avoid Y GTM Set to 0, T represents the gain reference of the target pixel.
In some embodiments, the determining the brightness gain of the target pixel point according to the gain reference includes:
determining a target image area to which the target pixel point belongs;
determining an adjustment ratio corresponding to target scene information of the target image area;
and determining a first product of the adjustment ratio corresponding to the target scene information and the gain reference as the brightness gain of the target pixel point.
In this embodiment, after gain references of pixels in an original image are obtained, scene information in the original image may be identified, the original image may be segmented based on different scene information, and the gain references of pixels in an image area corresponding to the different scene information may be adjusted in different manners. Specifically, each piece of scene information has a corresponding adjustment ratio, and the gain references of all the pixel points in the image area corresponding to the scene information can be adjusted based on the adjustment ratio corresponding to the scene information, so as to obtain the final brightness gain.
For example, if the target scene information corresponding to the target pixel point is a yin-yang face, that is, half of the face is illuminated to be very bright, and the other half is not illuminated to be a relatively dark face. In this case, in the process of brightening the SDR image corresponding to the original image, since the brightness gain of the bright portion is generally greater than that of the dark portion, a bright half of the face will be brighter, which seriously affects the look and feel of the display image, so that the value of the gain reference needs to be reduced, thereby obtaining a smaller brightness gain. Then, the adjustment ratio corresponding to the yin-yang face can be obtained, and the value of the gain reference is reduced based on the adjustment ratio, so that smaller brightness gain is obtained.
In this embodiment, the luminance gain may be further adjusted based on the luminance gain reference in combination with specific scene information, so as to more accurately implement differential control of luminance gains in different areas on the image.
In some embodiments, the determining the first product of the adjustment ratio corresponding to the target scene information and the gain reference as the brightness gain of the target pixel includes:
and determining a first product of the adjustment ratio corresponding to the target scene information and the gain reference as the brightness gain of the target pixel point.
In this embodiment, for the original image, each pixel point in the original image may be traversed, whether the pixel points correspond to the target scene information may be determined, and the gain references of the pixel points may be adjusted to be the brightness gains based on the determination result.
The formula for adjustment is as follows:
GainMap=Ratio*T*Mask+T*(1-Mask)
the GainMap represents brightness gain of the pixel point, the Ratio represents adjustment Ratio, the Mask is used for representing whether the pixel point corresponds to target scene information, if so, the Mask of the pixel point is 1, otherwise, the Mask is 0, and the T represents gain reference of the pixel point.
That is, if the pixel corresponds to the target scene information, the brightness gain of the pixel is the first product of the adjustment ratio corresponding to the target scene information and the gain reference; if the pixel point corresponds to the target scene information, the brightness gain of the pixel point is the gain reference of the pixel point.
In some embodiments, the determining the brightness gain of the at least one pixel in the original image according to the first brightness of the at least one pixel includes:
acquiring a brightness threshold value of a standard dynamic range image corresponding to the original image;
and determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the brightness threshold value.
In this embodiment, the luminance threshold refers to the highest luminance that can be displayed by the standard dynamic range image, if the first luminance of the pixel point in the original image is higher than the luminance threshold, the first luminance of the pixel point must be compressed in the process of converting the original image into the standard dynamic range image, so that a corresponding luminance gain needs to be set for the pixel point, so that the luminance of the standard dynamic range image can be recovered in the process of brightening, thereby obtaining a better display effect. Thus, the luminance gain of each pixel point may be determined from the first luminance and the luminance threshold. Specifically, since the larger the difference between the first luminance and the luminance threshold value, the larger the degree of compression will be correspondingly, that is, the larger luminance gain needs to be determined.
In this embodiment, the brightness gain is directly determined by the first brightness of the pixel point of the original image and the brightness threshold of the SDR image in the above manner, so that the brightness enhancement times are related to the actual brightness of different areas in the original image in the brightness enhancement process, so that accurate brightness enhancement control can be performed on the different areas accurately.
In some embodiments, the determining the brightness gain of the at least one pixel according to the first brightness of the at least one pixel and the brightness threshold comprises:
When the first brightness of the target pixel point is larger than the brightness threshold value, determining that the sum of the first brightness and the second value of the target pixel point is true, determining that the first pair of values is based on a third value, and determining that the brightness threshold value is true, and determining that the second pair of values is based on the third value;
determining a first difference between the first and second log values;
and determining the sum of the first difference value and the fourth value as the brightness gain of the target pixel point.
In some embodiments, the determining the brightness gain of the at least one pixel according to the first brightness of the at least one pixel and the brightness threshold comprises:
and determining the brightness gain of the target pixel point to be 1 under the condition that the first brightness of the target pixel point is smaller than or equal to the brightness threshold value.
In this embodiment, after knowing the first luminance of the target pixel point and the luminance threshold, the luminance gain of the target pixel point may be determined by an interval function. The third value may be any constant greater than 1 set in advance, and is used for converting the brightness into a log domain value, so as to facilitate subsequent calculation.
Specifically, the interval function is as follows:
wherein GainMap represents the brightness gain of the target pixel point, sdr _threshold represents a fixed brightness threshold, YLog is the log domain expression of the first brightness of the target pixel point, log 2 (sdr threshold ) The third value is 2 and the fourth value is 1 in the interval function, which is the log domain expression of the brightness threshold.
Furthermore, there are also:
YLog=log 2 (Y+1)
wherein, YLog is the log domain expression of the first brightness of the target pixel point, Y is the first brightness, and the second value is 1.
From the above, in the case where the first luminance of the target pixel is less than or equal to the luminance threshold value, the luminance gain of the target pixel may be directly determined as 1, and in the case where the first luminance of the target pixel is greater than the luminance threshold value, the luminance gain of the target pixel may be determined as a value obtained by adding the difference value of the log domain expression of the first luminance and the log domain expression of the luminance threshold value and 1.
For example, in the case where the luminance threshold value is 4096, if the first luminance is 4096, the luminance gain of the target pixel point is 1, and if the first luminance is 16384, the luminance gain of the target pixel point is 3.
In some embodiments, after the generating the gain map according to the brightness gain of the at least one pixel point and the original image, the method further includes:
Determining the maximum brightness gain in the gain map in the brightness gain of the at least one pixel point;
determining a second difference value between the maximum brightness gain and a fifth value and a third difference value between the brightness gain of the target pixel point and the fifth value;
determining a third ratio of the third difference to the second difference;
and normalizing and storing the product of the third ratio and the sixth value.
In this embodiment, after the gain map is generated, the gain map and the SDR image may be stored together. Specifically, in storing the gain map, the numerical range of the pixel gain of each pixel point in the gain map may be mapped to an integer range of 0 to 255 and stored as an 8-bit gray scale image.
The mapping process is shown in the following formula:
maxGain=max(GainMap)
wherein maxGain is the maximum brightness gain in the gain map, and max (gainMap) represents the pixel point with the maximum brightness gain obtained by screening in all the pixel points.
After obtaining the maximum luminance gain, the maximum luminance gain may be substituted into the following equation:
wherein GM is a value to be normalized, maxGain is a maximum brightness gain in the gain map, gainMap represents a brightness gain of the target pixel point, the fifth value is 1, and the sixth value is 255.
Through the calculation of the formula, each brightness gain can be converted into a value to be normalized between 0 and 255, the value to be normalized is normalized into the nearest integer, and the nearest integer is stored as an 8-bit gray image.
In this embodiment, the gain map can be expressed as a gray-scale image by normalizing it to 0 to 255 for storage, and gain information is expressed using an integer value of 8 bits in each pixel. This representation facilitates the storage and processing of the gain map and further use in subsequent image processing. In addition, the maximum value plus normalization mode is adopted, so that the accuracy of the gain map is conveniently reserved, and the display fault problem of the display image caused by the accuracy problem of the gain map is improved.
Fig. 2 is a schematic structural diagram of a gain map generating apparatus according to another embodiment of the present application, and as shown in fig. 2, the gain map generating apparatus may include:
an obtaining module 201, configured to obtain first luminance information of an original image, where the first luminance information includes first luminance of at least one pixel point in the original image, where each pixel point in the at least one pixel point corresponds to one first luminance;
A determining module 202, configured to determine a brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
and the generating module 203 is configured to generate a gain map according to the brightness gain of the at least one pixel point and the original image.
In the application, after the first brightness of each pixel point in the original image is acquired, the brightness gain of each pixel point is determined based on the first brightness of at least one pixel point, and a gain map is generated by the brightness gain of each pixel point and the original image. Compared with the prior art that the gain map can be determined by tone mapping the original image to obtain the SDR image, the method does not need to obtain the image data of the SDR image, and the corresponding gain map can be determined only by a single frame of original image, so that the generation mode of the gain map can be suitable for wider application scenes.
In another alternative example, the determination module 202 includes:
a first determining unit, configured to determine a compression coefficient of each pixel point in the original image according to an image area to which each pixel point in the original image belongs, where the original image includes at least one image area divided based on scene information, and each image area in the at least one image area corresponds to one type of scene information of the original image;
The first compression unit is used for compressing the first brightness of the at least one pixel point based on the compression coefficient to obtain the second brightness of the at least one pixel point;
and the second determining unit is used for determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the second brightness of the at least one pixel point.
In another optional example, the second determining unit is further configured to calculate a sum of the second brightness and the first value of the target pixel point to obtain a first sum value;
the second determining unit is further configured to determine a first luminance of the target pixel point and a first ratio of the first sum value as a gain reference of the target pixel point;
the second determining unit is further used for determining the brightness gain of the target pixel point according to the gain reference;
wherein the target pixel point is any one of the at least one pixel point.
In another optional example, the second determining unit is further configured to:
determining a target image area to which the target pixel point belongs;
determining an adjustment ratio corresponding to target scene information of the target image area;
and determining a first product of the adjustment ratio corresponding to the target scene information and the gain reference as the brightness gain of the target pixel point.
In another optional example, the second determining unit is further configured to determine, as the luminance gain of the target pixel point, a first product of the gain reference and an adjustment ratio corresponding to the target scene information.
The determining module 202 further includes:
the threshold value acquisition unit is used for acquiring the brightness threshold value of the standard dynamic range image corresponding to the original image;
and the third determining unit is used for determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the brightness threshold value.
In another optional example, the first determining subunit is further configured to determine that, when the first luminance of the target pixel is greater than the luminance threshold, a sum of the first luminance and the second value of the target pixel is a true number, a first logarithmic value based on a third value, and determine that the luminance threshold is a true number, and a second logarithmic value based on the third value; determining a first difference between the first and second log values; and determining the sum of the first difference value and the fourth value as the brightness gain of the target pixel point.
In another optional example, the first determining subunit is further configured to determine, when the first luminance of the target pixel point is less than or equal to the luminance threshold, a luminance gain of the target pixel point to be 1.
In another optional example, the generating device of the gain map further includes:
a screening module 204, configured to determine a maximum brightness gain in the gain map from brightness gains of the at least one pixel point;
a first calculation module 205, configured to determine a second difference between the maximum brightness gain and a fifth value, and a third difference between the brightness gain of the target pixel point and the fifth value;
a second calculation module 206 configured to determine a third ratio of the third difference to the second difference;
a storage module 207, configured to normalize and store the product of the third ratio and the sixth value.
The device for generating the gain map in the embodiment of the application can be electronic equipment, and can also be a component in the electronic equipment, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. The electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile internet appliance (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., a server, a network attached storage (NetworkAttached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which are not limited in the embodiments of the present application.
The device for generating the gain map in the embodiment of the application may be a device with an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The gain map generating device provided by the embodiment of the present application can implement each process implemented by the method embodiment of fig. 1, and in order to avoid repetition, details are not repeated here.
Optionally, as shown in fig. 3, an embodiment of the present application further provides an electronic device 100, including a processor 110, a memory 119, where the processor 110 includes a central processing unit CPU 1101 and a GPU compression processing unit 1102. A program or an instruction stored in the memory 119 and capable of running on the processor 110, where the program or the instruction, when executed by the processor 110, implement each process of the foregoing embodiment of the method for generating a gain map, and achieve the same technical effects, and are not repeated herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Referring to fig. 4 in combination, fig. 4 is a schematic hardware structure of an electronic device implementing an embodiment of the present application. The electronic device 100 includes, but is not limited to: radio frequency unit 121, network module 122, audio output unit 123, input unit 124, sensor 125, display unit 126, user input unit 127, interface unit 128, memory 129, and processor 120.
Those skilled in the art will appreciate that the electronic device 120 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 120 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 4 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The input unit 124 is configured to obtain first luminance information of an original image, where the first luminance information includes first luminance of at least one pixel point in the original image, and each pixel point in the at least one pixel point corresponds to one first luminance;
a processor 120, configured to determine a brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
and a processor 120, configured to generate a gain map according to the brightness gain of the at least one pixel point and the original image.
In the application, after the first brightness of each pixel point in the original image is acquired, the brightness gain of each pixel point is determined based on the first brightness of at least one pixel point, and a gain map is generated by the brightness gain of each pixel point and the original image. Compared with the prior art that the gain map can be determined by tone mapping the original image to obtain the SDR image, the method does not need to obtain the image data of the SDR image, and the corresponding gain map can be determined only by a single frame of original image, so that the generation mode of the gain map can be suitable for wider application scenes.
In another alternative example, the processor 120 includes:
a first determining unit, configured to determine a compression coefficient of each pixel point in the original image according to an image area to which each pixel point in the original image belongs, where the original image includes at least one image area divided based on scene information, and each image area in the at least one image area corresponds to one type of scene information of the original image;
the first compression unit is used for compressing the first brightness of the at least one pixel point based on the compression coefficient to obtain the second brightness of the at least one pixel point;
and the second determining unit is used for determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the second brightness of the at least one pixel point.
In another optional example, the second determining unit is further configured to calculate a sum of the second brightness and the first value of the target pixel point to obtain a first sum value;
the second determining unit is further configured to determine a first luminance of the target pixel point and a first ratio of the first sum value as a gain reference of the target pixel point;
the second determining unit is further used for determining the brightness gain of the target pixel point according to the gain reference;
Wherein the target pixel point is any one of the at least one pixel point.
In another optional example, the second determining unit is further configured to:
determining a target image area to which the target pixel point belongs;
determining an adjustment ratio corresponding to target scene information of the target image area;
and determining a first product of the adjustment ratio corresponding to the target scene information and the gain reference as the brightness gain of the target pixel point.
In another optional example, the second determining unit is further configured to determine, as the luminance gain of the target pixel point, a first product of the gain reference and an adjustment ratio corresponding to the target scene information.
The determining module 202 further includes:
the threshold value acquisition unit is used for acquiring the brightness threshold value of the standard dynamic range image corresponding to the original image;
and the third determining unit is used for determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the brightness threshold value.
In another optional example, the first determining subunit is further configured to determine that, when the first luminance of the target pixel is greater than the luminance threshold, a sum of the first luminance and the second value of the target pixel is a true number, a first logarithmic value based on a third value, and determine that the luminance threshold is a true number, and a second logarithmic value based on the third value; determining a first difference between the first and second log values; and determining the sum of the first difference value and the fourth value as the brightness gain of the target pixel point.
In another optional example, the first determining subunit is further configured to determine, when the first luminance of the target pixel point is less than or equal to the luminance threshold, a luminance gain of the target pixel point to be 1.
In another optional example, the generating device of the gain map further includes:
a processor 120, configured to determine a maximum brightness gain in the gain map from brightness gains of the at least one pixel point;
a processor 120, configured to determine a second difference between the maximum brightness gain and a fifth value, and a third difference between the brightness gain of the target pixel and the fifth value;
a processor 120 for determining a third ratio of the third difference to the second difference;
and a memory 129, configured to normalize and store a product of the third ratio and the sixth value.
It should be appreciated that in embodiments of the present application, the input unit 124 may include a graphics processor (Graphics Processing Unit, GPU) 1241 and a microphone 1242, with the graphics processor 1241 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 126 may include a display panel 1261, and the display panel 1261 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 127 includes at least one of a touch panel 1271 and other input devices 1272. Touch panel 1271 is also referred to as a touch screen. Touch panel 1271 may include two parts, a touch detection device and a touch controller. Other input devices 1272 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
The memory 129 may be used to store software programs and various data. The memory 129 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 129 may include volatile memory or nonvolatile memory, or the memory 129 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (RandomAccess Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 129 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 120 may include one or more processing units; optionally, the processor 120 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 120.
The embodiment of the application also provides a readable storage medium, and the readable storage medium stores a program or an instruction, which when executed by a processor, implements each process of the above-mentioned gain map generating method embodiment, and can achieve the same technical effect, so that repetition is avoided, and no further description is given here.
The processor is a processor in the electronic device in the above embodiment. Readable storage media include computer readable storage media such as computer readable memory ROM, random access memory RAM, magnetic or optical disks, and the like.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, the processes of the embodiment of the method for generating the gain map can be realized, the same technical effects can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the embodiments of the method for generating a gain map as described above, and achieve the same technical effects, and are not described herein in detail for avoiding repetition.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
Claims (13)
1. A method for generating a gain map, comprising:
acquiring first brightness information of an original image, wherein the first brightness information comprises first brightness of at least one pixel point in the original image, and each pixel point in the at least one pixel point corresponds to one first brightness;
determining the brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
and generating a gain map according to the brightness gain of the at least one pixel point and the original image.
2. The method of claim 1, wherein determining the brightness gain of at least one pixel in the original image based on the first brightness of the at least one pixel comprises:
determining compression coefficients of all pixel points in the original image according to image areas of all pixel points in the original image, wherein the original image comprises at least one image area divided based on scene information, and each image area in the at least one image area corresponds to one scene information of the original image;
compressing the first brightness of the at least one pixel point based on the compression coefficient to obtain the second brightness of the at least one pixel point;
And determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the second brightness of the at least one pixel point.
3. The method of claim 2, wherein the determining the brightness gain of the at least one pixel based on the first brightness of the at least one pixel and the second brightness of the at least one pixel comprises:
calculating the sum of the second brightness and the first value of the target pixel point to obtain a first sum value;
determining a first ratio of the first brightness of the target pixel point to the first sum value as a gain reference of the target pixel point;
determining the brightness gain of the target pixel point according to the gain reference;
wherein the target pixel point is any one of the at least one pixel point.
4. A method according to claim 3, wherein said determining the brightness gain of the target pixel point from the gain reference comprises:
determining a target image area to which the target pixel point belongs;
determining an adjustment ratio corresponding to target scene information of the target image area;
and determining a first product of the adjustment ratio corresponding to the target scene information and the gain reference as the brightness gain of the target pixel point.
5. The method of claim 1, wherein determining the brightness gain of at least one pixel in the original image based on the first brightness of the at least one pixel comprises:
acquiring a brightness threshold value of a standard dynamic range image corresponding to the original image;
and determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the brightness threshold value.
6. The method of claim 5, wherein said determining the brightness gain of said at least one pixel based on the first brightness of said at least one pixel and said brightness threshold comprises:
when the first brightness of the target pixel point is larger than the brightness threshold value, determining that the sum of the first brightness and the second value of the target pixel point is true, determining that the first pair of values is based on a third value, and determining that the brightness threshold value is true, and determining that the second pair of values is based on the third value;
determining a first difference between the first and second log values;
and determining the sum of the first difference value and the fourth value as the brightness gain of the target pixel point.
7. The method of claim 5, wherein said determining the brightness gain of said at least one pixel based on the first brightness of said at least one pixel and said brightness threshold comprises:
and determining the brightness gain of the target pixel point to be 1 under the condition that the first brightness of the target pixel point is smaller than or equal to the brightness threshold value.
8. The method of claim 1, wherein after generating a gain map from the brightness gain of the at least one pixel and the original image, further comprising:
determining the maximum brightness gain in the gain map in the brightness gain of the at least one pixel point;
determining a second difference value between the maximum brightness gain and a fifth value and a third difference value between the brightness gain of the target pixel point and the fifth value;
determining a third ratio of the third difference to the second difference;
and normalizing and storing the product of the third ratio and the sixth value.
9. A gain map generation apparatus, comprising:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring first brightness information of an original image, the first brightness information comprises first brightness of at least one pixel point in the original image, and each pixel point in the at least one pixel point corresponds to one first brightness;
A determining module, configured to determine a brightness gain of at least one pixel point in the original image according to the first brightness of the at least one pixel point;
and the generating module is used for generating a gain graph according to the brightness gain of the at least one pixel point and the original image.
10. The apparatus of claim 9, wherein the determining module comprises:
a first determining unit, configured to determine a compression coefficient of each pixel point in the original image according to an image area to which each pixel point in the original image belongs, where the original image includes at least one image area divided based on scene information, and each image area in the at least one image area corresponds to one type of scene information of the original image;
the first compression unit is used for compressing the first brightness of the at least one pixel point based on the compression coefficient to obtain the second brightness of the at least one pixel point;
and the second determining unit is used for determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the second brightness of the at least one pixel point.
11. The apparatus of claim 9, wherein the determining module further comprises:
The threshold value acquisition unit is used for acquiring the brightness threshold value of the standard dynamic range image corresponding to the original image;
and the third determining unit is used for determining the brightness gain of the at least one pixel point according to the first brightness of the at least one pixel point and the brightness threshold value.
12. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method of generating a gain map as claimed in any one of claims 1 to 8.
13. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the gain map generation method according to any of claims 1-8.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310688228.3A CN117011124A (en) | 2023-06-09 | 2023-06-09 | Gain map generation method and device, electronic equipment and medium |
PCT/CN2024/096982 WO2024251062A1 (en) | 2023-06-09 | 2024-06-03 | Gain map generation method and apparatus, electronic device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310688228.3A CN117011124A (en) | 2023-06-09 | 2023-06-09 | Gain map generation method and device, electronic equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117011124A true CN117011124A (en) | 2023-11-07 |
Family
ID=88573574
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310688228.3A Pending CN117011124A (en) | 2023-06-09 | 2023-06-09 | Gain map generation method and device, electronic equipment and medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117011124A (en) |
WO (1) | WO2024251062A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024251062A1 (en) * | 2023-06-09 | 2024-12-12 | 维沃移动通信有限公司 | Gain map generation method and apparatus, electronic device and medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6600216B2 (en) * | 2015-09-29 | 2019-10-30 | キヤノン株式会社 | Image processing apparatus, image processing method, program, and storage medium |
US10943335B2 (en) * | 2018-06-15 | 2021-03-09 | Intel Corporation | Hybrid tone mapping for consistent tone reproduction of scenes in camera systems |
CN111292269B (en) * | 2020-02-13 | 2023-09-01 | 珠海全志科技股份有限公司 | Image tone mapping method, computer device, and computer-readable storage medium |
CN115760652B (en) * | 2023-01-06 | 2023-06-16 | 荣耀终端有限公司 | Method for expanding dynamic range of image and electronic equipment |
CN117011124A (en) * | 2023-06-09 | 2023-11-07 | 维沃移动通信有限公司 | Gain map generation method and device, electronic equipment and medium |
-
2023
- 2023-06-09 CN CN202310688228.3A patent/CN117011124A/en active Pending
-
2024
- 2024-06-03 WO PCT/CN2024/096982 patent/WO2024251062A1/en unknown
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024251062A1 (en) * | 2023-06-09 | 2024-12-12 | 维沃移动通信有限公司 | Gain map generation method and apparatus, electronic device and medium |
Also Published As
Publication number | Publication date |
---|---|
WO2024251062A1 (en) | 2024-12-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109685746B (en) | Image brightness adjusting method and device, storage medium and terminal | |
US20200058111A1 (en) | Image Processing Method, Storage Medium, and Electronic Apparatus | |
US9826149B2 (en) | Machine learning of real-time image capture parameters | |
US9129388B2 (en) | Global approximation to spatially varying tone mapping operators | |
US8681187B2 (en) | Image processing apparatus, non-transitory storage medium storing image processing program and image processing method | |
CN109697738B (en) | Image processing method, device, terminal equipment and storage medium | |
CN113538223B (en) | Noise image generation method, device, electronic equipment and storage medium | |
CN111429371A (en) | Image processing method and device and terminal equipment | |
US10810462B2 (en) | Object detection with adaptive channel features | |
CN107172354A (en) | Method for processing video frequency, device, electronic equipment and storage medium | |
WO2014173145A1 (en) | Image enhancement method and device | |
US11010879B2 (en) | Video image processing method and apparatus thereof, display device, computer readable storage medium and computer program product | |
KR102582643B1 (en) | Display apparatus and method for processing image thereof | |
CN108259771A (en) | Image processing method, image processing apparatus, storage medium, and electronic device | |
CN110473156B (en) | Image information processing method and device, storage medium and electronic equipment | |
CN117011124A (en) | Gain map generation method and device, electronic equipment and medium | |
WO2023011280A1 (en) | Image noise degree estimation method and apparatus, and electronic device and storage medium | |
CN113438400B (en) | Image acquisition method, image acquisition device and electronic equipment | |
CN116489377A (en) | Image processing method and electronic device | |
CN114299014A (en) | Image processing architecture, method, electronic device and storage medium | |
CN114782261B (en) | Image processing method and device, electronic equipment and readable storage medium | |
CN117793513A (en) | Video processing method and device | |
CN113298888B (en) | Image processing method, device, equipment and storage medium | |
CN117952875A (en) | Image contrast enhancement method and device, storage medium and electronic equipment | |
CN117670685A (en) | Image processing method, device, electronic equipment and readable 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 |