CN109068116B - Image processing method and device based on supplementary lighting, mobile terminal and storage medium - Google Patents

Image processing method and device based on supplementary lighting, mobile terminal and storage medium Download PDF

Info

Publication number
CN109068116B
CN109068116B CN201811014395.5A CN201811014395A CN109068116B CN 109068116 B CN109068116 B CN 109068116B CN 201811014395 A CN201811014395 A CN 201811014395A CN 109068116 B CN109068116 B CN 109068116B
Authority
CN
China
Prior art keywords
color
image data
gain
component
target component
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
CN201811014395.5A
Other languages
Chinese (zh)
Other versions
CN109068116A (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.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201811014395.5A priority Critical patent/CN109068116B/en
Publication of CN109068116A publication Critical patent/CN109068116A/en
Application granted granted Critical
Publication of CN109068116B publication Critical patent/CN109068116B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • 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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Landscapes

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

Abstract

The embodiment of the invention provides an image processing method, an image processing device, a mobile terminal and a storage medium based on supplementary lighting, wherein the method comprises the following steps: when the camera is started, displaying white ground color image data in the screen to emit light rays with set color temperature; reading setting data in a designated storage area, wherein the setting data is color gain set for the color temperature of the screen; calling the camera to acquire candidate image data under the light of the color temperature; and correcting the colors of the candidate image data according to the color gain to obtain target image data. And a corresponding color gain is set for the color temperature of the screen, so that the color deviation caused by the color temperature difference of the screen can be corrected, the color adjustment for the personalized difference of the screen is realized, and the color temperature of the collected image data is kept normal.

Description

Image processing method and device based on supplementary lighting, mobile terminal and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an image processing method and apparatus based on supplementary lighting, a mobile terminal, and a storage medium.
Background
With the development of science and technology, mobile terminals such as mobile phones and tablet computers have higher and higher utilization rate in various aspects such as work, study and daily communication of people.
At present, in order to ensure the authenticity of image data, a corresponding color gain is set for a camera, and the color component of the acquired image data is corrected.
However, in a scene such as a self-timer shot by using the mobile terminal, in addition to the light supplement by using the front flash, a white image can be displayed on the screen to enhance the brightness to several times of the maximum brightness, so that the light supplement lamp is used, and at this time, the color of the image data collected under the light supplement of the screen often deviates.
Disclosure of Invention
The embodiment of the invention provides an image processing method and device based on light supplement, a mobile terminal and a storage medium, and aims to solve the problem of color deviation of image data caused by light supplement of a screen.
According to an aspect of the present invention, there is provided an image processing method based on supplementary lighting, applied in a mobile terminal, wherein the mobile terminal has a camera and a screen with the same orientation, the method comprising:
when the camera is started, displaying white ground color image data in the screen to emit light rays with set color temperature;
reading setting data in a designated storage area, wherein the setting data is color gain set for the color temperature of the screen;
calling the camera to acquire candidate image data under the light of the color temperature;
and correcting the colors of the candidate image data according to the color gain to obtain target image data.
Optionally, the method further comprises:
in the test box, starting the camera, and displaying white ground color image data on the screen to emit light rays with set color temperature to the test card;
under the light of the color temperature, calling the camera to collect and correct image data for the test card;
color gains are calculated from the corrected image data.
Optionally, the calculating color gain from the corrected image data includes:
counting the total color level of each color component in the corrected image data, wherein the color component comprises a red component, a green component and a blue component;
determining a first target component and a second target component from the color components based on the total color level, wherein the first target component is the color component with the highest total color level, and the second target component is the color components except the first target component;
setting a color gain of the first color component as a reference color gain;
calculating a tone scale coefficient based on a total tone scale number of the first target component and a total tone scale number of the second target component, the tone scale coefficient being greater than 1;
the tone scale coefficient is configured for the reference color gain as the color gain of the second target component.
Optionally, the method further comprises:
in the test box, starting the camera, and displaying white ground color image data on the screen to emit light with set color temperature to the test card;
under the light of the color temperature, calling the camera to collect and detect image data for the test card;
correcting the color of the detected image data according to the color gain to obtain verification image data;
comparing the verification image data with the correction image data to verify the validity of the color gain.
Optionally, the comparing the verification image data with the correction image data to verify the effectiveness of the color gain comprises:
calculating a first color deviation value of the corrected image data;
calculating a second color deviation value of the verification image data;
judging whether the second color deviation value is smaller than the first color deviation value;
if yes, determining that the color gain is effective;
if not, determining that the color gain is invalid.
Optionally, the calculating a first color deviation value of the corrected image data includes:
calculating the variance of the color components in the corrected image data as a first color deviation value;
the calculating a second color deviation value of the verification image data includes:
and calculating the variance of the color components in the verification image data as a second color deviation value.
According to another aspect of the present invention, there is provided an image processing apparatus based on supplementary lighting, applied in a mobile terminal having a camera and a screen facing the same direction, the apparatus comprising:
the camera light supplement module is used for displaying white ground color image data in the screen when the camera is started so as to emit light rays with set color temperature;
the color gain reading module is used for reading set data in a designated storage area, wherein the set data is color gain set aiming at the color temperature of the screen;
the candidate image data acquisition module is used for calling the camera to acquire candidate image data under the light of the color temperature;
and the candidate image data correction module is used for correcting the color of the candidate image data according to the color gain to obtain target image data.
Optionally, the method further comprises:
the correction light supplement module is used for starting the camera in the test box and displaying white ground color image data on the screen so as to emit light with set color temperature to the test card;
the corrected image data acquisition module is used for calling the camera to acquire corrected image data for the test card under the light of the color temperature;
and the color gain calculation module is used for calculating color gain according to the corrected image data.
Optionally, the color gain calculation module includes:
the total color rank counting submodule is used for counting the total color rank of each color component in the corrected image data, and the color components comprise a red component, a green component and a blue component;
a component distinguishing submodule, configured to determine a first target component and a second target component from the color components based on the total gradation number, where the first target component is a color component with a highest total gradation number, and the second target component is another color component except the first target component;
a reference color gain setting sub-module for setting the color gain of the first color component as a reference color gain;
a color gradation coefficient calculation sub-module, configured to calculate a color gradation coefficient based on a total color gradation number of the first target component and a total color gradation number of the second target component, where the color gradation coefficient is greater than 1;
and the tone scale coefficient configuration sub-module is used for configuring the tone scale coefficient for the reference color gain as the color gain of the second target component.
Optionally, the method further comprises:
the verification light supplementing module is used for starting the camera in the test box and displaying white ground color image data on the screen so as to emit light with set color temperature to the test card;
the detection image data acquisition module is used for calling the camera to acquire detection image data for the test card under the light of the color temperature;
the detection image data correction module is used for correcting the color of the detection image data according to the color gain to obtain verification image data;
and the image data comparison module is used for comparing the verification image data with the correction image data so as to verify the effectiveness of the color gain.
Optionally, the image data comparison module comprises:
the first color deviation value calculating submodule is used for calculating a first color deviation value of the corrected image data;
the second color deviation value calculating submodule is used for calculating a second color deviation value of the verification image data;
the color deviation value judgment sub-module is used for judging whether the second color deviation value is smaller than the first color deviation value; if yes, calling an effective determination submodule, and if not, calling an ineffective determination submodule;
an effective determination submodule for determining that the color gain is effective;
and the invalidation determining submodule is used for determining that the color gain is invalid.
Optionally, the first color deviation value calculating sub-module includes:
a first variance calculating unit for calculating a variance of color components in the corrected image data as a first color deviation value;
the second color deviation value calculation sub-module includes:
and a second variance calculating unit for calculating a variance of the color components in the verification image data as a second color deviation value.
According to another aspect of the present invention, there is provided a mobile terminal, comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the fill light-based image processing method.
According to another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the fill-in-light based image processing method.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, when the camera is started, white ground color image data is displayed in the screen to emit light with set color temperature, the color gain set for the color temperature of the screen is read in the designated storage area, the camera is called to collect candidate image data under the light with the color temperature, the color of the candidate image data is corrected according to the color gain to obtain target image data, the corresponding color gain is set for the color temperature of the screen, the color deviation caused by the color temperature difference of the screen can be corrected, the color adjustment for the personalized difference of the screen is realized, and the color temperature of the collected image data is kept normal.
Drawings
Fig. 1 is a flowchart illustrating steps of a light supplement-based image processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another fill-in light-based image processing method according to an embodiment of the invention;
fig. 3 is a block diagram of an image processing apparatus based on fill-in light according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an image processing method based on supplementary lighting according to an embodiment of the present invention is shown, and specifically may include the following steps:
and 101, when the camera shooting is started, displaying white ground color image data in the screen to emit light with set color temperature.
In a specific implementation, the embodiment of the present invention may be applied to a mobile terminal, for example, a mobile phone, a tablet computer, a wearable device (such as VR (Virtual Reality) glasses, a VR helmet, a smart watch), and the like, which is not limited in this respect.
The mobile terminal is provided with one or more cameras (cameras), such as a dual Camera and a triple Camera, and generally includes a Lens (Lens), a base (Holder), an infrared filter (IR), an Image Sensor (Sensor), an Image Signal Processing (ISP), and a circuit board, and is configured to collect Image data.
Furthermore, the camera may be disposed on the back of the mobile terminal (also referred to as a rear camera), or disposed on the front of the mobile terminal (also referred to as a front camera) and oriented in the same direction as the screen, which is not limited in the embodiments of the present invention.
The operating system of the mobile terminal includes Android, IOS, Windows Phone, Windows, and the like, and can support running of various camera-tunable applications, such as a camera application, a browser, a shopping application, an instant messaging application, and the like, and call the camera to perform operations such as photographing, recording, scanning a two-dimensional code, and the like.
In scenes such as shooting (shooting for a user, which can be called self-shooting), face recognition and the like, if the mobile terminal receives a starting instruction of the front camera, the front camera can be started to acquire image data to be executed, and meanwhile (especially during exposure), the screen can be driven to display white ground color image data, the brightness can be improved, so that light with set color temperature is emitted, and light supplementing operation is performed.
The starting instruction of the camera refers to an instruction for starting the camera, and a user can trigger the starting instruction of the camera by clicking a camera application or pressing a designated physical key and the like.
It should be noted that the color temperature is a scale (unit is kelvin K) representing the light color of the light source, for a user, the color temperature is changed by human eyes, and for a mobile terminal, due to a limitation of a production process, for the same type of mobile terminal, a difference between the color temperature of the same model screen and a standard color temperature by a certain value (for example, 2000K) is also considered to be in accordance with a hardware index, that is, the difference between the color temperatures of the same type of mobile terminal and the same model screen may be large, which may cause a color deviation of the acquired image data to be obvious.
That is, under the same standard (for example, displaying a white picture, etc.), the color temperature of the light emitted by the mobile terminal and the screen of the same model may have a deviation.
In step 102, the setting data is read from the designated storage area.
Wherein the setting data is a color gain set for a color temperature of the screen.
By applying the embodiment of the invention, the corresponding color gain can be set aiming at the color temperature of the light emitted by the screen of the current mobile terminal in advance, and is used for balancing the color components of the image data collected under the light of the color temperature.
The color gain can be used as setting data for scenes such as self-timer shooting and face recognition, and is stored in a designated storage area, such as a diag partition, and after the set light emitted by the screen is detected, the color gain can be read from the designated storage area and written into the ISP.
And 103, calling the camera to acquire candidate image data under the light of the color temperature.
In practical application, light of a given color temperature emitted by a screen is irradiated on a SCENE (SCENE), the SCENE (SCENE) emits the light, an optical image generated by a Lens (Lens) of a camera is projected on the surface of an image Sensor (Sensor), then the optical image is converted into an electric signal, the electric signal is converted into a digital image signal after A/D (analog-to-digital conversion), and the digital image signal is compressed and converted into a specific image file as candidate image data in a digital signal processing chip (DSP) or a coding library.
And 104, correcting the color of the candidate image data according to the color gain to obtain target image data.
For candidate image data collected by a camera under light emitted by a screen, the color of the candidate image data can be corrected in an ISP (internet service provider) according to the color gain set for the light of the screen, namely, the color component of each pixel point is multiplied by the corresponding color gain, so that the target image data with the color recovered to the normal color temperature is obtained.
Further, the color gain may include a red gain R _ gain, a green gain G _ gain, and a blue gain B _ gain, and the color of the candidate image data includes a red component R, a green component G, and a blue component B.
Multiplying the red component R of each pixel point by a red gain R _ gain, multiplying the green component G by a green gain G _ gain, and multiplying the blue component B by a blue gain B _ gain.
In the embodiment of the invention, when the camera is started, white ground color image data is displayed in the screen to emit light with set color temperature, the color gain set for the color temperature of the screen is read in the designated storage area, the camera is called to collect candidate image data under the light with the color temperature, the color of the candidate image data is corrected according to the color gain to obtain target image data, the corresponding color gain is set for the color temperature of the screen, the color deviation caused by the color temperature difference of the screen can be corrected, the color adjustment for the personalized difference of the screen is realized, and the color temperature of the collected image data is kept normal.
Referring to fig. 2, a flowchart illustrating steps of another light supplement-based image processing method according to an embodiment of the present invention is shown, and specifically may include the following steps:
step 201, in the test box, starting the camera, and displaying white ground color image data on the screen to emit light with a set color temperature to the test card.
Step 202, under the light of the color temperature, calling the camera to collect and correct image data for the test card.
Step 203, calculating color gain according to the corrected image data.
Before the mobile terminal leaves the factory, the color gain may be calculated for the color temperature of its screen.
Further, the task inspector may issue a first attribute value, such as flash, wb, correct, 1, to the mobile terminal, and place the mobile terminal in a test box.
The inner wall of the test box is pure black, and a test card is placed, wherein the red component R, the green component G and the blue component B of the test card are the same, such as an 18% gray card, and are used as standard colors during photometry, and the exposure under the luminous environment is equal to the average value of the exposure of various colors under the luminous environment (namely, the accurate exposure).
And the mobile terminal reads the first attribute value and executes the operation of calculating the color gain.
At the moment, the mobile terminal can start the front camera to acquire image data and drive the screen to display white image data, so that light with set color temperature is emitted to the test card to perform light supplementing operation.
Under the condition that light of the color temperature is used for supplementing light to the test card, the front-facing camera acquires image data as correction image data.
The color of the corrected image data is analyzed to calculate a color gain suitable for the color temperature of the screen, and stored to a designated storage area, such as a diag partition, as setting data used in scenes of self-timer shooting, face recognition, and the like.
In one embodiment of the present invention, step 203 may comprise the sub-steps of:
and a substep S11 of counting the total color level of each color component in the corrected image data.
In a specific implementation, the color components are typically divided into a plurality of levels, e.g., 0-255, and the total number of levels of the individual color components is obtained by cumulatively correcting the levels of the individual color components for each pixel in the image data.
The color components include a red component R, a green component G, and a blue component B.
And a sub-step S12 of determining a first target component and a second target component from the color components based on the total number of gradations.
The first target component is a color component with the highest total color level number, and the second target component is other color components except the first target component.
The sub-step S13 sets the color gain of the first color component as a reference color gain.
And a substep S14 of calculating a gradation coefficient based on the total gradation number of the first target component and the total gradation number of the second target component.
The sub-step S15 of configuring the tone scale coefficient for the reference color gain as the color gain of the second target component.
For the most-proportioned color component (i.e., the first target component), its color gain may be set to the reference color gain, such as 1.
For the color components with less proportion (i.e. the second target component), the total color level number can be compared with the total color level number of the first target component, so as to calculate the color level coefficient, wherein the color level coefficient is greater than 1.
And configuring the reference color gain with a color level coefficient so that the color gain of the second target component is greater than that of the first target component due to the color level coefficient being greater than 1, thereby increasing the color components of the second target component and balancing the ratio of the color components.
In one example, for a camera using a certain platform chip (e.g., DSP, ISP):
if the total color rank of the red color component R is the highest, the color gain of each color component can be calculated as follows:
R_gain=Basic_gain
B_gain=((r+b)2b)*Basic_gain
G_gain=((r+g)2g)*Basic_gain
if the total gradation number of the green color component G is the highest, the color gain of each color component can be calculated as follows:
G_gain=Basic_gain
R_gain=((g+r)2r)*Basic_gain
B_gain=((g+b)2b)*Basic_gain
if the total color rank of the blue component B is the highest, the color gain of each color component can be calculated as follows:
B_gain=Basic_gain
G_gain=((b+g)2g)*Basic_gain
R_gain=((b+r)2r)*Basic_gain
wherein, Basic _ gain is the reference color gain, R is the total color level of the red component R, G is the total color level of the green component G, and B is the total color level of the blue component B.
In the embodiment of the invention, the screen is driven to emit light with set color temperature to the test card in the test box, the corrected image data is collected for the test card under the light with the color temperature, the color gain is calculated according to the corrected image data, and the color temperature consistency of the collected image data can be ensured through the corresponding color gain at the position of the screen light supplement test calculation on the basis of not increasing the hardware consistency control cost.
And 204, starting the camera in the test box, and displaying white ground color image data on the screen to emit light with set color temperature to the test card.
Step 205, under the light of the color temperature, calling the camera to collect and detect image data for the test card.
Step 206, correcting the color of the detected image data according to the color gain to obtain verification image data.
Step 207, comparing the verification image data with the correction image data to verify the effectiveness of the color gain.
Before the mobile terminal leaves the factory, the validity of the color gain can be verified with respect to the color temperature of its screen.
Further, the task inspector may issue a second attribute value, such as flash, wb, correct, 2, to the mobile terminal, and place the mobile terminal in a test box.
The test chamber is black and has a test card, such as 18% gray card, disposed on its inner wall.
It should be noted that, in the production line, the test box and the test card used for calculating the color gain are at least the same type as the test box and the test card used for verifying the validity of the color gain.
And the mobile terminal reads the second attribute value and executes the operation of verifying the validity of the color gain.
At the moment, the mobile terminal can start the front camera to acquire image data and drive the screen to display white image data, so that light with set color temperature is emitted to the test card to perform light supplementing operation.
Under the condition that light of the color temperature is used for supplementing light to the test card, the front-facing camera collects image data to serve as detection image data.
After detecting that the screen emits the set light, the color gain can be read from the designated storage area and written into the ISP.
In the ISP, the color of the detected image data is corrected according to the previously calculated color gain, i.e., the color component of each pixel is multiplied by the corresponding color gain, thereby obtaining the verification image data.
Comparing colors between the corrected image data before the correction color and the verification image data after the correction color, thereby verifying the validity of the color gain.
If the color gain is valid, the operation of setting the color gain for the color temperature of the screen may be ended.
If the color gain is not effective, the color gain stored in the designated area may be cleared, and the operation of setting the color gain for the color temperature of the screen may be performed again (i.e., steps 201 to 207 may be performed again).
In one embodiment of the present invention, step 207 may comprise the following sub-steps:
and a sub-step S21 of calculating a first color deviation value of the corrected image data.
In a theoretical case, the balance between the color components can ensure that the color of the image data is true, i.e., the total number of color levels between the red component R, the green component G, and the blue component B is equal.
For the corrected image data before correcting colors, a first color deviation value may be calculated.
The first color deviation value may refer to a degree to which an actual color in the corrected image data deviates from a standard color (balance between color components).
In one example, a variance of color components in the corrected image data may be calculated as the first color deviation value.
And a sub-step S22 of calculating a second color deviation value of the verification image data.
For the verification image data after color correction, a second color deviation value may be calculated.
The first person color deviation value may refer to a degree of deviation of an actual color in the verification image data from a standard color (balance between color components).
In one example, the variance of the color components in the verification image data may be calculated as the second color deviation value.
The substep S23, determining whether the second color deviation value is smaller than the first color deviation value; if yes, go to substep S24, otherwise go to substep S25.
And a sub-step S24 of determining that the color gain is valid.
And a sub-step S25 of determining that the color gain is invalid.
The second color deviation value after the color correction is compared with the first color deviation value before the color correction.
If the second color deviation value is less than the first color deviation value, indicating that the color deviation is reduced, the color gain may be considered valid.
Further, a threshold value may be set on the basis that the second color deviation value is smaller than the first color deviation value, and the color gain is considered to be valid if the second color deviation value is smaller than the threshold value.
If the second color deviation value is greater than the first color deviation value, indicating that the color deviation is not decreasing, the color gain may be considered invalid.
In the embodiment of the invention, in the test box, the screen is driven to emit light with set color temperature to the test card, under the light with the color temperature, the test card is collected with detection image data, the color of the detection image data is corrected according to the color gain, verification image data is obtained, the verification image data is compared with the correction image data to verify the effectiveness of the color gain, the color gain can be ensured to be effective, and the color deviation of the collected image data during screen light supplement can be corrected.
And step 208, when the camera is started, displaying white ground color image data in the screen to emit light with set color temperature.
In step 209, the setting data is read from the designated memory area.
Wherein the setting data is a color gain set for a color temperature of the screen.
And step 210, calling the camera to acquire candidate image data under the light of the color temperature.
Step 211, correcting the color of the candidate image data according to the color gain to obtain the target image data.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a structure of an image processing apparatus based on supplementary lighting according to an embodiment of the present invention is shown, and is applied to a mobile terminal, where the mobile terminal has a camera and a screen with the same orientation, and the apparatus may specifically include the following modules:
the camera light supplement module 301 is configured to display white ground color image data in the screen when the camera is started, so as to emit light of a set color temperature;
a color gain reading module 302 for reading setting data in a designated storage area, the setting data being a color gain set for a color temperature of the screen;
the candidate image data acquisition module 303 is configured to invoke the camera to acquire candidate image data under the light of the color temperature;
and a candidate image data correction module 304, configured to correct colors of the candidate image data according to the color gains to obtain target image data.
In one embodiment of the present invention, further comprising:
the correction light supplement module is used for starting the camera in the test box and displaying white ground color image data on the screen so as to emit light with set color temperature to the test card;
the corrected image data acquisition module is used for calling the camera to acquire corrected image data for the test card under the light of the color temperature;
and the color gain calculation module is used for calculating color gain according to the corrected image data.
In one embodiment of the present invention, the color gain calculation module includes:
the total color rank counting submodule is used for counting the total color rank of each color component in the corrected image data, and the color components comprise a red component, a green component and a blue component;
a component distinguishing submodule, configured to determine a first target component and a second target component from the color components based on the total gradation number, where the first target component is a color component with a highest total gradation number, and the second target component is another color component except the first target component;
a reference color gain setting sub-module for setting the color gain of the first color component as a reference color gain;
a color gradation coefficient calculation sub-module, configured to calculate a color gradation coefficient based on a total color gradation number of the first target component and a total color gradation number of the second target component, where the color gradation coefficient is greater than 1;
and the tone scale coefficient configuration sub-module is used for configuring the tone scale coefficient for the reference color gain as the color gain of the second target component.
In one embodiment of the present invention, further comprising:
the verification light supplementing module is used for starting the camera in the test box and displaying white ground color image data on the screen so as to emit light with set color temperature to the test card;
the detection image data acquisition module is used for calling the camera to acquire detection image data for the test card under the light of the color temperature;
the detection image data correction module is used for correcting the color of the detection image data according to the color gain to obtain verification image data;
and the image data comparison module is used for comparing the verification image data with the correction image data so as to verify the effectiveness of the color gain.
In one embodiment of the present invention, the image data comparison module includes:
the first color deviation value calculating submodule is used for calculating a first color deviation value of the corrected image data;
the second color deviation value calculating submodule is used for calculating a second color deviation value of the verification image data;
the color deviation value judgment sub-module is used for judging whether the second color deviation value is smaller than the first color deviation value; if yes, calling an effective determination submodule, and if not, calling an ineffective determination submodule;
an effective determination submodule for determining that the color gain is effective;
and the invalidation determining submodule is used for determining that the color gain is invalid.
In one example of the embodiment of the present invention, the first color bias value calculating sub-module includes:
a first variance calculating unit for calculating a variance of color components in the corrected image data as a first color deviation value;
the second color deviation value calculation sub-module includes:
and a second variance calculating unit for calculating a variance of the color components in the verification image data as a second color deviation value.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In the embodiment of the invention, when the camera is started, white ground color image data is displayed in the screen to emit light with set color temperature, the color gain set for the color temperature of the screen is read in the designated storage area, the camera is called to collect candidate image data under the light with the color temperature, the color of the candidate image data is corrected according to the color gain to obtain target image data, the corresponding color gain is set for the color temperature of the screen, the color deviation caused by the color temperature difference of the screen can be corrected, the color adjustment for the personalized difference of the screen is realized, and the color temperature of the collected image data is kept normal.
Fig. 4 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention.
The mobile terminal 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410, and power supply 411. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 4 is not intended to be limiting of mobile terminals, and that a mobile terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 410 is configured to display white ground color image data in the screen when the camera is started, so as to emit light of a set color temperature; reading setting data in a designated storage area, wherein the setting data is color gain set for the color temperature of the screen; calling the camera to acquire candidate image data under the light of the color temperature; and correcting the colors of the candidate image data according to the color gain to obtain target image data.
In the embodiment of the invention, when the camera is started, white ground color image data is displayed in the screen to emit light with set color temperature, the color gain set for the color temperature of the screen is read in the designated storage area, the camera is called to collect candidate image data under the light with the color temperature, the color of the candidate image data is corrected according to the color gain to obtain target image data, the corresponding color gain is set for the color temperature of the screen, the color deviation caused by the color temperature difference of the screen can be corrected, the color adjustment for the personalized difference of the screen is realized, and the color temperature of the collected image data is kept normal.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 410; in addition, the uplink data is transmitted to the base station. Typically, radio unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. Further, the radio unit 401 can also communicate with a network and other devices through a wireless communication system.
The mobile terminal provides the user with wireless broadband internet access through the network module 402, such as helping the user send and receive e-mails, browse web pages, and access streaming media.
The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output related to a specific function performed by the mobile terminal 400 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.
The input unit 404 is used to receive audio or video signals. The input Unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042, and the Graphics processor 4041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 406. The image frames processed by the graphic processor 4041 may be stored in the memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 may receive sound, and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 401 in case of the phone call mode.
The mobile terminal 400 also includes at least one sensor 405, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 4061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 4061 and/or the backlight when the mobile terminal 400 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 405 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
The display unit 406 is used to display information input by the user or information provided to the user. The Display unit 406 may include a Display panel 4061, and the Display panel 4061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 407 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. Touch panel 4071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 4071 using a finger, a stylus, or any suitable object or attachment). The touch panel 4071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 410, receives a command from the processor 410, and executes the command. In addition, the touch panel 4071 can be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 4071, the user input unit 407 may include other input devices 4072. Specifically, the other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 4071 can be overlaid on the display panel 4061, and when the touch panel 4071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 410 to determine the type of the touch event, and then the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Although in fig. 4, the touch panel 4071 and the display panel 4061 are two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 4071 and the display panel 4061 may be integrated to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 408 is an interface through which an external device is connected to the mobile terminal 400. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 400 or may be used to transmit data between the mobile terminal 400 and external devices.
The memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 409 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 410 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 409 and calling data stored in the memory 409, thereby integrally monitoring the mobile terminal. Processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The mobile terminal 400 may further include a power supply 411 (e.g., a battery) for supplying power to various components, and preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the mobile terminal 400 includes some functional modules that are not shown, and thus, are not described in detail herein.
Preferably, an embodiment of the present invention further provides a mobile terminal, which includes a processor 410, a memory 409, and a computer program that is stored in the memory 409 and can be run on the processor 410, and when being executed by the processor 410, the computer program implements each process of the above-mentioned image processing method based on supplementary lighting, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image processing method based on light supplement, and can achieve the same technical effect, and in order to avoid repetition, the detailed description is omitted here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (7)

1. An image processing method based on supplementary lighting is applied to a mobile terminal, wherein the mobile terminal is provided with a camera and a screen which are oriented in the same direction, and the method comprises the following steps:
in the test box, starting the camera, and displaying white ground color image data on the screen to emit light rays with set color temperature to the test card;
under the light of the set color temperature, calling the camera to collect and correct image data for the test card;
calculating color gain from the corrected image data;
storing the calculated color gain to a designated storage area;
when the camera is started in practical application, displaying white ground color image data in the screen to emit the light rays with the set color temperature;
reading setting data in a designated storage area, wherein the setting data is color gain calculated aiming at the color temperature of the screen; wherein the color gain comprises a color gain of a first target component and a color gain of a second target component;
calling the camera to acquire candidate image data under the light with the set color temperature;
correcting the color of the candidate image data according to the read color gain, and multiplying the color component of each pixel point by the corresponding color gain to obtain target image data;
wherein said calculating color gains from said corrected image data comprises:
counting the total color level of each color component in the corrected image data, wherein the color component comprises a red component, a green component and a blue component;
determining a first target component and a second target component from the color components based on the total number of levels of the colors; the first target component is a color component with the highest total color level number, and the second target component is other color components except the first target component;
setting a color gain of the first target component as a reference color gain;
calculating a tone scale coefficient based on a total tone scale number of the first target component and a total tone scale number of the second target component, the tone scale coefficient being greater than 1;
configuring the tone scale coefficient for the reference color gain as a color gain of the second target component; wherein the color gain of the second target component is greater than the color gain of the first target component.
2. The method of claim 1, further comprising:
in the test box, starting the camera, and displaying white ground color image data on the screen to emit light with set color temperature to the test card;
under the light of the set color temperature, calling the camera to collect and detect image data for the test card;
correcting the color of the detected image data according to the calculated color gain to obtain verification image data;
comparing the verification image data with the correction image data to verify the validity of the calculated color gain.
3. The method of claim 2, wherein comparing the verification image data with the correction image data to verify the validity of the calculated color gain comprises:
calculating a first color deviation value of the corrected image data;
calculating a second color deviation value of the verification image data;
judging whether the second color deviation value is smaller than the first color deviation value;
if so, determining that the calculated color gain is valid;
if not, it is determined that the calculated color gain is not valid.
4. The method of claim 3,
the calculating a first color deviation value of the corrected image data includes:
calculating the variance of the color components in the corrected image data as a first color deviation value;
the calculating a second color deviation value of the verification image data includes:
and calculating the variance of the color components in the verification image data as a second color deviation value.
5. The device for processing the image based on the supplementary lighting is applied to a mobile terminal, wherein the mobile terminal is provided with a camera and a screen which are oriented in the same direction, and the device comprises:
the correction light supplement module is used for starting the camera in the test box and displaying white ground color image data on the screen so as to emit light with set color temperature to the test card;
the corrected image data acquisition module is used for calling the camera to acquire corrected image data for the test card under the light of the set color temperature;
a color gain calculation module for calculating color gain according to the corrected image data; wherein the calculated color gain is stored to a designated storage area;
the camera light supplement module is used for displaying white ground color image data in the screen to emit the light rays with the set color temperature when the camera is started in practical application;
the color gain reading module is used for reading set data in a designated storage area, wherein the set data is color gain calculated aiming at the color temperature of the screen; wherein the color gain comprises a color gain of a first target component and a color gain of a second target component;
the candidate image data acquisition module is used for calling the camera to acquire candidate image data under the light with the set color temperature;
the candidate image data correction module is used for correcting the color of the candidate image data according to the read color gain and multiplying the color component of each pixel point by the corresponding color gain to obtain target image data;
wherein the color gain calculation module comprises:
the total color rank counting submodule is used for counting the total color rank of each color component in the corrected image data, and the color components comprise a red component, a green component and a blue component;
a component distinguishing submodule, configured to determine a first target component and a second target component from the color components based on the total gradation number, where the first target component is a color component with a highest total gradation number, and the second target component is another color component except the first target component;
a reference color gain setting sub-module for setting the color gain of the first target component as a reference color gain;
a color gradation coefficient calculation sub-module, configured to calculate a color gradation coefficient based on a total color gradation number of the first target component and a total color gradation number of the second target component, where the color gradation coefficient is greater than 1;
a tone scale coefficient configuration submodule configured to configure the tone scale coefficient for the reference color gain as a color gain of the second target component; wherein the color gain of the second target component is greater than the color gain of the first target component.
6. A mobile terminal, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the fill-in based image processing method according to any one of claims 1 to 4.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the fill-in based image processing method according to any one of claims 1 to 4.
CN201811014395.5A 2018-08-31 2018-08-31 Image processing method and device based on supplementary lighting, mobile terminal and storage medium Active CN109068116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811014395.5A CN109068116B (en) 2018-08-31 2018-08-31 Image processing method and device based on supplementary lighting, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811014395.5A CN109068116B (en) 2018-08-31 2018-08-31 Image processing method and device based on supplementary lighting, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109068116A CN109068116A (en) 2018-12-21
CN109068116B true CN109068116B (en) 2021-01-22

Family

ID=64759159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811014395.5A Active CN109068116B (en) 2018-08-31 2018-08-31 Image processing method and device based on supplementary lighting, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109068116B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109934211B (en) * 2019-03-11 2021-04-09 Oppo广东移动通信有限公司 Fingerprint calibration method and related device
CN110753217B (en) * 2019-10-28 2022-03-01 黑芝麻智能科技(上海)有限公司 Color balance method and device, vehicle-mounted equipment and storage medium
CN112446371B (en) * 2020-11-24 2024-08-20 上海海洋大学 Multi-camera underwater image recognition device and enhancement processing method thereof
CN113259556B (en) * 2021-05-06 2023-04-18 深圳市中诺通讯有限公司 Method, device and equipment for eliminating brightness difference and color difference in different areas and storage medium
CN113838154B (en) * 2021-08-19 2022-12-13 荣耀终端有限公司 Touch pen and color extraction method
CN116453457B (en) * 2023-06-16 2023-09-05 广东保伦电子股份有限公司 Color correction method and system for LED display screen

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7551207B2 (en) * 2003-08-26 2009-06-23 Casio Computer Co., Ltd. Image pickup apparatus, white balance control method, and white balance control program
JP4379129B2 (en) * 2004-01-23 2009-12-09 ソニー株式会社 Image processing method, image processing apparatus, and computer program
JP5549440B2 (en) * 2010-07-12 2014-07-16 株式会社リコー Imaging device, color shift adjustment method for display monitor device, and color shift adjustment device for display monitor device
CN103826113B (en) * 2014-03-12 2016-02-17 中国科学院上海高等研究院 A kind of color rendition method and device
CN105554489A (en) * 2015-07-10 2016-05-04 宇龙计算机通信科技(深圳)有限公司 White balance adjusting method and shooting terminal
CN105554412B (en) * 2016-02-15 2018-03-16 广东欧珀移动通信有限公司 A kind of photographic method based on screen light filling, device and mobile terminal
CN106412543A (en) * 2016-09-06 2017-02-15 深圳天珑无线科技有限公司 Method and device for calibrating color cast of flashlight
CN106604010A (en) * 2016-12-15 2017-04-26 北京小米移动软件有限公司 Method and device for controlling lighting of screen
CN108377336A (en) * 2018-04-26 2018-08-07 青岛海信移动通信技术股份有限公司 A kind of method and apparatus that screen light filling is taken pictures

Also Published As

Publication number Publication date
CN109068116A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109068116B (en) Image processing method and device based on supplementary lighting, mobile terminal and storage medium
CN110602473B (en) White balance calibration method and device
CN108257581B (en) Light intensity detection device, mobile terminal and display screen brightness adjustment method
CN109361865B (en) Shooting method and terminal
CN107038681B (en) Image blurring method and device, computer readable storage medium and computer device
CN109688322B (en) Method and device for generating high dynamic range image and mobile terminal
CN108989678B (en) Image processing method and mobile terminal
CN107846583B (en) Image shadow compensation method and mobile terminal
CN108038825B (en) Image processing method and mobile terminal
CN108307106B (en) Image processing method and device and mobile terminal
CN110113528B (en) Parameter obtaining method and terminal equipment
CN107623818B (en) Image exposure method and mobile terminal
CN107730460B (en) Image processing method and mobile terminal
CN110300267B (en) Photographing method and terminal equipment
CN108040240B (en) White balance adjustment method and device and mobile terminal
CN108040209B (en) Shooting method and mobile terminal
CN108335258B (en) Image processing method and device of mobile terminal
CN111401463B (en) Method for outputting detection result, electronic equipment and medium
CN109618218B (en) Video processing method and mobile terminal
CN109727212B (en) Image processing method and mobile terminal
CN111652942B (en) Calibration method of camera module, first electronic equipment and second electronic equipment
CN109462727B (en) Filter adjusting method and mobile terminal
CN109348212B (en) Image noise determination method and terminal equipment
CN108234978B (en) A kind of image processing method and mobile terminal
CN110650296A (en) Photographing-based light supplementing method and device, mobile terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder