CN114066783A - Tone mapping method, tone mapping device, electronic equipment and storage medium - Google Patents

Tone mapping method, tone mapping device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114066783A
CN114066783A CN202111349059.8A CN202111349059A CN114066783A CN 114066783 A CN114066783 A CN 114066783A CN 202111349059 A CN202111349059 A CN 202111349059A CN 114066783 A CN114066783 A CN 114066783A
Authority
CN
China
Prior art keywords
histogram
image
tone mapping
mapping
local
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.)
Withdrawn
Application number
CN202111349059.8A
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.)
Shenzhen TetrasAI Technology Co Ltd
Original Assignee
Shenzhen TetrasAI 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 Shenzhen TetrasAI Technology Co Ltd filed Critical Shenzhen TetrasAI Technology Co Ltd
Priority to CN202111349059.8A priority Critical patent/CN114066783A/en
Publication of CN114066783A publication Critical patent/CN114066783A/en
Withdrawn legal-status Critical Current

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof

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 present disclosure provides a tone mapping method, apparatus, electronic device and storage medium, the method comprising: performing inverse transformation on a preset gamma parameter to generate a standard histogram; performing histogram equalization on the RAW image to be processed by utilizing a standard histogram to obtain a tone mapping curve; and mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.

Description

Tone mapping method, tone mapping device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer vision technologies, and in particular, to a tone mapping method and apparatus, an electronic device, and a storage medium.
Background
Image tone mapping is a commonly used technique in image processing, and is generally applied in the fields of improving image brightness contrast and performing high dynamic range image compression.
At present, most of common tone mapping algorithms are applied to an RGB space, and therefore, a RAW image needs to be converted into the RGB space, however, on one hand, data loss exists in the data conversion, and on the other hand, the calculation amount of the algorithm is increased, so that the system is difficult to operate in real time, and the efficiency and the effect of tone mapping are poor.
Disclosure of Invention
Embodiments of the present disclosure are intended to provide a tone mapping method, apparatus, electronic device, and storage medium.
The technical scheme of the embodiment of the disclosure is realized as follows:
the embodiment of the disclosure provides a tone mapping method, which includes:
performing inverse transformation on a preset gamma parameter to generate a standard histogram;
carrying out histogram equalization on the RAW image to be processed by utilizing the standard histogram to obtain a tone mapping curve;
and mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.
It should be noted that, in the embodiment of the present disclosure, the standard histogram is formulated by using the preset gamma parameter, so that tone mapping in the linear space of the RAW domain can be directly implemented based on the standard histogram, which not only avoids information loss caused by mapping processing in image space conversion, but also has less calculation amount, and improves mapping efficiency and effect.
In the above method, the performing histogram equalization on the RAW image to be processed by using the standard histogram to obtain a tone mapping curve includes:
carrying out bilinear interpolation downsampling on the RAW image to be processed to obtain a gray image corresponding to the RAW image to be processed;
performing histogram statistics on the gray level image to generate an image histogram;
determining the tone mapping curve using the standard histogram and the image histogram.
It should be noted that, the image histogram of the grayscale image can obviously describe the brightness actually presented by the image, the standard histogram describes the brightness actually presented by the image, and in the embodiment of the present disclosure, by comparing the difference between the image histogram and the standard histogram, the difference between the actual tone and the standard tone can be simply and quickly determined, so as to determine the appropriate mapping curve.
In the above method, the performing histogram statistics on the grayscale image to generate an image histogram includes:
performing histogram statistics on the gray level image to generate a global histogram, and determining the global histogram as the image histogram;
alternatively, the first and second electrodes may be,
dividing the grayscale image into a plurality of image regions; performing histogram statistics on each image area in the plurality of image areas respectively to generate a plurality of local histograms; determining the plurality of local histograms as the image histogram.
It should be noted that, in the embodiment of the present disclosure, a global histogram or a local histogram may be selectively generated according to actual requirements to serve as an image histogram, if the global histogram is selected, global tone mapping is performed subsequently, and if the local histogram is selected, local tone mapping is performed subsequently, so as to achieve different tone mapping effects, so that flexibility of image processing is high.
In the above method, the determining the tone mapping curve using the standard histogram and the image histogram, wherein the determining the tone mapping curve using the image histogram and the standard histogram is the global histogram, includes:
comparing the global histogram with the standard histogram to obtain a comparison result corresponding to the global histogram;
adjusting the global histogram based on a comparison result corresponding to the global histogram to generate a first target histogram;
and calculating a mapping curve between the global histogram and the first target histogram, and determining the mapping curve as the tone mapping curve.
It should be noted that, in the embodiment of the present disclosure, when the global histogram is selected to be generated as the image histogram, the first target histogram corresponding to the desired mapping effect, that is, the image tone condition, may be quickly determined by comparing the difference between the global histogram and the standard histogram, so that only the mapping relationship between the global histogram and the first target histogram needs to be calculated, a curve that enables the image to achieve the desired mapping effect may be obtained, the determination method of the tone mapping curve is simple, and the calculation amount is small.
In the above method, the determining the tone mapping curve using the standard histogram and the image histogram, wherein the determining the tone mapping curve using the image histogram and the standard histogram includes:
comparing each local histogram in the plurality of local histograms with the standard histogram respectively to obtain a comparison result corresponding to each local histogram;
for each local histogram, adjusting histogram distribution based on a comparison result corresponding to the local histogram, and generating a second target histogram corresponding to each local histogram;
respectively calculating mapping curves between each local histogram and a second target histogram corresponding to the local histogram to obtain a plurality of mapping curves;
determining the plurality of mapping curves as the tone mapping curve.
In the embodiment of the present disclosure, when a plurality of local histograms are selected and generated as the image histogram, similar to the above-described method for determining the tone mapping curve by using the global histogram, only the corresponding mapping relationship needs to be determined for each local histogram, and similarly, the method for determining the tone mapping curve is simple and the amount of calculation is small.
In the above method, the mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image includes:
mapping the gray level image by using the tone mapping curve to obtain a mapped image;
comparing the mapping image with the gray level image to determine a brightening weight;
and carrying out image processing on the RAW image to be processed by utilizing the brightening weight to obtain the target RAW image.
It should be noted that, in the embodiment of the present disclosure, the tone mapping curve is actually determined based on the gray scale image corresponding to the RAW image to be processed, and the tone mapping curve is applied to the gray scale image, so that the brightness difference before and after mapping can be quickly and accurately reflected, and thus, the boosting weight can be accurately obtained, and the mapping effect can be ensured by applying the boosting weight to the RAW image to be processed.
In the above method, the obtaining a mapping image by mapping the grayscale image with the tone mapping curve includes:
performing Gaussian smoothing filtering on the plurality of mapping curves to obtain a plurality of target curves;
and mapping the gray level image by using the plurality of target curves in a linear interpolation mode to obtain the mapping image.
It should be noted that, in the embodiment of the present disclosure, when local tone mapping is selected, gaussian smooth filtering may be performed on a plurality of mapping curves in a space to obtain a curve with better performance, so as to improve a mapping effect.
In the above method, the performing image processing on the RAW image to be processed by using the brightening weight to obtain a target RAW image includes:
extracting a low-frequency part and a high-frequency part from the RAW image to be processed;
carrying out brightening treatment on the low-frequency part by using the brightening weight to obtain a brightened low-frequency part;
and fusing the brightened low-frequency part with the high-frequency part to obtain the target RAW image.
It should be noted that, in the embodiment of the present disclosure, only the low-frequency part in the image may be mapped, that is, the low-frequency part is brightened by the brightening weight and then fused with the high-frequency part in the image, so that the details of the image are better retained.
The disclosed embodiment provides a tone mapping apparatus, including:
the first processing module is used for carrying out inverse transformation on the preset gamma parameter to generate a standard histogram;
the second processing module is used for carrying out histogram equalization on the RAW image to be processed by utilizing the standard histogram to obtain a tone mapping curve;
and the mapping module is used for mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.
In the above apparatus, the second processing module is specifically configured to:
carrying out bilinear interpolation downsampling on the RAW image to be processed to obtain a gray image corresponding to the RAW image to be processed;
performing histogram statistics on the gray level image to generate an image histogram;
determining the tone mapping curve using the standard histogram and the image histogram.
In the above apparatus, the second processing module is specifically configured to:
performing histogram statistics on the gray level image to generate a global histogram, and determining the global histogram as the image histogram;
alternatively, the first and second electrodes may be,
dividing the grayscale image into a plurality of image regions; performing histogram statistics on each image area in the plurality of image areas respectively to generate a plurality of local histograms; determining the plurality of local histograms as the image histogram.
In the above apparatus, the image histogram is the global histogram, and the second processing module is specifically configured to:
comparing the global histogram with the standard histogram to obtain a comparison result corresponding to the global histogram;
adjusting the global histogram based on a comparison result corresponding to the global histogram to generate a first target histogram;
and calculating a mapping curve between the global histogram and the first target histogram, and determining the mapping curve as the tone mapping curve.
In the above apparatus, the image histogram is the plurality of local histograms, and the second processing module is specifically configured to:
comparing each local histogram in the plurality of local histograms with the standard histogram respectively to obtain a comparison result corresponding to each local histogram;
for each local histogram in the plurality of local histograms, adjusting histogram distribution based on a comparison result corresponding to the local histogram, and generating a second target histogram corresponding to the local histogram;
respectively calculating mapping curves between each local histogram and a second target histogram corresponding to the local histogram to obtain a plurality of mapping curves;
determining the plurality of mapping curves as the tone mapping curve.
In the above apparatus, the mapping module is specifically configured to:
mapping the gray level image by using the tone mapping curve to obtain a mapped image;
comparing the mapping image with the gray level image to determine a brightening weight;
and carrying out image processing on the RAW image to be processed by utilizing the brightening weight to obtain the target RAW image.
In the above apparatus, the image histogram is a plurality of local histograms, the tone mapping curve is a plurality of mapping curves corresponding to the plurality of local histograms one to one, and the mapping module is specifically configured to:
performing Gaussian smoothing filtering on the plurality of mapping curves to obtain a plurality of target curves;
and mapping the gray level image by using the plurality of target curves in a linear interpolation mode to obtain the mapping image.
In the above apparatus, the mapping module is specifically configured to:
extracting a low-frequency part and a high-frequency part from the RAW image to be processed;
carrying out brightening treatment on the low-frequency part by using the brightening weight to obtain a brightened low-frequency part;
and fusing the brightened low-frequency part with the high-frequency part to obtain the target RAW image.
An embodiment of the present disclosure provides an electronic device, including: a processor, a memory, and a communication bus; wherein the content of the first and second substances,
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the tone mapping method.
Embodiments of the present disclosure provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the tone mapping method described above.
The embodiment of the disclosure provides a tone mapping method, a tone mapping device, an electronic device and a storage medium, wherein the method comprises the following steps: performing inverse transformation on a preset gamma parameter to generate a standard histogram; performing histogram equalization on the RAW image to be processed by utilizing a standard histogram to obtain a tone mapping curve; and mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image. According to the technical scheme provided by the embodiment of the disclosure, the standard histogram is formulated by using the preset gamma parameter, so that tone mapping is performed in the linear space of the RAW domain based on the standard histogram, and the mapping efficiency and effect are improved.
Drawings
Fig. 1 is a schematic flowchart of a tone mapping method provided in an embodiment of the present disclosure;
FIG. 2(a) is a schematic diagram of an exemplary preset gamma parameter provided by an embodiment of the present disclosure;
FIG. 2(b) is a schematic diagram of an exemplary standard histogram provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of an exemplary local tone mapping provided by an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating an exemplary global tone mapping provided by an embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating another exemplary local tone mapping provided by embodiments of the present disclosure;
FIG. 6 is a schematic structural diagram of a tone mapping apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. The following examples are intended to illustrate the present disclosure, but are not intended to limit the scope of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
It should be noted that the terms "first \ second \ third" related to the embodiments of the present disclosure are only used for distinguishing similar objects and do not represent a specific ordering for the objects, and it should be understood that "first \ second \ third" may be interchanged with a preset order or sequence order where permitted so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
The embodiment of the present disclosure provides a tone mapping method, an execution subject of which may be a tone mapping apparatus, for example, the tone mapping method may be executed by a terminal device or a server or other electronic devices, wherein the terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like. In some possible implementations, the tone mapping method may be implemented by a processor calling computer readable instructions stored in a memory.
The disclosed embodiments provide a method. Fig. 1 is a schematic flowchart of a tone mapping method according to an embodiment of the present disclosure. As shown in fig. 1, in the embodiment of the present disclosure, the tone mapping method mainly includes the following steps:
and S101, performing inverse transformation on the preset gamma parameters to generate a standard histogram.
In the embodiment of the present disclosure, the tone mapping device may obtain the preset gamma parameter, so as to perform inverse transformation on the preset gamma parameter, and generate the standard histogram.
It should be noted that, in the embodiment of the disclosure, the preset gamma parameter may specifically be a curve of a mapping relationship between a set target brightness value and a real brightness value. The specific preset gamma parameter can be set according to actual requirements and application scenarios, and the embodiment of the disclosure is not limited.
It is understood that, in the embodiment of the present disclosure, the tone mapping apparatus performs inverse transformation on the preset gamma parameter, that is, may perform derivation on the preset gamma parameter, so as to generate a histogram equalization target, that is, a standard histogram.
Fig. 2(a) is a schematic diagram of an exemplary preset gamma parameter provided in an embodiment of the present disclosure. Fig. 2(b) is a schematic diagram of an exemplary standard histogram provided in an embodiment of the present disclosure. The tone mapping apparatus derives the preset gamma parameter shown in fig. 2(a) to obtain the standard histogram of fig. 2 (b).
S102, histogram equalization is carried out on the RAW image to be processed by utilizing the standard histogram to obtain a tone mapping curve.
In the embodiment of the present disclosure, in the case where the tone mapping apparatus obtains the standard histogram, the tone mapping apparatus may perform histogram equalization on the RAW image to be processed using the standard histogram, thereby obtaining the tone mapping curve.
It should be noted that, in the embodiment of the present disclosure, the tone mapping apparatus may acquire the RAW image to be processed first, and the specific manner may be as follows: acquiring an original RAW image; and preprocessing the original RAW image to obtain a RAW image to be processed. The preprocessing may be to remove a black level from the original RAW image, perform automatic white balance, or the like, and of course, other processing manners may also be included, which is not limited in the embodiment of the present disclosure.
Specifically, in an embodiment of the present disclosure, the tone mapping apparatus performs histogram equalization on a RAW image to be processed by using a standard histogram to obtain a tone mapping curve, including: carrying out bilinear interpolation downsampling on the RAW image to be processed to obtain a gray image corresponding to the RAW image to be processed; performing histogram statistics on the gray level image to generate an image histogram; using the standard histogram and the image histogram, a tone mapping curve is determined.
It should be noted that, in the embodiment of the present disclosure, the tone mapping apparatus may first generate a gray scale image corresponding to the RAW image to be processed, so as to perform histogram statistics on the gray scale image, where the statistical brightness value is the brightness value of all pixel points in the gray scale image, specifically, during the statistics, the statistical brightness value may be global statistics to generate a global histogram, or may be regional statistics to generate a local histogram in each region, so as to subsequently determine the tone mapping curve by using the obtained histogram and the standard histogram.
Specifically, in the embodiment of the present disclosure, the tone mapping apparatus performs histogram statistics on the grayscale image to generate an image histogram, including: performing histogram statistics on the gray level image to generate a global histogram, and determining the global histogram as an image histogram; or, dividing the gray-scale image into a plurality of image areas; respectively carrying out histogram statistics on each image area in the plurality of image areas to generate a plurality of local histograms; the plurality of local histograms are determined as image histograms.
It is to be understood that, in the embodiment of the present disclosure, the tone mapping apparatus may be global tone mapping or local tone mapping for the tone mapping process of the RAW image to be processed. If global tone mapping is selected to be performed on the RAW image to be processed, when an image histogram is generated, histogram statistics is directly performed on all pixel points contained in the gray image in a unified mode, and a global histogram is generated according to a statistical result and serves as the image histogram; if local tone mapping is selected to be performed on the RAW image to be processed, when an image histogram is generated, the gray-scale image is divided into a plurality of image areas equally, histogram statistics is performed on each image area, that is, a histogram corresponding to each image area is generated and is called as a local histogram, so that a plurality of local histograms are finally obtained, and the plurality of local histograms are used as the image histogram.
It should be noted that, in the embodiment of the present disclosure, the two selectable specific image histogram generation manners may be selected according to actual requirements and application scenarios in actual applications, and the embodiment of the present disclosure is not limited.
Specifically, in the embodiment of the present disclosure, in a case where the image histogram is a global histogram, the tone mapping apparatus determines the tone mapping curve using the standard histogram and the image histogram, including: comparing the global histogram with the standard histogram to obtain a comparison result corresponding to the global histogram; adjusting the global histogram based on a comparison result corresponding to the global histogram to generate a first target histogram; and calculating a mapping curve between the global histogram and the first target histogram, and determining the mapping curve as a tone mapping curve.
It should be noted that, in the embodiment of the present disclosure, in the case that the obtained image histogram is a global histogram, the tone mapping apparatus may directly compare the obtained image histogram with a standard histogram to generate a first target histogram, and then, the tone mapping apparatus calculates a mapping curve between the global histogram and the first target histogram, which is actually a curve that can specifically realize the conversion of the global histogram into the first target histogram, and the curve is the tone mapping curve.
Specifically, in an embodiment of the present disclosure, in a case where the image histogram is a plurality of local histograms, the tone mapping apparatus determines the tone mapping curve using the standard histogram and the image histogram, including: respectively comparing each local histogram in the plurality of local histograms with the standard histogram to obtain a comparison result corresponding to each local histogram; adjusting the distribution of the histogram based on the comparison result corresponding to the local histogram for each local histogram in the plurality of local histograms to generate a second target histogram corresponding to the local histogram; respectively calculating a mapping curve between each local histogram and a second target histogram corresponding to the local histogram to obtain a plurality of mapping curves; the plurality of mapping curves is determined as tone mapping curves.
It should be noted that, in the embodiment of the present disclosure, in the case where the obtained image histogram is a plurality of local histograms, the tone mapping device actually determines the finally determined tone mapping curve to include a plurality of mapping curves in one-to-one correspondence with the plurality of local histograms. The tone mapping apparatus needs to compare each local histogram with the standard histogram to obtain a corresponding comparison result, and then determine a corresponding second target histogram.
It should be noted that, in the embodiment of the present disclosure, the tone mapping apparatus calculates the mapping curve between each local histogram and the corresponding second target histogram, and actually determines the curve that can specifically realize the conversion of the local histogram into the corresponding second target histogram, and the finally obtained multiple mapping curves constitute the tone mapping curve.
And S103, mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.
In the embodiment of the present disclosure, the tone mapping apparatus may map the RAW image to be processed by using the tone mapping curve to obtain the target RAW image when obtaining the tone mapping curve.
Fig. 3 is a schematic flowchart of an exemplary local tone mapping provided by an embodiment of the present disclosure. As shown in fig. 3, the tone mapping apparatus may first calculate a local histogram of each image region, then set a second target histogram correspondingly, then calculate a corresponding mapping curve by using the corresponding local histogram and the second target histogram for different image regions, and finally perform gaussian smoothing filtering on all the obtained mapping curves in space, and then apply the obtained mapping curves to the RAW image to be processed to obtain the target RAW image.
Specifically, in an embodiment of the present disclosure, a tone mapping apparatus maps a RAW image to be processed by using a tone mapping curve to obtain a target RAW image, including: mapping the gray level image by using the tone mapping curve to obtain a mapping image; comparing the mapping image with the gray level image, and determining a brightening weight; and carrying out image processing on the RAW image to be processed by utilizing the brightening weight to obtain a target RAW image.
It should be noted that, in the embodiment of the present disclosure, as described in step S102, in the specific process of determining the tone mapping curve, the tone mapping apparatus generates the grayscale image corresponding to the RAW image to be processed, and therefore, the mapping may be performed directly on the grayscale image by using the tone mapping curve to obtain the mapped image.
In an embodiment of the present disclosure, in a case where the image histogram is a plurality of local histograms and the tone mapping curve is a plurality of mapping curves in one-to-one correspondence with the plurality of local histograms, the tone mapping apparatus maps the grayscale image with the tone mapping curve to obtain a mapped image, and includes: performing Gaussian smoothing filtering on the plurality of mapping curves to obtain a plurality of target curves; and mapping the gray level image by using the plurality of target curves in a linear interpolation mode to obtain a mapped image.
It can be understood that, in the embodiment of the present disclosure, when the tone mapping manner performed on the RAW image to be processed is specifically local tone mapping, correspondingly, the tone mapping curve includes a plurality of mapping curves, and the tone mapping apparatus may perform gaussian smoothing filtering on the plurality of mapping curves in space before performing mapping, so as to obtain a curve with better performance.
It can be understood that, in the embodiment of the present disclosure, in a case that the tone mapping manner performed on the RAW image to be processed is specifically local tone mapping, when the tone mapping apparatus performs mapping, since each mapping curve in the plurality of mapping curves actually corresponds to a mapping relationship of pixel points at a part of positions in the image, the gray-scale image may be mapped by using the plurality of mapping curves in a trilinear interpolation manner; in the case where the tone mapping manner performed on the RAW image to be processed is specifically global tone mapping, the tone mapping apparatus may directly apply a tone mapping curve obtained based on the global histogram to the grayscale image.
It can be understood that, in the embodiment of the present disclosure, the brightness of the mapping image actually represents the brightness after the mapping of the RAW image to be processed is expected, and the grayscale image actually represents the brightness of the RAW image to be processed itself, so the tone mapping apparatus may compare the mapping image with the grayscale image, determine the boosting weight according to the brightness difference, and then directly apply the boosting weight to the RAW image to be processed, that is, implement the mapping of the RAW to be processed.
Specifically, in an embodiment of the present disclosure, a tone mapping apparatus performs image processing on a RAW image to be processed by using a brightening weight to obtain a target RAW image, including: extracting a low-frequency part and a high-frequency part from a RAW image to be processed; carrying out brightening treatment on the low-frequency part by using the brightening weight to obtain a brightened low-frequency part; and fusing the highlighted low-frequency part and the highlighted high-frequency part to obtain a target RAW image.
It can be understood that, in the embodiment of the present disclosure, when the tone mapping apparatus brightens the image to be processed by using the brightening weight, only the low-frequency part in the image may be brightened, and then the low-frequency part in the image may be fused with the high-frequency part in the image, so that the details of the image may be better retained.
Fig. 4 is a flowchart illustrating an exemplary global tone mapping according to an embodiment of the present disclosure. Fig. 5 is a schematic flow chart of another exemplary local tone mapping provided by the embodiment of the present disclosure. As shown in fig. 4 and 5, for both global tone mapping and local tone mapping, an original RAW image and preset gamma parameters are obtained first, so as to perform preprocessing on the original RAW image to obtain a RAW image to be processed, and then a corresponding grayscale image is further determined, and in addition, derivation is performed on the preset gamma parameters to obtain a standard histogram. As shown in fig. 4, during global tone mapping, image region division is not required, the generated image histogram is a global histogram, and accordingly, for the determination of the mapping curve subsequently, only one mapping curve needs to be determined based on the global histogram, and finally, the image mapping is implemented by using the one mapping curve. As shown in fig. 5, the local tone mapping requires image region division, a corresponding local histogram is generated for each image region, a mapping curve is determined based on each local histogram, and image mapping is implemented by using all mapping curves.
The embodiment of the disclosure provides a tone mapping method, which includes: performing inverse transformation on a preset gamma parameter to generate a standard histogram; performing histogram equalization on the RAW image to be processed by utilizing a standard histogram to obtain a tone mapping curve; and mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image. According to the tone mapping method provided by the embodiment of the disclosure, the standard histogram is formulated by using the preset gamma parameter, so that tone mapping in the linear space of the RAW domain is realized based on the standard histogram, and the mapping efficiency and effect are improved.
The embodiment of the disclosure provides a tone mapping device. Fig. 6 is a schematic structural diagram of a tone mapping apparatus according to an embodiment of the present disclosure. As shown in fig. 6, the tone mapping apparatus includes:
the first processing module 601 is configured to perform inverse transformation on a preset gamma parameter to generate a standard histogram;
a second processing module 602, configured to perform histogram equalization on the RAW image to be processed by using the standard histogram to obtain a tone mapping curve;
and a mapping module 603, configured to map the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.
In an embodiment of the present disclosure, the second processing module 602 is specifically configured to:
carrying out bilinear interpolation downsampling on the RAW image to be processed to obtain a gray image corresponding to the RAW image to be processed;
performing histogram statistics on the gray level image to generate an image histogram;
determining the tone mapping curve using the standard histogram and the image histogram.
In an embodiment of the present disclosure, the second processing module 602 is specifically configured to:
performing histogram statistics on the gray level image to generate a global histogram, and determining the global histogram as the image histogram;
alternatively, the first and second electrodes may be,
dividing the grayscale image into a plurality of image regions; performing histogram statistics on each image area in the plurality of image areas respectively to generate a plurality of local histograms; determining the plurality of local histograms as the image histogram.
In an embodiment of the present disclosure, the image histogram is the global histogram, and the second processing module 602 is specifically configured to:
comparing the global histogram with the standard histogram to obtain a comparison result corresponding to the global histogram;
adjusting the global histogram based on a comparison result corresponding to the global histogram to generate a first target histogram;
and calculating a mapping curve between the global histogram and the first target histogram, and determining the mapping curve as the tone mapping curve.
In an embodiment of the disclosure, the image histogram is the multiple local histograms, and the second processing module 602 is specifically configured to:
comparing each local histogram in the plurality of local histograms with the standard histogram respectively to obtain a comparison result corresponding to each local histogram;
for each local histogram in the plurality of local histograms, adjusting histogram distribution based on a comparison result corresponding to the local histogram, and generating a second target histogram corresponding to the local histogram;
respectively calculating mapping curves between each local histogram and a second target histogram corresponding to the local histogram to obtain a plurality of mapping curves;
determining the plurality of mapping curves as the tone mapping curve.
In an embodiment of the present disclosure, the mapping module 603 is specifically configured to:
mapping the gray level image by using the tone mapping curve to obtain a mapped image;
comparing the mapping image with the gray level image to determine a brightening weight;
and carrying out image processing on the RAW image to be processed by utilizing the brightening weight to obtain the target RAW image.
In an embodiment of the present disclosure, the mapping module 603 is specifically configured to:
performing Gaussian smoothing filtering on the plurality of mapping curves to obtain a plurality of target curves;
and mapping the gray level image by using the plurality of target curves in a linear interpolation mode to obtain the mapping image.
In an embodiment of the present disclosure, the mapping module 603 is specifically configured to:
extracting a low-frequency part and a high-frequency part from the RAW image to be processed;
carrying out brightening treatment on the low-frequency part by using the brightening weight to obtain a brightened low-frequency part;
and fusing the brightened low-frequency part with the high-frequency part to obtain the target RAW image.
The embodiment of the disclosure provides a tone mapping device, which performs inverse transformation on a preset gamma parameter to generate a standard histogram; performing histogram equalization on the RAW image to be processed by utilizing a standard histogram to obtain a tone mapping curve; and mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image. The tone mapping device provided by the embodiment of the disclosure utilizes the preset gamma parameter to formulate the standard histogram, thereby realizing tone mapping in the linear space of the RAW domain based on the standard histogram, and improving mapping efficiency and effect.
The embodiment of the disclosure provides an electronic device. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and as shown in fig. 7, the electronic device includes: a processor 701, a memory 702, and a communication bus 703; wherein the content of the first and second substances,
the communication bus 703 is used for realizing connection communication between the processor 701 and the memory 702;
the processor 701 is configured to execute one or more programs stored in the memory 702 to implement the tone mapping method.
Embodiments of the present disclosure provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the tone mapping method described above. The computer-readable storage medium may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD); or may be a respective device, such as a mobile phone, computer, tablet device, personal digital assistant, etc., that includes one or any combination of the above-mentioned memories.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable signal processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable signal processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable signal processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable signal processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure.

Claims (11)

1. A tone mapping method, comprising:
performing inverse transformation on a preset gamma parameter to generate a standard histogram;
carrying out histogram equalization on the RAW image to be processed by utilizing the standard histogram to obtain a tone mapping curve;
and mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.
2. The method according to claim 1, wherein the histogram equalization of the RAW image to be processed by using the standard histogram to obtain a tone mapping curve comprises:
carrying out bilinear interpolation downsampling on the RAW image to be processed to obtain a gray image corresponding to the RAW image to be processed;
performing histogram statistics on the gray level image to generate an image histogram;
determining the tone mapping curve using the standard histogram and the image histogram.
3. The method of claim 2, wherein performing histogram statistics on the grayscale image to generate an image histogram comprises:
performing histogram statistics on the gray level image to generate a global histogram, and determining the global histogram as the image histogram;
alternatively, the first and second electrodes may be,
dividing the grayscale image into a plurality of image regions; performing histogram statistics on each image area in the plurality of image areas respectively to generate a plurality of local histograms; determining the plurality of local histograms as the image histogram.
4. The method of claim 3, wherein the image histogram is the global histogram, and wherein determining the tone mapping curve using the standard histogram and the image histogram comprises:
comparing the global histogram with the standard histogram to obtain a comparison result corresponding to the global histogram;
adjusting the global histogram based on a comparison result corresponding to the global histogram to generate a first target histogram;
and calculating a mapping curve between the global histogram and the first target histogram, and determining the mapping curve as the tone mapping curve.
5. The method of claim 3, wherein the image histogram is the plurality of local histograms, and wherein determining the tone mapping curve using the standard histogram and the image histogram comprises:
comparing each local histogram in the plurality of local histograms with the standard histogram respectively to obtain a comparison result corresponding to each local histogram;
for each local histogram in the plurality of local histograms, adjusting histogram distribution based on a comparison result corresponding to the local histogram, and generating a second target histogram corresponding to the local histogram;
respectively calculating mapping curves between each local histogram and a second target histogram corresponding to the local histogram to obtain a plurality of mapping curves;
determining the plurality of mapping curves as the tone mapping curve.
6. The method according to claim 2, wherein the mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image comprises:
mapping the gray level image by using the tone mapping curve to obtain a mapped image;
comparing the mapping image with the gray level image to determine a brightening weight;
and carrying out image processing on the RAW image to be processed by utilizing the brightening weight to obtain the target RAW image.
7. The method of claim 6, wherein the image histogram is a plurality of local histograms, the tone mapping curve is a plurality of mapping curves corresponding to the local histograms in a one-to-one manner, and the mapping the grayscale image using the tone mapping curve to obtain a mapped image comprises:
performing Gaussian smoothing filtering on the plurality of mapping curves to obtain a plurality of target curves;
and mapping the gray level image by using the plurality of target curves in a linear interpolation mode to obtain the mapping image.
8. The method according to claim 6, wherein the performing image processing on the RAW image to be processed by using the brightening weight to obtain the target RAW image comprises:
extracting a low-frequency part and a high-frequency part from the RAW image to be processed;
carrying out brightening treatment on the low-frequency part by using the brightening weight to obtain a brightened low-frequency part;
and fusing the brightened low-frequency part with the high-frequency part to obtain the target RAW image.
9. A tone mapping apparatus, characterized by comprising:
the first processing module is used for carrying out inverse transformation on the preset gamma parameter to generate a standard histogram;
the second processing module is used for carrying out histogram equalization on the RAW image to be processed by utilizing the standard histogram to obtain a tone mapping curve;
and the mapping module is used for mapping the RAW image to be processed by using the tone mapping curve to obtain a target RAW image.
10. An electronic device, comprising: a processor, a memory, and a communication bus; wherein the content of the first and second substances,
the communication bus is used for realizing connection communication between the processor and the memory;
the processor, configured to execute one or more programs stored in the memory to implement the tone mapping method of any one of claims 1-8.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs which are executable by one or more processors to implement the tone mapping method of any one of claims 1-8.
CN202111349059.8A 2021-11-15 2021-11-15 Tone mapping method, tone mapping device, electronic equipment and storage medium Withdrawn CN114066783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111349059.8A CN114066783A (en) 2021-11-15 2021-11-15 Tone mapping method, tone mapping device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111349059.8A CN114066783A (en) 2021-11-15 2021-11-15 Tone mapping method, tone mapping device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114066783A true CN114066783A (en) 2022-02-18

Family

ID=80272343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111349059.8A Withdrawn CN114066783A (en) 2021-11-15 2021-11-15 Tone mapping method, tone mapping device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114066783A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115861096A (en) * 2022-11-22 2023-03-28 瀚博半导体(上海)有限公司 Image processing method and device and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115861096A (en) * 2022-11-22 2023-03-28 瀚博半导体(上海)有限公司 Image processing method and device and computer equipment
CN115861096B (en) * 2022-11-22 2023-10-31 瀚博半导体(上海)有限公司 Image processing method and device and computer equipment

Similar Documents

Publication Publication Date Title
CN109191395B (en) Image contrast enhancement method, device, equipment and storage medium
CN107993189B (en) Image tone dynamic adjustment method and device based on local blocking
CN103778900B (en) A kind of image processing method and system
CN108961260B (en) Image binarization method and device and computer storage medium
CN111489322B (en) Method and device for adding sky filter to static picture
CN111312141B (en) Color gamut adjusting method and device
CN109309826B (en) Image color balancing method and device, terminal equipment and readable storage medium
CN110675334A (en) Image enhancement method and device
KR20190035602A (en) A low cost color extension module to extend the colors of the image
CN110189384B (en) Image compression method, device, computer equipment and storage medium based on Unity3D
CN116113976A (en) Image processing method and device, computer readable medium and electronic equipment
CN114862725A (en) Method and device for realizing motion perception fuzzy special effect based on optical flow method
CN111090384B (en) Soft keyboard display method and device
CN114066783A (en) Tone mapping method, tone mapping device, electronic equipment and storage medium
CN112669241B (en) Image processing method, device, equipment and medium
CN111784598B (en) Training method of tone mapping model, tone mapping method and electronic equipment
CN110473156B (en) Image information processing method and device, storage medium and electronic equipment
CN115205168A (en) Image processing method, device, electronic equipment, storage medium and product
CN113256785B (en) Image processing method, apparatus, device and medium
CN112950515A (en) Image processing method and device, computer readable storage medium and electronic device
US9697593B2 (en) System and method for tone mapping on high dynamic range images
CN111510622B (en) Image processing method, device, terminal and storage medium
CN113888429A (en) Image brightening method and device and electronic equipment
CN112258527A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN114820349B (en) Image processing method, device, electronic equipment 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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220218