CN109218620B - Photographing method and device based on ambient brightness, storage medium and mobile terminal - Google Patents
Photographing method and device based on ambient brightness, storage medium and mobile terminal Download PDFInfo
- Publication number
- CN109218620B CN109218620B CN201811236728.9A CN201811236728A CN109218620B CN 109218620 B CN109218620 B CN 109218620B CN 201811236728 A CN201811236728 A CN 201811236728A CN 109218620 B CN109218620 B CN 109218620B
- Authority
- CN
- China
- Prior art keywords
- brightness
- target
- frame image
- interval
- determining
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 70
- 230000008859 change Effects 0.000 claims abstract description 57
- 230000001960 triggered effect Effects 0.000 claims abstract description 33
- 238000001514 detection method Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 9
- 238000005096 rolling process Methods 0.000 claims description 7
- 230000006870 function Effects 0.000 description 10
- 230000004927 fusion Effects 0.000 description 10
- 230000002093 peripheral effect Effects 0.000 description 9
- 230000007613 environmental effect Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 238000010897 surface acoustic wave method Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000009432 framing Methods 0.000 description 1
- 238000007499 fusion processing Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000007500 overflow downdraw method Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
The embodiment of the application discloses a photographing method, a photographing device, a storage medium and a terminal based on ambient brightness, wherein the method comprises the following steps: firstly, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image; secondly, determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images; thirdly, determining at least one second frame image according to the target brightness interval; and finally, generating a target image according to the at least one second frame image. By adopting the technical scheme, the influence of the ambient brightness change on the brightness accuracy of the shot image can be avoided, and the shooting quality is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of mobile terminals, in particular to a photographing method and device based on ambient brightness, a storage medium and a mobile terminal.
Background
At present, the photographing function becomes a standard configuration of most mobile terminals, and a terminal user can easily and quickly realize photographing operation through a portable mobile terminal.
When a terminal user uses the mobile terminal to take a picture, if the ambient brightness changes, the problem of inaccurate brightness of the taken picture occurs, so that the quality of the taken picture is affected.
Disclosure of Invention
The embodiment of the application provides a photographing method and device based on ambient brightness, a storage medium and a mobile terminal, and the photographing quality can be improved.
In a first aspect, an embodiment of the present application provides a photographing method based on ambient brightness, including:
when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image;
determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
determining at least one second frame image according to the target brightness interval;
and generating a target image according to the at least one second frame image.
In a second aspect, an embodiment of the present application provides a photographing apparatus based on ambient brightness, including:
the first frame image acquisition module is used for acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image when a photographing instruction is triggered;
a brightness interval determining module, configured to determine a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images acquired by the first frame image acquiring module;
the second frame image determining module is used for determining at least one second frame image according to the target brightness interval determined by the brightness interval determining module;
and the generating module is used for generating a target image according to the at least one second frame image determined by the second frame image determining module.
In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the ambient brightness based photographing method according to the present application.
In a fourth aspect, an embodiment of the present application provides a mobile terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the ambient brightness-based photographing method according to the embodiment of the present application.
According to the photographing scheme based on the environment brightness, firstly, when a photographing instruction is triggered, a plurality of continuous first frame images are obtained, and an environment brightness value corresponding to each first frame image is obtained; secondly, determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images; thirdly, determining at least one second frame image according to the target brightness interval; and finally, generating a target image according to the at least one second frame image. By adopting the technical scheme, the influence of the ambient brightness change on the brightness accuracy of the shot image can be avoided, and the shooting quality is improved.
Drawings
Fig. 1 is a schematic flowchart of a photographing method based on ambient brightness according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a photographing apparatus based on ambient brightness according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Detailed Description
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
At present, the photographing function becomes a standard configuration of most mobile terminals, and a terminal user can easily and quickly realize photographing operation through a portable mobile terminal. When a terminal user uses the mobile terminal to photograph, if the environmental color temperature changes, the color temperature of the photographed image is inaccurate, and the quality of the photographed image is affected. The required exposure time and the final imaging are the same under different ambient brightness, and the shooting moment may not be the optimal ambient brightness node, and at this time, the brightness of the shot image is inaccurate, so the image shooting function of the mobile terminal still needs to be improved.
The embodiment of the application provides a photographing method based on environment brightness, which can acquire a plurality of first frame images and an environment brightness value corresponding to each first frame image after a photographing instruction is triggered, determine an optimal target brightness interval based on the environment brightness value, and generate a target image based on at least one second frame image corresponding to the target brightness interval, so that the target image is generated for the second frame image under the optimal environment brightness, and further capture the photographing moment with proper environment brightness, thereby avoiding the situation that a user cannot capture the optimal photographing opportunity due to repeated photographing, optimizing the image brightness, and improving the quality of the photographed image. The specific scheme is as follows:
fig. 1 is a schematic flowchart of a photographing method based on ambient brightness according to an embodiment of the present application, where the method is suitable for a photographing situation when the ambient brightness changes. The method can be executed by a mobile terminal with a photographing function, the mobile terminal can be a smart phone, a tablet computer, wearable equipment (a smart watch or smart glasses) and the like, and the method specifically comprises the following steps:
When the user starts the camera function, a photographing button is displayed in the screen, and the user clicks the photographing button or can trigger a photographing instruction through external equipment such as earphones. And continuously acquiring a plurality of first frame images when a photographing instruction is triggered. For any one first frame image, the ambient brightness value is firstly acquired when photographing, and then the first frame image is acquired through the photosensitive element. N (N is 2 or more) sets (first frame image, ambient brightness value) of key-value pairs are obtained. The exposure time of the first frame image may be the same or different. Alternatively, the exposure time of the first frame image may be determined according to the ambient brightness. Optionally, when a plurality of first frame images are continuously acquired, the number of the first frame images may be a preset number (e.g., 10), or may be determined according to the ambient brightness change rate.
Further, the ambient brightness value does not change every time the photographing instruction is triggered, so that the power consumption of the terminal is increased if the step 110 is executed every time the photographing instruction is triggered. Based on this, the ambient brightness change rate is detected in the preview stage. If the change rate of the environmental brightness is larger than a preset rate threshold, when a photographing instruction is triggered, a plurality of continuous first frame images are obtained, and an environmental brightness value corresponding to each first frame image is obtained.
When a user enters a photographing function, the terminal acquires a preview frame image through the camera and displays the preview frame image in the screen, the user confirms photographing environment and a photographing object according to the preview frame image displayed in the preview stage and adjusts parameters such as a photographing angle, and after debugging is finished, the user triggers a photographing instruction to photograph. Optionally, after the preview frame image is acquired, the ambient brightness change rate at the preview stage may be determined by performing image analysis on the preview frame image. If the ambient brightness change rate changes slowly, then no image quality problems due to ambient brightness changes will occur. If the ambient brightness change rate is greater than the preset rate threshold, step 110 is executed when the photographing instruction is triggered, so as to start the execution of the embodiment of the present application.
Optionally, detecting whether there is an ambient brightness change according to the preview frame image may be to start to detect the ambient brightness change in real time or once every preset time interval (e.g., 1 second) after the shooting function of the mobile terminal is started, and update the detection result. Or rolling and storing the latest M (M is greater than or equal to 2) preview frame images, when a terminal user triggers a photographing instruction (such as a shooting button is clicked for triggering, voice triggering, gesture or expression triggering, and the like), calculating an ambient brightness change rate according to the stored M preview frame images, and if the ambient brightness change rate is greater than a preset rate threshold, acquiring a plurality of continuous first frame images and acquiring an ambient brightness value corresponding to each first frame image.
And step 120, determining a target brightness interval according to a plurality of environment brightness values corresponding to a plurality of first frame images.
The plurality of environment luminance values corresponding to the plurality of first frame images are discrete luminance values, and an average luminance or a luminance value closest to the average luminance is selected as an equalization value from the plurality of environment luminance values in consideration of equalization. And determining a target brightness interval by taking the balance quality as a center and a preset multiple of the total interval of the plurality of environment brightness values as an interval length. Wherein the preset multiple is larger than zero and smaller than one. For example, the ambient brightness is 200K, 300K, 500K, 400K, and 450K, and the average brightness is 370K, which can be taken as an equalization value. If the predetermined multiple is 1/3, the predetermined multiple of the total environmental brightness value interval (500-. The target luminance interval determined with the preset multiple of the total interval of the plurality of environment luminance values as the interval length centered on the equalization value (370K) is [320K, 420K ].
And step 130, determining at least one second frame image according to the target brightness interval.
And searching the first frame image with the corresponding ambient light brightness in the target brightness interval as a second frame image.
And 140, generating a target image according to the at least one second frame image.
And if the number of the second frame images is one, taking the second frame images as target images. Or detecting the ambient brightness according to the ambient brightness corresponding to the second frame image, and taking a picture when the ambient brightness is matched with the ambient brightness of the second frame image to obtain the target image. If there are a plurality of second frame images, one image with better image quality is selected as the target image from the plurality of second frame images. Optionally, the plurality of second frame images may also be merged to obtain the target image.
Illustratively, the target image is obtained by combining a plurality of second frame images, which is not limited in the embodiment of the present application. The brightness of the at least two second frame images is adjusted to be consistent according to the target color temperature interval, and then the at least two frame images with the adjusted brightness are subjected to fusion processing to generate the target shooting image. Furthermore, the balance value is used as a brightness adjustment reference value, the brightness of the plurality of second frame images is adjusted to the balance value, and then the plurality of second frame images are fused to generate the target shot image, so that the accuracy of finally determining the color temperature value of the target shot image can be improved while the image processing efficiency is improved.
Optionally, when the plurality of second frame images are fused, at least two processed second frame images may be fused based on a pixel level fusion algorithm and/or a feature level fusion algorithm to generate a target shot image. The pixel-level fusion is also called data-level fusion, and may be a process of directly processing collected image data with a changed color temperature to obtain a fused image. Specifically, the pixel level fusion algorithm may include a spatial domain algorithm, a transform domain algorithm, and the like, and the spatial domain algorithm may further include a plurality of fusion rule methods, such as a logic filtering method, a gray-scale weighted average method, a contrast modulation method, and the like; the transform domain algorithm may also include a pyramid decomposition fusion method, a wavelet transform method, and the like. The pixel level fusion algorithm has the advantage that the detailed information in the image, such as the extraction of edges and textures, can be restored as much as possible. The characteristics of shooting content, color temperature, color and the like can be well restored. The feature level image fusion algorithm can extract color temperature and color feature information in the collected image, and then analyze, process and integrate the feature information to obtain fused image features. The method has the advantages that the accuracy of the color temperature and the color of the fused image is greatly improved by adopting the feature level fusion algorithm, the image information is compressed by the feature level fusion and is analyzed and processed by a computer, the consumed memory and time are relatively small, and the real-time performance of the image shooting processing is improved.
The embodiment of the application provides a photographing method based on environment brightness. And secondly, determining a target brightness interval according to a plurality of environment brightness values corresponding to a plurality of first frame images. And thirdly, determining at least one second frame image according to the target brightness interval. Finally, a target image is generated from the at least one second frame image. Compared with the situation that the image brightness is abnormal due to the fact that a user cannot accurately capture the image when the environment brightness changes, the image quality is low, the method and the device can acquire a plurality of first frame images and the environment brightness value corresponding to each first frame image after a photographing instruction is triggered, determine the optimal target brightness interval based on the environment brightness values, and generate the target image based on at least one second frame image corresponding to the target brightness interval, so that the target image is generated for the second frame image under the optimal environment brightness, further capture the photographing moment with the proper environment brightness, avoid the situation that the user cannot capture the optimal photographing opportunity due to repeated photographing, optimize the image brightness and improve the quality of the photographed image.
Fig. 2 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present application, and as a further description of the foregoing embodiment, the method includes the following steps:
and step 210, storing a second environment brightness value in a rolling manner according to the detection time window, wherein the second environment brightness value is an environment brightness value corresponding to the detection time window.
After entering the camera function, a user acquires framing information through a preview stage, and acquires an environment brightness value according to a preset time interval in the preview stage. The detection time window can be adjusted according to the change interval and the change speed of the second ambient brightness value. The larger the change interval of the second ambient brightness value is, the longer the detection time window is, the faster the change speed of the second ambient brightness value is, and the shorter the detection time window is. The detection time window may also be a fixed duration, for example 5 seconds to 1 minute.
And step 220, determining the change rate of the ambient brightness according to the second ambient brightness value.
The ambient brightness rate of change may be obtained by dividing the total interval of the second ambient brightness values by the detection time window. A temporary storage space can be allocated in the memory to store the second environment brightness value stored in the detection time window in a rolling manner, and the waste data in the storage space can be cleaned in time based on the time information acquired by the second environment brightness value.
The preset rate threshold may be preset according to the sensitivity of human eyes to the ambient brightness change, and the size of the preset rate threshold may be fixed, or may be adjusted according to the change of the shooting scene or the shooting mode. Similarly, the duration of the detection time window may be a preset fixed duration; the detection time window may also be adjusted in real time based on the ambient brightness change rate in the shooting scene at that time, for example, when the ambient brightness change rate is faster, the duration of the detection time window may be set to be relatively shorter; if the second ambient brightness frequency is large, the duration of the detection time window may be set relatively long. And detecting whether the ambient brightness change rate is greater than a preset rate threshold value. If the rate exceeds the preset rate threshold, a flag bit can be prestored. When a photographing instruction is received, whether a plurality of continuous first frame images are acquired or not is determined according to the data content of the zone bit, and an environment brightness value corresponding to each first frame image is acquired.
And step 250, determining at least one second frame image according to the target brightness interval.
The photographing method based on the environmental brightness provided by the embodiment of the application can detect the change rate of the environmental brightness by using limited system resources based on the detection time window, and further can determine whether to acquire a plurality of continuous first frame images and acquire the environmental brightness value corresponding to each first frame image according to the judgment conclusion obtained in the preview stage when the photographing instruction is triggered, so that the response speed of the photographing instruction is increased, and the utilization rate of the system resources is increased.
Fig. 3 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present application, and as a further description of the foregoing embodiment, the method includes the following steps:
and step 310, acquiring a plurality of third frame images in a preview stage.
And acquiring the preview frame image of the latest preview stage as a third frame image. The third frame image can be cached and stored in a memory and updated in real time. The plurality of third frame images are consecutive preview frame images or preview frame images acquired at fixed intervals.
And step 320, determining the ambient brightness change rate according to the brightness information of the third frame image.
And performing brightness detection on the third frame image to determine brightness information, wherein the brightness information can be average brightness information of the third frame image. The rate of change of the average luminance information may be taken as the ambient luminance change rate. Further, a background area can be obtained from the third frame image through edge detection and body identification, and the ambient brightness information is determined according to the brightness information of the background area, so as to determine the ambient brightness change rate.
And step 350, determining at least one second frame image according to the target brightness interval.
And 360, generating a target image according to the at least one second frame image.
The photographing method based on the ambient brightness can determine the ambient brightness change rate through the third frame image in the preview stage, further the ambient brightness does not need to be detected through the brightness sensor, and the power consumption of the terminal is reduced.
Fig. 4 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present application, and as a further description of the foregoing embodiment, the method includes the following steps:
When the change of the ambient brightness is more dispersed, the plurality of ambient brightness values corresponding to the first frame image are distributed in a multi-class aggregation form and are respectively and intensively distributed in the plurality of first brightness intervals.
And step 430, determining a target brightness interval according to the first brightness interval.
At this time, if the luminance average value is taken as the equalization value, there may occur a problem that the equalization value determination is not accurate. Optionally, the matched first luminance interval may be selected from the plurality of first luminance intervals according to the current time information as the target luminance interval. Further, the target luminance section may be determined from the plurality of first luminance sections in combination with location information, such as indoors or outdoors.
And step 450, generating a target image according to the at least one second frame image.
The photographing method based on the ambient brightness can more accurately determine the target brightness interval from the plurality of first brightness intervals, and further improves image quality.
Fig. 5 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present application, and as a further description of the foregoing embodiment, the method includes the following steps:
And step 520, acquiring current scene information.
The current scene information may include position information of the current scene and photographic subject information included in the current scene. The photographic subject includes a light source, a photographic subject, and the like.
The matching relation between the current scene information and the environment brightness value can be determined in a machine learning mode, and the target brightness interval is determined through the matching relation.
And 540, determining at least one second frame image according to the target brightness interval.
The photographing method based on the ambient brightness, provided by the embodiment of the application, can determine the target brightness interval matched with the current scene according to the current scene, so that the second frame image can be more accurately acquired, and the accuracy of the target image is improved.
Fig. 6 is a schematic flowchart of another photographing method based on ambient brightness according to an embodiment of the present application, and as a further description of the foregoing embodiment, the method includes the following steps:
And step 640, segmenting the second frame image to obtain a sub-image.
The segmentation can be carried out according to the preset size, and the clustering segmentation can also be carried out according to the shooting objects to obtain the image areas of all the shooting subjects.
And 650, determining the target sub-image according to the quality score of the sub-image.
And scoring the sub-images segmented by each second frame image to obtain quality scores. The sub-image with the higher quality score is determined as the target sub-image.
And 660, generating a target image according to the target sub-image.
And generating a target image by splicing and overlapping the target sub-images.
According to the photographing method based on the ambient brightness, the target sub-images with high quality can be screened out from the second positive images based on the quality scores, and the target images are formed according to the target sub-images, so that the details of the target images are clearer, and the image quality is improved.
Fig. 7 is a block diagram of a photographing apparatus based on ambient brightness according to an embodiment of the present disclosure, where the photographing apparatus may be implemented by software and/or hardware, and is generally integrated in a mobile terminal having a photographing function, and may execute the photographing method based on ambient brightness according to the foregoing embodiments. As shown in fig. 7, the apparatus includes: a first frame image obtaining module 710, a brightness interval determining module 720, a second frame image determining module 730 and a generating module 740.
A first frame image obtaining module 710, configured to obtain a plurality of consecutive first frame images and obtain an environment brightness value corresponding to each first frame image when a photographing instruction is triggered;
a brightness interval determining module 720, configured to determine a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images acquired by the first frame image acquiring module 710;
a second frame image determining module 730, configured to determine at least one second frame image according to the target brightness interval determined by the brightness interval determining module 720;
a generating module 740, configured to generate a target image according to the at least one second frame image determined by the second frame image determining module 730.
Further, the first frame image obtaining module 710 is configured to:
detecting the change rate of the ambient brightness in a preview stage;
and if the ambient brightness change rate is greater than a preset rate threshold, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an ambient brightness value corresponding to each first frame image.
Further, the first frame image obtaining module 710 detects the ambient brightness change rate in the preview stage, including:
storing a second environment brightness value according to the rolling of the detection time window, wherein the second environment brightness value is an environment brightness value corresponding to the time window;
and determining the change rate of the ambient brightness according to the second ambient brightness value.
Further, the first frame image obtaining module 710 detects the ambient brightness change rate in the preview stage, including:
acquiring a plurality of third frame images in a preview stage;
and determining the ambient brightness change rate according to the brightness information of the third frame image.
Further, the luminance interval determination module 720 is configured to:
determining at least one first brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
and determining a target brightness interval according to the first brightness interval.
Further, the luminance interval determination module 720 is configured to:
acquiring current scene information;
and determining a target brightness interval according to the current scene information and a plurality of environment brightness values corresponding to the plurality of first frame images.
Further, the generating module 740 is configured to:
segmenting the second frame image to obtain sub-images;
determining a target sub-image according to the quality score of the sub-image;
and generating a target image according to the target sub-image.
The embodiment of the application provides a photographing device based on ambient brightness, and first, when a photographing instruction is triggered, a first frame image obtaining module 710 obtains a plurality of continuous first frame images and obtains an ambient brightness value corresponding to each first frame image. Next, the luminance interval determination module 720 determines a target luminance interval according to a plurality of environment luminance values corresponding to a plurality of first frame images. Again, the second frame image determining module 730 determines at least one second frame image according to the target brightness interval. Finally, the generating module 740 generates the target image according to the at least one second frame image. Compared with the situation that the image brightness is abnormal due to the fact that a user cannot accurately capture the image when the environment brightness changes, the image quality is low, the method and the device can acquire a plurality of first frame images and the environment brightness value corresponding to each first frame image after a photographing instruction is triggered, determine the optimal target brightness interval based on the environment brightness values, and generate the target image based on at least one second frame image corresponding to the target brightness interval, so that the target image is generated for the second frame image under the optimal environment brightness, further capture the photographing moment with the proper environment brightness, avoid the situation that the user cannot capture the optimal photographing opportunity due to repeated photographing, optimize the image brightness and improve the quality of the photographed image.
The device can execute the methods provided by all the embodiments of the application, and has corresponding functional modules and beneficial effects for executing the methods. For details of the technology not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present application.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 8, the terminal may include: a housing (not shown), a memory 801, a Central Processing Unit (CPU) 802 (also called a processor, hereinafter referred to as CPU), a computer program stored in the memory 801 and operable on the processor 802, a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU802 and the memory 801 are provided on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the terminal; the memory 801 is used for storing executable program codes; the CPU802 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 801.
The terminal further comprises: peripheral interface 803, RF (Radio Frequency) circuitry 805, audio circuitry 806, speakers 811, power management chip 808, input/output (I/O) subsystem 809, touch screen 812, other input/control devices 810, and external port 804, which communicate over one or more communication buses or signal lines 807.
It should be understood that the illustrated terminal device 800 is merely one example of a terminal, and that the terminal device 800 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a terminal device provided in this embodiment, where the terminal device is a smart phone as an example.
A memory 801, the memory 801 being accessible by the CPU802, the peripheral interface 803, and the like, the memory 801 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 803, said peripheral interface 803 allowing input and output peripherals of the device to be connected to the CPU802 and the memory 801.
I/O subsystem 809, which I/O subsystem 809 may connect input and output peripherals on the device, such as touch screen 812 and other input/control devices 810, to peripheral interface 803. The I/O subsystem 809 may include a display controller 8091 and one or more input controllers 8092 for controlling other input/control devices 810. Where one or more input controllers 8092 receive electrical signals from or transmit electrical signals to other input/control devices 810, other input/control devices 810 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is worth noting that the input controller 8092 may be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
The touch screen 812 may be a resistive type, a capacitive type, an infrared type, or a surface acoustic wave type, according to the operating principle of the touch screen and the classification of media for transmitting information. The touch screen 812 may be classified by installation method: external hanging, internal or integral. Classified according to technical principles, the touch screen 812 may be: a vector pressure sensing technology touch screen, a resistive technology touch screen, a capacitive technology touch screen, an infrared technology touch screen, or a surface acoustic wave technology touch screen.
A touch screen 812, which touch screen 812 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like. Optionally, the touch screen 812 sends an electrical signal (e.g., an electrical signal of the touch surface) triggered by the user on the touch screen to the processor 802.
The display controller 8091 in the I/O subsystem 809 receives electrical signals from the touch screen 812 or sends electrical signals to the touch screen 812. The touch screen 812 detects a contact on the touch screen, and the display controller 8091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 812, that is, implements a human-computer interaction, and the user interface object displayed on the touch screen 812 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 805 is mainly used to establish communication between the smart speaker and a wireless network (i.e., a network side), and implement data reception and transmission between the smart speaker and the wireless network. Such as sending and receiving short messages, e-mails, etc.
The audio circuit 806 is mainly used to receive audio data from the peripheral interface 803, convert the audio data into an electric signal, and transmit the electric signal to the speaker 811.
And the power management chip 808 is used for supplying power and managing power to the hardware connected with the CPU802, the I/O subsystem and the peripheral interface.
In this embodiment, the cpu802 is configured to:
when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image;
determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
determining at least one second frame image according to the target brightness interval;
and generating a target image according to the at least one second frame image.
Further, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image, including:
detecting the change rate of the ambient brightness in a preview stage;
and if the ambient brightness change rate is greater than a preset rate threshold, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an ambient brightness value corresponding to each first frame image.
Further, detecting the ambient brightness change rate in the preview stage includes:
storing a second environment brightness value according to the rolling of the detection time window, wherein the second environment brightness value is an environment brightness value corresponding to the time window;
and determining the change rate of the ambient brightness according to the second ambient brightness value.
Further, the detecting the ambient brightness change rate in the preview phase includes:
acquiring a plurality of third frame images in a preview stage;
and determining the ambient brightness change rate according to the brightness information of the third frame image.
Further, the determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images includes:
determining at least one first brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
and determining a target brightness interval according to the first brightness interval.
Further, the determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images includes:
acquiring current scene information;
and determining a target brightness interval according to the current scene information and a plurality of environment brightness values corresponding to the plurality of first frame images.
Further, the generating the target image according to the at least one second frame image includes:
segmenting the second frame image to obtain sub-images;
determining a target sub-image according to the quality score of the sub-image;
and generating a target image according to the target sub-image.
Embodiments of the present application further provide a storage medium containing terminal device executable instructions, which when executed by a terminal device processor, are configured to perform a method for calibrating white balance of an image, the method including:
when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image;
determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
determining at least one second frame image according to the target brightness interval;
and generating a target image according to the at least one second frame image.
Further, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image, including:
detecting the change rate of the ambient brightness in a preview stage;
and if the ambient brightness change rate is greater than a preset rate threshold, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an ambient brightness value corresponding to each first frame image.
Further, detecting the ambient brightness change rate in the preview stage includes:
storing a second environment brightness value according to the rolling of the detection time window, wherein the second environment brightness value is an environment brightness value corresponding to the time window;
and determining the change rate of the ambient brightness according to the second ambient brightness value.
Further, the detecting the ambient brightness change rate in the preview phase includes:
acquiring a plurality of third frame images in a preview stage;
and determining the ambient brightness change rate according to the brightness information of the third frame image.
Further, the determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images includes:
determining at least one first brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
and determining a target brightness interval according to the first brightness interval.
Further, the determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images includes:
acquiring current scene information;
and determining a target brightness interval according to the current scene information and a plurality of environment brightness values corresponding to the plurality of first frame images.
Further, the generating the target image according to the at least one second frame image includes:
segmenting the second frame image to obtain sub-images;
determining a target sub-image according to the quality score of the sub-image;
and generating a target image according to the target sub-image.
The computer storage media of the embodiments of the present application may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the application recommendation operation described above, and may also perform related operations in the photographing method based on ambient brightness provided in any embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims (10)
1. A photographing method based on ambient brightness is characterized by comprising the following steps:
when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image;
determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
determining at least one second frame image according to the target brightness interval;
generating a target image according to the at least one second frame image;
the determining at least one second frame image according to the target brightness interval includes:
taking the first frame image with the ambient light brightness in a target brightness interval as the second frame image;
determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images, including:
selecting an average brightness or a brightness value closest to the average brightness from the plurality of environment brightness values as an equalization value;
and determining a target brightness interval by taking the balance value as a center and a preset multiple of the total interval of the plurality of environment brightness values as an interval length, wherein the preset multiple is more than zero and less than one.
2. The method for taking a picture based on ambient brightness according to claim 1, wherein when the photographing instruction is triggered, acquiring a plurality of consecutive first frame images and acquiring an ambient brightness value corresponding to each first frame image comprises:
detecting the change rate of the ambient brightness in a preview stage;
and if the ambient brightness change rate is greater than a preset rate threshold, when a photographing instruction is triggered, acquiring a plurality of continuous first frame images and acquiring an ambient brightness value corresponding to each first frame image.
3. The method of claim 2, wherein detecting the ambient brightness change rate in the preview stage comprises:
storing a second environment brightness value according to the rolling of the detection time window, wherein the second environment brightness value is an environment brightness value corresponding to the time window;
and determining the change rate of the ambient brightness according to the second ambient brightness value.
4. The method for taking a picture based on ambient brightness according to claim 2, wherein the detecting the ambient brightness change rate in the preview stage comprises:
acquiring a plurality of third frame images in a preview stage;
and determining the ambient brightness change rate according to the brightness information of the third frame image.
5. The method of claim 1, wherein the determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images comprises:
determining at least one first brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images;
and determining a target brightness interval according to the first brightness interval.
6. The method of claim 1, wherein the determining a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images comprises:
acquiring current scene information;
and determining a target brightness interval according to the current scene information and a plurality of environment brightness values corresponding to the plurality of first frame images.
7. The ambient brightness based photographing method according to any one of claims 1 to 6, wherein the generating of the target image from the at least one second frame image comprises:
segmenting the second frame image to obtain sub-images;
determining a target sub-image according to the quality score of the sub-image;
and generating a target image according to the target sub-image.
8. A photographing apparatus based on ambient brightness, comprising:
the first frame image acquisition module is used for acquiring a plurality of continuous first frame images and acquiring an environment brightness value corresponding to each first frame image when a photographing instruction is triggered;
a brightness interval determining module, configured to determine a target brightness interval according to a plurality of environment brightness values corresponding to the plurality of first frame images acquired by the first frame image acquiring module;
the second frame image determining module is used for determining at least one second frame image according to the target brightness interval determined by the brightness interval determining module;
a generating module, configured to generate a target image according to the at least one second frame image determined by the second frame image determining module;
the second frame image determination module is to: taking the first frame image with the ambient light brightness in a target brightness interval as the second frame image;
the luminance interval determination module is configured to: selecting an average brightness or a brightness value closest to the average brightness from the plurality of environment brightness values as an equalization value;
and determining a target brightness interval by taking the balance value as a center and a preset multiple of the total interval of the plurality of environment brightness values as an interval length, wherein the preset multiple is more than zero and less than one.
9. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the ambient brightness-based photographing method according to any one of claims 1 to 7.
10. A mobile terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the ambient brightness based photographing method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811236728.9A CN109218620B (en) | 2018-10-23 | 2018-10-23 | Photographing method and device based on ambient brightness, storage medium and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811236728.9A CN109218620B (en) | 2018-10-23 | 2018-10-23 | Photographing method and device based on ambient brightness, storage medium and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109218620A CN109218620A (en) | 2019-01-15 |
CN109218620B true CN109218620B (en) | 2021-08-27 |
Family
ID=64979746
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811236728.9A Active CN109218620B (en) | 2018-10-23 | 2018-10-23 | Photographing method and device based on ambient brightness, storage medium and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109218620B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113568688B (en) * | 2020-04-29 | 2023-06-06 | RealMe重庆移动通信有限公司 | View switching method and device, electronic equipment and storage medium |
CN113824875B (en) * | 2021-08-11 | 2023-05-09 | 北京京仪仪器仪表研究总院有限公司 | Fruit and vegetable shooting method based on modulated light source brightness interval and shooting interval |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104917976B (en) * | 2015-06-05 | 2018-08-21 | 北京大恒图像视觉有限公司 | A kind of camera automatic exposure and automatic gain regulating method |
JP6521776B2 (en) * | 2015-07-13 | 2019-05-29 | オリンパス株式会社 | Image processing apparatus, image processing method |
CN106534660B (en) * | 2015-09-11 | 2023-04-28 | 深圳中集天达空港设备有限公司 | Self-adaptive image shooting method and device |
CN105227858B (en) * | 2015-10-30 | 2019-03-05 | 维沃移动通信有限公司 | A kind of image processing method and mobile terminal |
CN106162136B (en) * | 2016-08-12 | 2018-12-07 | 惠州Tcl移动通信有限公司 | A kind of white balance calibration method, system and mobile terminal for infrared shooting |
CN106713778B (en) * | 2016-12-28 | 2019-04-23 | 上海兴芯微电子科技有限公司 | Exposal control method and device |
CN108683857A (en) * | 2018-08-16 | 2018-10-19 | Oppo广东移动通信有限公司 | Photographing optimization method and device, storage medium and terminal equipment |
-
2018
- 2018-10-23 CN CN201811236728.9A patent/CN109218620B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109218620A (en) | 2019-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3579544B1 (en) | Electronic device for providing quality-customized image and method of controlling the same | |
CN108399349B (en) | Image recognition method and device | |
CN107205125B (en) | An image processing method, device, terminal and computer-readable storage medium | |
CN110650379B (en) | Video abstract generation method and device, electronic equipment and storage medium | |
CN108989678B (en) | Image processing method and mobile terminal | |
KR102566998B1 (en) | Apparatus and method for determining image sharpness | |
CN109167893B (en) | Shot image processing method and device, storage medium and mobile terminal | |
CN108668086B (en) | Automatic focusing method and device, storage medium and terminal | |
EP3621292B1 (en) | Electronic device for obtaining images by controlling frame rate for external moving object through point of interest, and operating method thereof | |
CN109040524B (en) | Artifact removal method, device, storage medium and terminal | |
CN110059685A (en) | Word area detection method, apparatus and storage medium | |
CN109327691B (en) | Image shooting method and device, storage medium and mobile terminal | |
CN111432245B (en) | Multimedia information playing control method, device, equipment and storage medium | |
CN109639896A (en) | Obstruction detection method and device, storage medium and mobile terminal | |
CN109218621B (en) | Image processing method, device, storage medium and mobile terminal | |
CN111857793B (en) | Training method, device, equipment and storage medium of network model | |
CN111984803B (en) | Multimedia resource processing method and device, computer equipment and storage medium | |
CN113038165B (en) | Method, apparatus and storage medium for determining encoding parameter set | |
CN110839128A (en) | Photographing behavior detection method and device and storage medium | |
CN108665510B (en) | Rendering method and device of continuous shooting image, storage medium and terminal | |
CN109040729B (en) | Image white balance correction method and device, storage medium and terminal | |
CN109218620B (en) | Photographing method and device based on ambient brightness, storage medium and mobile terminal | |
CN112489006A (en) | Image processing method, image processing device, storage medium and terminal | |
CN111586279B (en) | Method, device and equipment for determining shooting state and storage medium | |
CN110677580A (en) | Shooting method, shooting device, storage medium and 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 |