CN107707827B - High-dynamic image shooting method and mobile terminal - Google Patents

High-dynamic image shooting method and mobile terminal Download PDF

Info

Publication number
CN107707827B
CN107707827B CN201711122040.3A CN201711122040A CN107707827B CN 107707827 B CN107707827 B CN 107707827B CN 201711122040 A CN201711122040 A CN 201711122040A CN 107707827 B CN107707827 B CN 107707827B
Authority
CN
China
Prior art keywords
exposure
value
image
brightness
range
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.)
Active
Application number
CN201711122040.3A
Other languages
Chinese (zh)
Other versions
CN107707827A (en
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 CN201711122040.3A priority Critical patent/CN107707827B/en
Publication of CN107707827A publication Critical patent/CN107707827A/en
Application granted granted Critical
Publication of CN107707827B publication Critical patent/CN107707827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, TV cameras, video cameras, camcorders, webcams, camera modules for embedding in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/225Television cameras ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, camcorders, webcams, camera modules specially adapted for being embedded in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/235Circuitry or methods for compensating for variation in the brightness of the object, e.g. based on electric image signals provided by an electronic image sensor
    • H04N5/2355Circuitry or methods for compensating for variation in the brightness of the object, e.g. based on electric image signals provided by an electronic image sensor by increasing the dynamic range of the final image compared to the dynamic range of the electronic image sensor, e.g. by adding correct exposed portions of short and long exposed images
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, TV cameras, video cameras, camcorders, webcams, camera modules for embedding in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/225Television cameras ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, camcorders, webcams, camera modules specially adapted for being embedded in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/232Devices for controlling television cameras, e.g. remote control ; Control of cameras comprising an electronic image sensor
    • H04N5/23216Control of parameters, e.g. field or angle of view of camera via graphical user interface, e.g. touchscreen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, TV cameras, video cameras, camcorders, webcams, camera modules for embedding in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/225Television cameras ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, camcorders, webcams, camera modules specially adapted for being embedded in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/232Devices for controlling television cameras, e.g. remote control ; Control of cameras comprising an electronic image sensor
    • H04N5/23229Devices for controlling television cameras, e.g. remote control ; Control of cameras comprising an electronic image sensor comprising further processing of the captured image without influencing the image pickup process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, TV cameras, video cameras, camcorders, webcams, camera modules for embedding in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Abstract

The invention discloses a high dynamic image shooting method and a mobile terminal, wherein the method comprises the following steps: acquiring a gray level histogram of a preview image acquired by a camera; determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram; controlling a camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image; and carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image. The method and the device can better present details of the too bright and too dark areas in the shooting scene, and improve the imaging quality.

Description

High-dynamic image shooting method and mobile terminal
Technical Field
The invention relates to the technical field of communication, in particular to a high-dynamic image shooting method and a mobile terminal.
Background
Photographing through an intelligent terminal such as a mobile phone is one of the operations commonly used by users. With the progress and development of the lens and the control algorithm applied to the intelligent terminal, the daily use requirements of the user can be basically met by photographing through the intelligent terminal. However, there are some unavoidable problems in taking pictures through the intelligent terminal, especially because the dynamic range of the image sensor of the intelligent terminal is limited, and in a scene with high contrast in brightness, the dynamic range of a single-frame image is often insufficient, so that the dark part is too dark and the bright part is too exposed during imaging of the image sensor, and thus the details of the dark part and the bright part of the image cannot be presented.
Disclosure of Invention
The embodiment of the invention provides a high-dynamic image shooting method and a mobile terminal, and aims to solve the problem that details of a dark part and a bright part of an image are lost when a scene with high contrast in brightness is shot in the prior art.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, a high dynamic image shooting method is provided, which includes:
acquiring a gray level histogram of a preview image acquired by a camera;
determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram;
controlling a camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
and carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image.
In a second aspect, a mobile terminal is provided, which includes:
the acquisition module is used for acquiring a gray level histogram of a preview image acquired by the camera;
the determining module is used for determining the exposure of the under-exposed image and the exposure of the high-exposed image based on the gray histogram;
the control module is used for controlling the camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
and the synthesis module is used for carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image.
In a third aspect, a mobile terminal is provided, comprising a processor, a memory and a computer program stored on the memory and being executable on the processor, the computer program, when executed by the processor, implementing the steps of the method according to the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the method according to the first aspect.
In the embodiment of the invention, the exposure of an under-exposed image and the exposure of a high-exposed image are determined by acquiring a gray level histogram of a preview image acquired by a camera, the camera is controlled to shoot a normal exposed image, the under-exposed image and the high-exposed image respectively, and the normal exposed image, the under-exposed image and the high-exposed image are subjected to image synthesis to generate a high dynamic range image; the underexposed image can better present the details of the over-bright area in the preview image, and the overexposed image can better present the details of the over-dark area in the preview image. Therefore, after the normal exposure image, the underexposure image and the strong exposure image are synthesized, the details of the over-bright area and the over-dark area in the shooting scene can be presented better, and the imaging quality is improved.
Drawings
Fig. 1 is a flowchart of a high dynamic image capturing method according to an embodiment of the present invention;
FIG. 2 is one of the flow charts for the substeps of step 140 of FIG. 1 according to the present invention;
FIG. 3 is a flow chart of sub-steps of step 142 of FIG. 2 in accordance with the present invention;
FIG. 4 is a flow chart of sub-steps of step 143 of FIG. 2 in accordance with the present invention;
FIG. 5 is a second flowchart illustrating the substeps of step 140 of FIG. 1 according to the present invention;
fig. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention;
FIG. 7 is a block diagram illustrating the structure of the determination module 640 of FIG. 6 according to the present invention;
FIG. 8 is a second exemplary configuration of the determination module 640 of FIG. 6 according to the present invention;
fig. 9 is a second schematic structural diagram of a mobile terminal according to an embodiment 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.
Fig. 1 shows a flowchart of a high-dynamic image photographing method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
and step 120, acquiring a gray level histogram of the preview image acquired by the camera.
When the mobile terminal controls the camera to image, the camera needs to be controlled to focus a scene needing imaging and the like, at this time, the camera does not image an image displayed on the screen of the mobile terminal, and the image displayed on the screen of the mobile terminal before imaging is a preview image.
In this embodiment, when the mobile terminal performs imaging, the grayscale histogram of the preview image may be directly obtained. The gray histogram is a statistic of gray level distribution in the preview image, and it is to count the frequency of occurrence of all pixels in the preview image according to the size of the gray level value, and represent the brightness of the preview image by the horizontal axis and represent the relative number of pixels in the brightness range in the preview image by the vertical axis to form the gray histogram. Typically, the horizontal axis goes from left to right, with the luminance gradually transitioning from full black to full white.
And step 140, determining the exposure of the underexposed image and the exposure of the high exposed image based on the gray histogram.
It is to be understood that the underexposed image exposure is the exposure to be applied when imaging an excessively bright region in the preview image, and the overexposed image exposure is the exposure to be applied when imaging an excessively dark region in the preview image. The over-bright area and the over-dark area are relative, and based on the gray histogram, the over-bright area is an area with a large gray value in the gray histogram, and the over-dark area is an area with a small gray value in the dune gray histogram. In general, an excessively bright area is an area that needs to be underexposed, and an excessively dark area is an area that needs to be strongly exposed.
And step 160, controlling the camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image.
The exposure amount when the image is normally shot can be set in the mobile terminal, and the shooting mode can obtain the normally exposed image. It is to be appreciated that an under-exposed image may be captured based on an under-exposed image exposure and a high-exposed image may be captured based on a high-exposed image exposure.
And 180, carrying out image synthesis on the normal exposure image, the underexposure image and the high exposure image to generate a high dynamic range image.
And imaging the preview image at the moment when the user presses a camera shutter in the mobile terminal. Here, it can be known that the image finally captured by the camera in the present embodiment is an image synthesized from a normal exposure image, an underexposed image, and a high exposure image, and is a high dynamic range image.
In the embodiment of the invention, the exposure of an under-exposed image and the exposure of a high-exposed image are determined by acquiring a gray level histogram of a preview image acquired by a camera, the camera is controlled to shoot a normal exposed image, the under-exposed image and the high-exposed image respectively, and the normal exposed image, the under-exposed image and the high-exposed image are subjected to image synthesis to generate a high dynamic range image; the underexposed image can better present the details of the over-bright area in the preview image, and the overexposed image can better present the details of the over-dark area in the preview image. Therefore, after the normal exposure image, the underexposure image and the strong exposure image are synthesized, the details of the over-bright area and the over-dark area in the shooting scene can be presented better, and the imaging quality is improved.
Preferably, as shown in fig. 2, step 140 specifically includes:
step 141, respectively calculating a first luminance average value of the first region and a second luminance average value of the second region based on the gray histogram.
The first area is an area between the maximum gray value and a preset first gray value in the gray histogram, the second area is an area between the minimum gray value and a preset second gray value in the gray histogram, and the first gray value is larger than the second gray value.
It is known that the gray values in the gray histogram have a maximum gray value less than a minimum gray value, a region between the maximum gray value and a preset first gray value may be determined as the first region, and a first average luminance value of the first region may be calculated. The preset first gray value is smaller than the maximum gray value. The first average luminance value may be an average of all gray values in the first region. Further, a region between the minimum gray value and a preset second gray value may be determined as the second region, and a second average luminance value of the second region may be calculated. The preset second gray value is greater than the minimum gray value. The second average luminance value may be an average of all the gradation values in the second area.
And 142, calculating the underexposed intensity ratio based on the first brightness average value.
In this embodiment, the underexposure intensity ratio of the over-bright area in the captured scene may be determined based on the first average brightness value, so that the captured image may better show details of the over-bright area in the scene.
And 143, calculating the high exposure intensity ratio based on the second brightness average value.
In this embodiment, the high exposure intensity ratio of the excessively dark area in the captured scene may be determined based on the second average brightness value, so that the captured image may better show details of the excessively dark area in the scene.
Step 144, obtaining the current exposure of the preview image.
The current exposure of the preview image is the exposure applied to the preview image when taking a picture, and is related to relevant parameters of a camera on the mobile terminal, including sensitivity, aperture coefficient, exposure time and the like. When the mobile terminal controls the camera to image, the exposure of the preview image can be directly obtained according to the relevant parameters of the camera.
And step 145, determining the exposure of the under-exposed image and the exposure of the high-exposed image based on the current exposure, the proportion of the under-exposed intensity and the proportion of the high-exposed intensity.
Specifically, the product of the current exposure amount and the underexposed intensity ratio may be determined as the underexposed image exposure amount, and the product of the current exposure amount and the high exposed intensity ratio may be determined as the high exposed image exposure amount.
In this embodiment, the underexposure intensity ratio is calculated from the first luminance average value, and the overexposure intensity ratio is calculated from the second luminance average value, so that the underexposure image exposure amount and the overexposure image exposure amount can be reasonably determined.
Preferably, as shown in fig. 3, step 142 specifically includes:
step 1421, determining a first comparison result between the first brightness average and a preset first brightness range;
step 1422, calculate the underexposure intensity ratio according to the first comparison result and the preset first ratio range.
In this embodiment, the preset first luminance range and the preset first ratio range have a corresponding relationship. The preset first brightness range and the preset first ratio range can be obtained by carrying out experimental statistics on a large number of scenes with different brightness contrast degrees and analyzing the scenes with different brightness contrast degrees, and the two most suitable ranges can enable the details of the over-bright areas of all the scenes with different contrast degrees to present the most ideal state.
It can be appreciated that the first comparison results are different, and the calculated underexposed intensity ratio is also different. Due to the fact that the proportion of the underexposed intensity is different, the over-bright area in the preview image can be better exposed, and finally the detail portion in the over-bright area in the preview image can be better presented.
In an implementation manner of this embodiment, step 1422 may be specifically implemented as:
determining a maximum ratio in the first ratio range as an underexposure intensity ratio when the first comparison result indicates that the first luminance average value is greater than or equal to a maximum luminance value in the first luminance range;
determining a minimum ratio in the first ratio range as an underexposure intensity ratio when the first comparison result indicates that the first brightness average value is less than or equal to a minimum brightness value in the first brightness range;
determining a quotient of the first numerator and the first denominator as an underexposed intensity ratio when the first comparison result indicates that the first luminance average value is greater than a minimum luminance value in the first luminance range and less than a maximum luminance value in the first luminance range;
the first numerator is a sum of a first value and a second value, the first value is a product of a difference value obtained by subtracting the first brightness average value from the maximum brightness value in the first brightness range and a minimum ratio value in the first ratio range, the second value is a product of a difference value obtained by subtracting the minimum brightness value in the first brightness range from the first brightness average value and a maximum ratio value in the first ratio range, and the first denominator is a difference value obtained by subtracting the maximum brightness value and the minimum brightness value in the first brightness range.
E.g. presetThe first brightness range may be Y _ min1-Y _ max1, and the corresponding preset first ratio range may be EV- _ min-EV- _ max. At this time, the underexposed intensity ratio EV-time can be calculated from the first average luminance value Y _ down. When Y _ down>When Y _ max1, EV — max; when Y _ min1<Y_down<Y _ max1, EV [ [ (Y _ max1-Y _ down) × EV- _ min + (Y _ down-Y _ min1) × EV--_max]/(Y _ max1-Y _ min 1); when Y _ down<When Y _ min1, EV-=EV-_min。
Preferably, as shown in fig. 4, step 143 specifically includes:
step 1431, determining a second comparison result of the second brightness average value and a preset second brightness range;
step 1432, calculate the high exposure intensity ratio according to the second comparison result and the preset second ratio range.
In this embodiment, the preset second brightness range and the preset second ratio range have a corresponding relationship. The preset second brightness range and the preset second ratio range can be obtained by carrying out experimental statistics on a large number of scenes with different brightness contrast degrees and analyzing the scenes with different brightness contrast degrees, and the two most suitable ranges can be obtained, so that the details of the too-dark regions of all the scenes with different contrast degrees can present the most ideal state.
It will be appreciated that, as the second comparison results differ, the calculated high exposure intensity ratio will also correspond to the difference. Due to the fact that the high exposure intensity ratio is different, the excessively dark area in the preview image can be better exposed, and finally the detail part in the excessively dark area in the preview image can be better presented.
In an implementation manner of this embodiment, step 1432 may be specifically implemented as:
determining the maximum ratio in the second ratio range as the high exposure intensity ratio when the second comparison result indicates that the second brightness average value is greater than or equal to the maximum brightness value in the second brightness range;
when the second comparison result indicates that the second brightness average value is less than or equal to the minimum brightness value in the second brightness range, determining the minimum ratio in the second ratio range as a high exposure intensity ratio;
determining a quotient of the second numerator and the second denominator as a high exposure intensity ratio when the second comparison result indicates that the second brightness average value is greater than a minimum brightness value in the second brightness range and less than a maximum brightness value in the second brightness range;
the second numerator is a sum of a third value and a fourth value, the third value is a product of a difference value obtained by subtracting the second brightness average value from the maximum brightness value in the second brightness range and a minimum ratio value in the second ratio range, the fourth value is a product of a difference value obtained by subtracting the minimum brightness value in the second brightness range from the second brightness average value and a maximum ratio value in the second ratio range, and the second denominator is a difference value obtained by subtracting the maximum brightness value and the minimum brightness value in the second brightness range.
For example, the preset second brightness range may be Y _ min 2-Y _ max2, and the corresponding preset second ratio range may be EV+_min~EV+Max. At this time, from the second average luminance value Y _ up, the high exposure intensity ratio EV can be calculated+. When Y _ up>When Y _ max2, EV+=EV+Max; when Y _ min2<Y_up<At Y _ max2, EV+=[(Y_max2-Y_up)*EV+_min+(Y_up-Y_min2)*EV+_max]/(Y _ max2-Y _ min 2); when Y _ up<When Y _ min2, EV+=EV+_min。
Through the calculation, the underexposure intensity ratio EV can be obtained-And the intensity ratio EV of the aeration+
The present embodiment also provides another implementation of step 140. Preferably, as shown in fig. 5, step 140 specifically includes:
in step 1401, the maximum gray scale value and the minimum gray scale value in the gray scale histogram are obtained.
It will be appreciated that the gray scale values in the preview image do not necessarily all include all of the gray scale values in 0-255. Therefore, the present embodiment needs to acquire the maximum gray value and the minimum gray value in the gray histogram of the preview image.
In step 1402, the gray intervals determined by the minimum gray value and the maximum gray value are divided into a preset number of intervals at equal intervals.
It can be known that the equal interval division is that the number of the gradation values included in each section is the same.
Step 1403, a corresponding weight value is assigned to each block.
In this embodiment, a central block section of a preset number of block sections may be determined, and a corresponding weight value may be assigned to each block section according to the number of block sections spaced between each block section and the central block section. The number of the sections is positively correlated with the weight value. Generally speaking, the brighter or darker the imaged area, the smaller the corresponding number of pixels, and therefore, the correspondingly increased weight value can reduce the exposure degree of the excessively bright portion and increase the exposure degree of the excessively dark portion, thereby improving the imaging details of the excessively bright portion and the excessively dark portion. Therefore, the larger the number is, the larger the corresponding weight value may be, and the smaller the number is, the smaller the corresponding weight value may be.
Step 1404, determining the section contained in the third area and the fourth area respectively;
the number of the sections contained in the third area and the fourth area is one half of the preset number, the sections contained in the third area and the fourth area are continuous sections, and the gray value in the section contained in the third area is larger than the gray value in the section contained in the fourth area.
Step 1405, calculating an underexposure intensity ratio according to the section included in the third region and the corresponding weight value.
Specifically, the number of pixels in each section included in the third area may be multiplied by the corresponding weight value, so as to obtain a third sum, and the third sum is determined as the underexposure intensity ratio.
In step 1406, a high exposure intensity ratio is calculated according to the block section and the corresponding weight value included in the fourth region.
Specifically, the number of pixels in each block included in the fourth region may be multiplied by the corresponding weight value, so as to obtain a fourth sum, and the fourth sum is determined as the high exposure rate.
In step 1407, the current exposure of the preview image is obtained.
The current exposure of the preview image is the exposure applied to the preview image when taking a picture, and is related to relevant parameters of a camera on the mobile terminal, including sensitivity, aperture coefficient, exposure time and the like. When the mobile terminal controls the camera to image, the exposure of the preview image can be directly obtained according to the relevant parameters of the camera.
Step 1408, determining the exposure of the under-exposed image and the exposure of the high-exposed image based on the current exposure, the proportion of the under-exposed intensity and the proportion of the high-exposed intensity;
specifically, the product of the current exposure amount and the underexposed intensity ratio may be determined as the underexposed image exposure amount, and the product of the current exposure amount and the high exposed intensity ratio may be determined as the high exposed image exposure amount.
For example, the minimum gray value Y _ min and the maximum gray value Y _ max in the gray histogram may be counted, and the gray interval defined by the maximum gray value and the minimum gray value is Y _ min to Y _ max. Dividing the gray scale interval into n equal sections, each section comprises the same number of gray scale values, and the brightness distance of each section is (Y _ max-Y _ min)/n. Correspondingly, the number N of pixels in each interval can be calculated1~Nn. Further, a corresponding underexposure proportion EV is calculated-And high flare ratio EV+In time, different weight values W can be correspondingly given to the n sections respectively1~Wn. Then EV-=W1*N1+W2*N2+~W(n/2-1)*N(n/2-1),EV+=Wn/2*Nn/2+W(n/2+1)*N(n/2+1)+~Wn*Nn. When n is an odd number, n/2 may take a corresponding integer value, and this embodiment will not be described in detail herein.
It should be noted that, in this embodiment, the weight value assigned to each segment is a parameter weight value obtained when the details of the over-bright area and the over-dark area of all scenes with different contrast degrees are optimal by performing experimental statistics on a large number of scenes with different brightness contrast degrees and analyzing the scenes with different brightness contrast degrees.
It should be further noted that, in this embodiment, a High-Dynamic Range (HDR) function is usually added to the mobile terminal. HDR requires three images of different exposure times, where an underexposed image is used to capture details of overly bright areas, a normal exposed image is used as a synthesis reference, and a high exposed image is used to capture details of overly dark areas. However, when the ratio of the exposure time of the underexposed image and the exposure time of the overexposed image to the exposure time of the normal exposed image is fixed or is inappropriate, for image scenes with different brightness contrast intensities, the details of the obtained over-bright area and over-dark area are insufficient, so that the HDR synthesis effect is not good, and the dynamic range of the obtained image cannot be maximized. Through the content of the embodiment, the invention can better perform exposure imaging on the over-bright area and the over-dark area of the image, and after the image is synthesized, the output image can optimally present the detailed parts of the over-bright area and the over-dark area of the image, thereby avoiding the defects in HDR imaging and better improving the imaging quality.
The high-dynamic image photographing method according to the embodiment of the present invention is described in detail above with reference to fig. 1 to 5. A mobile terminal according to an embodiment of the present invention is described in detail below. Fig. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention, and as shown in fig. 6, the mobile terminal 600 includes:
an obtaining module 620, configured to obtain a grayscale histogram of a preview image acquired by a camera;
a determining module 640, configured to determine an under-exposed image exposure amount and a high-exposed image exposure amount based on the gray histogram;
the control module 660 is used for controlling the camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
and the synthesis module 680 is configured to perform image synthesis on the normal exposure image, the under exposure image, and the high exposure image to generate a high dynamic range image.
In the embodiment of the invention, the exposure of an under-exposed image and the exposure of a high-exposed image are determined by acquiring a gray level histogram of a preview image acquired by a camera, the camera is controlled to shoot a normal exposed image, the under-exposed image and the high-exposed image respectively, and the normal exposed image, the under-exposed image and the high-exposed image are subjected to image synthesis to generate a high dynamic range image; the underexposed image can better present the details of the over-bright area in the preview image, and the overexposed image can better present the details of the over-dark area in the preview image. Therefore, after the normal exposure image, the underexposure image and the strong exposure image are synthesized, the details of the over-bright area and the over-dark area in the shooting scene can be presented better, and the imaging quality is improved.
Preferably, as shown in fig. 7, the determining module 640 specifically includes:
an average operator unit 641, configured to calculate a first luminance average value of the first region and a second luminance average value of the second region based on the grayscale histogram, respectively;
a first proportion calculating subunit 642, configured to calculate an under-exposure intensity proportion based on the first luminance average;
a second ratio calculation subunit 643, configured to calculate a high exposure intensity ratio based on the second luminance average value;
an exposure amount acquisition subunit 644 for acquiring the current exposure amount of the preview image;
an exposure determination subunit 645, configured to determine an under-exposure image exposure and a high-exposure image exposure based on the current exposure, the under-exposure intensity ratio, and the high-exposure intensity ratio;
the first area is an area between the maximum gray value and a preset first gray value in the gray histogram, the second area is an area between the minimum gray value and a preset second gray value in the gray histogram, and the first gray value is larger than the second gray value.
Optionally, as an embodiment, the first proportion calculating subunit 642 is specifically configured to:
determining a first comparison result of the first brightness average value and a preset first brightness range;
calculating an under-exposure intensity ratio according to the first comparison result and a preset first ratio range;
and the preset first brightness range and the preset first ratio range have a corresponding relation.
Optionally, as an embodiment, the first proportion calculating subunit 642 is specifically configured to:
determining a maximum ratio in the first ratio range as an underexposure intensity ratio when the first comparison result indicates that the first luminance average value is greater than or equal to a maximum luminance value in the first luminance range;
determining a minimum ratio in the first ratio range as an underexposure intensity ratio when the first comparison result indicates that the first brightness average value is less than or equal to a minimum brightness value in the first brightness range;
determining a quotient of the first numerator and the first denominator as an underexposed intensity ratio when the first comparison result indicates that the first luminance average value is greater than a minimum luminance value in the first luminance range and less than a maximum luminance value in the first luminance range;
the first numerator is a sum of a first value and a second value, the first value is a product of a difference value obtained by subtracting the first brightness average value from the maximum brightness value in the first brightness range and a minimum ratio value in the first ratio range, the second value is a product of a difference value obtained by subtracting the minimum brightness value in the first brightness range from the first brightness average value and a maximum ratio value in the first ratio range, and the first denominator is a difference value obtained by subtracting the maximum brightness value and the minimum brightness value in the first brightness range.
Optionally, as an embodiment, the second ratio calculation subunit 643 is specifically configured to:
determining a second comparison result of the second brightness average value and a preset second brightness range;
calculating a high exposure intensity ratio according to the second comparison result and a preset second ratio range;
and the preset second brightness range and the preset second ratio range have a corresponding relation.
Optionally, as an embodiment, the second ratio calculation subunit 643 is specifically configured to:
determining the maximum ratio in the second ratio range as the high exposure intensity ratio when the second comparison result indicates that the second brightness average value is greater than or equal to the maximum brightness value in the second brightness range;
when the second comparison result indicates that the second brightness average value is less than or equal to the minimum brightness value in the second brightness range, determining the minimum ratio in the second ratio range as a high exposure intensity ratio;
determining a quotient of the second numerator and the second denominator as a high exposure intensity ratio when the second comparison result indicates that the second brightness average value is greater than a minimum brightness value in the second brightness range and less than a maximum brightness value in the second brightness range;
the second numerator is a sum of a third value and a fourth value, the third value is a product of a difference value obtained by subtracting the second brightness average value from the maximum brightness value in the second brightness range and a minimum ratio value in the second ratio range, the fourth value is a product of a difference value obtained by subtracting the minimum brightness value in the second brightness range from the second brightness average value and a maximum ratio value in the second ratio range, and the second denominator is a difference value obtained by subtracting the maximum brightness value and the minimum brightness value in the second brightness range.
Preferably, as shown in fig. 8, the determining module 640 specifically includes:
a first obtaining subunit 6401, configured to obtain a maximum grayscale value and a minimum grayscale value in the grayscale histogram;
the dividing subunit 6402 is configured to divide the gray scale interval determined by the minimum gray scale value and the maximum gray scale value into a preset number of intervals at equal intervals;
an assignment subunit 6403, configured to assign a corresponding weight value to each segment;
a determining subunit 6404, configured to determine segment sections included in the third area and the fourth area, respectively;
a first calculating subunit 6405, configured to calculate an underexposure intensity ratio according to the section included in the third region and the corresponding weight value;
a second calculating subunit 6406, configured to calculate a high exposure intensity ratio according to the block segment included in the fourth region and the corresponding weight value;
a second acquiring subunit 6407, configured to acquire a current exposure amount of the preview image;
an exposure amount determination subunit 6408 for determining an under-exposure image exposure amount and a high-exposure image exposure amount based on the current exposure amount, the under-exposure intensity ratio, and the high-exposure intensity ratio;
the number of the sections contained in the third area and the fourth area is one half of the preset number, the sections contained in the third area and the fourth area are continuous sections, and the gray value in the section contained in the third area is larger than the gray value in the section contained in the fourth area.
Optionally, as an embodiment, the first calculating subunit 6405 is specifically configured to:
multiplying the number of pixels in each section contained in the third area by the corresponding weight value respectively to obtain a third sum;
the third sum is determined as the underexposed intensity ratio.
Optionally, as an embodiment, the second calculating subunit 6406 is specifically configured to:
multiplying the number of pixels in each section contained in the fourth area by the corresponding weight value respectively to obtain a fourth sum;
the fourth sum is determined as the high exposure intensity ratio.
Optionally, as an embodiment, the assignment subunit 6404 is specifically configured to:
determining a central section of a preset number of sections;
according to the number of the interval sections between each section and the central section, giving a corresponding weight value to each section;
the number of the sections is positively correlated with the weight value.
Optionally, as an embodiment, the exposure amount determining subunit is specifically configured to:
determining the exposure of the under-exposed image and the exposure of the high-exposed image based on the current exposure, the proportion of the under-exposed intensity and the proportion of the high-exposed intensity, comprising the following steps:
determining the product of the current exposure and the underexposure intensity ratio as the exposure of the underexposed image;
and determining the product of the current exposure and the high exposure intensity ratio as the high exposure image exposure.
Fig. 9 is a schematic hardware structure diagram of a mobile terminal for implementing various embodiments of the present application, where the mobile terminal 900 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910, and a power supply 911. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 9 is not intended to be limiting of mobile terminals, and that a mobile terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present application, the mobile terminal 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.
Wherein, the processor 910 is configured to: acquiring a gray level histogram of a preview image acquired by a camera; determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram; controlling a camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image; and carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image.
In the embodiment of the invention, during imaging, a gray level histogram of a preview image is obtained, the ratio of the exposure of a preset exposure area in the gray level histogram to the exposure of the preview image is calculated, the exposure of the exposure area is calculated according to the ratio and the exposure of the preview image, and the preview image can be imaged according to the exposure of the exposure area; the exposure of the exposure area in the preview image is controlled in the whole imaging process, so that the exposure area in the preview image can obtain the most suitable exposure, the dynamic range of the image is improved to the maximum extent, and the imaging quality is improved.
It should be understood that, in the embodiment of the present application, the radio frequency unit 901 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 910; in addition, the uplink data is transmitted to the base station. Generally, the radio frequency unit 901 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 901 can also communicate with a network and other devices through a wireless communication system.
The mobile terminal provides the user with wireless broadband internet access via the network module 902, such as helping the user send and receive e-mails, browse web pages, and access streaming media.
The audio output unit 903 may convert audio data received by the radio frequency unit 901 or the network module 902 or stored in the memory 909 into an audio signal and output as sound. Also, the audio output unit 903 may also provide audio output related to a specific function performed by the mobile terminal 900 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 903 includes a speaker, a buzzer, a receiver, and the like.
The input unit 904 is used to receive audio or video signals. The input Unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042, and the Graphics processor 9041 processes image data of a still picture or video obtained by an image capturing device (such as a camera) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 906. The image frames processed by the graphic processor 9041 may be stored in the memory 909 (or other storage medium) or transmitted via the radio frequency unit 901 or the network module 902. The microphone 9042 can receive sounds and can process 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 901 in case of the phone call mode.
The mobile terminal 900 also includes at least one sensor 905, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 9061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 9061 and/or backlight when the mobile terminal 900 is moved to the ear. As one of the motion sensors, the 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 the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 905 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which are not described in detail herein.
The display unit 906 is used to display information input by the user or information provided to the user. The Display unit 906 may include a Display panel 1061, and the Display panel 9061 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 907 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 9071 (e.g., operations by a user on or near the touch panel 9071 using a finger, a stylus, or any other suitable object or accessory). The touch panel 9071 may include two parts, 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 910, receives a command from the processor 910, and executes the command. In addition, the touch panel 9071 may be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 907 may include other input devices 9072 in addition to the touch panel 9071. Specifically, the other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, and the like), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 9071 may be overlaid on the display panel 9061, and when the touch panel 9071 detects a touch operation on or near the touch panel 9071, the touch panel is transmitted to the processor 910 to determine the type of the touch event, and then the processor 910 provides a corresponding visual output on the display panel 9061 according to the type of the touch event. Although in fig. 9, the touch panel 9071 and the display panel 9061 are two independent components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 9071 and the display panel 9061 may be integrated to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 908 is an interface through which an external device is connected to the mobile terminal 900. 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 908 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 900 and external devices.
The memory 909 may be used to store software programs as well as various data. The memory 909 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for 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 909 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 910 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing software programs and/or modules stored in the memory 909 and calling data stored in the memory 909, thereby performing overall monitoring of the mobile terminal. Processor 910 may include one or more processing units; preferably, the processor 910 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 is to be appreciated that the modem processor described above may not be integrated into processor 910.
The mobile terminal 900 may also include a power supply 911 (e.g., a battery) for powering the various components, and preferably, the power supply 911 is logically connected to the processor 910 through a power management system that provides power management functions to manage charging, discharging, and power consumption.
In addition, the mobile terminal 900 includes some functional modules that are not shown, and thus will not be described in detail herein.
Preferably, an embodiment of the present invention further provides a mobile terminal, which includes a processor 910, a memory 909, and a computer program that is stored in the memory 109 and can be run on the processor 910, and when the computer program is executed by the processor 910, the processes of the above-mentioned embodiment of the high dynamic image capturing method are implemented, and the same technical effect can be achieved, and in order to avoid repetition, details are not repeated here.
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 high dynamic image shooting method, and can achieve the same technical effect, and in order to avoid repetition, the detailed description is omitted 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 (16)

1. A high-dynamic image photographing method, characterized by comprising:
acquiring a gray level histogram of a preview image acquired by a camera;
determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram;
controlling a camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image;
the determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram comprises:
respectively calculating a first brightness average value of the first area and a second brightness average value of the second area based on the gray level histogram;
calculating an underexposure intensity ratio based on the first luminance average;
calculating a high exposure intensity ratio based on the second brightness average value;
acquiring the current exposure of the preview image;
determining an under-exposed image exposure and a high-exposed image exposure based on the current exposure, the under-exposed intensity ratio and the high-exposed intensity ratio;
the first region is a region between the maximum gray value and a preset first gray value in the gray histogram, the second region is a region between the minimum gray value and a preset second gray value in the gray histogram, and the first gray value is larger than the second gray value;
the calculating an under-exposure intensity ratio based on the first luminance average value includes: determining a first comparison result of the first brightness average value and a preset first brightness range; calculating an underexposure intensity ratio according to the first comparison result and a preset first ratio range; the preset first brightness range and the preset first ratio range have a corresponding relation;
the calculating of the under-exposure intensity ratio according to the first comparison result and a preset first ratio range includes: determining a maximum ratio value in the first ratio range as the under-exposure intensity ratio when the first comparison result indicates that the first luminance average value is greater than or equal to a maximum luminance value in the first luminance range;
calculating a high exposure intensity ratio based on the second luminance average value, including: determining a second comparison result of the second brightness average value and a preset second brightness range; calculating a high exposure intensity ratio according to the second comparison result and a preset second ratio range; the preset second brightness range and the preset second ratio range have a corresponding relation;
calculating a high exposure intensity ratio according to the second comparison result and a preset second ratio range, wherein the calculation comprises the following steps: determining the maximum ratio in the second ratio range as the high exposure proportion when the second comparison result indicates that the second brightness average value is greater than or equal to the maximum brightness value in the second brightness range.
2. The method according to claim 1, wherein the calculating an underexposure intensity ratio according to the first comparison result and a preset first ratio range further comprises:
determining a minimum ratio value in the first ratio range as the underexposed intensity ratio when the first comparison result indicates that the first luminance average value is less than or equal to a minimum luminance value in the first luminance range;
determining a quotient of a first numerator and a first denominator as the underexposed intensity ratio when the first comparison result indicates that the first luminance average value is greater than a minimum luminance value in the first luminance range and less than a maximum luminance value in the first luminance range;
the first numerator is a sum of a first value and a second value, the first value is a product of a difference value of a maximum brightness value in the first brightness range minus the first brightness average value and a minimum ratio value in the first ratio range, the second value is a product of a difference value of the first brightness average value minus the minimum brightness value in the first brightness range and a maximum ratio value in the first ratio range, and the first denominator is a difference value of the maximum brightness value and the minimum brightness value in the first brightness range.
3. The method according to claim 1, wherein the calculating a high exposure intensity ratio according to the second comparison result and a preset second ratio range further comprises:
determining a minimum ratio value in the second ratio range as the high exposure intensity ratio when the second comparison result indicates that the second brightness average value is less than or equal to a minimum brightness value in the second brightness range;
determining a quotient of a second numerator and a second denominator as the high exposure intensity ratio when the second comparison result indicates that the second luminance average value is greater than a minimum luminance value in the second luminance range and less than a maximum luminance value in the second luminance range;
the second numerator is a sum of a third value and a fourth value, the third value is a product of a difference value obtained by subtracting the second brightness average value from the maximum brightness value in the second brightness range and a minimum ratio value in the second ratio range, the fourth value is a product of a difference value obtained by subtracting the minimum brightness value in the second brightness range from the second brightness average value and a maximum ratio value in the second ratio range, and the second denominator is a difference value obtained by subtracting the maximum brightness value and the minimum brightness value in the second brightness range.
4. The method of claim 1, wherein determining an underexposed image exposure and a high-exposed image exposure based on the current exposure, the underexposed intensity proportion, and the high-exposed intensity proportion comprises:
determining the product of the current exposure and the underexposure intensity ratio as the underexposed image exposure;
and determining the product of the current exposure and the high exposure intensity ratio as the high exposure image exposure.
5. A high-dynamic image photographing method, characterized by comprising:
acquiring a gray level histogram of a preview image acquired by a camera;
determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram;
controlling a camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image;
the determining an under-exposed image exposure and a high-exposed image exposure based on the gray histogram comprises:
acquiring the maximum gray value and the minimum gray value in the gray histogram;
dividing the gray interval determined by the minimum gray value and the maximum gray value into a preset number of sections at equal intervals;
assigning a corresponding weight value to each section;
respectively determining the section contained in the third area and the fourth area;
calculating an under-exposure intensity ratio according to the section and the corresponding weight value contained in the third area;
calculating a high exposure intensity ratio according to the section and the corresponding weight value contained in the fourth area;
acquiring the current exposure of the preview image;
determining an under-exposed image exposure and a high-exposed image exposure based on the current exposure, the under-exposed intensity ratio and the high-exposed intensity ratio;
the number of the sections contained in the third area and the fourth area is one half of the preset number, the sections contained in the third area and the fourth area are continuous sections, and the gray value in the section contained in the third area is larger than the gray value in the section contained in the fourth area;
the calculating of the under-exposure intensity ratio according to the section and the corresponding weight value included in the third area includes:
multiplying the number of pixels in each section contained in the third area by the corresponding weight value respectively to obtain a third sum;
determining the third sum as an underexposed intensity ratio;
calculating a high exposure intensity ratio according to the section and the corresponding weight value included in the fourth area, specifically:
multiplying the number of pixels in each section contained in the fourth area by the corresponding weight value respectively to obtain a fourth sum;
determining the fourth sum as a high exposure intensity ratio.
6. The method of claim 5, wherein said assigning each of said segments a corresponding weight value comprises:
determining a central interval of the preset number of intervals;
according to the number of the interval sections between each section and the central section, giving a corresponding weight value to each section;
wherein the number of the block sections is positively correlated with the weight value.
7. The method of claim 5, wherein determining an under-exposed image exposure and a high-exposed image exposure based on the current exposure, the under-exposed intensity proportion, and the high-exposed intensity proportion comprises:
determining the product of the current exposure and the underexposure intensity ratio as the underexposed image exposure;
and determining the product of the current exposure and the high exposure intensity ratio as the high exposure image exposure.
8. A mobile terminal, characterized in that the mobile terminal comprises:
the acquisition module is used for acquiring a gray level histogram of a preview image acquired by the camera;
the determining module is used for determining the exposure of the under-exposed image and the exposure of the high-exposed image based on the gray histogram;
the control module is used for controlling the camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
the synthesis module is used for carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image;
the determining module comprises:
the mean value calculating subunit is used for respectively calculating a first brightness mean value of the first area and a second brightness mean value of the second area based on the gray level histogram;
a first ratio calculation subunit, configured to calculate an under-exposure intensity ratio based on the first luminance average;
a second ratio calculation subunit, configured to calculate a high exposure intensity ratio based on the second luminance average value;
an exposure obtaining subunit, configured to obtain a current exposure of the preview image;
an exposure amount determining subunit, configured to determine an under-exposure image exposure amount and a high-exposure image exposure amount based on the current exposure amount, the under-exposure intensity ratio, and the high-exposure intensity ratio;
the first region is a region between the maximum gray value and a preset first gray value in the gray histogram, the second region is a region between the minimum gray value and a preset second gray value in the gray histogram, and the first gray value is larger than the second gray value; the first scale calculation subunit is specifically configured to: determining a first comparison result of the first brightness average value and a preset first brightness range; calculating an underexposure intensity ratio according to the first comparison result and a preset first ratio range; the preset first brightness range and the preset first ratio range have a corresponding relation;
the first scale calculation subunit is specifically configured to: determining a maximum ratio value in the first ratio range as the under-exposure intensity ratio when the first comparison result indicates that the first luminance average value is greater than or equal to a maximum luminance value in the first luminance range;
the second proportion calculation subunit is specifically configured to: determining a second comparison result of the second brightness average value and a preset second brightness range; calculating a high exposure intensity ratio according to the second comparison result and a preset second ratio range; the preset second brightness range and the preset second ratio range have a corresponding relation;
the second proportion calculation subunit is specifically configured to: determining the maximum ratio in the second ratio range as the high exposure proportion when the second comparison result indicates that the second brightness average value is greater than or equal to the maximum brightness value in the second brightness range.
9. The mobile terminal of claim 8, wherein the first scale calculation subunit is further specifically configured to:
determining a minimum ratio value in the first ratio range as the underexposed intensity ratio when the first comparison result indicates that the first luminance average value is less than or equal to a minimum luminance value in the first luminance range;
determining a quotient of a first numerator and a first denominator as the underexposed intensity ratio when the first comparison result indicates that the first luminance average value is greater than a minimum luminance value in the first luminance range and less than a maximum luminance value in the first luminance range;
the first numerator is a sum of a first value and a second value, the first value is a product of a difference value of a maximum brightness value in the first brightness range minus the first brightness average value and a minimum ratio value in the first ratio range, the second value is a product of a difference value of the first brightness average value minus the minimum brightness value in the first brightness range and a maximum ratio value in the first ratio range, and the first denominator is a difference value of the maximum brightness value and the minimum brightness value in the first brightness range.
10. The mobile terminal of claim 8, wherein the second scale calculation subunit is further specifically configured to:
determining a minimum ratio value in the second ratio range as the high exposure intensity ratio when the second comparison result indicates that the second brightness average value is less than or equal to a minimum brightness value in the second brightness range;
determining a quotient of a second numerator and a second denominator as the high exposure intensity ratio when the second comparison result indicates that the second luminance average value is greater than a minimum luminance value in the second luminance range and less than a maximum luminance value in the second luminance range;
the second numerator is a sum of a third value and a fourth value, the third value is a product of a difference value obtained by subtracting the second brightness average value from the maximum brightness value in the second brightness range and a minimum ratio value in the second ratio range, the fourth value is a product of a difference value obtained by subtracting the minimum brightness value in the second brightness range from the second brightness average value and a maximum ratio value in the second ratio range, and the second denominator is a difference value obtained by subtracting the maximum brightness value and the minimum brightness value in the second brightness range.
11. The mobile terminal of claim 8, wherein the exposure determination subunit is specifically configured to:
determining an under-exposed image exposure and a high-exposed image exposure based on the current exposure, the under-exposed intensity ratio, and the high-exposed intensity ratio, comprising:
determining the product of the current exposure and the underexposure intensity ratio as the underexposed image exposure;
and determining the product of the current exposure and the high exposure intensity ratio as the high exposure image exposure.
12. A mobile terminal, characterized in that the mobile terminal comprises:
the acquisition module is used for acquiring a gray level histogram of a preview image acquired by the camera;
the determining module is used for determining the exposure of the under-exposed image and the exposure of the high-exposed image based on the gray histogram;
the control module is used for controlling the camera to shoot a normal exposure image, an under exposure image and a high exposure image respectively based on the exposure of the under exposure image and the exposure of the high exposure image;
the synthesis module is used for carrying out image synthesis on the normal exposure image, the under exposure image and the high exposure image to generate a high dynamic range image;
the determining module comprises:
the first acquisition subunit is used for acquiring the maximum gray value and the minimum gray value in the gray histogram;
the dividing subunit is used for dividing the gray scale interval determined by the minimum gray scale value and the maximum gray scale value into a preset number of interval sections at equal intervals;
the assignment subunit is used for assigning a corresponding weight value to each block section;
a determining subunit, configured to determine the block sections included in the third area and the fourth area, respectively;
the first calculating subunit is used for calculating an under-exposure intensity ratio according to the section and the corresponding weight value contained in the third area;
the second calculating subunit is used for calculating a high exposure intensity ratio according to the section and the corresponding weight value contained in the fourth area;
the second acquisition subunit is used for acquiring the current exposure of the preview image;
an exposure amount determining subunit, configured to determine an under-exposure image exposure amount and a high-exposure image exposure amount based on the current exposure amount, the under-exposure intensity ratio, and the high-exposure intensity ratio;
the number of the sections contained in the third area and the fourth area is one half of the preset number, the sections contained in the third area and the fourth area are continuous sections, and the gray value in the section contained in the third area is larger than the gray value in the section contained in the fourth area;
the first calculating subunit is specifically configured to:
multiplying the number of pixels in each section contained in the third area by the corresponding weight value respectively to obtain a third sum;
determining the third sum as an underexposed intensity ratio;
the second calculating subunit is specifically configured to:
multiplying the number of pixels in each section contained in the fourth area by the corresponding weight value respectively to obtain a fourth sum;
determining the fourth sum as a high exposure intensity ratio.
13. The mobile terminal according to claim 12, wherein the assignment subunit is specifically configured to:
determining a central interval of the preset number of intervals;
according to the number of the interval sections between each section and the central section, giving a corresponding weight value to each section;
wherein the number of the block sections is positively correlated with the weight value.
14. The mobile terminal of claim 12, wherein the exposure determination subunit is specifically configured to:
determining an under-exposed image exposure and a high-exposed image exposure based on the current exposure, the under-exposed intensity ratio, and the high-exposed intensity ratio, comprising:
determining the product of the current exposure and the underexposure intensity ratio as the underexposed image exposure;
and determining the product of the current exposure and the high exposure intensity ratio as the high exposure image exposure.
15. A mobile terminal, comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the high dynamic image capturing method as claimed in any one of claims 1 to 4 or 5 to 7.
16. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, carries out the steps of the high-dynamic image capturing method according to any one of claims 1 to 4 or 5 to 7.
CN201711122040.3A 2017-11-14 2017-11-14 High-dynamic image shooting method and mobile terminal Active CN107707827B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711122040.3A CN107707827B (en) 2017-11-14 2017-11-14 High-dynamic image shooting method and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711122040.3A CN107707827B (en) 2017-11-14 2017-11-14 High-dynamic image shooting method and mobile terminal

Publications (2)

Publication Number Publication Date
CN107707827A CN107707827A (en) 2018-02-16
CN107707827B true CN107707827B (en) 2020-05-01

Family

ID=61179225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711122040.3A Active CN107707827B (en) 2017-11-14 2017-11-14 High-dynamic image shooting method and mobile terminal

Country Status (1)

Country Link
CN (1) CN107707827B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108270977A (en) * 2018-03-06 2018-07-10 广东欧珀移动通信有限公司 Control method and device, imaging device, computer equipment and readable storage medium storing program for executing
CN108616689B (en) * 2018-04-12 2020-10-02 Oppo广东移动通信有限公司 Portrait-based high dynamic range image acquisition method, device and equipment
CN108632537B (en) * 2018-05-04 2020-08-21 Oppo广东移动通信有限公司 Control method and apparatus, imaging device, computer device, and readable storage medium
CN110708468A (en) * 2018-07-10 2020-01-17 福州瑞芯微电子股份有限公司 Image pickup method and apparatus
CN108718388B (en) * 2018-08-29 2020-02-11 维沃移动通信有限公司 Photographing method and mobile terminal
CN109218613B (en) * 2018-09-18 2020-08-14 Oppo广东移动通信有限公司 High dynamic range image synthesis method and device, terminal equipment and storage medium
CN109348088A (en) * 2018-11-22 2019-02-15 Oppo广东移动通信有限公司 Image denoising method, device, electronic equipment and computer readable storage medium
CN110266954B (en) * 2019-06-28 2021-04-13 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN110198419A (en) * 2019-06-28 2019-09-03 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN111447371A (en) * 2020-03-12 2020-07-24 努比亚技术有限公司 Automatic exposure control method, terminal and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248828A (en) * 2012-02-13 2013-08-14 宏达国际电子股份有限公司 Exposure value adjustment apparatus and method
CN105872148A (en) * 2016-06-21 2016-08-17 维沃移动通信有限公司 Method and mobile terminal for generating high dynamic range images
WO2017035750A1 (en) * 2015-08-31 2017-03-09 华为技术有限公司 Method and apparatus for taking pictures

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8582001B2 (en) * 2009-04-08 2013-11-12 Csr Technology Inc. Exposure control for high dynamic range image capture

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103248828A (en) * 2012-02-13 2013-08-14 宏达国际电子股份有限公司 Exposure value adjustment apparatus and method
WO2017035750A1 (en) * 2015-08-31 2017-03-09 华为技术有限公司 Method and apparatus for taking pictures
CN105872148A (en) * 2016-06-21 2016-08-17 维沃移动通信有限公司 Method and mobile terminal for generating high dynamic range images

Also Published As

Publication number Publication date
CN107707827A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
US9451173B2 (en) Electronic device and control method of the same
CN106937039B (en) Imaging method based on double cameras, mobile terminal and storage medium
US9894287B2 (en) Method and apparatus for acquiring a high dynamic image using multiple cameras
CN107679482B (en) Unlocking control method and related product
EP3410390A1 (en) Image processing method and device, computer readable storage medium and electronic device
US7555141B2 (en) Video phone
JP4149467B2 (en) How to adjust camera exposure
CN105744175B (en) A kind of screen light compensation method, device and mobile terminal
CN105809647B (en) Automatic defogging photographing method, device and equipment
US9357127B2 (en) System for auto-HDR capture decision making
KR102149453B1 (en) Electronic device and method for acquiring image
CN107566529B (en) Photographing method, mobile terminal and cloud server
EP2095627B1 (en) System and method for camera metering based on flesh tone detection
JP2008526149A (en) Digital imaging exposure
CN106131441B (en) Photographing method and device and electronic equipment
KR101937708B1 (en) Control System For Camera and Portable Device including the same, and control Method thereof
CN105306788B (en) A kind of noise-reduction method and device of image of taking pictures
EP3624439A2 (en) Imaging processing method for camera module in night scene, electronic device and storage medium
CN107635101B (en) Shooting method, shooting device, storage medium and electronic equipment
JP6374970B2 (en) Image processing method and apparatus, and computer device
CN104517268A (en) Method and device for adjusting image brightness
WO2018219170A1 (en) Focusing control method, computer device and computer readable storage medium
KR20200019728A (en) Shooting mobile terminal
CN107820014B (en) Shooting method, mobile terminal and computer storage medium
CN108881733B (en) Panoramic shooting method and mobile terminal

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
GR01 Patent grant
GR01 Patent grant