Image processing method and device and storage medium

By acquiring the image in the state of the flash component in the terminal and determining the white balance parameters based on the relative spectral power distribution curve and spectral sensitivity curve, the problem of inaccurate white balance of the flash image is solved, and the color temperature and color rendering of the image are significantly improved.

CN120075632APending Publication Date: 2025-05-30BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311605648.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, images captured by flash lights are prone to problems with inaccurate white balance, resulting in color castration of the image.

Method used

By acquiring the image of the terminal's flash assembly in the on state, the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash assembly and the spectral sensitivity curve of the shooting assembly, and the image is processed to improve the color casting phenomenon.

Benefits of technology

It effectively reduces the error of white balance parameters, improves the image quality of the flash shooting, and reduces the phenomenon of image color casting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075632A_ABST
    Figure CN120075632A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device and a storage medium. The image processing method comprises the following steps: acquiring a first image, wherein the first image is an image acquired when a flash lamp assembly of a terminal is in an on state; based on a predetermined white balance parameter, the first image is processed, and the white balance parameter is predetermined based on a relative spectral power distribution curve of a flash lamp assembly and a spectral sensitivity curve of a shooting assembly; wherein the relative spectral power distribution curve represents the function relationship between the spectral density relative value and the wavelength, and the spectral sensitivity curve represents the function relationship between the spectral sensitivity and the wavelength. Errors of white balance parameters can be reduced, and the phenomenon of color cast of flash lamp photographing can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of vision technologies, and in particular, to an image processing method, apparatus, and storage medium. Background Art

[0002] Currently, terminal photography has basically replaced traditional digital cameras and has become the most popular and convenient way of taking pictures. As an essential part of many terminals, the flash not only provides lighting conditions for dim shooting scenarios but is also commonly used as a fill light to improve lighting quality. Both the color temperature and color rendering property of the flash have a very important impact on the quality of the captured image. Summary of the Invention

[0003] To overcome the problems existing in the related art, the present disclosure provides an image processing method, apparatus, and storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, an image processing method is provided, including: obtaining a first image, where the first image is an image collected when a flash component of a terminal is in an on state; processing the first image based on a pre-determined white balance parameter, where the white balance parameter is pre-determined based on a relative spectral power distribution curve of the flash component and a spectral sensitivity curve of a shooting component; where the relative spectral power distribution curve represents a functional relationship between a relative value of spectral density and a wavelength, and the spectral sensitivity curve represents a functional relationship between spectral sensitivity and a wavelength.

[0005] In an implementation manner, the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: based on the relative spectral power distribution curves of a first number of flash components, determining a first average value of the relative value of spectral density corresponding to each wavelength to obtain a relative spectral power distribution mean curve, where the relative spectral power distribution mean curve represents a functional relationship between the first average value and a wavelength; based on the spectral sensitivity curves of a second number of shooting components, determining a second average value of the spectral sensitivity corresponding to each wavelength to obtain a spectral sensitivity mean curve, where the spectral sensitivity mean curve represents a functional relationship between the second average value and a wavelength; integrating the relative spectral power distribution mean curve and the spectral sensitivity mean curve to obtain a reference value; where the spectral sensitivity mean curve includes spectral sensitivity mean curves corresponding to the three primary colors respectively, and the reference value includes reference values corresponding to the three primary colors respectively; determining the white balance parameter based on the reference values corresponding to the three primary colors respectively.

[0006] In one embodiment, integrating the mean relative spectral power distribution curve and the mean spectral sensitivity curve to obtain a reference value includes: obtaining a spectral reflectance curve when the flash component of the terminal is in the on state, where the spectral reflectance curve represents the functional relationship between spectral reflectance and wavelength; integrating the mean relative spectral power distribution curve and the spectral reflectance curve with the mean spectral sensitivity curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors respectively.

[0007] In one embodiment, the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: integrating the pre-configured relative spectral power distribution curve of the terminal and the spectral sensitivity curve to obtain a reference value; where the spectral sensitivity curve includes the spectral sensitivity curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; determining the white balance parameter based on the reference values corresponding to the three primary colors respectively.

[0008] In one embodiment, determining the parameter values corresponding to the three primary colors based on the pre-configured relative spectral power distribution function curve of the terminal and the spectral sensitivity curves corresponding to the three primary colors respectively includes: obtaining a spectral reflectance curve when the flash component of the terminal is in the on state, where the spectral reflectance curve represents the curve between spectral reflectance and wavelength; integrating the pre-configured relative spectral power distribution curve and the spectral reflectance curve with the pre-configured spectral sensitivity curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors respectively.

[0009] In one embodiment, obtaining the first image includes: controlling the flash component of the terminal to be in the on state and controlling the shooting component of the terminal to capture the first image; after processing the first image based on the pre-determined white balance parameter to obtain a target image, the method further includes: using the target image as the image output by the shooting component.

[0010] According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus, including: an acquisition module, configured to acquire a first image, where the first image is an image captured when the flash component of the terminal is in the on state; a processing module, configured to process the first image based on a pre-determined white balance parameter, where the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component; where the relative spectral power distribution curve represents the functional relationship between the relative spectral density value and wavelength, and the spectral sensitivity curve represents the functional relationship between spectral sensitivity and wavelength.

[0011] In one embodiment, the processing module pre - determines white - balance parameters based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Based on the relative spectral power distribution curves of the first number of flash components, determine the first average value of the relative spectral density values corresponding to each wavelength to obtain a relative spectral power distribution mean curve, and the relative spectral power distribution mean curve represents the functional relationship between the first average value and the wavelength; Based on the spectral sensitivity curves of the second number of shooting components, determine the second average value of the spectral sensitivities corresponding to each wavelength to obtain a spectral sensitivity mean curve, and the spectral sensitivity mean curve represents the functional relationship between the second average value and the wavelength; Integrate the relative spectral power distribution mean curve and the spectral sensitivity mean curve to obtain a reference value; wherein, the spectral sensitivity mean curve includes the spectral sensitivity mean curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; Determine the white - balance parameters based on the reference values corresponding to the three primary colors respectively.

[0012] In one embodiment, the processing module integrates the relative spectral power distribution mean curve and the spectral sensitivity mean curve in the following manner to obtain a reference value: Obtain the spectral reflectance curve when the flash component of the terminal is in the on - state, and the spectral reflectance curve represents the functional relationship between the spectral reflectance and the wavelength; Integrate the relative spectral power distribution mean curve and the spectral reflectance curve with the spectral sensitivity mean curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors respectively.

[0013] In one embodiment, the processing module pre - determines white - balance parameters based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Integrate the pre - configured relative spectral power distribution curve and the spectral sensitivity curve of the terminal to obtain a reference value; wherein, the spectral sensitivity curve includes the spectral sensitivity curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; Determine the white - balance parameters based on the reference values corresponding to the three primary colors respectively.

[0014] In one embodiment, the processing module determines the parameter values corresponding to the three primary colors respectively based on the pre - configured relative spectral power distribution function curve of the terminal and the spectral sensitivity curves corresponding to the three primary colors respectively in the following manner: Obtain the spectral reflectance curve when the flash component of the terminal is in the on - state, and the spectral reflectance curve represents the curve between the spectral reflectance and the wavelength; Integrate the pre - configured relative spectral power distribution curve and the spectral reflectance curve with the pre - configured spectral sensitivity curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors respectively.

[0015] In one embodiment, the obtaining module obtains the first image in the following manner: controlling the flash component of the terminal to be in an on state, and controlling the shooting component of the terminal to collect the first image; after the processing module processes the first image based on the pre-determined white balance parameter to obtain the target image, the processing module is further configured to: use the target image as the image output by the shooting component.

[0016] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a memory for storing instructions; and a processor for invoking the instructions stored in the memory to execute the image processing method according to the first aspect and any one of the embodiments of the first aspect.

[0017] According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium storing instructions that, when executed by a processor, execute the image processing method according to the first aspect or any one of the embodiments of the first aspect.

[0018] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: by obtaining the first image and processing the first image according to the pre-determined white balance parameter to obtain the target image. Since the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component, and the influence of both the flash component and the shooting component on the white balance parameter is considered, the error of the white balance parameter can be reduced, and the color cast phenomenon of the image taken with the flash can be effectively improved.

[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and, together with the specification, are used to explain the principles of the present disclosure.

[0021] Figure 1 is a flowchart of an image processing method shown according to an exemplary embodiment.

[0022] Figure 2 is a schematic diagram of a relative spectral power distribution curve shown according to an exemplary embodiment.

[0023] Figure 3 is a schematic diagram of a spectral sensitivity curve shown according to an exemplary embodiment.

[0024] Figure 4 is a flowchart of a white balance parameter determination method shown according to an exemplary embodiment.

[0025] Figure 5 It is a schematic diagram showing a relative spectral power distribution curve and a relative spectral power distribution mean curve according to an exemplary embodiment.

[0026] Figure 6 It is a flowchart showing a method for determining tristimulus reference values according to an exemplary embodiment.

[0027] Figure 7 It is a flowchart showing an image processing method according to an exemplary embodiment.

[0028] Figure 8 It is a flowchart showing a method for determining tristimulus reference values according to an exemplary embodiment.

[0029] Figure 9 It is a flowchart showing an image processing method according to an exemplary embodiment.

[0030] Figure 10 It is a block diagram showing an image processing apparatus according to an exemplary embodiment.

[0031] Figure 11 It is a block diagram showing an image processing apparatus according to an exemplary embodiment. Detailed implementation manners

[0032] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure.

[0033] Currently, taking pictures with a terminal has basically replaced traditional digital cameras and has become the most popular and convenient way to take pictures. As an essential part of many terminals, the flash not only provides lighting conditions for dim shooting scenes but is also commonly used as a fill light to improve lighting quality. Both the color temperature and color rendering property of the flash have a very important impact on the quality of the captured image. Compared with dual light-emitting diodes (LEDs) and single LEDs, a dual-color temperature flash has a softer imaging effect and more accurate white balance. When taking pictures with a dual-color temperature flash in a low-light environment, the photo quality can be significantly improved, which has led to more and more electronic devices starting to adopt the technology of dual-color temperature flashes.

[0034] However, due to differences in manufacturing processes, there are significant color biases between different flash lamp units, resulting in inaccurate white balance when taking pictures with flash lamps. Moreover, even if the white balance parameters of the flash lamp are accurate, affected by the differences in the consistency of the camera modules of the terminals, there will still be cases of inaccurate white balance when taking pictures with the flash lamp. Therefore, before an electronic device using a dual-color temperature flash lamp is put on the market, a calibration process for the dual-color temperature flash lamp needs to be performed to generate calibration data for different color temperature ratio values. For example, a customized light box on the production line can be used to complete the corresponding flash lamp calibration operation. The distance between the flash lamp and the gray card in the customized light box is 15 centimeters (cm), and the calibrated flash lamp can better restore colors.

[0035] In some embodiments, a mobile terminal usually uses a golden flash lamp module and its white balance parameters to determine the white balance parameters. Among them, the golden flash lamp module can be understood as the flash lamp module with the highest performance score in a group of flash lamp modules, and can be called the debugging module. The performance score of the golden flash lamp module is not the highest nor the lowest in a group of flash lamp modules. However, only calibrating the flash lamp unit is easily affected by the color restoration of the camera module in actual use, resulting in errors in the white balance parameters and color cast in flash lamp photography.

[0036] In some embodiments, the gain value of the current flash lamp can be calculated based on the ratio of the reference brightness value of the reference flash lamp to the brightness value of the current flash lamp, and the reference gain of the reference flash lamp. The image captured by the current flash lamp is processed using the gain value of the current flash lamp to eliminate the color cast of the current flash lamp. However, affected by ambient light and flash lamp aging, the calibration data is not applicable to the actual application scenario and there are significant errors.

[0037] In some embodiments, an image can be obtained by turning off the flash lamp to photograph an object, and a color temperature value is recorded. Then, the flash lamp is turned on to photograph the object to obtain an image, and another color temperature value is recorded. The difference between the two color temperature values is calculated, and this difference is used to compensate the color temperature of the flash lamp, so that the color temperature of the flash lamp is consistent with the ambient light color temperature, improving the quality of the image. However, on the one hand, this method inevitably requires real-time photographing, calculation, and recording of color temperature values, involving a large amount of calculation and consuming high power. On the other hand, errors may occur during the process of photographing the object to obtain an image and recording the color temperature value, resulting in inaccurate results and increasing the probability of mistakes.

[0038] Therefore, the present disclosure provides an image processing method, which obtains a first image and processes the first image according to a pre-determined white balance parameter to obtain a target image. Since the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component, and the influences of the flash component and the shooting component on the white balance parameter are considered, the color cast phenomenon of the image taken by the flash is effectively improved.

[0039] The image processing method provided by the present disclosure can be applied to a terminal having a flash component and a shooting component. Herein, the terminal can also be referred to as a terminal device, a mobile station (MS), a mobile terminal (MT), etc., and is a device that provides voice and / or data connectivity to a user. For example, the terminal can be a handheld device with a wireless connection function, a vehicle-mounted device, etc. Currently, some examples of terminals are: mobile phones, pocket personal computers (PPCs), palm computers, personal digital assistants (PDAs), laptop computers, tablet computers, wearable devices, or vehicle-mounted devices, etc. In addition, when it is a vehicle-to-everything (V2X) communication system, the terminal device can also be a vehicle-mounted device. It should be understood that the specific technologies and specific device forms adopted by the terminal in the embodiments of the present disclosure are not limited.

[0040] Figure 1 is a flowchart of an image processing method shown according to an exemplary embodiment, as Figure 1 shown, the image processing method includes the following steps.

[0041] In step S11, a first image is obtained, and the first image is an image collected when the flash component of the terminal is in an on state.

[0042] In some embodiments, an image collected when the flash component of the terminal is in an on state can be obtained. The present disclosure refers to the image collected when the flash component of the terminal is in an on state as the first image. The first image can be obtained by collecting it in real time during the process of taking a picture with the flash turned on at the terminal, or by reading it from the terminal memory, or obtaining it from other devices or the cloud, etc. The present disclosure does not limit this. The flash component of the terminal can also be referred to as a flash module.

[0043] In step S12, the first image is processed based on a pre-determined white balance parameter, wherein the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component.

[0044] In some embodiments, the first image may be affected by the light source of the flash component, and there is a large difference between the color temperature of the image and the ambient color temperature. The first image may also be affected by the color rendering degree of the shooting component when the flash component is in the on state, and there is a large difference between the color temperature of the image and the ambient color temperature, or the color rendering property is poor, etc. The white balance parameters can be determined in advance based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component, and the first image can be processed based on the pre-determined white balance parameters. The problem of color cast such as unreasonable color temperature and poor color rendering of the first image can be effectively improved. Among them, the relative spectral power distribution curve represents the functional relationship between the relative value of spectral density and wavelength, and the spectral sensitivity curve represents the functional relationship between spectral sensitivity and wavelength. The relative spectral power distribution curve can be called the relative spectral power distribution function, and the spectral sensitivity curve can also be called the spectral sensitivity function. Among them, the spectral sensitivity curve may include spectral sensitivity curves corresponding to the three primary colors respectively. That is, it includes a red light spectral sensitivity curve, a green light spectral sensitivity curve, and a blue light spectral sensitivity curve. Exemplarily, Figure 2 is a schematic diagram of the relative spectral power distribution curve shown according to an exemplary embodiment. As Figure 2 shown, the abscissa is the wavelength, and the unit of the wavelength is nanometer (nm). The ordinate is the relative spectrum, that is, the relative value of spectral density. The curves in the coordinate space represent the relative spectral power distribution curves corresponding to different flash components A, B, C, D65. Exemplarily, Figure 3 is a schematic diagram of the spectral sensitivity curve shown according to an exemplary embodiment. As Figure 3 shown, the abscissa is the wavelength, and the unit is nm. The ordinate is the spectral sensitivity. The three curves in the coordinate space respectively represent the spectral sensitivity curves of the RGB three channels of the shooting component.

[0045] The present disclosure obtains the first image and processes the first image according to the pre-determined white balance parameters to obtain a target image. Since the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component, and the influences of the flash component and the shooting component on the white balance parameters are considered at the same time, the phenomenon of color cast in the image taken by the flash is effectively improved.

[0046] In some embodiments, the present disclosure provides a method for determining white balance parameters. The white balance determination method can be used in combination with the image processing method or can be used as an independent embodiment. Figure 4 is a flowchart of the method for determining white balance parameters shown according to an exemplary embodiment. As Figure 4 shown, the white balance determination method includes the following steps.

[0047] In step S21, based on the relative spectral power distribution curves of the first quantity of flash lamp components, determine the first average value of the relative spectral density values corresponding to each wavelength, and obtain the relative spectral power distribution mean curve. The relative spectral power distribution mean curve represents the functional relationship between the first average value and the wavelength.

[0048] In some embodiments, a mean curve can be obtained for the relative spectral power distribution curves of the first quantity of flash lamp components. For example, points with the same abscissa are found on different curves, and the average value of the ordinates is calculated to obtain the first average value. Here, the abscissa is the wavelength, and the ordinate is the relative spectral density value, that is, the average value of different relative spectral density values for the same wavelength is calculated to obtain the first average value. The relative spectral power distribution mean curve represents the functional relationship between the first average value and the wavelength. Exemplarily, Figure 5 FIG. is a schematic diagram showing the relative spectral power distribution curve and the relative spectral power distribution mean curve according to an exemplary embodiment. As Figure 5 shown, assume that the relative spectral power distribution curves of the first quantity include curve A and curve B, and the corresponding relative spectral power distribution mean curve is curve C. On curve A, the relative spectral density value Y A1 corresponding to wavelength X1 can be found. On curve B, the Y B1 corresponding to wavelength X1 is found. Calculate the average value of Y A and Y B , for example, it is Y1. Take Y1 as the relative spectral density value corresponding to wavelength X1 on curve C. That is, there is a point (X1, Y A1 ) on curve A, and a point (X1, Y B1 ) on curve B. The average value of the ordinates of these two points is calculated to obtain a new point (X1, Y1). The first average value of the relative spectral density values corresponding to each wavelength can be determined respectively, that is, determine Y1, Y2... Yn corresponding to X1, X2... Xn, and obtain curve C according to (X1, Y1), (X2, Y2)... (Xn, Yn). Among them, Y1, Y2,... Yn are the first average values, and the relative spectral power distribution mean curve represents the functional relationship between the first average value and the wavelength. Of course, Figure 5The curve schematic diagram shown is only exemplary, and the present disclosure does not limit this. Among them, the first quantity can be preset or can be set according to the actual situation. For example, the first quantity can be 100, 200, etc., and the present disclosure does not limit this. Each flash component corresponds to a relative spectral power distribution curve. For example, the relative spectral power distribution curve of the flash can be measured using a spectral radiometer when the flash is in the on state. The relative spectral power distribution curve can be pre-burned into the terminal or stored in the cloud. For example, it can be burned into the electrically erasable programmable read only memory (EEPROM) or one time programmable (OTP) memory of the flash component. Of course, it can also be stored in other memories of the terminal, and the present disclosure does not limit this. The relative spectral power distribution curves of the first quantity of flash components can be the relative spectral power distribution curves pre-burned in each of the first quantity of terminals obtained, or the relative spectral power distribution curves of the first quantity of flash components obtained from the cloud. The first quantity of flash components can be the first quantity of flash components in the same batch of produced flash components, or the first quantity of flash components produced by the same manufacturer, or the first quantity of flash components used in the same type of terminal. Among them, if the first quantity of flash components is the flash components in the same batch, the first quantity of flash components can include golden flash components and limit flash components. The golden flash component refers to the flash component with the highest multiplicity of performance scores among the same batch of flash components or the selected flash component samples. That is, the performance score of the golden flash component appears most frequently among the performance scores of the same batch or the selected samples. The limit flash component refers to the flash component with the marginal value of the performance score among the same batch of flash components or the selected flash component samples. The marginal value represents some of the highest values or some of the lowest values.

[0049] In step S22, based on the spectral sensitivity curves of the second quantity of shooting components, determine the second average value of the spectral sensitivity corresponding to each wavelength, and obtain the spectral sensitivity mean curve. The spectral sensitivity mean curve represents the functional relationship between the second average value and the wavelength.

[0050] In some embodiments, the mean curve of the spectral sensitivities of the second number of imaging components can be obtained by finding the mean value of the ordinates at the same abscissa on different curves, for example, to obtain a first average value. Here, the abscissa is the wavelength and the ordinate is the spectral sensitivity, that is, the average value of the spectral sensitivities at the same wavelength is obtained to get a second average value. The mean curve of the spectral sensitivities represents the functional relationship between the second average value and the wavelength. For the specific implementation, reference can be made to the implementation of step S21, which will not be elaborated here in this disclosure. Each imaging component corresponds to spectral sensitivity curves of the three primary colors. Therefore, the mean curve of the spectral sensitivities also includes the mean curves of the spectral sensitivities corresponding to the three primary colors respectively. That is, based on the red spectral sensitivity curves of the first number of imaging components, a mean curve of the red spectral sensitivities can be obtained. Based on the green spectral sensitivity curves of the first number of imaging components, a mean curve of the green spectral sensitivities can be obtained. Based on the blue spectral sensitivity curves of the first number of imaging components, a mean curve of the blue spectral sensitivities can be obtained. The second number can be preset or set according to the actual situation. For example, the second number can be 100, 200, etc. The first number and the second number can be the same or different, which is not limited in this disclosure. For example, a spectrometer can be used to measure the spectral sensitivity curves of the three primary colors of the imaging components. The spectral sensitivity curves can be pre-burned into the terminal or stored in the cloud. For example, they can be burned into the EEPROM or OTP memory of the imaging components.

[0051] It can be understood that the execution order of step S21 and step S22 in this disclosure is arbitrary. Step S21 can be executed first and then step S22, or step S22 can be executed first and then step S21, or step S21 and step S22 can be executed simultaneously.

[0052] In step S23, the relative spectral power distribution mean curve and the mean curve of the spectral sensitivities are integrated to obtain a reference value.

[0053] In some embodiments, the relative spectral power distribution mean curve and the spectral sensitivity mean curve can be integrated, and the result of the integration is a reference value. Since the spectral sensitivity mean curve includes the spectral sensitivity mean curves corresponding to the three primary colors respectively, the reference value also includes the reference values corresponding to the three primary colors respectively. That is, the relative spectral power distribution mean curve and the red spectral sensitivity mean curve are integrated to obtain the reference value corresponding to red. The relative spectral power distribution mean curve and the green spectral sensitivity curve are integrated to obtain the reference value corresponding to green. The relative spectral power distribution mean curve and the blue spectral sensitivity curve are integrated to obtain the reference value corresponding to blue. Among them, the reference values corresponding to the three primary colors can be understood as tristimulus values. Tristimulus values represent the amounts of the stimuli of the three primary colors that cause the human retina to have a certain color sensation.

[0054] In step S24, based on the reference values corresponding to the three primary colors respectively, white balance parameters are determined.

[0055] In some embodiments, the white balance parameters can be determined according to the parameter values corresponding to the three primary colors. For example, methods such as the mirror method or the scale mapping method can be used to determine the white balance parameters based on the reference values corresponding to the three primary colors. Alternatively, other algorithms can also be used, which are not limited in the present disclosure.

[0056] The present disclosure calculates the mean curve of the relative spectral power distribution curves of the first number of flash lamp components to obtain the relative spectral power distribution mean curve. The white balance parameters calculated based on the relative spectral power distribution mean curve enable the target images processed by different terminals based on the white balance parameters to have consistency, that is, the differences are small.

[0057] In some embodiments, the present disclosure provides a method for determining the reference values of the three primary colors. The method for determining the reference values of the three primary colors can be used in combination with the above embodiments or used as a separate embodiment. Figure 6 is a flowchart of the method for determining the reference values of the three primary colors shown according to an exemplary embodiment. As Figure 6 shown, the method for determining the reference values of the three primary colors includes the following steps.

[0058] In step S31, a spectral reflectance curve when the flash lamp component of the terminal is in the on state is obtained. The spectral reflectance curve represents the functional relationship between the spectral reflectance and the wavelength.

[0059] In some embodiments, the spectral reflectance curve in the on state of the flash component can be obtained. For example, a gray card can be irradiated when the flash is in the on state, and the spectral reflectance can be measured by a spectral radiometer. The terminal obtains the measured spectral reflectance curve. Of course, the spectral reflectance curve can also be obtained by other feasible methods. This disclosure is only an example and is not limited. It can be understood that during the use of the terminal, it is the real-time spectral reflectance curve of the flash component.

[0060] In step S32, the relative spectral power distribution mean curve and the spectral reflectance curve are respectively integrated with the spectral sensitivity mean curves corresponding to the three primary colors to obtain the reference values corresponding to the three primary colors.

[0061] In some embodiments, based on the basic theory of colorimetry, the relative spectral power distribution mean curve and the spectral reflectance curve are respectively integrated with the spectral sensitivity mean curves corresponding to the three primary colors to obtain the reference values corresponding to the three primary colors. Exemplarily, refer to Formula 1 below.

[0062]

[0063] In Formula 1, R represents the R value, that is, the reference value corresponding to red light. G represents the G value, that is, the reference value corresponding to green light. B represents the B value, that is, the reference value corresponding to blue light. K represents the normalization coefficient in the basic theory of colorimetry and can be set according to actual situations. S(λ) represents the relative spectral power distribution mean curve. ρ(λ) represents the spectral reflectance curve. Φ R (λ), Φ G (λ), Φ B (λ) represents the spectral sensitivity mean curves corresponding to the three primary colors. Among them, Φ R (λ) represents the red light spectral sensitivity mean curve, Φ G (λ) represents the green light spectral sensitivity mean curve, Φ B (λ) represents the blue light spectral sensitivity mean curve. ∫dλ represents the integral formula, and ∫S(λ)ρ(λ)Φ R (λ)dλ represents the integration of S(λ)ρ(λ)Φ R (λ).

[0064] By obtaining the spectral reflectance curve of the flash component in the on state, as the flash component ages during use, the spectral reflectance curve may change. That is, by obtaining the spectral reflectance curve, the white balance parameters calculated based on the spectral reflectance curve can avoid the influence of the aging of the flash component on the white balance parameters, and the color temperature and color rendering property of the target image are better.

[0065] In the image processing method provided by the present disclosure, in order to simplify the steps, the white balance parameters can be determined only based on the relative spectral power distribution curve pre-programmed in the flash component of the terminal and the spectral sensitivity curve pre-programmed in the shooting component. Figure 7 It is a flowchart of an image processing method shown according to an exemplary embodiment. As Figure 7 shown, the image processing method includes the following steps.

[0066] In step S41, the relative spectral power distribution curve and the spectral sensitivity curve pre-configured in the terminal are integrated to obtain a reference value.

[0067] In some embodiments, the white balance parameters can be calculated based on the relative spectral power distribution curve of the flash component pre-configured in the terminal and the spectral sensitivity curves of the three primary colors of the shooting component. For example, the relative spectral power distribution curve pre-programmed in the EEPROM or OTP memory of the flash component can be read. The spectral sensitivity curve pre-programmed in the EEPROM or OTP memory of the shooting component can be read. Among them, the spectral sensitivity curve includes the spectral sensitivity curves of the three primary colors. The relative spectral power distribution curve and the spectral sensitivity curves of the three primary colors can be integrated respectively to obtain the reference values corresponding to the three primary colors. The reference values corresponding to the three primary colors can be understood as tristimulus values. The specific implementation manner of this embodiment can refer to the implementation manner of step S23 above, and will not be elaborated here.

[0068] In step S42, based on the reference values corresponding to the three primary colors, the white balance parameters are determined.

[0069] The implementation manner of step S42 can refer to the implementation manner of step S24 above, and will not be elaborated here.

[0070] In the present disclosure, the white balance parameters are determined based on the relative spectral power distribution curve and the spectral sensitivity curve pre-configured in the terminal, and the white balance parameters can be obtained simply and quickly.

[0071] In some embodiments, the present disclosure provides a method for determining the reference values of the three primary colors. The method for determining the reference values of the three primary colors can be used in combination with the above embodiments or as a separate embodiment. Figure 8 It is a flowchart of the method for determining the reference values of the three primary colors shown according to an exemplary embodiment. As Figure 8 shown, the method for determining the reference values of the three primary colors includes the following steps.

[0072] In step S51, the spectral reflectance curve when the flash component of the terminal is in the on state is obtained, and the spectral reflectance curve represents the functional relationship between the spectral reflectance and the wavelength.

[0073] The implementation of step S51 can refer to the implementation of step S31, and details are not described herein again in this disclosure.

[0074] In step S52, the pre-configured relative spectral power distribution curve and spectral reflectance curve are respectively integrated with the spectral sensitivity curves corresponding to the three primary colors to obtain the reference values corresponding to the three primary colors.

[0075] In some embodiments, based on the basic theory of colorimetry, the relative spectral power distribution curve and spectral reflectance curve are respectively integrated with the spectral sensitivity curves corresponding to the three primary colors to obtain the reference values corresponding to the three primary colors. The specific implementation can refer to the implementation of step S32 above. Formula 1 can be referred to. In this embodiment, S(λ) in Formula 1 can represent the relative spectral power distribution curve. Φ R (λ), Φ G (λ), Φ B (λ) represents the spectral sensitivity curves corresponding to the three primary colors.

[0076] In this disclosure, by obtaining the spectral reflectance curve of the flash component in the on state, as the flash component ages during use, the spectral reflectance curve may change. That is, by obtaining the spectral reflectance curve, the white balance parameters calculated based on the spectral reflectance curve can avoid the influence of the aging of the flash component on the white balance parameters, and the color temperature and color rendering of the target image are better.

[0077] In some embodiments, Figure 9 is a flowchart of an image processing method shown according to an exemplary embodiment. As Figure 9 shown, the image processing method includes the following steps.

[0078] In step S61, the flash component of the control terminal is in the on state, and the shooting component of the control terminal is controlled to capture a first image.

[0079] In some embodiments, the flash component of the control terminal can be controlled to be in the on state. At this time, the shooting component of the control terminal is controlled to capture a first image. For example, the user can turn on the flash and take a photo. The control terminal controls the flash component to be in the on state according to the flash on instruction, and controls the shooting component of the control terminal to capture a first image according to the photo taking instruction.

[0080] In step S62, the first image is processed based on the pre-determined white balance parameters to obtain a target image.

[0081] The implementation of step S62 can refer to the implementation of step S12, and details are not described herein again in this disclosure.

[0082] In step S63, the target image is used as the image output by the shooting component.

[0083] In some embodiments, the target image can be used as the image output by the shooting component. That is, the user can preview the target image.

[0084] The present disclosure controls the flash component to be in the on state, controls the shooting component to collect a first image, processes the collected first image based on predetermined white balance parameters to obtain a target image, and uses the target image as the image output by the shooting component, so that the user can achieve seamless preview and obtain a processed image during the real-time photographing process. That is, the obtained image has better color temperature and color rendering effects.

[0085] Based on the same concept, the present disclosure provides an image processing device.

[0086] It can be understood that in order to implement the above functions, the image processing device provided in the embodiments of the present disclosure includes corresponding hardware structures and / or software modules for executing each function. Combining the units and algorithm steps of the examples disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiments of the present disclosure.

[0087] It should be noted that those skilled in the art can understand that the various embodiments / implementations involved in the embodiments of the present disclosure can be used in combination with the foregoing embodiments, or can be used independently. Whether used independently or in combination with the foregoing embodiments, their implementation principles are similar. In the embodiments of the present disclosure, some embodiments are described in the form of being used in combination. Of course, those skilled in the art can understand that such illustrative examples are not limitations on the embodiments of the present disclosure.

[0088] Figure 10 It is a block diagram of an image processing device 100 shown according to an exemplary embodiment. As Figure 10 shown, the device 100 includes: an acquisition module 101 and a processing module 102.

[0089] Among them, an acquisition module 101 is configured to acquire a first image, where the first image is an image acquired when the flash component of the terminal is in an on state. A processing module 102 is configured to process the first image based on pre-determined white balance parameters, where the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component. Among them, the relative spectral power distribution curve represents the functional relationship between the relative value of spectral density and wavelength, and the spectral sensitivity curve represents the functional relationship between spectral sensitivity and wavelength.

[0090] In one implementation, the processing module 102 pre-determines the white balance parameters based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Based on the relative spectral power distribution curves of the first number of flash components, determine the first average value of the relative spectral density values corresponding to each wavelength, and obtain a relative spectral power distribution mean curve, where the relative spectral power distribution mean curve represents the functional relationship between the first average value and wavelength. Based on the spectral sensitivity curves of the second number of shooting components, determine the second average value of the spectral sensitivities corresponding to each wavelength, and obtain a spectral sensitivity mean curve, where the spectral sensitivity mean curve represents the functional relationship between the second average value and wavelength. Integrate the relative spectral power distribution mean curve and the spectral sensitivity mean curve to obtain a reference value. Among them, the spectral sensitivity mean curve includes the spectral sensitivity mean curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively. Determine the white balance parameters based on the reference values corresponding to the three primary colors respectively.

[0091] In one implementation, the processing module 102 integrates the relative spectral power distribution mean curve and the spectral sensitivity mean curve in the following manner to obtain a reference value: Obtain the spectral reflectance curve when the flash component of the terminal is in an on state, where the spectral reflectance curve represents the functional relationship between spectral reflectance and wavelength. Integrate the relative spectral power distribution mean curve and the spectral reflectance curve respectively with the spectral sensitivity mean curves corresponding to the three primary colors to obtain the reference values corresponding to the three primary colors respectively.

[0092] In one implementation, the spectral sensitivity curve includes the spectral sensitivity curves corresponding to the three primary colors respectively, and the processing module 102 pre-determines the white balance parameters based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Integrate the pre-configured relative spectral power distribution curve and spectral sensitivity curve of the terminal to obtain a reference value. Among them, the spectral sensitivity curve includes the spectral sensitivity curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively. Determine the white balance parameters based on the reference values corresponding to the three primary colors respectively.

[0093] In one embodiment, the processing module 102 determines the parameter values corresponding to the three primary colors based on the relative spectral power distribution function curve pre-configured in the terminal and the spectral sensitivity curves corresponding to the three primary colors in the following manner: obtaining the spectral reflectance curve when the flash component is in the on state, where the spectral reflectance curve represents the curve between the spectral reflectance and the wavelength. Integrating the pre-configured relative spectral power distribution curve and the spectral reflectance curve with the spectral sensitivity curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors.

[0094] In one embodiment, the acquisition module 101 acquires the first image in the following manner: controlling the flash component of the terminal to be in the on state and controlling the shooting component of the terminal to acquire the first image. After the processing module 102 processes the first image based on the pre-determined white balance parameters to obtain the target image, the processing module 102 is further configured to: use the target image as the image output by the shooting component.

[0095] Figure 11 It is a block diagram of an image processing apparatus 200 shown according to an exemplary embodiment.

[0096] As Figure 11 shown, the apparatus 200 may include one or more of the following components: a processing component 202, a memory 204, a power component 206, a multimedia component 208, an audio component 210, an input / output (I / O) interface 212, a sensor component 214, and a communication component 216.

[0097] The processing component 202 generally controls the overall operation of the apparatus 200, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing component 202 may include one or more processors 220 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 202 may include one or more modules to facilitate the interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate the interaction between the multimedia component 208 and the processing component 202.

[0098] The memory 204 is configured to store various types of data to support the operation of the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, and the like. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0099] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 200.

[0100] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

[0101] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) that is configured to receive external audio signals when the device 200 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 further includes a speaker for outputting audio signals.

[0102] The I / O interface 212 provides an interface between the processing component 202 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0103] The sensor assembly 214 includes one or more sensors for providing an assessment of various aspects of the status of the device 200. For example, the sensor assembly 214 can detect the on / off state of the device 200, the relative positioning of components, such as components for the display and keypad of the device 200. The sensor assembly 214 can also detect a change in the position of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200, and the temperature change of the device 200. The sensor assembly 214 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 214 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0104] The communication component 216 is configured to facilitate communication between the device 200 and other devices in a wired or wireless manner. The device 200 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0105] In an exemplary embodiment, the device 200 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described methods.

[0106] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 204 including instructions, is also provided. The above instructions can be executed by the processor 220 of the device 200 to complete the above-described methods. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0107] The present disclosure obtains a first image and processes the first image according to a pre-determined white balance parameter to obtain a target image. Since the white balance parameter is pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component, and the influences of the flash component and the shooting component on the white balance parameter are considered simultaneously, the error of the white balance parameter can be reduced, and the color cast phenomenon of the image taken by the flash can be effectively improved.

[0108] It can be understood that in the present disclosure, "a plurality of" means two or more, and other quantifiers are similar thereto. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The singular forms of "a", "an" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0109] It can be further understood that the terms "first", "second", etc. are used to describe various information, but this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other and do not represent a specific order or importance. In fact, the expressions such as "first" and "second" can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.

[0110] It can be further understood that although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that these operations are required to be performed in the specific order shown or in a serial order, or that all the operations shown are required to obtain the desired result. In a specific environment, multi-tasking and parallel processing may be advantageous.

[0111] Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure.

[0112] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

Claims

1. An image processing method, characterized in that, comprising: obtaining a first image, where the first image is an image captured when the flash component of the terminal is in an on state; processing the first image based on pre-determined white balance parameters, where the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component; wherein, the relative spectral power distribution curve represents the functional relationship between the relative spectral density value and the wavelength, and the spectral sensitivity curve represents the functional relationship between the spectral sensitivity and the wavelength.

2. The method according to claim 1, characterized in that, the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Based on the relative spectral power distribution curves of the first number of flash components, determining the first average value of the relative spectral density value corresponding to each wavelength to obtain a relative spectral power distribution mean curve, and the relative spectral power distribution mean curve represents the functional relationship between the first average value and the wavelength; Based on the spectral sensitivity curves of the second number of shooting components, determining the second average value of the spectral sensitivity corresponding to each wavelength to obtain a spectral sensitivity mean curve, and the spectral sensitivity mean curve represents the functional relationship between the second average value and the wavelength; Integrating the relative spectral power distribution mean curve and the spectral sensitivity mean curve to obtain a reference value; wherein, the spectral sensitivity mean curve includes the spectral sensitivity mean curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; Determining the white balance parameters based on the reference values corresponding to the three primary colors respectively.

3. The method according to claim 2, characterized in that, the integrating the relative spectral power distribution mean curve and the spectral sensitivity mean curve to obtain a reference value includes: obtaining a spectral reflectance curve when the flash component of the terminal is in an on state, and the spectral reflectance curve represents the functional relationship between the spectral reflectance and the wavelength; Integrating the relative spectral power distribution mean curve and the spectral reflectance curve respectively with the spectral sensitivity mean curves corresponding to the three primary colors to obtain the reference values corresponding to the three primary colors respectively.

4. The method according to claim 1, characterized in that, the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Integrating the pre-configured relative spectral power distribution curve of the terminal and the spectral sensitivity curve to obtain a reference value; wherein, the spectral sensitivity curve includes the spectral sensitivity curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; Determining the white balance parameters based on the reference values corresponding to the three primary colors respectively.

5. The method according to claim 4, characterized in that, the determining the parameter values corresponding to the three primary colors respectively based on the pre-configured relative spectral power distribution function curve of the terminal and the spectral sensitivity curves corresponding to the three primary colors respectively includes: Obtain the spectral reflectance curve when the flash component of the terminal is in the on state, where the spectral reflectance curve represents the curve between spectral reflectance and wavelength; Integrate the pre-configured relative spectral power distribution curve and the spectral reflectance curve with the spectral sensitivity curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors respectively.

6. The method according to claim 1, wherein, the obtaining of the first image includes: Controlling the flash component of the terminal to be in the on state and controlling the shooting component of the terminal to collect the first image; After processing the first image based on the pre-determined white balance parameters to obtain the target image, the method further includes: Taking the target image as the image output by the shooting component.

7. An image processing device, wherein, comprising: An acquisition module for acquiring a first image, where the first image is an image collected when the flash component of the terminal is in the on state; A processing module for processing the first image based on pre-determined white balance parameters, where the white balance parameters are pre-determined based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component; wherein, the relative spectral power distribution curve represents the functional relationship between the relative value of spectral density and wavelength, and the spectral sensitivity curve represents the functional relationship between spectral sensitivity and wavelength.

8. The device according to claim 7, wherein, the processing module pre-determines the white balance parameters based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Based on the relative spectral power distribution curves of the first number of flash components, determine the first average value of the relative spectral density values corresponding to each wavelength to obtain a relative spectral power distribution mean curve, where the relative spectral power distribution mean curve represents the functional relationship between the first average value and wavelength; Based on the spectral sensitivity curves of the second number of shooting components, determine the second average value of the spectral sensitivities corresponding to each wavelength to obtain a spectral sensitivity mean curve, where the spectral sensitivity mean curve represents the functional relationship between the second average value and wavelength; Integrate the relative spectral power distribution mean curve and the spectral sensitivity mean curve to obtain a reference value; wherein, the spectral sensitivity mean curve includes the spectral sensitivity mean curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; Determine the white balance parameters based on the reference values corresponding to the three primary colors respectively.

9. The device according to claim 8, wherein, the processing module integrates the relative spectral power distribution mean curve and the spectral sensitivity mean curve in the following manner to obtain a reference value: Obtain the spectral reflectance curve when the flash component of the terminal is in the on state, where the spectral reflectance curve represents the functional relationship between spectral reflectance and wavelength; Integrate the mean relative spectral power distribution curve and the spectral reflectance curve with the mean spectral sensitivity curves corresponding to the three primary colors respectively to obtain the reference values corresponding to the three primary colors.

10. The apparatus according to claim 7, wherein, the processing module pre - determines white - balance parameters based on the relative spectral power distribution curve of the flash component and the spectral sensitivity curve of the shooting component in the following manner: Integrate the pre - configured relative spectral power distribution curve and the spectral sensitivity curve of the terminal to obtain a reference value; wherein, the spectral sensitivity curve includes the spectral sensitivity curves corresponding to the three primary colors respectively, and the reference value includes the reference values corresponding to the three primary colors respectively; Determine white - balance parameters based on the reference values corresponding to the three primary colors respectively.

11. The apparatus according to claim 10, wherein, the processing module determines the parameter values corresponding to the three primary colors respectively based on the pre - configured relative spectral power distribution function curve of the terminal and the spectral sensitivity curves corresponding to the three primary colors respectively in the following manner: Obtain the spectral reflectance curve when the flash component of the terminal is in the on state, and the spectral reflectance curve represents the curve between spectral reflectance and wavelength; Integrate the pre - configured relative spectral power distribution curve and the spectral reflectance curve with the spectral sensitivity curves corresponding to the pre - configured three primary colors respectively to obtain the reference values corresponding to the three primary colors respectively.

12. The apparatus according to claim 7, wherein, the acquisition module acquires the first image in the following manner: Control the flash component of the terminal to be in the on state, and control the shooting component of the terminal to acquire the first image; After the processing module processes the first image based on the pre - determined white - balance parameters to obtain a target image, the processing module is further configured to: use the target image as the image output by the shooting component.

13. An electronic device, wherein, comprises: a memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the method according to any one of claims 1 - 6.

14. A storage medium, wherein, the storage medium stores instructions, and when the instructions are executed by a processor, the method according to any one of claims 1 - 6 is executed.