CN111131722A - Image processing method, electronic device, and medium - Google Patents

Image processing method, electronic device, and medium Download PDF

Info

Publication number
CN111131722A
CN111131722A CN201911399015.9A CN201911399015A CN111131722A CN 111131722 A CN111131722 A CN 111131722A CN 201911399015 A CN201911399015 A CN 201911399015A CN 111131722 A CN111131722 A CN 111131722A
Authority
CN
China
Prior art keywords
image
brightness
tone mapping
pixel
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911399015.9A
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201911399015.9A priority Critical patent/CN111131722A/en
Publication of CN111131722A publication Critical patent/CN111131722A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses an image processing method, electronic equipment and a medium. The image processing method comprises the following steps: acquiring at least two frames of images, wherein the shooting scenes and the field ranges of the at least two frames of images are the same; performing image synthesis on at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in a shooting scene; and performing first tone mapping processing on the first image and outputting a second image. The embodiment of the invention can solve the problem that the image with a single exposure value can only be acquired in the prior art.

Description

Image processing method, electronic device, and medium
Technical Field
Embodiments of the present invention relate to the field of image processing technologies, and in particular, to an image processing method, an electronic device, and a medium.
Background
When a user uses the electronic device to capture an image, in order to obtain a better capturing effect, the electronic device performs photometry on a scene to be captured in advance, and then performs image capturing based on a photometry result.
However, this method of capturing an image by taking light first and then taking the image can only capture an image with a single exposure value, and when the user readjusts the captured image, texture details in the image are lost, and even a risk of a fault may occur.
Disclosure of Invention
The embodiment of the invention provides an image shooting method, electronic equipment and a medium, and aims to solve the problem that only an image with a single exposure value can be acquired in the prior art.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides an image processing method applied to an electronic device, including:
acquiring at least two frames of images, wherein the shooting scenes and the field ranges of the at least two frames of images are the same;
performing image synthesis on at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in a shooting scene;
and performing first tone mapping processing on the first image and outputting a second image.
In a second aspect, an embodiment of the present invention provides an electronic device, including:
the device comprises an image acquisition module, a display module and a display module, wherein the image acquisition module is used for acquiring at least two frames of images, and the shooting scenes and the field ranges of the at least two frames of images are the same;
the image synthesis module is used for carrying out image synthesis on at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in a shooting scene;
the first mapping module is used for performing first tone mapping processing on the first image and outputting a second image.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and being executable on the processor, and when executed by the processor, the computer program implements the steps of the image processing method according to the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the image processing method according to the first aspect.
In the embodiment of the present invention, the first image can be synthesized by using at least two frames of images in the same field of view of the same shooting scene, the first tone mapping process can be performed on the first image, the second image can be output, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, the problem that only an image with a single exposure value can be obtained in the prior art can be solved, therefore, when the luminance of the output second image is not satisfied by a user, the electronic device can perform the tone mapping process again by using the first luminance value of each pixel in the first image, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, when performing the tone mapping process again, different texture details can be adjusted based on the actual luminance value thereof, and the loss of texture details of the image after performing the tone mapping process again can be avoided, and avoids the occurrence of a fault in the image after the tone mapping process is newly performed.
Drawings
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems of the prior art, embodiments of the present invention provide an image processing method, an electronic device, and a medium. The following first describes an image processing method provided by an embodiment of the present invention.
Fig. 1 is a flowchart illustrating an image processing method according to an embodiment of the present invention. The method shown in fig. 1 may be performed by an electronic device, including but not limited to a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
As shown in fig. 1, the image processing method may include:
step 110, acquiring at least two frames of images, wherein the shooting scenes and the field ranges of the at least two frames of images are the same;
step 120, synthesizing at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in a shooting scene;
step 130, performing a first color tone mapping process on the first image, and outputting a second image.
In the embodiment of the present invention, the first image can be synthesized by using at least two frames of images in the same field of view of the same shooting scene, the first tone mapping process can be performed on the first image, the second image can be output, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, the problem that only an image with a single exposure value can be obtained in the prior art can be solved, therefore, when the luminance of the output second image is not satisfied by a user, the electronic device can perform the tone mapping process again by using the first luminance value of each pixel in the first image, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, when performing the tone mapping process again, different texture details can be adjusted based on the actual luminance value thereof, and the loss of texture details of the image after performing the tone mapping process again can be avoided, and avoids the occurrence of a fault in the image after the tone mapping process is newly performed.
In some embodiments of the present invention, the electronic device may acquire at least two images with the same shooting scene and field of view range directly from the images that the user has shot. For example, in a continuous shooting image in which a shooting scene and a field of view range are the same as each other shot by a user, at least two frames of images are acquired.
In other embodiments of the present invention, the electronic device may capture at least two frames of images directly corresponding to the same capture scene in the same field of view when image processing is required.
In these embodiments, optionally, the specific method of step 110 may include:
performing photometry on a shot scene to obtain reference brightness of the shot scene;
determining at least two exposure values according to the reference brightness;
at least two frames of images are taken in accordance with at least two exposure values.
Specifically, the luminance of the light reflected by the shot scene may be measured by a photometric system of the electronic device to serve as a reference luminance of the shot scene, then a target exposure value corresponding to the reference luminance is determined, then at least two exposure values under the exposure value group are determined according to the exposure value group to which the target exposure value belongs, and finally, a frame of image corresponding to each exposure value in the at least two determined exposure values is shot. At least two exposure values under the exposure value group to which the target exposure value belongs may include the target exposure value or may not include the target exposure value.
In some embodiments, the above-mentioned light metering system may be an Automatic Exposure (AE) light metering system, and the AE light metering system may perform light metering by using an AE method to determine the reference brightness of the shooting scene.
In still other embodiments, the light metering system may also be a manual exposure light metering system, which may perform light metering based on an exposure gear selected by a user to determine the reference brightness of the photographic scene.
Taking a normal photographing mode as an example, photometry can be performed on a photographed scene by using an AE mode to obtain a reference brightness of the photographed scene, if a target exposure value corresponding to the reference brightness is 0EV, an exposure value group to which 0EV belongs in the normal photographing mode can be selected, and all exposure values +3EV, 0EV, and-3 EV in the exposure value group are obtained, so that an image with any brightness from +3EV to-3 EV can be obtained without damage.
Taking a High-Dynamic Range (HDR) photographing mode as an example, taking an AE mode to perform photometry on a photographing scene to obtain a reference brightness of the photographing scene, if a target exposure value corresponding to the reference brightness is 0EV, selecting an exposure value group to which 0EV belongs in the HDR photographing mode, and acquiring all exposure values +3EV, 0EV, -3EV, and-6 EV under the exposure value group, so that at least two obtained images can cover a light ratio of the scene as much as possible, and the brightness of the photographing scene in at least one image is ensured to be appropriate.
In other embodiments, optionally, the specific method of step 110 may further include:
at least two frames of images are shot according to at least two preset exposure values.
Specifically, the electronic apparatus may set at least two exposure values in advance, so that no matter in which mode, at least two frames of images are photographed directly using the preset at least two exposure values without performing photometry on the photographed scene.
In step 120 of some embodiments of the present invention, the electronic device may synthesize at least two frames of images into a first image based on the HDR imaging technology, where the first image is an HDR image.
When the first image is synthesized by using the HDR imaging technology, the HDR image can be synthesized by the HDR imaging technology only by shooting less images, generally only 2-4 frames of images, so that the image processing amount is reduced, and the image processing efficiency is improved.
In the embodiment of the invention, the first brightness value of each pixel in the first image is obtained as the actual brightness value of the pixel in the shooting scene, that is, an image with any exposure value can be generated, that is, the brightness of any region in the shooting scene is adjusted to the brightness which the user wants to highlight, so that an image with better bright area details and dark area details is obtained.
There are a variety of methods for composing the first image using HDR imaging techniques, and in some embodiments of the invention, the specific method of step 120 may include:
acquiring the exposure time of each frame of image in at least two frames of images and the second brightness value of each pixel in each frame of image;
generating a brightness response function corresponding to a shooting scene according to the exposure time and the second brightness value of each frame of image;
and determining an actual brightness value corresponding to each pixel in the first image according to the brightness response function to obtain the first image.
Specifically, the second luminance value of each pixel in each frame image is an image luminance value of the pixel in the image, and the image luminance value is generally different from an actual luminance value of the pixel due to exposure processing. However, since the exposure value of each frame of image and the second brightness value of each pixel in each frame of image are known, we can generate a brightness response function corresponding to the shooting scene, and restore the actual brightness value corresponding to each pixel by using the brightness response function, thereby obtaining the first image.
In these embodiments, optionally, a specific method for generating a luminance response function corresponding to a shooting scene according to the exposure time of each frame of image and the second luminance value may include:
calculating a least square solution of a first optimization function according to the exposure time and the second brightness value of each frame of image, wherein the first optimization function is used for calculating a parameter optimal solution of a brightness response function, and the parameter optimal solution is the least square solution of the first optimization function;
and generating a brightness response function corresponding to the shooting scene according to the least square solution.
Specifically, the exposure time of each frame of image and the second brightness value may be used to fit a brightness response function f, which is the exposure amount of each pixel and the second brightness value ZijThe exposure amount is the actual brightness value EiAnd exposure time deltatjThe luminance response function f is fitted to the formula:
Zij=f(EiΔtj)
where j denotes the jth frame image and i denotes the ith pixel.
Then, while taking into account the smoothness of the fit-out function, solve for ZijThe parameter (c) of (c). Therefore, for calculating ZijThe first optimization function of (d) may be:
Figure BDA0002347031820000061
wherein the content of the first and second substances,
f-1(Zij)=EiΔtj
lnf-1(Zij)=lnEi+lnΔtj
g(Zij)=lnEi+lnΔtj
where P is the total number of images, N is the total number of pixels in an image, ZmaxIs the maximum second luminance value, ZminThe second term of the first optimization function guarantees the smoothness of the function g and thus of the luminance response function f for a minimum second luminance value. And substituting the exposure time of each frame of image and the second brightness value of each pixel into a first optimization function, and solving a least square solution of the first optimization function by using a least square method, wherein the least square solution is a parameter optimal solution of the function g, namely a parameter optimal solution of the brightness response function f.
Therefore, the least square solution can be substituted into the luminance response function f obtained by fitting, and the luminance response function corresponding to the shooting scene can be generated.
In these embodiments, optionally, the specific method for determining the actual luminance value corresponding to each pixel in the first image according to the luminance response function may include:
and for each pixel in the first image, determining an actual brightness value corresponding to each pixel according to a second brightness value of each pixel in each frame of image, the exposure time of each frame of image and an influence weight coefficient of each frame of image on a shooting scene.
Specifically, the second brightness value Zij of each pixel in each frame image, the exposure time Δ t of each frame imagejAnd the influence weight coefficient omega (Z) of each frame image to the shooting sceneij) And inputting an actual brightness calculation formula generated according to the function g to obtain an actual brightness value corresponding to each pixel.
Wherein, the actual brightness calculation formula is as follows:
Figure BDA0002347031820000071
in some embodiments of the present invention, if the at least two frames of images are images captured in the normal photographing mode, the step 130 may specifically include:
and performing first tone mapping processing on the first image according to the target exposure time and the brightness response function corresponding to the target exposure value, and outputting a second image, wherein the target exposure value is an exposure value corresponding to the reference brightness.
Specifically, the target exposure time corresponding to the reference brightness and the first brightness value of each pixel in the first image may be input into the brightness response function f to obtain a third brightness value of each pixel, and the third brightness value of each pixel is converted into an 8-bit image in the conventional photographing mode to obtain a second image, and the second image is output and displayed.
In other embodiments of the present invention, if the at least two frames of images are images captured in the normal photographing mode, step 130 may specifically include:
automatically judging important image areas in a shooting scene;
calculating the area brightness average value of the actual brightness values of all pixels in the image area;
calculating the area exposure time corresponding to the area brightness average value according to the brightness response function;
and performing first tone mapping processing on the first image according to the first brightness value, the area exposure time and the brightness response function of each pixel, and outputting a second image.
Thus, an important image area in the shooting scene can be automatically judged, and the first tone mapping processing is carried out based on the image area, so that a second image with the image area having proper brightness can be obtained.
In some embodiments of the present invention, if the at least two frames of images are images captured in the normal photographing mode, after step 130, the image processing method may further include:
receiving a first input of a user to a first area in a second image;
calculating a first luminance average value of actual luminance values of all pixels in the first region in response to a first input;
calculating a first exposure time corresponding to the first brightness average value according to the brightness response function;
and performing second tone mapping processing on the first image according to the first exposure time and the brightness response function, and outputting a third image.
Specifically, after the second image is output, first prompt information for prompting the user to manually adjust the exposure may be output.
If a first input by the user to the first region in the second image is received after the first prompt information is output, the tone mapping process may be performed again based on the selected first region in response to the first input, the third image may be output, and if the first input by the user to the first region in the second image is not received, the second image may be kept output.
Specifically, the first area in the first image may be determined according to the first area in the second image, then a first luminance average value of actual luminance values of all pixels in the first area in the first image is calculated, the first luminance average value and the preset image luminance are substituted into the luminance response function, a first exposure time corresponding to the first luminance average value is calculated, and thus, the second tone mapping process may be performed on the first image according to the first exposure time and the luminance response function, and the third image may be output.
First luminance average value
Figure BDA0002347031820000081
Figure BDA0002347031820000082
The corresponding preset image brightness value can be 128, that is, half of the maximum value 255 of the image gray scale, which can ensure that the brightness is relatively moderate, the first exposure time obtained by calculation is a, and the calculated first exposure time is substituted into the brightness response function f, so that the brightness response function f becomes:
Zij=f(Ei×a)
and substituting the actual brightness value of each pixel into the formula to obtain a fourth brightness value of each pixel, converting the fourth brightness value of each pixel into an 8-bit image in a conventional photographing mode to obtain a third image, and outputting and displaying the third image, wherein the third image can adjust the brightness of the first area touched by the user to be more appropriate central brightness.
In some embodiments of the present invention, if the at least two frames of images are images captured in the HDR photographing mode, the step 130 may specifically include:
and performing first tone mapping processing on the first image according to a preset tone mapping function, and outputting a second image.
Specifically, the preset tone mapping function may be a function corresponding to an arbitrary tone mapping (tone mapping) algorithm, for example, the tone mapping algorithm may be a Gamma correction algorithm, a logarithmic correction algorithm, a histogram normalization algorithm, a segmented gray scale conversion algorithm, and the like, which is not limited herein.
In other embodiments of the present invention, if the at least two frames of images are images captured in the HDR photographing mode, step 130 may specifically include:
automatically judging important image areas in a shooting scene;
calculating the area brightness average value of the actual brightness values of all pixels in the image area;
generating an optimized tone mapping function corresponding to the region brightness average value according to the preset tone mapping function and a preset constraint condition corresponding to the preset tone mapping function;
and performing third tone mapping processing on the first image according to the optimized tone mapping function, and outputting a fourth image.
Thus, an important image area in the shooting scene can be automatically judged, and the first tone mapping processing is carried out based on the image area, so that a second image with the image area having proper brightness can be obtained.
In some embodiments of the present invention, if the at least two frames of images are images captured in the HDR photographing mode, after step 130, the image processing method may further include:
receiving a second input of the user to a second area in the second image;
calculating a second luminance average value of actual luminance values of all pixels in the second region in response to a second input;
generating an optimized tone mapping function corresponding to the second brightness average value according to the preset tone mapping function and a preset constraint condition corresponding to the preset tone mapping function;
and performing third tone mapping processing on the first image according to the optimized tone mapping function, and outputting a fourth image.
Specifically, after the second image is output, second prompt information for prompting the user to manually adjust the exposure may be output.
If a second input by the user to the second region in the second image is received after the second prompt information is output, the tone mapping process may be performed again based on the selected second region in response to the second input, and the fourth image may be output, and if the second input by the user to the second region in the second image is not received, the second image may be kept output.
In the process of performing the tone mapping processing again based on the selected second region, firstly, the preset tone mapping function needs to be improved, and the optimized tone mapping function is generated to be the tone mapping function with the second region priority, so that the detail preservation in the process of mapping from high dynamic to low dynamic can be met, and meanwhile, the proper brightness of the interested second region can be realized, namely, the brightness is equivalent to re-light measurement.
Assuming that the second optimization function using the preset tone mapping function is ming (l), and the optimized tone mapping function obtained by the optimization is l, the third optimization function for calculating the optimal solution of the parameters of the optimized tone mapping function l may be ming (l) + λ h (l).
H (l) is a predetermined constraint condition corresponding to the predetermined tone mapping function for constraining the intermediate brightness of the second region in the image, e.g., h (l) (k) -128)2Wherein (l (k) -128) is a second brightness average value of actual brightness values of all pixels in the second region, and l (k) is the second regionAs a result of the tone mapping process, the expression restricts the value of the second region after the tone mapping process from approaching the intermediate luminance value 128 of the picture. Lambda is an adjusting parameter for adjusting two optimization problems, when lambda is 0, the optimized tone mapping function is degenerated to a conventional preset tone mapping function, and when the lambda value is larger, the brightness of the second region can be better ensured.
In summary, according to the embodiment of the present invention, when the effect of some shooting scenes cannot meet the expectation of the user, the flexibility and convenience of the user for adjusting the photometry are greatly increased, so that the user can shoot a satisfactory image more easily.
Fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device shown in fig. 2 may include, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
As shown in fig. 2, the electronic device may include:
the image acquisition module 210 is configured to acquire at least two frames of images, where a shooting scene and a field range of the at least two frames of images are the same;
the image synthesis module 220 is configured to perform image synthesis on at least two frames of images to obtain a first image, where a first brightness value of each pixel in the first image is an actual brightness value of the pixel in a shooting scene;
the first mapping module 230 is configured to perform a first color tone mapping process on the first image and output a second image.
In the embodiment of the present invention, the first image can be synthesized by using at least two frames of images in the same field of view of the same shooting scene, the first tone mapping process can be performed on the first image, the second image can be output, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, the problem that only an image with a single exposure value can be obtained in the prior art can be solved, therefore, when the luminance of the output second image is not satisfied by a user, the electronic device can perform the tone mapping process again by using the first luminance value of each pixel in the first image, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, when performing the tone mapping process again, different texture details can be adjusted based on the actual luminance value thereof, and the loss of texture details of the image after performing the tone mapping process again can be avoided, and avoids the occurrence of a fault in the image after the tone mapping process is newly performed.
In some embodiments of the present invention, the image composition module 220 may include:
the image parameter acquiring unit is used for acquiring the exposure time of each frame of image in at least two frames of images and the second brightness value of each pixel in each frame of image;
the response function generating unit is used for generating a brightness response function corresponding to the shooting scene according to the exposure time and the second brightness value of each frame of image;
and the first image generation unit is used for determining an actual brightness value corresponding to each pixel in the first image according to the brightness response function to obtain the first image.
In these embodiments, optionally, the response function generating unit may be specifically configured to:
calculating a least square solution of a first optimization function according to the exposure time and the second brightness value of each frame of image, wherein the first optimization function is used for calculating a parameter optimal solution of a brightness response function, and the parameter optimal solution is the least square solution of the first optimization function;
and generating a brightness response function corresponding to the shooting scene according to the least square solution.
In these embodiments, optionally, the first image generation unit may be specifically configured to:
and for each pixel in the first image, determining an actual brightness value corresponding to each pixel according to a second brightness value of each pixel in each frame of image, the exposure time of each frame of image and an influence weight coefficient of each frame of image on a shooting scene.
In some embodiments of the present invention, the image acquisition module 210 may include:
the shooting scene photometry unit is used for performing photometry on a shooting scene to obtain reference brightness of the shooting scene;
an exposure value determining unit for determining at least two exposure values based on the reference brightness;
and the image shooting unit is used for shooting at least two frames of images according to at least two exposure values.
In some embodiments of the present invention, the first mapping module 230 may specifically be configured to:
and performing first tone mapping processing on the first image according to the target exposure time and the brightness response function corresponding to the target exposure value, and outputting a second image, wherein the target exposure value is an exposure value corresponding to the reference brightness.
In some embodiments of the present invention, the electronic device may further include:
the first input receiving module is used for receiving first input of a user to a first area in the second image;
a first luminance value processing module for calculating a first luminance average value of actual luminance values of all pixels in the first region in response to a first input;
the exposure time calculation module is used for calculating first exposure time corresponding to the first brightness average value according to the brightness response function;
and the second mapping module is used for performing second tone mapping processing on the first image according to the first exposure time and the brightness response function and outputting a third image.
In other embodiments of the present invention, the first mapping module 230 may be specifically used for
And performing first tone mapping processing on the first image according to a preset tone mapping function, and outputting a second image.
In some embodiments of the present invention, the electronic device may further include:
the second input receiving module is used for receiving second input of a user to a second area in a second image;
a second luminance value processing module for calculating a second luminance average value of actual luminance values of all pixels in the second region in response to a second input;
the mapping function optimization module is used for generating an optimized tone mapping function corresponding to the second brightness average value according to the preset tone mapping function and a preset constraint condition corresponding to the preset tone mapping function;
and the third mapping module is used for performing third tone mapping processing on the first image according to the optimized tone mapping function and outputting a fourth image.
It should be noted that the electronic device provided in the embodiment of the present invention can implement each process and effect implemented by the electronic device in the method embodiment of fig. 1, and the principles for implementing each process are similar, and are not described herein again to avoid repetition.
Fig. 3 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention. As shown in fig. 3, the electronic device 300 includes, but is not limited to: radio frequency unit 301, network module 302, audio output unit 303, input unit 304, sensor 305, display unit 306, user input unit 307, interface unit 308, memory 309, processor 310, and power supply 311. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 3 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 310 is configured to acquire at least two frames of images, where a shooting scene and a field of view range of the at least two frames of images are the same; performing image synthesis on at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in a shooting scene; and performing first tone mapping processing on the first image and outputting a second image.
In the embodiment of the present invention, the first image can be synthesized by using at least two frames of images in the same field of view of the same shooting scene, the first tone mapping process can be performed on the first image, the second image can be output, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, the problem that only an image with a single exposure value can be obtained in the prior art can be solved, therefore, when the luminance of the output second image is not satisfied by a user, the electronic device can perform the tone mapping process again by using the first luminance value of each pixel in the first image, since the first luminance value of each pixel in the first image is the actual luminance value of the pixel in the shooting scene, when performing the tone mapping process again, different texture details can be adjusted based on the actual luminance value thereof, and the loss of texture details of the image after performing the tone mapping process again can be avoided, and avoids the occurrence of a fault in the image after the tone mapping process is newly performed.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 301 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 310; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 301 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 302, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 303 may convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into an audio signal and output as sound. Also, the audio output unit 303 may also provide audio output related to a specific function performed by the electronic apparatus 300 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
The input unit 304 is used to receive audio or video signals. The input Unit 304 may include a Graphics Processing Unit (GPU) 3041 and a microphone 3042, and the Graphics processor 3041 processes image data of a still picture or video obtained by an image capturing apparatus (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 306. The image frames processed by the graphic processor 3041 may be stored in the memory 309 (or other storage medium) or transmitted via the radio frequency unit 301 or the network module 302. The microphone 3042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 301 in case of the phone call mode.
The electronic device 300 also includes at least one sensor 305, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 3061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 3061 and/or the backlight when the electronic device 300 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 305 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 306 is used to display information input by the user or information provided to the user. The Display unit 306 may include a Display panel 3061, and the Display panel 3061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 307 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 307 includes a touch panel 3071 and other input devices 3072. The touch panel 3071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 3071 (e.g., operations by a user on or near the touch panel 3071 using a finger, a stylus, or any suitable object or attachment). The touch panel 3071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 310, and receives and executes commands sent by the processor 310. In addition, the touch panel 3071 may be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 307 may include other input devices 3072 in addition to the touch panel 3071. Specifically, the other input devices 3072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described herein.
Further, the touch panel 3071 may be overlaid on the display panel 3061, and when the touch panel 3071 detects a touch operation on or near the touch panel, the touch operation is transmitted to the processor 310 to determine the type of the touch event, and then the processor 310 provides a corresponding visual output on the display panel 3061 according to the type of the touch event. Although the touch panel 3071 and the display panel 3061 are shown in fig. 3 as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 3071 and the display panel 3061 may be integrated to implement the input and output functions of the electronic device, which is not limited herein.
The interface unit 308 is an interface for connecting an external device to the electronic apparatus 300. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 308 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 300 or may be used to transmit data between the electronic apparatus 300 and the external device.
The memory 309 may be used to store software programs as well as various data. The memory 309 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 309 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 310 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 309 and calling data stored in the memory 309, thereby performing overall monitoring of the electronic device. Processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 310.
The electronic device 300 may further include a power supply 311 (such as a battery) for supplying power to various components, and preferably, the power supply 311 may be logically connected to the processor 310 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the electronic device 300 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 310, a memory 309, and a computer program stored in the memory 309 and capable of running on the processor 310, where the computer program is executed by the processor 310 to implement each process of the above-mentioned embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (12)

1. An image processing method applied to an electronic device, comprising:
acquiring at least two frames of images, wherein the shooting scenes and the field ranges of the at least two frames of images are the same;
performing image synthesis on the at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in the shooting scene;
and performing first tone mapping processing on the first image and outputting a second image.
2. The method according to claim 1, wherein said image-synthesizing the at least two frame images to obtain a first image comprises:
acquiring the exposure time of each frame of image in the at least two frames of images and a second brightness value of each pixel in each frame of image;
generating a brightness response function corresponding to the shooting scene according to the exposure time and the second brightness value of each frame of image;
and determining an actual brightness value corresponding to each pixel in the first image according to the brightness response function to obtain the first image.
3. The method of claim 2, wherein generating a luminance response function corresponding to the captured scene according to the exposure time and the second luminance value of each frame of image comprises:
calculating a least square solution of a first optimization function according to the exposure time and the second brightness value of each frame of image, wherein the first optimization function is used for calculating a parameter optimal solution of the brightness response function, and the parameter optimal solution is the least square solution of the first optimization function;
and generating a brightness response function corresponding to the shooting scene according to the least square solution.
4. The method of claim 2, wherein said determining an actual luminance value for each pixel in the first image according to the luminance response function comprises:
and for each pixel in the first image, determining an actual brightness value corresponding to each pixel according to a second brightness value of each pixel in each frame of image, the exposure time of each frame of image and an influence weight coefficient of each frame of image on the shooting scene.
5. The method of claim 2, wherein said acquiring at least two frames of images comprises:
performing photometry on the shooting scene to obtain the reference brightness of the shooting scene;
determining at least two exposure values according to the reference brightness;
at least two frames of images are captured according to the at least two exposure values.
6. The method according to claim 5, wherein said performing a first tone mapping process on the first image and outputting a second image comprises:
and performing first tone mapping processing on the first image according to the target exposure time corresponding to the target exposure value and the brightness response function, and outputting the second image, wherein the target exposure value is the exposure value corresponding to the reference brightness.
7. The method according to claim 6, wherein after the first tone mapping process is performed on the first image and the second image is output, the method further comprises:
receiving a first input of a user to a first area in the second image;
calculating a first luminance average of actual luminance values of all pixels in the first region in response to the first input;
calculating a first exposure time corresponding to the first brightness average value according to the brightness response function;
and performing second tone mapping processing on the first image according to the first exposure time and the brightness response function, and outputting a third image.
8. The method according to claim 1, wherein said performing a first tone mapping process on the first image and outputting a second image comprises:
and performing first tone mapping processing on the first image according to a preset tone mapping function, and outputting the second image.
9. The method according to claim 8, wherein after the first tone mapping process is performed on the first image and the second image is output, the method further comprises:
receiving a second input of a user to a second area in the second image;
calculating a second luminance average of actual luminance values of all pixels in the second region in response to the second input;
generating an optimized tone mapping function corresponding to the second brightness average value according to the preset tone mapping function and a preset constraint condition corresponding to the preset tone mapping function;
and performing third tone mapping processing on the first image according to the optimized tone mapping function, and outputting a fourth image.
10. An electronic device, comprising:
the device comprises an image acquisition module, a display module and a display module, wherein the image acquisition module is used for acquiring at least two frames of images, and the shooting scenes and the field ranges of the at least two frames of images are the same;
the image synthesis module is used for carrying out image synthesis on the at least two frames of images to obtain a first image, wherein a first brightness value of each pixel in the first image is an actual brightness value of the pixel in the shooting scene;
and the first mapping module is used for performing first tone mapping processing on the first image and outputting a second image.
11. An electronic device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the image processing method according to any one of claims 1 to 9.
CN201911399015.9A 2019-12-30 2019-12-30 Image processing method, electronic device, and medium Pending CN111131722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911399015.9A CN111131722A (en) 2019-12-30 2019-12-30 Image processing method, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911399015.9A CN111131722A (en) 2019-12-30 2019-12-30 Image processing method, electronic device, and medium

Publications (1)

Publication Number Publication Date
CN111131722A true CN111131722A (en) 2020-05-08

Family

ID=70505520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911399015.9A Pending CN111131722A (en) 2019-12-30 2019-12-30 Image processing method, electronic device, and medium

Country Status (1)

Country Link
CN (1) CN111131722A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040130A (en) * 2020-09-08 2020-12-04 Oppo(重庆)智能科技有限公司 Photographing method, photographing device, mobile terminal and computer readable storage medium
CN113592754A (en) * 2021-07-28 2021-11-02 维沃移动通信有限公司 Image generation method and electronic equipment
CN114463191A (en) * 2021-08-26 2022-05-10 荣耀终端有限公司 Image processing method and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101394487A (en) * 2008-10-27 2009-03-25 华为技术有限公司 Image synthesizing method and system
US20150062413A1 (en) * 2013-08-30 2015-03-05 Sony Corporation Light emission control unit, light emission control method, and image pickup unit
CN105450939A (en) * 2015-11-19 2016-03-30 上海斐讯数据通信技术有限公司 High dynamic range image display method and mobile terminal
CN106060418A (en) * 2016-06-29 2016-10-26 深圳市优象计算技术有限公司 IMU information-based wide dynamic image fusion method
CN107454340A (en) * 2017-07-28 2017-12-08 广州翼拍联盟网络技术有限公司 Image combining method, device and mobile terminal based on HDR principle
CN108109180A (en) * 2017-12-12 2018-06-01 上海顺久电子科技有限公司 The method and display device that a kind of high dynamic range images to input are handled
CN110009587A (en) * 2019-04-09 2019-07-12 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110033418A (en) * 2019-04-15 2019-07-19 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110346116A (en) * 2019-06-14 2019-10-18 东南大学 A kind of scene illumination calculation method based on Image Acquisition

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101394487A (en) * 2008-10-27 2009-03-25 华为技术有限公司 Image synthesizing method and system
US20150062413A1 (en) * 2013-08-30 2015-03-05 Sony Corporation Light emission control unit, light emission control method, and image pickup unit
CN105450939A (en) * 2015-11-19 2016-03-30 上海斐讯数据通信技术有限公司 High dynamic range image display method and mobile terminal
CN106060418A (en) * 2016-06-29 2016-10-26 深圳市优象计算技术有限公司 IMU information-based wide dynamic image fusion method
CN107454340A (en) * 2017-07-28 2017-12-08 广州翼拍联盟网络技术有限公司 Image combining method, device and mobile terminal based on HDR principle
CN108109180A (en) * 2017-12-12 2018-06-01 上海顺久电子科技有限公司 The method and display device that a kind of high dynamic range images to input are handled
CN110009587A (en) * 2019-04-09 2019-07-12 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110033418A (en) * 2019-04-15 2019-07-19 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110346116A (en) * 2019-06-14 2019-10-18 东南大学 A kind of scene illumination calculation method based on Image Acquisition

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040130A (en) * 2020-09-08 2020-12-04 Oppo(重庆)智能科技有限公司 Photographing method, photographing device, mobile terminal and computer readable storage medium
CN113592754A (en) * 2021-07-28 2021-11-02 维沃移动通信有限公司 Image generation method and electronic equipment
WO2023005910A1 (en) * 2021-07-28 2023-02-02 维沃移动通信有限公司 Image generation method and electronic device
CN114463191A (en) * 2021-08-26 2022-05-10 荣耀终端有限公司 Image processing method and electronic equipment
CN114463191B (en) * 2021-08-26 2023-01-31 荣耀终端有限公司 Image processing method and electronic equipment

Similar Documents

Publication Publication Date Title
CN110177221B (en) Shooting method and device for high dynamic range image
CN109361865B (en) Shooting method and terminal
CN107707827B (en) High-dynamic image shooting method and mobile terminal
CN107613191B (en) Photographing method, photographing equipment and computer readable storage medium
CN108307109B (en) High dynamic range image preview method and terminal equipment
CN109688322B (en) Method and device for generating high dynamic range image and mobile terminal
CN107566739B (en) photographing method and mobile terminal
CN110505400B (en) Preview image display adjustment method and terminal
CN107566730B (en) A kind of panoramic picture image pickup method and mobile terminal
CN107623818B (en) Image exposure method and mobile terminal
CN109218626B (en) Photographing method and terminal
CN110365907B (en) Photographing method and device and electronic equipment
CN108449541B (en) Panoramic image shooting method and mobile terminal
CN110213484B (en) Photographing method, terminal equipment and computer readable storage medium
CN107730460B (en) Image processing method and mobile terminal
CN111083386B (en) Image processing method and electronic device
CN110930329A (en) Starry sky image processing method and device
CN111131722A (en) Image processing method, electronic device, and medium
CN110868544B (en) Shooting method and electronic equipment
CN109819166B (en) Image processing method and electronic equipment
CN108718388B (en) Photographing method and mobile terminal
CN110708475B (en) Exposure parameter determination method, electronic equipment and storage medium
CN109104578B (en) Image processing method and mobile terminal
CN108307123B (en) Exposure adjusting method and mobile terminal
CN111145151A (en) Motion area determination method and electronic equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200508