CN108307125B - Image acquisition method, device and storage medium - Google Patents

Image acquisition method, device and storage medium Download PDF

Info

Publication number
CN108307125B
CN108307125B CN201810127237.4A CN201810127237A CN108307125B CN 108307125 B CN108307125 B CN 108307125B CN 201810127237 A CN201810127237 A CN 201810127237A CN 108307125 B CN108307125 B CN 108307125B
Authority
CN
China
Prior art keywords
brightness
color temperature
value
terminal
ambient light
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
CN201810127237.4A
Other languages
Chinese (zh)
Other versions
CN108307125A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810127237.4A priority Critical patent/CN108307125B/en
Publication of CN108307125A publication Critical patent/CN108307125A/en
Application granted granted Critical
Publication of CN108307125B publication Critical patent/CN108307125B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Processing Of Color Television Signals (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention discloses an image acquisition method, an image acquisition device and a storage medium; according to the embodiment of the invention, when the terminal starts a front-end camera shooting process, the screen brightness of the terminal is adjusted by detecting the ambient light brightness and the ambient light color temperature, and the light with the light supplementing color is projected to the camera shooting object through the screen, so that the color temperature can be balanced while the ambient light brightness reaches the brightness required by preset shooting, noise points and color deviation are reduced, image acquisition can be better carried out on the camera shooting object, and the image quality is improved.

Description

Image acquisition method, device and storage medium
Technical Field
The invention relates to the technical field of communication, in particular to an image acquisition method, an image acquisition device and a storage medium.
Background
With the popularization and function diversification of intelligent mobile terminals (terminals for short), more and more users prefer to use the terminals for shooting, however, because the cameras of most of the existing terminals are not equipped with light supplement lamps, if the shooting environment is dim, the shot images have the problems of too much noise and insufficient exposure, so how to improve the shooting quality in the dim environment becomes one of the concerns of people in recent years.
In order to solve the above problems, the prior art proposes a scheme for achieving a light supplement effect by increasing screen brightness. Specifically, when a user opens the camera, the ambient light brightness during current shooting is obtained, the brightness value needing to be enhanced is determined by comparing the ambient light brightness with the preset brightness required by shooting, then, the screen brightness is increased according to the brightness value needing to be enhanced, the light supplementing effect is achieved, the noise of the shot image is reduced, and the purpose of improving the image quality is achieved.
In the process of research and practice of the prior art, the inventor of the present invention found that when there is a large deviation between the color temperature of the ambient light and the white light, the image collected by the prior art has a large color deviation, and the image quality is poor.
Disclosure of Invention
Embodiments of the present invention provide an image acquisition method, an image acquisition device, and a storage medium, which can reduce noise in a dark environment, reduce color deviation of an image caused by ambient light, and improve image quality.
The embodiment of the invention provides an image acquisition method, which comprises the following steps:
when a terminal starts a front camera shooting process, detecting the ambient light brightness of the terminal;
adjusting the screen brightness of the terminal to enable the ambient light brightness to reach the brightness required by preset shooting;
Detecting the ambient light color temperature of the terminal under the brightness required by shooting;
determining a supplementary lighting color according to the ambient light color temperature, and projecting light with the supplementary lighting color to a camera object through a screen of the terminal;
and acquiring an image of the camera object through the front camera process.
An embodiment of the present invention further provides an image capturing apparatus, including:
the brightness detection unit is used for detecting the ambient light brightness of the terminal when the terminal starts a front camera shooting process;
the brightness adjusting unit is used for adjusting the screen brightness of the terminal so that the ambient light brightness reaches the brightness required by preset shooting;
the color temperature detection unit can be used for detecting the ambient light color temperature of the terminal under the brightness required by the shooting;
the color temperature adjusting unit can be used for determining a supplementary light color according to the ambient light color temperature and projecting light with the supplementary light color to a camera shooting object through a screen of the terminal;
and the acquisition unit can be used for acquiring the image of the camera object through the front camera shooting process.
Optionally, in some embodiments, the brightness adjustment unit may be specifically configured to obtain brightness of a current display window, calculate a difference between preset shooting required brightness and the ambient light brightness, obtain a first brightness difference, use the first brightness difference as an increment, and increase the brightness of the current display window, so that the ambient light brightness reaches the preset shooting required brightness.
Optionally, in some embodiments, the brightness adjustment unit may be specifically configured to obtain display brightness currently set by the terminal, calculate a difference between preset shooting required brightness and the ambient light brightness, obtain a second brightness difference, use the second brightness difference as an increment, and increase the display brightness currently set by the terminal, so that the ambient light brightness reaches the preset shooting required brightness.
Optionally, in some embodiments, the color temperature detection unit may include an acquisition subunit, an analysis subunit, and a statistics subunit, as follows:
the acquiring subunit is configured to acquire an image of a photographic object at a luminance required by the photographing, and obtain an image to be analyzed;
the analysis subunit may be configured to analyze pixels in a preset region of the image to be analyzed to determine a color temperature level of each pixel in the preset region;
and the counting subunit is used for counting the number of pixels corresponding to each color temperature level and determining the color temperature level with the largest number as the ambient light color temperature of the terminal.
Optionally, in some embodiments, the obtaining subunit may be specifically configured to, under the brightness required for shooting, project white light to a human face through a screen of the terminal, and perform real-time tracking on the human face irradiated by the white light, so as to obtain an image to be analyzed.
Optionally, in some embodiments, the analysis subunit may be specifically configured to acquire a three-primary-color RGB value of each pixel in a preset region of the image to be analyzed, calculate an R/G value and a B/G value of each pixel according to the RGB value of each pixel, and determine a color temperature level of each pixel according to the R/G value and the B/G value of each pixel.
Optionally, in some embodiments, the analysis subunit may be specifically configured to search a preset color temperature curve to obtain a color temperature interval of each color temperature level, determine the color temperature interval to which each pixel belongs according to the R/G value and the B/G value of each pixel, and determine the color temperature level of each pixel according to the color temperature interval to which each pixel belongs.
Optionally, in some embodiments, the analysis subunit may be specifically configured to obtain a three-primary-color (RGB, Red Green Blue, that is, Red, Green, and Blue, and referred to as three-primary-color) value of each pixel in a preset region of the image to be analyzed, filter the pixel whose RGB value is smaller than a preset value according to the RGB value of each pixel to obtain a filtered pixel, respectively calculate an R/G value and a B/G value of each filtered pixel according to the RGB value of each filtered pixel, and determine a color temperature level of each filtered pixel according to the R/G value and the B/G value of each filtered pixel.
Optionally, in some embodiments, the color temperature adjustment unit may include a color determination subunit and a projection subunit, as follows:
the color determination subunit may be configured to calculate a fill-in color temperature according to the ambient light color temperature, and determine a fill-in color according to the fill-in color temperature;
the projection subunit may be configured to project, to the image pickup object, light having the fill-in color through a screen of the terminal.
Optionally, in some embodiments, the color determination subunit may be specifically configured to obtain a preset mixed light color temperature and an adjusted screen brightness, and calculate a fill-in color temperature according to the mixed light color temperature, the ambient light brightness, the adjusted screen brightness, and the ambient light color temperature.
Optionally, in some embodiments, the image capturing apparatus may further include a photographing unit, as follows:
the photographing unit can be used for calling a function interface corresponding to the photographing instruction when the photographing instruction is received, acquiring the acquired image through the function interface to obtain photographing data, and generating a photo according to the photographing data.
Optionally, in some embodiments, the photographing unit may be specifically configured to perform white balance processing on the photographing data by using a gray scale method, and generate a photo according to the photographing data after the white balance processing.
In addition, the embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform the steps in any one of the image capturing methods provided by the embodiments of the present invention.
According to the embodiment of the invention, when the terminal starts a front-end camera shooting process, the screen brightness of the terminal is adjusted by detecting the ambient light brightness and the ambient light color temperature, and light with a light supplementing color is projected to a camera shooting object through the screen, so that the color temperature can be balanced while the ambient light brightness reaches the brightness required by preset shooting, and further, the image acquisition can be better carried out on the camera shooting object; because this scheme not only can strengthen the shooting ambient brightness under the dim environment, can throw the light that has the light filling colour to the object of making a video recording through the screen in addition and realize the balance of colour temperature, so, can reduce the color deviation that the ambient light caused the image when the noise under the dim environment of significantly reducing, improve image quality.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a scene schematic diagram of an image acquisition method according to an embodiment of the present invention;
FIG. 1b is a flowchart of an image capturing method according to an embodiment of the present invention;
FIG. 2a is another flowchart of an image capturing method according to an embodiment of the present invention;
fig. 2b is a schematic view of a scene of face detection in the image acquisition method according to the embodiment of the present invention;
fig. 2c is a schematic view of a scene where fill-in light is projected in the image acquisition method according to the embodiment of the present invention;
fig. 3a is a schematic structural diagram of an image capturing device according to an embodiment of the present invention;
fig. 3b is another schematic structural diagram of an image capturing device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The embodiment of the invention provides an image acquisition method, an image acquisition device and a storage medium.
The image acquisition device can be specifically integrated in a terminal, such as a mobile phone, a tablet computer or a mobile computer.
For example, taking the image capturing device as an example specifically integrated in a terminal, referring to fig. 1a, when the terminal starts a front-end camera shooting process, the terminal may detect ambient light brightness of the terminal, then adjust screen brightness of the terminal so that the ambient light brightness reaches a preset brightness required for shooting, and then, under the brightness required for shooting, detect ambient light color temperature of the terminal, determine a fill light color according to the ambient light color temperature, and project light having the fill light color to a camera object through the screen of the terminal so as to achieve color temperature balance.
For example, taking a shooting object as a human face, white light may be projected to the human face through a screen of the terminal, then the human face under the irradiation of the white light is tracked in real time, and pixels in a human face area are analyzed to determine a color temperature level of each pixel in the human face area, where the color temperature level with the largest number of pixels is the ambient light color temperature of the terminal.
The following are detailed below.
The first embodiment,
The embodiment will be described from the perspective of an image capturing device, which may be specifically integrated in a terminal and other devices, where the terminal may include a mobile phone, a tablet computer, a mobile computer, a wearable smart mobile device, and the like.
An image acquisition method comprising: when the terminal starts a front-end shooting process, the ambient light brightness of the terminal is detected, the screen brightness of the terminal is adjusted, the ambient light brightness reaches the brightness required by preset shooting, the ambient light color temperature of the terminal is detected under the brightness required by the shooting, the light supplement color is determined according to the ambient light color temperature, light with the light supplement color is projected to a shooting object through the screen of the terminal, and then the image acquisition is carried out on the shooting object through the front-end shooting process.
As shown in fig. 1b, the specific flow of the image capturing method may be as follows:
101. when the terminal starts a front camera shooting process, the ambient light brightness of the terminal is detected.
For example, specifically, when a user enters a photographing mode and turns on a front camera of the terminal, the terminal calls a front camera process and detects the ambient light brightness of the terminal; or, when the user enters the video recording mode and starts the front camera, the terminal calls the front camera process, and then detects the environmental light brightness of the terminal, and the like; for convenience of description, in the present embodiment, photographing will be taken as an example for explanation.
For example, the terminal may receive light monitoring information carrying the currently detected ambient light brightness sent by the light sensor through a preset sensor monitoring interface, and then extract the ambient light brightness from the light monitoring information.
The sensor monitoring interface can be registered in advance according to the requirements of practical application.
102. And adjusting the screen brightness of the terminal to enable the ambient light brightness to reach the brightness required by preset shooting.
The screen brightness of the terminal may be the brightness of a current display window of the terminal, or may be the display brightness currently set by the terminal (i.e., the screen brightness set by the system), and therefore, any one of the following manners may be specifically selected to adjust the screen brightness of the terminal, as follows:
(1) a first mode;
the method comprises the steps of obtaining the brightness of a current display window, calculating the difference value between the preset shooting required brightness and the environment light brightness to obtain a first brightness difference, and increasing the brightness of the current display window by taking the first brightness difference as an increment to enable the environment light brightness to reach the preset shooting required brightness.
(2) A second mode;
the method comprises the steps of obtaining the display brightness currently set by the terminal, calculating the difference value between the preset shooting required brightness and the environment light brightness to obtain a second brightness difference, and increasing the display brightness currently set by the terminal by taking the second brightness difference as an increment to enable the environment light brightness to reach the preset shooting required brightness.
It should be noted that the difference between the first manner and the second manner is that the screen brightness increased by the first manner is effective in real time and in a short time, and the screen brightness is the same as the current display window, that is, when exiting the current display window, the screen brightness will be restored to the original brightness (the screen brightness set by the system); the screen brightness increased by the second method is effective for a long time, and the screen brightness is irrelevant to the current display window, namely, when the current display window exits, the screen brightness still keeps the adjusted screen brightness.
Optionally, before adjusting the screen brightness of the terminal, it may be determined whether the ambient light brightness is lower than a preset threshold, if so, the step of adjusting the screen brightness of the terminal is executed, otherwise, if the ambient light brightness is not lower than the preset threshold, the process is ended.
103. And detecting the ambient light color temperature of the terminal under the brightness required by the shooting.
The color temperature of the ambient light of the terminal refers to the color temperature of the ambient light where the terminal is currently located. The color temperature is a unit of measurement indicating that a light ray contains a color component. Theoretically, color temperature refers to the color that an absolute black body would appear after warming from absolute zero (-273 ℃). After being heated, the black body gradually turns from black to red, turns yellow and becomes white, and finally emits blue light. When heated to a certain temperature, the light emitted by a black body contains spectral components, which are referred to as the color temperature at this temperature, measured in kelvin and marked with the symbol "K". If the light emitted from a light source has the same spectral composition as the light emitted from a black body at a certain temperature, i.e. the color of the light emitted from a 100W bulb, which is called a certain K color temperature, is the same as the color of the light emitted from an absolute black body at 2527K, then the color temperature of the light emitted from the bulb is: 2527K +273K 2800K, and so on.
The manner of detecting the color temperature of the ambient light of the terminal may be various, and for example, may specifically be as follows:
(1) and acquiring an image of the shot object under the brightness required by shooting to obtain an image to be analyzed.
For example, light of a preset color may be projected to the photographic subject through the screen of the terminal at the brightness required for the photographing, and then the photographic subject irradiated by the light of the preset color may be tracked in real time to obtain an image to be analyzed.
The preset color may be set according to a requirement of an actual application, for example, the preset color may be specifically determined according to a color of a surface of a shot object. For example, taking the shooting object as a human face as an example, since the skin surface of a person is light and is close to white, white light can be projected to the human face through a screen of the terminal, and then the human face is tracked in real time to obtain the image to be analyzed, so that the color temperature of ambient light can be analyzed based on the change of the skin color of the human face in the image to be analyzed. That is, if the photographic subject is a human face, the step "acquiring an image of the photographic subject at the brightness required for the photographing, and obtaining the image to be analyzed" may include:
And under the brightness required by the shooting, projecting white light rays to the face through the screen of the terminal, and tracking the face under the irradiation of the white light rays in real time to obtain an image to be analyzed.
(2) And analyzing pixels in a preset area of the image to be analyzed to determine the color temperature level of each pixel in the preset area.
For example, three primary colors (RGB, Red Green Blue, namely Red, Green and Blue, which are called three primary colors) of each pixel in a preset area of the image to be analyzed may be specifically obtained, an R/G value (namely, a ratio of a Red value to a Green value) and a B/G value (namely, a ratio of a Blue value to a Green value) of each pixel are respectively calculated according to the RGB values of each pixel, and a color temperature level of each pixel is determined according to the R/G value and the B/G value of each pixel.
This is because, since the R/G value and the B/G value of the color temperature in the same range are substantially in the same similar range, the color temperature can be graded in a stepwise range according to the value ranges of the R/G value and the B/G value. Wherein, each color temperature grade corresponds to a color temperature interval, and the value range of the R/G value corresponding to each color temperature interval is [ (R/G)min,(R/G)max]The value range of the B/G value corresponding to each color temperature interval is [ (B/G) min,(B/G)max]. Wherein, (R/G)min、(R/G)max、(B/G)minAnd (B/G)maxThe color temperature curve can be searched and obtained through a preset color temperature curve.
That is to say, the step of determining the color temperature interval to which each pixel belongs according to the R/G value and the B/G value of each pixel, and further determining the color temperature level of each pixel, that is, the step of "determining the color temperature level of each pixel according to the R/G value and the B/G value of each pixel" may include:
and searching a preset color temperature curve to obtain a color temperature interval of each color temperature grade, determining the color temperature interval of each pixel according to the R/G value and the B/G value of each pixel, and determining the color temperature grade of each pixel according to the color temperature interval of each pixel.
Optionally, in order to reduce the influence of noise on the color temperature calculation, the remaining pixels may be analyzed after filtering out pixels with too small RGB values. That is, before the step of "calculating R/G value and B/G value of each pixel respectively from RGB value of each pixel", the image capturing method may further include:
and filtering the pixels with the RGB values smaller than the preset value according to the RGB value of each pixel to obtain the filtered pixels.
Then, at this time, the step of "calculating R/G value and B/G value of each pixel respectively based on RGB value of each pixel" may specifically be: respectively calculating the R/G value and the B/G value of each filtered pixel according to the RGB value of each filtered pixel;
The step of determining the color temperature level of each pixel according to the R/G value and the B/G value of each pixel may specifically be: and determining the color temperature level of each filtered pixel according to the R/G value and the B/G value of each filtered pixel.
(3) And counting the number of pixels corresponding to each color temperature level, and determining the color temperature level with the largest number as the ambient light color temperature of the terminal.
For example, if 100 pixels correspond to a color temperature level of "3", 50 pixels correspond to a color temperature level of "2", and 300 pixels correspond to a color temperature level of "1", then the color temperature level of "1" may be determined as the ambient light color temperature of the terminal.
104. And determining a supplementary lighting color according to the ambient light color temperature, and projecting light with the supplementary lighting color to a camera object through a screen of the terminal.
For example, the fill-in color temperature may be specifically calculated according to the ambient light color temperature, and the fill-in color may be determined according to the fill-in color temperature.
The mode of calculating the fill-in color temperature according to the ambient light color temperature may be various, for example, a preset mixed light color temperature and an adjusted screen brightness may be obtained, and then the fill-in color temperature may be calculated according to the mixed light color temperature, the ambient light brightness, the adjusted screen brightness, and the ambient light color temperature.
Because the color temperature of natural light is about 5000K, so, in order to realize the effect of shooing under the natural light, need to make the color temperature of the mixed light of ambient light and light filling reach about 5000K, wherein, the color temperature computational formula of mixed light is:
Tmix=(Ta*Ya+Tb*Yb)/(Ya+Yb);
wherein, TmixFor mixing the colour temperature of the light, TaIs the ambient light color temperature, TbTo supplement the color temperature, YaIs the brightness of the ambient light, YbIs the adjusted screen brightness.
Therefore, the color temperature T of the fill light can be derived by the formulabThe calculation formula of (c) may be:
Tb=(Tmix*(Ya+Yb)-Ta*Ya)/Yb
that is, the step of calculating the fill-in color temperature according to the color temperature of the mixed light, the ambient light brightness, the adjusted screen brightness, and the ambient light color temperature may specifically be as follows:
calculating the sum of the ambient light brightness and the adjusted screen brightness, and calculating the product of the sum (i.e. the sum of the ambient light brightness and the adjusted screen brightness) and the color temperature of the mixed light to obtain a first value; calculating the product of the ambient light color and the ambient light brightness to obtain a second value; calculating the difference between the first value and the second value to obtain a third value; and calculating the quotient of the third value and the adjusted screen brightness to obtain the fill-in color temperature.
It should be noted that the above algorithm for calculating the fill-in color temperature is only an example, and it should be understood that other algorithms may be used to calculate the fill-in color temperature, for example, the above equation may be modified, and is not further described here.
After the light supplement color is determined, the light with the light supplement color can be projected to the camera shooting object through the screen of the terminal, for example, when the camera shooting is carried out, the light with the light supplement color is projected to a face needing to be shot, so that the environment of natural light is created, the effect of color temperature balance is achieved, and the like.
105. And acquiring an image of the camera object through the front camera process.
For example, the image of the camera object may be collected through the pre-camera process, the collected image is written into a cache of the terminal, and the collected image is displayed on a terminal screen for a user to preview, and so on.
Optionally, further operations may be performed on the acquired image, such as recording or photographing, that is, after the step "acquiring the image of the photographic object through the pre-camera process", the image acquisition method may further include:
when a photographing instruction is received, generating a photo according to the acquired image; or when a recording instruction is received, generating a video according to the acquired image. The method comprises the following specific steps:
(1) photographing;
and when a photographing instruction is received, calling a function interface corresponding to the photographing instruction, acquiring the acquired image through the function interface corresponding to the photographing instruction to obtain photographing data, and generating a photo according to the photographing data.
Optionally, in order to further eliminate the color deviation and improve the quality of the picture, before the picture is generated, white balance processing may be performed on the photographed data. That is, before the step "generating a photograph from the photographed data", the image capturing method may further include:
the shot data is subjected to white balance processing, for example, the shot data may be subjected to white balance processing by using a gray scale method, or the like.
Then, the step "generating a photo according to the photographing data" may specifically be: and generating a photo according to the shot data after the white balance processing.
Here, the white balance processing refers to adjustment of white balance. White balance is the balance of white, which means the visual response of light reflected to human eyes due to the same proportion of blue, green and red lights and a certain brightness, and the white or other colors seen by human eyes are related to the color temperature of the light source and the visual sense of human eyes besides the factors of the inherent color of the object, the reflection or transmission characteristics of the object, etc., and because human eyes have unique adaptability, we can sometimes not find the change of color temperature, therefore, it is necessary to adjust the color deviation possibly generated under the condition of different color temperatures by adjusting the white balance, so that the finally displayed image can be closer to the visual habit of human eyes.
(2) Recording a video;
and when a recording instruction is received, calling a function interface corresponding to the recording instruction, acquiring the acquired image through the function interface corresponding to the recording instruction to obtain video data, and generating a video according to the video data.
Optionally, after the photo or video is obtained, the photo or video may be further processed, such as clipping, beautifying, saving, or sharing.
Therefore, in the embodiment, when the terminal starts the front-end camera shooting process, the screen brightness of the terminal can be adjusted by detecting the ambient light brightness and the ambient light color temperature, and light with the light supplementing color is projected to the camera shooting object through the screen, so that the color temperature can be balanced while the ambient light brightness reaches the preset brightness required by shooting, and further, the image of the camera shooting object can be better acquired; because this scheme not only can strengthen the shooting ambient brightness under the dim environment, can throw the light that has the light filling colour to the object of making a video recording through the screen in addition and realize the balance of colour temperature, so, can reduce the color deviation that the ambient light caused the image when the noise under the dim environment of significantly reducing, improve image quality.
Example II,
The method described in the first embodiment is further illustrated by way of example.
In this embodiment, the image capturing apparatus is specifically integrated in a terminal, and an image capturing object, specifically a human face, is taken as an example for explanation.
As shown in fig. 2a, a specific flow of an image acquisition method may be as follows:
201. when the terminal starts a front camera shooting process, the ambient light brightness of the terminal is detected.
For example, specifically, when a user enters a photographing mode and turns on a front camera, a front camera process is called, and then the ambient light brightness of the terminal is detected; or, when the user enters the video recording mode and turns on the front camera, the front camera process may be invoked, and then the ambient light brightness of the terminal may be detected, and so on.
The manner of detecting the ambient light brightness of the terminal is various, for example, the light sensor locally equipped in the terminal may be used to detect the ambient light in real time to obtain the ambient light brightness, for example, the method may specifically be as follows:
the terminal receives light monitoring information sent by a light sensor configured locally (namely, the terminal) through a preset sensor monitoring interface, wherein the light monitoring information carries the currently detected ambient light brightness, and then the ambient light brightness is extracted from the light monitoring information.
The sensor monitoring interface may be registered in advance according to the requirements of actual applications, and is not described herein again.
202. And the terminal adjusts the screen brightness of the terminal, so that the ambient light brightness reaches the brightness required by preset shooting.
For example, the screen brightness may be increased by adjusting the brightness of the current display window or directly adjusting the display brightness currently set by the terminal (i.e., the screen brightness set by the system), and the ambient light may be increased by the screen brightness, so that the ambient light brightness may reach the brightness required by the preset shooting. The specific operation modes of increasing the screen brightness by adjusting the brightness of the current display window and increasing the screen brightness by directly adjusting the display brightness currently set by the terminal may be as follows:
(1) the first mode is as follows: the brightness of the current display window is adjusted to improve the screen brightness;
the terminal obtains the brightness of a current display window, calculates the difference value between the preset shooting required brightness and the environment light brightness to obtain a first brightness difference, and increases the brightness of the current display window by taking the first brightness difference as an increment so that the environment light brightness reaches the preset shooting required brightness.
For example, if the brightness of the current display window is 300LX (lux), the brightness required for the preset shooting is 500LX, and the ambient light brightness is 200LX, then the brightness of the current display window needs to be increased by "500 LX to 200 LX" on the basis of 300LX, that is, the brightness of the current display window is adjusted to 600LX, so as to illuminate the environment, so that the ambient light brightness can reach the brightness 500LX required for the preset shooting as much as possible.
(2) The second mode is as follows: the screen brightness is improved by directly adjusting the display brightness currently set by the terminal.
The terminal obtains the display brightness currently set by the terminal, calculates the difference value between the preset shooting required brightness and the environment light brightness to obtain a second brightness difference, and increases the display brightness currently set by the terminal by taking the second brightness difference as an increment so that the environment light brightness reaches the preset shooting required brightness.
For example, taking the brightness required for the preset shooting as 500LX and the ambient light brightness as 200LX as an example, if the display brightness currently set by the terminal (i.e. the screen brightness set by the system) is 400LX, then at this time, the display brightness needs to be increased by "500 + 200-300 LX" on the basis of 400LX, that is, the display brightness needs to be adjusted to 700LX, so as to illuminate the environment, so that the ambient light brightness can reach the brightness 500LX required for the preset shooting as much as possible, and so on.
It should be noted that the difference between the first manner and the second manner is that the screen brightness increased by the first manner is effective in real time and in a short time, and the screen brightness is the same as the current display window, that is, when exiting the current display window, the screen brightness will return to the original brightness; the screen brightness increased by the second method is effective for a long time, and the screen brightness is irrelevant to the current display window, namely, when the current display window exits, the screen brightness still keeps the adjusted screen brightness.
203. And the terminal projects white light rays to the face through the screen of the terminal under the brightness required by shooting, and the face under the irradiation of the white light rays is tracked in real time to obtain an image to be analyzed.
For example, referring to fig. 2b, when the user opens the front camera of the terminal and enters a self-photographing mode in a dark environment, on one hand, the terminal can improve the brightness of the environment by enhancing the brightness of the screen, and on the other hand, the terminal can project white light to the face of the user through the screen and track the face under the illumination of the white light in real time to obtain an image to be analyzed.
204. The terminal obtains the RGB value of each pixel in the face area of the image to be analyzed, and filters the pixels with the RGB values smaller than a preset value according to the RGB value of each pixel to obtain filtered pixels; for example, the following may be specifically mentioned:
The terminal traverses each pixel in the face area of the image to be analyzed, if a pixel with an RGB value smaller than a preset value exists, the pixel with the RGB value smaller than the preset value is filtered, and the step of traversing each pixel in the face area of the image to be analyzed is returned to be executed, if the RGB values of all the pixels are greater than or equal to the preset value, it is indicated that all the pixels with the RGB values being too small (that is, the RGB values are smaller than the preset value) have been filtered, and then, step 205 may be executed at this time.
205. The terminal respectively calculates the R/G value and the B/G value of each filtered pixel according to the RGB value of each filtered pixel, and determines the color temperature level of each filtered pixel according to the R/G value and the B/G value of each filtered pixel; for example, the following may be specifically mentioned:
the terminal respectively acquires the R value (namely the component on the R channel), the B value (namely the component on the B channel) and the G value (namely the component on the G channel) of each filtered pixel according to the RGB value of each filtered pixel, then respectively calculates the ratio of the R value to the G value of each filtered pixel according to the R value, the B value and the G value of each filtered pixel to obtain the R/G value of each filtered pixel, and calculates the ratio of the B value to the G value of each filtered pixel to obtain the B/G value of each filtered pixel.
After the R/G value and the B/G value of each filtered pixel are obtained, the terminal can search a preset color temperature curve to obtain a color temperature interval of each color temperature grade, then the color temperature interval of each pixel is determined according to the R/G value and the B/G value of each pixel, and the color temperature grade of each pixel is determined according to the color temperature interval of each pixel.
WhereinEach color temperature grade corresponds to a color temperature interval, and the value range of the R/G value corresponding to each color temperature interval is [ (R/G)min,(R/G)max]The value range of the B/G value corresponding to each color temperature interval is [ (B/G)min,(B/G)max]。
For example, if the color temperature interval of the color temperature level 1 is a color temperature interval K, the range of the R/G value corresponding to the color temperature interval K is [0.5, 1], the range of the B/G value is [0.8,1], and the R/G value of a certain pixel a is 0.6 and the B/G value is 0.9, at this time, it may be determined that the pixel a belongs to the color temperature interval K, and the color temperature level of the pixel a is the color temperature level corresponding to the color temperature interval K, that is, the color temperature level 1.
206. And the terminal counts the number of pixels corresponding to each color temperature level, and determines the color temperature level with the largest number as the ambient light color temperature of the terminal.
For example, if 100 pixels correspond to a color temperature level of "3", 50 pixels correspond to a color temperature level of "2", and 300 pixels correspond to a color temperature level of "1", then the color temperature level of "1" may be determined as the ambient light color temperature of the terminal, and so on.
207. The terminal calculates a supplementary light color temperature according to the ambient light color temperature, determines a supplementary light color according to the supplementary light color temperature, and projects light with the supplementary light color to a camera shooting object through a screen of the terminal.
The mode of calculating the fill-in color temperature according to the ambient light color temperature may be various, for example, the terminal may obtain a preset mixed light color temperature and adjusted screen brightness, and then calculate the fill-in color temperature according to the mixed light color temperature, the ambient light brightness, the adjusted screen brightness and the ambient light color temperature, which may specifically be as follows:
the terminal calculates the sum of the ambient light brightness and the adjusted screen brightness, and calculates the product of the sum (namely the sum of the ambient light brightness and the adjusted screen brightness) and the color temperature of the mixed light to obtain a first value; calculating the product of the ambient light color and the ambient light brightness to obtain a second value; calculating the difference between the first value and the second value to obtain a third value; calculating the quotient of the third value and the adjusted screen brightness to obtain the supplementary lighting color temperature; is expressed by the formula:
Tb=(Tmix*(Ya+Yb)-Ta*Ya)/Yb
wherein, TmixFor mixing the colour temperature of the light, TaIs the ambient light color temperature, TbTo supplement the color temperature, YaIs the brightness of the ambient light, YbIs the adjusted screen brightness.
It should be noted that the above algorithm for calculating the fill-in color temperature is only an example, and it should be understood that other algorithms may be used to calculate the fill-in color temperature, for example, the above equation may be modified, and is not further described here.
After the light supplement color is determined, the light with the light supplement color can be projected to the camera shooting object through the screen of the terminal, for example, as shown in fig. 2c, when a user self-shoots, the terminal can project the light with the light supplement color to a face needing to be shot so as to create an environment of natural light, achieve an effect of color temperature balance, and the like.
208. And the terminal acquires the image of the camera object through the front camera process.
For example, the image of the camera object may be collected through the pre-camera process, the collected image is written into a cache of the terminal, and the collected image is displayed on a terminal screen for a user to preview, and so on.
Optionally, the user may further operate the captured image, such as recording or taking a picture. For example, taking a photo as an example, the image capturing method may further include steps 209 to 211 as follows:
209. and when the terminal receives the photographing instruction, calling a function interface corresponding to the photographing instruction, and acquiring the acquired image through the function interface to obtain photographing data.
210. The terminal performs white balance processing on the photographing data by adopting a gray scale method; for example, the following may be specifically mentioned:
The values of each pixel in the photographing data at R, G and B channels are summed respectively, and thenCalculating to obtain the average value of all pixels on R, G and B channels, and recording as Raver、GaverAnd BaverAccording to Raver、GaverAnd BaverThe pixel gain values of the R, G and B channels are calculated, and the calculation formula may specifically be as follows:
Rgain=(Raver+Gaver+Baver)/(3*Raver);
Ggain=(Raver+Gaver+Baver)/(3*Gaver);
Bgain=(Raver+Gaver+Baver)/(3*Baver);
wherein R isgainIs the pixel gain value of the R channel, GgainIs the pixel gain value of the G channel, and BgainThe pixel gain value for the B channel.
In the formation of Rgain、Ggain、BgainThen, each pixel in the photographed data can be traversed to convert Rgain、Ggain、BgainAnd multiplying the gain values of the three channels by the R value, the G value and the B value corresponding to each pixel respectively to obtain the photographing data after white balance processing.
211. And the terminal generates a photo according to the photo data after the white balance processing.
Optionally, after the photo is obtained, the photo may be further processed, for example, cutting, beautifying, storing, or sharing may be performed, which is not described herein again.
Therefore, in the embodiment, when the terminal starts the front-end camera shooting process, the screen brightness of the terminal can be adjusted by detecting the ambient light brightness and the ambient light color temperature, and the light with the light supplementing color is projected to the camera shooting object through the screen, so that the color temperature can be balanced while the ambient light brightness reaches the preset brightness required by shooting, and further, the image of the camera shooting object can be better acquired to generate a picture; because this scheme not only can strengthen the shooting ambient brightness under the dim environment, can throw the light that has the light filling colour to the object of making a video recording through the screen in addition and realize the balance of colour temperature, so, can reduce the color deviation that the ambient light caused the image when the noise under the dim environment of significantly reducing, improve image quality. Optionally, before generating the picture, white balance processing may be performed on the photographed data to further reduce color deviation and improve image quality.
Example III,
In order to better implement the method, an embodiment of the present invention further provides an image capturing device, where the image capturing device may be specifically integrated in a terminal and the like, and the terminal may include a mobile phone, a tablet computer, a mobile computer, a wearable smart mobile device, and the like.
For example, as shown in fig. 3a, the image capturing apparatus may include a brightness detecting unit 301, a brightness adjusting unit 302, a color temperature detecting unit 303, a color temperature adjusting unit 304, and a capturing unit 305, as follows:
(1) a luminance detection unit 301;
the brightness detection unit 301 is configured to detect the ambient light brightness of the terminal when the terminal starts a front-end camera shooting process.
For example, the brightness detection unit 301 may receive light monitoring information carrying the currently detected ambient light brightness sent by the light sensor through a preset sensor monitoring interface, and then extract the ambient light brightness from the light monitoring information.
The sensor monitoring interface can be registered in advance according to the requirements of practical application.
(2) A brightness adjustment unit 302;
a brightness adjusting unit 302, configured to adjust the screen brightness of the terminal, so that the ambient light brightness reaches a brightness required by preset shooting;
The screen brightness of the terminal may be the brightness of a current display window of the terminal, or may be the display brightness currently set by the terminal (i.e., the screen brightness set by the system), and therefore, any one of the following manners may be specifically selected to adjust the screen brightness of the terminal, as follows:
the brightness adjusting unit 302 may be specifically configured to obtain brightness of a current display window, calculate a difference between preset shooting required brightness and the ambient light brightness, obtain a first brightness difference, and increase the brightness of the current display window by using the first brightness difference as an increment, so that the ambient light brightness reaches the preset shooting required brightness.
Or, the brightness adjusting unit 302 may be specifically configured to obtain the currently set display brightness of the terminal, calculate a difference between the preset shooting required brightness and the ambient light brightness, obtain a second brightness difference, and increase the currently set display brightness of the terminal by using the second brightness difference as an increment, so that the ambient light brightness reaches the preset shooting required brightness.
Optionally, before adjusting the screen brightness of the terminal, the brightness adjusting unit 302 may further perform the step of adjusting the screen brightness of the terminal if the ambient light brightness is determined to be lower than the preset threshold, otherwise, the operation is ended if the ambient light brightness is not lower than the preset threshold.
(3) A color temperature detection unit 303;
a color temperature detection unit 303, configured to detect a color temperature of ambient light of the terminal at a luminance required for the shooting;
the manner of detecting the color temperature of the ambient light of the terminal may be various, for example, the color temperature detecting unit 303 may include an obtaining subunit, an analyzing subunit, and a counting subunit, as follows:
A. acquiring a subunit;
the acquiring subunit is configured to acquire an image of the object under the brightness required by the shooting, and obtain an image to be analyzed;
for example, the obtaining sub-unit may be specifically configured to project light of a preset color to the photographic object through a screen of the terminal at the brightness required by the photographing, and then track the photographic object under the irradiation of the light of the preset color in real time to obtain the image to be analyzed.
Wherein, this preset color can be set according to practical application's demand, for example, use this shooting object as the people's face as an example, because people's skin surface is lighter, comparatively close with white, consequently, can throw white light to people's face through the screen at terminal, then, carry out real-time tracking to people's face, obtain this image of waiting to analyze to follow-up can be based on the change of the skin color of this people's face in waiting to analyze the image, come analysis ambient light colour temperature. Namely:
The acquisition subunit is specifically configured to project white light to the face through the screen of the terminal at the luminance required for the shooting, and track the face under the irradiation of the white light in real time to obtain an image to be analyzed.
B. An analysis subunit;
the analysis subunit is configured to analyze pixels in a preset region of the image to be analyzed to determine a color temperature level of each pixel in the preset region;
for example, the analysis subunit may be specifically configured to obtain RGB values of three primary colors of each pixel in a preset region of the image to be analyzed, calculate an R/G value and a B/G value of each pixel according to the RGB values of each pixel, and determine a color temperature level of each pixel according to the R/G value and the B/G value of each pixel.
Wherein, each color temperature grade corresponds to a color temperature interval, and the value range of the R/G value corresponding to each color temperature interval is [ (R/G)min,(R/G)max]The value range of the B/G value corresponding to each color temperature interval is [ (B/G)min,(B/G)max]. Wherein, (R/G)min、(R/G)max、(B/G)minAnd (B/G)maxThe color temperature curve can be searched and obtained through a preset color temperature curve.
That is to say, the color temperature interval to which each pixel belongs may be specifically determined according to the R/G value and the B/G value of each pixel, and then the color temperature level of each pixel is determined, that is:
The analysis subunit may be specifically configured to search a preset color temperature curve to obtain a color temperature interval of each color temperature level, determine a color temperature interval to which each pixel belongs according to the R/G value and the B/G value of each pixel, and determine a color temperature level of each pixel according to the color temperature interval to which each pixel belongs.
Optionally, in order to reduce the influence of noise on the color temperature calculation, the remaining pixels may be analyzed after filtering out pixels with too small RGB values. Namely:
the analysis subunit may be specifically configured to obtain a three-primary-color RGB value of each pixel in a preset region of the image to be analyzed, filter pixels whose RGB values are smaller than a preset value according to the RGB value of each pixel to obtain filtered pixels, respectively calculate an R/G value and a B/G value of each filtered pixel according to the RGB value of each filtered pixel, and determine a color temperature level of each filtered pixel according to the R/G value and the B/G value of each filtered pixel.
C. A statistics subunit;
the statistical subunit is configured to count the number of pixels corresponding to each color temperature level, and determine the color temperature level with the largest number as the ambient light color temperature of the terminal.
(4) A color temperature adjustment unit 304;
the color temperature adjusting unit 304 may be configured to determine a fill-in color according to the color temperature of the ambient light, and project light having the fill-in color to a camera object through a screen of the terminal.
For example, the color temperature adjustment unit 304 includes a color determination subunit and a projection subunit, as follows:
the color determination subunit may be configured to calculate a fill-in color temperature according to the ambient light color temperature, and determine a fill-in color according to the fill-in color temperature.
For example, the color determination subunit may be specifically configured to obtain a preset mixed light color temperature and an adjusted screen brightness, and calculate the fill-in color temperature according to the mixed light color temperature, the ambient light brightness, the adjusted screen brightness, and the ambient light color temperature, which may be specifically referred to the foregoing method embodiment and is not described herein again.
The projection subunit may be configured to project light having the fill-in color to the photographic object through a screen of the terminal.
(5) An acquisition unit 305;
the capturing unit 305 may be configured to capture an image of the imaging target through the pre-imaging process.
For example, the acquisition unit 305 may specifically acquire an image of the imaging object through the pre-imaging process, write the acquired image into a cache of the terminal, and display the acquired image on a terminal screen for a user to preview, and so on.
Optionally, the user may further operate the captured image, such as recording or taking a picture, that is, as shown in fig. 3b, the image capturing apparatus may further include a picture taking unit 306, as follows:
the photographing unit is used for generating a photo according to the acquired image when a photographing instruction is received;
and/or the photographing unit can be used for generating a video according to the acquired image when receiving the recording instruction.
For example, the photographing unit 306 may be specifically configured to, when receiving a photographing instruction, call a function interface corresponding to the photographing instruction, acquire a collected image through the function interface corresponding to the photographing instruction, obtain photographing data, and generate a photo according to the photographing data.
Optionally, in order to further eliminate the color deviation and improve the quality of the picture, before the picture is generated, white balance processing may be performed on the photographed data. Namely:
the photographing unit 306 is specifically configured to perform white balance processing on the photographing data by using a gray scale method, and generate a photo according to the photographing data after the white balance processing.
For another example, the photographing unit 306 may be specifically configured to, when receiving a recording instruction, call a function interface corresponding to the recording instruction, obtain a captured image through the function interface corresponding to the recording instruction, obtain video data, and generate a video according to the video data.
Optionally, after obtaining the photo or the video, the photo or the video may be further processed, such as performing operations of clipping, beautifying, saving, or sharing, that is, the image capturing apparatus may further include an optimizing unit, as follows:
and the optimization unit is used for performing operations such as cutting, clipping, beautifying, saving or sharing on the photos or the videos.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, in this embodiment, when the terminal starts the front-end camera shooting process, the brightness detection unit 301 detects the brightness of the ambient light, and the color temperature detection unit 303 detects the color temperature of the ambient light, then, the brightness adjustment unit 302 adjusts the screen brightness of the terminal, and the color temperature adjustment unit 304 projects light with a fill-in color to the camera shooting object through the screen, so that the color temperature can be balanced while the brightness of the ambient light reaches the brightness required by the preset shooting, and the acquisition unit 305 can better acquire images of the camera shooting object; because this scheme not only can strengthen the shooting ambient brightness under the dim environment, can throw the light that has the light filling colour to the object of making a video recording through the screen in addition and realize the balance of colour temperature, so, can reduce the color deviation that the ambient light caused the image when the noise under the dim environment of significantly reducing, improve image quality.
Example four,
Accordingly, an embodiment of the present invention further provides a terminal, as shown in fig. 4, the terminal may include Radio Frequency (RF) circuits 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a Wireless Fidelity (WiFi) module 407, a processor 408 including one or more processing cores, and a power supply 409. Those skilled in the art will appreciate that the terminal configuration shown in fig. 4 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 401 may be used for receiving and transmitting signals during a message transmission or communication process, and in particular, for receiving downlink information of a base station and then sending the received downlink information to the one or more processors 408 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 401 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 401 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The memory 402 may be used to store software programs and modules, and the processor 408 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal, etc. Further, the memory 402 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. Accordingly, the memory 402 may also include a memory controller to provide the processor 408 and the input unit 403 access to the memory 402.
The input unit 403 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in a particular embodiment, the input unit 403 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface may comprise two parts, a touch detection means 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 it to touch point coordinates, and sends the touch point coordinates to the processor 408, and can receive and execute commands from the processor 408. In addition, touch sensitive surfaces may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 403 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 404 may be used to display information input by or provided to the user and various graphical user interfaces of the terminal, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 404 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 408 to determine the type of touch event, and then the processor 408 provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 4 the touch-sensitive surface and the display panel are shown as two separate components to implement input and output functions, in some embodiments the touch-sensitive surface may be integrated with the display panel to implement input and output functions.
The terminal may also include at least one sensor 405, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or the backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal, detailed description is omitted here.
Audio circuitry 406, a speaker, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 406 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electric signal, which is received by the audio circuit 406 and converted into audio data, which is then processed by the audio data output processor 408, and then transmitted to, for example, another terminal via the RF circuit 401, or the audio data is output to the memory 402 for further processing. The audio circuitry 406 may also include an earbud jack to provide peripheral headset communication with the terminal.
WiFi belongs to short distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web page and access streaming media etc. through WiFi module 407, it provides wireless broadband internet access for the user. Although fig. 4 shows the WiFi module 407, it is understood that it does not belong to the essential constitution of the terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 408 is a control center of the terminal, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the handset. Optionally, processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor, which handles primarily the operating system, user interface, applications, etc., and a modem processor, which handles primarily the wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 408.
The terminal also includes a power source 409 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 408 via a power management system to manage charging, discharging, and power consumption via the power management system. The power supply 409 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, and the like, which will not be described herein. Specifically, in this embodiment, the processor 408 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 408 runs the application programs stored in the memory 402, thereby implementing various functions:
when the terminal starts a front-end shooting process, the ambient light brightness of the terminal is detected, the screen brightness of the terminal is adjusted, the ambient light brightness reaches the brightness required by preset shooting, the ambient light color temperature of the terminal is detected under the brightness required by the shooting, the light supplement color is determined according to the ambient light color temperature, light with the light supplement color is projected to a shooting object through the screen of the terminal, and then the image acquisition is carried out on the shooting object through the front-end shooting process.
The screen brightness of the terminal may be the brightness of the current display window of the terminal, or the display brightness currently set by the terminal (i.e., the screen brightness set by the system), that is, the screen brightness may be improved by adjusting the brightness of the current display window, and the screen brightness may also be improved by adjusting the display brightness currently set by the terminal.
For example, an image of a shooting object at a luminance required by the shooting may be acquired to obtain an image to be analyzed, pixels in a preset region of the image to be analyzed are analyzed to determine a color temperature level of each pixel in the preset region, then, the number of pixels corresponding to each color temperature level is counted, and the color temperature level with the largest number is determined as the ambient light color temperature of the terminal.
Optionally, in order to reduce the influence of noise on the color temperature calculation, the remaining pixels may be analyzed after filtering out pixels with too small RGB values. Before the R/G value and the B/G value of each pixel are respectively calculated according to the RGB value of each pixel, the pixels with the RGB values smaller than the preset value can be filtered according to the RGB value of each pixel to obtain the filtered pixels, then the R/G value and the B/G value of each filtered pixel are respectively calculated according to the RGB value of each filtered pixel, and the color temperature level of each filtered pixel is determined according to the R/G value and the B/G value of each filtered pixel.
Optionally, after the image is acquired, the acquired image may be further operated, such as recording or photographing, for details, see the foregoing embodiment, and will not be described herein again.
The above operations can be specifically implemented by referring to the foregoing method embodiments, and are not described herein again.
As can be seen from the above, when the terminal of this embodiment starts the front-end camera shooting process, the screen brightness of the terminal can be adjusted by detecting the ambient light brightness and the ambient light color temperature, and light with a light supplement color is projected to the camera shooting object through the screen, so that the color temperature can be balanced while the ambient light brightness reaches the preset brightness required for shooting, and thus image acquisition can be better performed on the camera shooting object; because this scheme not only can strengthen the shooting ambient brightness under the dim environment, can throw the light that has the light filling colour to the object of making a video recording through the screen in addition and realize the balance of colour temperature, so, can reduce the color deviation that the ambient light caused the image when the noise under the dim environment of significantly reducing, improve image quality.
Example V,
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps of any one of the image capturing methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
when the terminal starts a front-end shooting process, the ambient light brightness of the terminal is detected, the screen brightness of the terminal is adjusted, the ambient light brightness reaches the brightness required by preset shooting, the ambient light color temperature of the terminal is detected under the brightness required by the shooting, the light supplement color is determined according to the ambient light color temperature, light with the light supplement color is projected to a shooting object through the screen of the terminal, and then the image acquisition is carried out on the shooting object through the front-end shooting process.
The screen brightness of the terminal may be the brightness of the current display window of the terminal, or the display brightness currently set by the terminal (i.e., the screen brightness set by the system), that is, the screen brightness may be improved by adjusting the brightness of the current display window, and the screen brightness may also be improved by adjusting the display brightness currently set by the terminal.
For example, an image of a shooting object at a luminance required by the shooting may be acquired to obtain an image to be analyzed, pixels in a preset region of the image to be analyzed are analyzed to determine a color temperature level of each pixel in the preset region, then, the number of pixels corresponding to each color temperature level is counted, and the color temperature level with the largest number is determined as the ambient light color temperature of the terminal.
Optionally, in order to reduce the influence of noise on the color temperature calculation, the remaining pixels may be analyzed after filtering out pixels with too small RGB values. Before the R/G value and the B/G value of each pixel are respectively calculated according to the RGB value of each pixel, the pixels with the RGB values smaller than the preset value can be filtered according to the RGB value of each pixel to obtain the filtered pixels, then the R/G value and the B/G value of each filtered pixel are respectively calculated according to the RGB value of each filtered pixel, and the color temperature level of each filtered pixel is determined according to the R/G value and the B/G value of each filtered pixel.
Optionally, after the image is acquired, the acquired image may be further operated, such as recording or photographing, for details, see the foregoing embodiment, and will not be described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any image acquisition method provided by the embodiment of the present invention, the beneficial effects that can be achieved by any image acquisition method provided by the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The image acquisition method, the image acquisition device and the storage medium provided by the embodiment of the invention are described in detail, a specific example is applied in the description to explain the principle and the embodiment of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. An image acquisition method, comprising:
When a terminal starts a front camera shooting process, detecting the ambient light brightness of the terminal;
adjusting the screen brightness of the terminal to enable the ambient light brightness to reach the brightness required by preset shooting;
detecting the ambient light color temperature of the terminal under the preset brightness required by shooting;
determining a supplementary lighting color according to the ambient light color temperature, and projecting light with the supplementary lighting color to a camera object through a screen of the terminal;
acquiring an image of the camera object through the front camera process;
wherein the determining the fill-in color according to the ambient light color temperature includes:
calculating the sum of the ambient light brightness and the adjusted screen brightness, and calculating the product of the sum and the preset mixed light color temperature to obtain a first value; the preset color temperature of the mixed light is the color temperature which is achieved by the mixed light of the ambient light and the supplementary light and realizes the photographing effect under natural light;
calculating the product of the ambient light color and the ambient light brightness to obtain a second value;
calculating the difference between the first value and the second value to obtain a third value;
calculating the quotient of the third value and the adjusted screen brightness to obtain the supplementary lighting color temperature;
and determining the supplementary lighting color according to the supplementary lighting color temperature.
2. The method of claim 1, wherein the adjusting the screen brightness of the terminal so that the ambient light brightness reaches a preset brightness required for shooting comprises:
acquiring the brightness of a current display window;
calculating a difference value between the brightness required by preset shooting and the ambient light brightness to obtain a first brightness difference;
and taking the first brightness difference as an increment, and increasing the brightness of the current display window to enable the ambient light brightness to reach the brightness required by preset shooting.
3. The method of claim 1, wherein the adjusting the screen brightness of the terminal so that the ambient light brightness reaches a preset brightness required for shooting comprises:
acquiring the display brightness currently set by the terminal;
calculating a difference value between the brightness required by preset shooting and the ambient light brightness to obtain a second brightness difference;
and taking the second brightness difference as an increment, and increasing the display brightness currently set by the terminal so that the ambient light brightness reaches the brightness required by preset shooting.
4. The method of claim 1, wherein the detecting the ambient light color temperature of the terminal at the brightness required by the preset shooting comprises:
Acquiring an image of a shooting object under the brightness required by the preset shooting to obtain an image to be analyzed;
analyzing pixels in a preset area of the image to be analyzed to determine the color temperature level of each pixel in the preset area;
and counting the number of pixels corresponding to each color temperature level, and determining the color temperature level with the largest number as the ambient light color temperature of the terminal.
5. The method according to claim 4, wherein the photographic object is a human face, and the obtaining of the image of the photographic object at the brightness required by the preset shooting to obtain the image to be analyzed comprises:
under the brightness required by the preset shooting, projecting white light to the face through a screen of the terminal;
and tracking the human face under the irradiation of the white light in real time to obtain an image to be analyzed.
6. The method of claim 4, wherein analyzing pixels within a predetermined region of the image to be analyzed to determine a color temperature level of each pixel within the predetermined region comprises:
acquiring a three-primary-color RGB value of each pixel in a preset area of the image to be analyzed;
respectively calculating the R/G value and the B/G value of each pixel according to the RGB value of each pixel;
The color temperature level of each pixel is determined according to the R/G value and the B/G value of each pixel.
7. The method of claim 6, wherein determining the color temperature level of each pixel from the R/G value and the B/G value of each pixel comprises:
searching a preset color temperature curve to obtain a color temperature interval of each color temperature level;
determining a color temperature interval to which each pixel belongs according to the R/G value and the B/G value of each pixel;
and determining the color temperature level of each pixel according to the color temperature interval to which each pixel belongs.
8. The method of claim 6, wherein before calculating the R/G value and the B/G value for each pixel from the RGB values for each pixel, respectively, further comprising:
according to the RGB value of each pixel, filtering the pixels with the RGB values smaller than a preset value to obtain filtered pixels;
the R/G value and the B/G value of each pixel are respectively calculated according to the RGB value of each pixel, specifically: respectively calculating the R/G value and the B/G value of each filtered pixel according to the RGB value of each filtered pixel;
the determining the color temperature level of each pixel according to the R/G value and the B/G value of each pixel specifically comprises: and determining the color temperature level of each filtered pixel according to the R/G value and the B/G value of each filtered pixel.
9. The method according to any one of claims 1 to 8, wherein after the image acquisition of the image pickup object by the pre-image pickup process, the method further comprises:
when a photographing instruction is received, calling a function interface corresponding to the photographing instruction;
acquiring the acquired image through the function interface to obtain photographing data;
and generating a photo according to the photographing data.
10. The method of claim 9, wherein before generating the photograph based on the photographing data, further comprising:
carrying out white balance processing on the photographing data by adopting a gray scale method;
the generating of the photo according to the photographing data specifically comprises: and generating a photo according to the shot data after the white balance processing.
11. An image acquisition apparatus, comprising:
the brightness detection unit is used for detecting the ambient light brightness of the terminal when the terminal starts a front camera shooting process;
the brightness adjusting unit is used for adjusting the screen brightness of the terminal so that the ambient light brightness reaches the brightness required by preset shooting;
the color temperature detection unit is used for detecting the ambient light color temperature of the terminal under the preset brightness required by shooting;
The color temperature adjusting unit is used for calculating the sum of the ambient light brightness and the adjusted screen brightness and calculating the product of the sum and the color temperature of the preset mixed light to obtain a first value; the preset color temperature of the mixed light is the color temperature which is achieved by the mixed light of the ambient light and the supplementary light and realizes the photographing effect under natural light; calculating the product of the ambient light color and the ambient light brightness to obtain a second value; calculating the difference between the first value and the second value to obtain a third value; calculating the quotient of the third value and the adjusted screen brightness to obtain the supplementary lighting color temperature; determining a supplementary lighting color according to the supplementary lighting color temperature, and projecting light with the supplementary lighting color to a camera object through a screen of the terminal;
and the acquisition unit is used for acquiring the image of the camera object through the front camera process.
12. A storage medium storing a plurality of programs adapted to be loaded by a processor for performing the steps of the image capturing method according to any one of claims 1 to 10.
CN201810127237.4A 2018-02-08 2018-02-08 Image acquisition method, device and storage medium Active CN108307125B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810127237.4A CN108307125B (en) 2018-02-08 2018-02-08 Image acquisition method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810127237.4A CN108307125B (en) 2018-02-08 2018-02-08 Image acquisition method, device and storage medium

Publications (2)

Publication Number Publication Date
CN108307125A CN108307125A (en) 2018-07-20
CN108307125B true CN108307125B (en) 2021-10-08

Family

ID=62864596

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810127237.4A Active CN108307125B (en) 2018-02-08 2018-02-08 Image acquisition method, device and storage medium

Country Status (1)

Country Link
CN (1) CN108307125B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023214927A1 (en) * 2022-05-04 2023-11-09 Pd Group Ab Improved user appearance in workstation applications

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109255331B (en) * 2018-09-18 2019-08-09 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN109600606B (en) * 2018-11-30 2019-12-27 深圳市华星光电半导体显示技术有限公司 Method for identifying single tone image
CN111510636B (en) * 2019-01-30 2021-07-09 华为技术有限公司 Method and device for acquiring brightness evaluation value and computer storage medium
CN110120021B (en) 2019-05-05 2021-04-09 腾讯科技(深圳)有限公司 Image brightness adjusting method and device, storage medium and electronic device
WO2021016789A1 (en) * 2019-07-29 2021-02-04 深圳市大疆创新科技有限公司 Image photographing method, photographing device, mobile terminal, and medium
CN110808002A (en) * 2019-11-28 2020-02-18 北京迈格威科技有限公司 Screen display compensation method and device and electronic equipment
CN110969981B (en) * 2019-12-30 2023-06-13 维沃移动通信有限公司 Screen display parameter adjusting method and electronic equipment
CN111131720A (en) * 2019-12-30 2020-05-08 惠州视维新技术有限公司 Television control method, television and storage medium
CN111698409A (en) * 2020-06-23 2020-09-22 韶关市启之信息技术有限公司 Indoor photographing light dimming method
CN111918047A (en) * 2020-07-27 2020-11-10 Oppo广东移动通信有限公司 Photographing control method and device, storage medium and electronic equipment
CN112188111B (en) 2020-09-23 2023-09-01 北京小米移动软件有限公司 Photographing method and device, terminal and storage medium
CN112561906A (en) * 2020-12-24 2021-03-26 百果园技术(新加坡)有限公司 Image processing method, device, equipment and medium
CN114025144B (en) * 2021-09-29 2024-02-06 浙江大华技术股份有限公司 White balance gain adjustment method, electronic device, and computer-readable storage medium
CN116453457B (en) * 2023-06-16 2023-09-05 广东保伦电子股份有限公司 Color correction method and system for LED display screen

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554413A (en) * 2016-02-15 2016-05-04 广东欧珀移动通信有限公司 Screen light compensation photographing method and device, and mobile terminal
CN106899768A (en) * 2017-03-22 2017-06-27 广东小天才科技有限公司 A kind of terminal photographic method and device
JP6196882B2 (en) * 2013-11-08 2017-09-13 オリンパス株式会社 Multi-area white balance control device, multi-area white balance control method, multi-area white balance control program, computer recording multi-area white balance control program, multi-area white balance image processing device, multi-area white balance image processing method, multi-area White balance image processing program, computer recording multi-area white balance image processing program, and imaging apparatus provided with multi-area white balance image processing device
CN107277388A (en) * 2017-07-27 2017-10-20 青岛海信移动通信技术股份有限公司 Mobile terminal and its light compensation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6196882B2 (en) * 2013-11-08 2017-09-13 オリンパス株式会社 Multi-area white balance control device, multi-area white balance control method, multi-area white balance control program, computer recording multi-area white balance control program, multi-area white balance image processing device, multi-area white balance image processing method, multi-area White balance image processing program, computer recording multi-area white balance image processing program, and imaging apparatus provided with multi-area white balance image processing device
CN105554413A (en) * 2016-02-15 2016-05-04 广东欧珀移动通信有限公司 Screen light compensation photographing method and device, and mobile terminal
CN106899768A (en) * 2017-03-22 2017-06-27 广东小天才科技有限公司 A kind of terminal photographic method and device
CN107277388A (en) * 2017-07-27 2017-10-20 青岛海信移动通信技术股份有限公司 Mobile terminal and its light compensation method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于色温估计自动白平衡算法研究与实现;王敏;《中国优秀硕士学位论文全文数据库》;20120815;论文第29-33页 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023214927A1 (en) * 2022-05-04 2023-11-09 Pd Group Ab Improved user appearance in workstation applications

Also Published As

Publication number Publication date
CN108307125A (en) 2018-07-20

Similar Documents

Publication Publication Date Title
CN108307125B (en) Image acquisition method, device and storage medium
US11330194B2 (en) Photographing using night shot mode processing and user interface
CN107438163B (en) Photographing method, terminal and computer readable storage medium
CN109191410B (en) Face image fusion method and device and storage medium
TWI658433B (en) Method and device of image blurring, computer reading storage medium and computer equipment
CN107451979B (en) Image processing method, device and storage medium
CN107302663B (en) Image brightness adjusting method, terminal and computer readable storage medium
CN107566752B (en) Shooting method, terminal and computer storage medium
CN107124555B (en) Method and device for controlling focusing, computer equipment and computer readable storage medium
US11546531B2 (en) Camera assembly, image acquisition method, and mobile terminal
KR102263537B1 (en) Electronic device and control method of the same
JP2016531362A (en) Skin color adjustment method, skin color adjustment device, program, and recording medium
CN107995437B (en) Photo shooting and lighting method and mobile terminal
CN108200352B (en) Method, terminal and storage medium for adjusting picture brightness
CN107241552B (en) Image acquisition method, device, storage medium and terminal
US20190385340A1 (en) Method, device and system for identifying light spot
CN108040209B (en) Shooting method and mobile terminal
CN108200421B (en) White balance processing method, terminal and computer readable storage medium
CN109348137B (en) Mobile terminal photographing control method and device, mobile terminal and storage medium
CN108040204B (en) Image shooting method and device based on multiple cameras and storage medium
CN109151428A (en) automatic white balance processing method, device and computer storage medium
CN108184105A (en) A kind of method, apparatus and computer readable storage medium for adjusting brightness
CN110177207B (en) Backlight image shooting method, mobile terminal and computer readable storage medium
CN105791790A (en) Image processing method and apparatus
CN106982327A (en) Image processing method and device

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