WO2021104352A1 - White balance correction method and apparatus, storage medium, and terminal device - Google Patents
White balance correction method and apparatus, storage medium, and terminal device Download PDFInfo
- Publication number
- WO2021104352A1 WO2021104352A1 PCT/CN2020/131682 CN2020131682W WO2021104352A1 WO 2021104352 A1 WO2021104352 A1 WO 2021104352A1 CN 2020131682 W CN2020131682 W CN 2020131682W WO 2021104352 A1 WO2021104352 A1 WO 2021104352A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- light source
- target
- color temperature
- classification result
- white balance
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 238000012937 correction Methods 0.000 title claims abstract description 75
- 238000004364 calculation method Methods 0.000 claims abstract description 26
- 230000003595 spectral effect Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 7
- 238000001228 spectrum Methods 0.000 claims description 7
- WFKWXMTUELFFGS-UHFFFAOYSA-N tungsten Chemical compound [W] WFKWXMTUELFFGS-UHFFFAOYSA-N 0.000 description 36
- 229910052721 tungsten Inorganic materials 0.000 description 36
- 239000010937 tungsten Substances 0.000 description 36
- 238000010586 diagram Methods 0.000 description 16
- 230000000875 corresponding effect Effects 0.000 description 15
- 230000000694 effects Effects 0.000 description 13
- 230000008569 process Effects 0.000 description 12
- 238000004422 calculation algorithm Methods 0.000 description 11
- 238000012545 processing Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 101000712600 Homo sapiens Thyroid hormone receptor beta Proteins 0.000 description 4
- 102100033451 Thyroid hormone receptor beta Human genes 0.000 description 4
- 238000005286 illumination Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 239000003086 colorant Substances 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000009499 grossing Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000002596 correlated effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- KLDZYURQCUYZBL-UHFFFAOYSA-N 2-[3-[(2-hydroxyphenyl)methylideneamino]propyliminomethyl]phenol Chemical compound OC1=CC=CC=C1C=NCCCN=CC1=CC=CC=C1O KLDZYURQCUYZBL-UHFFFAOYSA-N 0.000 description 1
- 230000005457 Black-body radiation Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 1
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/84—Camera processing pipelines; Components thereof for processing colour signals
- H04N23/88—Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
Definitions
- This application relates to the field of image processing technology, and in particular to a white balance correction method, device, storage medium, and terminal equipment.
- White balance is an important concept in the field of photography.
- White balance can solve a series of problems such as color restoration and tone processing.
- color restoration and tone processing For different light sources, the color of the light emitted by it is different, which causes the color of the light reflected by the object to be different. Then when the object is photographed through the terminal device, due to the influence of the light source, it is likely to cause the color cast of the photographed object. At this time, it is necessary to distinguish the indoor light source from the outdoor light source, and select the corresponding parameters according to the indoor/outdoor light source To adjust the white balance to improve color reproduction.
- the embodiments of the present application propose a white balance correction method, device, storage medium, and terminal equipment, which can improve the accuracy of indoor/outdoor judgment, and can better distinguish indoor/outdoor scenes, thereby achieving better and more stable White balance effect.
- an embodiment of the present application provides a white balance correction method, which includes:
- the target classification result is obtained by adjusting the initial classification result
- an embodiment of the present application provides a white balance correction device, which includes a determination unit, a calculation unit, an adjustment unit, and a correction unit, wherein:
- the determining unit is configured to determine the initial classification result and initial confidence of the light source based on the image data obtained by the camera; and is further configured to determine the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor;
- the calculation unit is configured to perform calculations based on the infrared band ratio, color temperature information and initial confidence to obtain the target confidence;
- the adjustment unit is configured to obtain the target classification result by adjusting the initial classification result when the target confidence is less than the preset threshold;
- the correction unit is configured to determine the target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
- an embodiment of the present application provides a white balance correction device, which includes a memory and a processor; wherein,
- the memory is used to store computer programs that can run on the processor
- the processor is configured to execute the method described in the first aspect when the computer program is running.
- an embodiment of the present application provides a computer storage medium that stores a white balance correction program, which implements the method described in the first aspect when the white balance correction program is executed by at least one processor.
- an embodiment of the present application provides a terminal device, which at least includes the white balance correction device as described in the second aspect or the third aspect.
- the white balance correction method, device, storage medium and terminal equipment determine the initial classification result and initial confidence of the light source based on the image data acquired by the camera; determine the light source's initial classification result and initial confidence based on the data acquired by the color temperature sensor Infrared band ratio and color temperature information; calculate according to the infrared band ratio, color temperature information and initial confidence to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; according to the target
- the classification result determines the target white balance parameters, and performs white balance correction on the image data according to the determined target white balance parameters; in this way, after the light source is judged once to obtain the initial classification result and initial confidence, the ratio of infrared bands and the
- the color temperature information performs a second judgment on the light source, which can effectively correct the misjudgment scenes that exist after the first judgment. It can not only better distinguish the indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to
- FIG. 1 is a schematic diagram of a white balance correction process provided by related technical solutions
- FIG. 2 is a schematic flowchart of a white balance correction method provided by an embodiment of the application.
- FIG. 3 is a schematic diagram 1 of the placement position of a color temperature sensor according to an embodiment of the application.
- FIG. 4 is a second schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application.
- FIG. 5 is a third schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application.
- FIG. 6 is a fourth schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application.
- FIG. 7 is a fifth schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application.
- FIG. 8 is a schematic flowchart of another white balance correction method provided by an embodiment of the application.
- FIG. 9 is a schematic flowchart of another white balance correction method provided by an embodiment of the application.
- FIG. 10 is a schematic diagram of a detailed process of obtaining a target confidence level according to an embodiment of this application.
- FIG. 11 is a detailed flowchart of a white balance correction method provided by an embodiment of the application.
- FIG. 12 is a schematic diagram of the composition structure of a white balance correction device provided by an embodiment of the application.
- FIG. 13 is a schematic diagram of a specific hardware structure of a white balance correction device provided by an embodiment of the application.
- FIG. 14 is a schematic diagram of the composition structure of a terminal device provided by an embodiment of the application.
- White balance is an important concept in the field of photography.
- White balance can solve a series of problems such as color reproduction and tone processing.
- a color will appear different colors under the illumination of different light sources.
- gray will appear yellow under the illumination of incandescent lamp, and will appear cyan under the illumination of cold light, which is the commonly referred to as color cast phenomenon.
- the color of the input original image needs to be processed to make it appear normal gray under the illumination of different light sources.
- the common correction method is white balance correction, but the existing white balance is difficult to accurately distinguish the light source information (indoor/outdoor), resulting in the result of correction in some scenes, there is still color cast or white balance jump phenomenon .
- the infrared band ratio that is, the ratio of the infrared band to the full spectrum band
- the current environment can be determined to be indoor; if the infrared band ratio is higher than 35%, or if the current environment If it is sunny and the infrared band ratio is higher than 45%, it can be determined that the current environment is outdoor.
- the indoor/outdoor judgment method is too simple, and there are theoretically wrong logic.
- the infrared band ratio is lower than 20%
- the light source spectrum of the indoor tungsten lamp is gradually rising, and its infrared band ratio is also very high.
- the current solution can be It is determined that the current environment is outdoor, which will cause misjudgment, that is, misjudge the tungsten light source as outdoor.
- the current solutions may also cause misjudgments. It was misjudged as an outdoor situation.
- the current solution still has a defect that it does not consider the smoothing mechanism. For example, the infrared band ratio in the actual scene may fluctuate between 30% and 40%, while the current solution will have the infrared band ratio less than 35%.
- the current solution does not consider the similarity between tungsten filament lamps and daylight sources, nor does it consider adding other dimensions to further distinguish indoor/outdoor, resulting in low accuracy of indoor/outdoor judgment, and does not consider the time domain. Due to the stability of the indoor/outdoor judgment result, there may be an abnormal phenomenon of frequent switching, and the stability is poor.
- FIG. 1 shows a schematic flowchart of a white balance correction provided by related technical solutions.
- the process is mainly to use a two-classifier to make indoor/outdoor judgments, and perform white balance corrections based on the judgment results.
- step S101 is first performed to input raw image data to be processed; after the raw image data is input to the second classifier, then step S102 is performed to judge by the second classifier; according to the judgment result of the second classifier , Execute step S103 to determine whether the judgment result is indoor; if it is determined that the judgment result is indoor, execute step S104 to call indoor parameters, and then execute step S105 to obtain the white balance correction result according to the indoor parameters; if it is determined that the judgment result is outdoor , Step S106 is executed to call the outdoor parameters, and then step S107 is executed to obtain the white balance correction result according to the outdoor parameters.
- indoors are basically artificial light sources, such as tungsten lamps (Tungsten Lamp), fluorescent lamps (Fluorescent Lamp), LEDs and other light sources; while outdoor light sources are basically daylight sources ( Day Light or Natural Light) mainly.
- the type of light source can basically be determined, so that some interference areas can be eliminated in the calculation of the white balance algorithm, so as to improve the effect of the white balance algorithm. For example, when it is judged that the current environment is outdoor, the light source landing area for fluorescent lamps and LEDs can be determined as the interference area, and at this time, the color of the light source is excluded from the statistics.
- the embodiment of the application provides a white balance correction method, which determines the initial classification result and initial confidence of the light source based on the image data acquired by the camera; determines the infrared band ratio and color temperature information of the light source based on the data acquired by the color temperature sensor; The ratio, color temperature information and initial confidence are calculated to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; the target white balance parameter is determined according to the target classification result, and the target white balance parameter is determined according to the target classification result.
- the determined target white balance parameter performs white balance correction on the image data; in this way, after the current light source is judged once to obtain the initial classification result and initial confidence, the light source is performed according to the infrared band ratio and color temperature information determined by the color temperature sensor.
- the second judgment can effectively correct the misjudgment scenes that exist after the first judgment. It can not only better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve better and more stable whiteness.
- the balance effect enables better color reproduction of the terminal equipment.
- FIG. 2 shows a schematic flowchart of a white balance correction method provided by an embodiment of the present application.
- the method may include:
- S201 Determine the initial classification result and initial confidence of the light source based on the image data acquired by the camera;
- the initial classification result and initial confidence of a light source can be obtained first.
- it can be based on a preset classifier (such as a two-classifier) to obtain the initial classification result and initial confidence of the light source, or it can be based on other classification methods (such as only based on infrared band information) to obtain the initial classification of the light source
- a preset classifier such as a two-classifier
- other classification methods such as only based on infrared band information
- the initial classification results of the light source may generally include indoor and outdoor two types, and for each of the initial classification results, the initial confidence can be set to 50%, but the embodiment of the present application does not specifically limit it.
- the initial classification result and initial confidence of the light source are obtained according to the two classifiers, for S201, the initial classification result and initial confidence of the light source are determined based on the image data obtained by the camera.
- the initial classification result and initial confidence of the light source are output.
- the preset classifier may be a two-classifier, that is, the current environment is classified as indoor or outdoor.
- the acquired image data is input into a preset classifier, through which the initial classification result and initial confidence of the light source can be obtained.
- the initial confidence can be set to 50%; when the initial classification result is outdoor, the initial confidence can also be set to 50%.
- S202 Determine the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor;
- the infrared band ratio usually refers to the ratio of the infrared band to the full-spectrum band;
- the color temperature information usually refers to the relative color temperature (CCT), which specifically indicates that the color of the light emitted by the light source and the black body are in a certain range.
- CCT relative color temperature
- the temperature of the black body is the color temperature of the light source; that is, the correlated color temperature refers to the relative value closest to the radiant temperature of the black body.
- S201 and S202 there is no priority between them.
- the embodiment of the present application can execute S201 and S202 in parallel to obtain the initial classification result, initial confidence, infrared band ratio and color temperature information of the light source.
- the color temperature sensor can be used to obtain the spectral channel values corresponding to each of the multiple spectral bands in the light source, so that the infrared band ratio and color temperature information of the light source can be determined. Therefore, for S202, the determination of the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor may include:
- the infrared band ratio and color temperature information of the light source are calculated.
- color temperature is a characteristic that visible light has important applications in photography, video and other fields.
- color temperature refers to the color that an absolute black body will appear after being heated from absolute zero (-273°C). After the black body is heated, it gradually turns from black to red, turns yellow, turns white, and finally emits blue light.
- the color temperature at this temperature the spectral component of the light emitted by the black body is called the color temperature at this temperature, and the unit of measurement is Kelvin (indicated by K).
- K the unit of measurement
- CCT refers to the relative value closest to the black body radiation temperature.
- the color temperature sensor can be set on the side of the front camera of the terminal device. As shown in Figure 3, it is configured on the left side of the front camera of the terminal device. There is a color temperature sensor; it can also be set on the side of the rear camera of the terminal device. As shown in Figure 4, a color temperature sensor is configured on the lower side of the rear camera of the terminal device.
- the color temperature sensor can also be set in the fringe area of the full screen.
- Fig. 5 is a schematic diagram of setting the color temperature sensor. As shown in Fig. 5, the terminal device places the color temperature sensor under the ink in the fringe area.
- the terminal device can also set the color temperature sensor in the slit on the top.
- FIG. 6 is a schematic diagram of the placement of the color temperature sensor on the side of the display screen of the terminal device;
- FIG. 7 is a schematic diagram of the placement of the color temperature sensor on the side of the rear camera of the terminal device.
- the color temperature sensor can determine the infrared band ratio and color temperature information of the current light source. Specifically, the color temperature sensor can usually output five channel values.
- the five channels are red light band (represented by R), green light band (represented by G), blue light band (represented by B), and infrared band (represented by IR). Shows), visible light and infrared full-range bands (indicated by C) and the corresponding channels of the five spectrum bands.
- the corresponding spectral channel values of the five spectral bands in the light source can be obtained; then based on the five spectral channel values, the infrared band ratio (that is, the infrared band relative to the full-spectrum band) can be calculated Ratio, expressed in IR%) and the color temperature information of the light source (expressed in CCT).
- the infrared band ratio that is, the infrared band relative to the full-spectrum band
- the color temperature information of the light source expressed in CCT.
- tungsten filament lamps and low color temperature daylight sources around 3000K
- high color temperature daylight sources between 4000K and 7500K
- Fluorescent lamps and LEDs The light source has almost no IR% value.
- Table 1 shows an example of the IR% value range under different light sources (the specific value varies with the response curves of the five channels of the color temperature sensor).
- the value range of IR% corresponding to daylight light source is 49% ⁇ 70%
- the value range of IR% corresponding to fluorescent light source is 8% ⁇ 21%
- the value range of IR% corresponding to LED light source is 12%-18%; it can be seen that the IR% corresponding to fluorescent lamps and LED light sources is very low, and there is almost no infrared band. Therefore, light sources can be distinguished according to different IR% values; and for mixed light sources, the infrared band ratio and color temperature information output by the color temperature sensor can also be combined for auxiliary judgment, thereby improving the accuracy of indoor/outdoor judgment.
- S203 Calculate according to the infrared band ratio, the color temperature information, and the initial confidence to obtain the target confidence
- the obtained infrared band ratio can be compared with a preset infrared band threshold, and then the initial confidence level can be correlated according to the infrared band ratio and color temperature information to obtain the target confidence level.
- the preset infrared band threshold may include a first threshold and a second threshold, where the first threshold represents a preset infrared band threshold when the initial classification result is indoor, and the second threshold represents when the initial classification result is outdoor.
- the preset infrared band threshold; here, the first threshold and the second threshold are both adjustable parameters, and the specific values are set according to actual application scenarios, which are not specifically limited in the embodiment of the present application.
- the initial classification result when the initial classification result is indoors, as shown in FIG. 8, for S203, according to the infrared band ratio, the color temperature information, and the initial confidence level Perform calculations to obtain target confidence, which can include:
- the method may further include:
- the first preset value, the second preset value, and the third preset value are all adjustable parameters, and the specific values are set according to actual application scenarios, which are not specifically limited in the embodiment of the present application.
- the infrared band ratio indicates that the current light source has a certain IR component, that is, the light source has three possibilities . It may be a daylight light source, it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight source belongs to the outdoor, and the tungsten lamp And the mixed light source belongs to indoors.
- a daylight light source it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight source belongs to the outdoor, and the tungsten lamp And the mixed light source belongs to indoors.
- step S302 needs to be performed to judge the light source according to the infrared band ratio and the color temperature information to determine whether the light source is a daylight light source; if the light source is a daylight light source, the current environment may be outdoor.
- step S303 needs to be performed, that is, the initial confidence level is subtracted from the first preset value to obtain the target confidence level; if the light source is a non-daylight light source, the current environment may be indoors.
- step S304 needs to be performed, that is, the initial confidence level is added. Set the second preset value to obtain the target confidence.
- step S305 needs to be performed, that is, the initial confidence level is added to the third preset value. To get the target confidence.
- the initial classification result when the initial classification result is outdoor, as shown in FIG. 9, for S203, according to the infrared band ratio, the color temperature information, and the initial confidence level Perform calculations to obtain target confidence, which can include:
- the method may further include:
- the fourth preset value, the fifth preset value, and the sixth preset value are all adjustable parameters, and the specific values are set according to actual application scenarios, which are not specifically limited in the embodiment of the present application.
- the infrared band ratio indicates that the current light source has a certain IR component, that is, the light source has three possibilities . It may be a daylight light source, it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight source belongs to the outdoor, and the tungsten lamp And the mixed light source belongs to indoors.
- a daylight light source it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight source belongs to the outdoor, and the tungsten lamp And the mixed light source belongs to indoors.
- step S402 needs to be executed to judge the light source according to the infrared band ratio and the color temperature information to determine whether the light source is a daylight light source; if the light source is a daylight light source, the current environment may be outdoor.
- step S403 needs to be performed, that is, the initial confidence level is added to the fourth preset value to obtain the target confidence level; if the light source is a non-daylight light source, the current environment may be indoors.
- step S404 needs to be performed, that is, the initial confidence level is reduced. Go to the fifth preset value to get the target confidence.
- step S405 is required, namely The sixth preset value is subtracted from the initial confidence level to obtain the target confidence level.
- the target confidence level can be compared with a preset threshold, and based on the result of the comparison, it is determined whether the initial classification result needs to be changed, that is, whether the initial classification result needs to be adjusted.
- the preset threshold is a preset judgment value used to judge whether the initial classification result is reliable.
- the preset threshold is an adjustable parameter, and the specific value is set according to actual application scenarios, which is not specifically limited in the embodiment of the present application.
- the preset threshold value needs to be set relatively small, for example, the preset threshold value is set to 30%; in this way, when the target confidence is less than 30%, it can be judged that the initial classification result is very unreliable, and there is a misjudgment at this time In the situation, the classification result needs to be changed, that is, the initial classification result is adjusted to obtain the target classification result.
- obtaining a target classification result by adjusting the initial classification result may include:
- the initial classification result is adjusted to determine the target classification result;
- the target classification result is indoor.
- the method may further include:
- the target classification result is outdoor.
- the target confidence is compared with the preset threshold. If the target confidence is less than the preset threshold, it indicates that the current initial classification result is unreliable. At this time, the initial classification result needs to be adjusted, for example, if the initial classification If the result is indoor, the target classification result obtained after adjustment is outdoor; if the initial classification result is outdoor, the target classification result obtained after adjustment is indoor. In addition, if the target confidence is greater than or equal to the preset threshold, it indicates that the current initial classification result is reliable.
- the initial classification result needs to be maintained, that is, if the initial classification result is indoor, the target classification result is also indoor; If the classification result is outdoor, the target classification result is also outdoor; in this way, the target classification result obtained is reliable, which improves the accuracy of indoor/outdoor judgment; and the smaller preset threshold also ensures that the probability of misjudgment is relatively high. Adjusting the classification result only when it is large can also be regarded as considering the smoothing mechanism in the time domain, which helps maintain the stability of the white balance algorithm, thereby avoiding the abnormal phenomenon of frequent switching of the white balance algorithm.
- S205 Determine the target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
- the target classification result takes into account the infrared band ratio and color temperature information at the same time, the target classification result is reliable. At this time, the white balance correction of the image data to be processed can achieve a better white balance effect. .
- determining the target white balance parameter according to the target classification result, and performing white balance correction on the image data according to the determined target white balance parameter may include:
- the target classification result is outdoor, call outdoor parameters, obtain target white balance parameters from the outdoor parameters, and perform white balance correction on the image data according to the target white balance parameters.
- the target classification result is indoor, you can call the indoor parameters at this time, and then obtain the target white balance parameters from the indoor parameters, and perform white balance correction on the image data according to the target white balance parameters; if the target classification result is outdoor, At this time, you can call the outdoor parameters, and then obtain the target white balance parameters from the outdoor parameters, and perform white balance correction on the image data according to the target white balance parameters. This can improve the effect of the white balance algorithm and eliminate the color cast in the original image. Can better achieve color reproduction.
- the current light source which may be daylight or tungsten.
- the filament light source may also be a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight light source belongs to the outdoor, and the tungsten lamp and the mixed light source belong to the indoor. Further distinguish the light source. Therefore, in some embodiments, the judging the light source based on the infrared band ratio and the color temperature information may include:
- the infrared band ratio query the first color temperature information corresponding to the infrared band ratio from a pre-established comparison table;
- the light source is judged according to the color temperature information and the first color temperature information obtained by the query.
- the judging the light source according to the color temperature information and the first color temperature information obtained by the query may include:
- the light source is a daylight light source
- the light source is a non-daylight light source.
- the infrared band ratio is greater than or equal to the preset infrared band threshold (such as the first threshold or the second threshold)
- the range of the infrared band ratio IR% They are relatively similar and cannot be distinguished only by IR%.
- the color temperature information output by the color temperature sensor needs to be considered, and the first color temperature information corresponding to the IR% can be queried from the pre-established comparison table. Multiple dimensions to distinguish the light source, which can improve the accuracy.
- the difference threshold indicates that the light source is a mixed light source, such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED; if the difference is less than the preset difference threshold, it indicates that the light source is a pure color light source, such as Daylight light source or tungsten light source; At this time, it is also necessary to select the smallest color temperature information from the color temperature information and the first color temperature information, and then compare the smallest color temperature information with the preset color temperature threshold; if the smallest color temperature information is greater than the preset color temperature Threshold (for example, 3000K), the light source is determined to be a daylight source; if the minimum color temperature information is less than or equal to the preset color temperature threshold, the light source
- the first typical scene is an indoor scene with high brightness and high CCT. Because the color feature is close to outdoor, it is easy to be wrongly judged as outdoor;
- the light source is a fluorescent lamp or an LED, and its IR component is very small.
- the method of the embodiment of the present application can greatly correct the misjudgment, and ensure that the accuracy of the indoor judgment can reach about 99%.
- the second typical scene is an outdoor scene with low brightness, such as the outdoor near the evening, it is easy to be mistakenly judged as indoor at this time; but the light source of this scene is sunlight, and its IR component is very high. It can better correct misjudgments, and ensure that the correct rate of judgement outdoor can reach about 97%.
- the method of the embodiment of the present application can effectively correct the scene of indoor/outdoor misjudgment in the preset classifier (such as the two classifier) in the original white balance algorithm, and improve the accuracy of indoor/outdoor classification; especially
- the indoor light source is a fluorescent lamp or LED, or there is only an outdoor daylight light source
- the accuracy of the judgment can reach about 99%.
- the correct and appropriate white balance parameters are called (assuming that the white balance parameters include two sets of parameters such as indoor parameters and outdoor parameters), but also the scene can be better distinguished in advance, so that the debugger can eliminate the problem without adding additional parameters.
- the white balance parameters include two sets of parameters such as indoor parameters and outdoor parameters
- the scene can be better distinguished in advance, so that the debugger can eliminate the problem without adding additional parameters.
- This embodiment provides a white balance correction method, which determines the initial classification result and initial confidence of the light source based on the image data acquired by the camera; determines the infrared band ratio and color temperature information of the light source based on the data acquired by the color temperature sensor; The ratio, color temperature information and initial confidence are calculated to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; the target white balance parameter is determined according to the target classification result, and the target white balance parameter is determined according to the target classification result.
- the determined target white balance parameter performs white balance correction on the image data; in this way, after the light source is judged once to obtain the initial classification result and initial confidence, the light source can also be judged twice based on the infrared band ratio and color temperature information. Effectively correct the misjudgment scene that exists after a judgment, not only can better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve a better and more stable white balance effect, and make the terminal The equipment is capable of better color reproduction.
- FIG. 10 shows a detailed flowchart of a target confidence acquisition provided by an embodiment of the present application.
- the method may include:
- the preset classifier may be a two-class classifier or a Support Vector Machine (SVM) classifier; according to the preset classifier, the initial classification result and initial confidence of the light source can be obtained.
- the initial confidence value is 50%, but the embodiment of the present application does not specifically limit it.
- step S502 If the initial classification result is indoor, perform step S503;
- the initial classification result is Indoor, it is necessary to judge whether the infrared band ratio (expressed in IR%) is less than the first threshold (expressed in THR1); if the IR% is not less than THR1, that is, the IR% is greater than Or equal to THR1, indicating that the current light source has a certain IR component. At this time, there are three possibilities for the light source.
- the CCT value needs to be added at this time; that is to say, the light source is judged according to the infrared band ratio and the color temperature information. If it is judged that the light source is a daylight source, the current environment may be outdoor.
- step S505 The initial confidence level such as the target confidence level is subtracted from the first preset value (indicated by X1%), that is, the target confidence level can be (50-X1)%; if it is determined that the light source is a non-sunlight light source, the current environment may be Indoors, step S506 needs to be performed at this time, the initial confidence level such as the target confidence level plus the second preset value (indicated by X2%), that is, the target confidence level can be (50+X2)%; in addition, if the IR% is less than THR1 , which shows that the IR component of the current light source is very small, so it can be judged that the light source is most likely to be fluorescent or LED, that is, the most likely to be an indoor scene.
- the target confidence is equal to the initial confidence plus the third preset value (Expressed by X3%), that is, the target confidence can be (50+X3)%; and the closer the target confidence is to 100%, the more it can be determined as an indoor scene.
- the target confidence level (CL) when the initial classification result is indoor can be calculated.
- step S510 If the initial classification result is outdoor, perform step S510;
- the light source has three possibilities. It may be a daylight light source, a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp). Or a mixed light source of a tungsten lamp and an LED lamp); among them, the daylight source belongs to the outdoor, and the tungsten lamp and the mixed light source belong to the indoor.
- the light source is judged according to the infrared band ratio and the color temperature information. If it is judged that the light source is a daylight light source, the current environment may be outdoor. At this time, step S512 needs to be performed, and the initial confidence level such as the target confidence level plus the fourth preset value (Expressed by X4%), that is, the target confidence level can be (50+X4)%; if it is determined that the light source is a non-daylight light source, the current environment may be indoors.
- the initial confidence level such as the target confidence level plus the fourth preset value (Expressed by X4%), that is, the target confidence level can be (50+X4)%; if it is determined that the light source is a non-daylight light source, the current environment may be indoors.
- step S513 needs to be performed, the target confidence level and other initial confidence levels Subtract the fifth preset value (indicated by X5%), that is, the target confidence can be (50-X5)%; in addition, if the IR% is less than THR2, it means that the current light source has very little IR component, then the light source can be judged
- the high probability is a fluorescent lamp or LED light, that is, the high probability is an indoor scene, and the probability that the judgment result is outdoor is very low.
- the target confidence level can be (50-X6)%; the closer the target confidence level obtained at this time is to 0%, the more it can be determined as an indoor scene. In this way, after these steps, the target confidence level (CL) when the initial classification result is outdoor can be calculated.
- the target confidence level can be used to determine whether the current judgment result needs to be changed. Specifically, the target confidence level can be compared with a preset threshold.
- the preset threshold is a predetermined judgment value used to determine whether the initial classification result is reliable.
- the preset threshold is set to be relatively small, which may be the lowest confidence level. Threshold (represented by Y%); in the embodiment of the present application, the preset threshold may be set to 30%, but the embodiment of the present application does not specifically limit it.
- the initial classification result is not reliable.
- the initial classification result can be adjusted, that is, if the initial classification result is indoor, the adjusted target classification result is outdoor; if the initial classification result is outdoor , The adjusted target classification result is indoor.
- CL is greater than or equal to 30%, then the initial classification result is reliable, and the target classification result at this time can maintain the initial classification result, that is, if the initial classification result is indoor, the target classification result is also indoor; if the initial classification result is outdoor , The target classification result is also outdoor.
- the preset threshold usually needs to be set relatively small, so that when the target confidence is lower than the preset threshold, it can be determined that the current initial classification result is very unreliable, that is, the initial classification result is determined to be incorrect.
- the initial classification result needs to be changed at this time. That is to say, because changing the initial classification result is a risky operation, it is necessary to change the initial classification result only when the misjudgment is determined with a high probability.
- the medium confidence interval if it is not certain whether it is a misjudgment, you can choose to maintain the original initial classification result at this time.
- This process can be regarded as a smoothing mechanism in the time domain, which helps maintain the stability of the white balance algorithm, avoids the abnormal phenomenon of frequent switching of the white balance algorithm, and also avoids the instability of the white balance effect in the same scene. .
- FIG. 11 shows a detailed flowchart of a white balance correction method provided by an embodiment of the present application.
- the detailed process adds four steps:
- S601 Calculate the initial confidence level according to the infrared band ratio and color temperature information to obtain the target confidence level
- S602 Determine whether the target confidence level is less than a preset threshold
- the target classification result is the adjusted initial classification result.
- the IR% and CCT can be obtained through the color temperature sensor; the target confidence of the current indoor/outdoor initial classification results can be calculated according to the IR% and CCT; the target confidence is low (ie, the target confidence When the degree is less than the preset threshold), change the initial classification result, that is, correct the misjudgment result under lower confidence; in this way, by combining the color temperature sensor for auxiliary judgment, not only can the accuracy of indoor/outdoor judgment be improved, but also Achieve a better white balance effect.
- FIG. 12 shows a schematic diagram of the composition structure of a white balance correction device 70 provided by an embodiment of the present application.
- the white balance correction device 70 may include: a determination unit 701, a calculation unit 702, an adjustment unit 703, and a correction unit 704, where
- the determining unit 701 is configured to determine the initial classification result and initial confidence of the light source based on the image data obtained by the camera; and is also configured to determine the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor;
- the calculation unit 702 is configured to perform calculation according to the infrared band ratio, the color temperature information, and the initial confidence to obtain the target confidence;
- the adjustment unit 703 is configured to obtain a target classification result by adjusting the initial classification result when the target confidence is less than a preset threshold;
- the correction unit 704 is configured to determine a target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
- the determining unit 701 is specifically configured to input the image data obtained by the camera into a preset classifier; and output the initial classification result and the initial confidence of the light source through the preset classifier.
- the determining unit 701 is specifically configured to obtain the spectral channel value corresponding to each of the multiple spectral bands in the light source through the color temperature sensor; and calculate the infrared band ratio and color temperature information of the light source based on the obtained spectral channel value .
- the white balance correction device 70 may further include a comparison unit 705 and a judgment unit 706, wherein,
- the comparing unit 705 is configured to compare the infrared band ratio with a first threshold when the initial classification result is indoor;
- the judging unit 706 is configured to judge the light source according to the infrared waveband ratio and the color temperature information when the infrared waveband ratio is greater than or equal to the first threshold;
- the calculation unit 702 is specifically configured to, if it is determined that the light source is a daylight light source, perform a subtraction operation between the initial confidence level and a first preset value to obtain the target confidence level; and if it is determined that the light source is a non-daylight light source, Then, the initial confidence level and the second preset value are added together to obtain the target confidence level.
- the calculation unit 702 is further configured to add the initial confidence level and a third preset value to obtain the target confidence when the infrared band ratio is less than the first threshold. degree.
- the comparing unit 705 is further configured to compare the infrared band ratio with a second threshold when the initial classification result is outdoor;
- the judging unit 706 is further configured to judge the light source according to the infrared waveband ratio and the color temperature information when the infrared waveband ratio is greater than or equal to the second threshold;
- the calculation unit 702 is specifically configured to, if it is determined that the light source is a daylight light source, add the initial confidence level and a fourth preset value to obtain the target confidence level; and if it is determined that the light source is a non-daylight light source, Then, the initial confidence level is subtracted from the fifth preset value to obtain the target confidence level.
- the calculation unit 702 is further configured to perform a subtraction calculation between the initial confidence level and a sixth preset value when the infrared band ratio is less than the second threshold value to obtain the target confidence degree.
- the adjustment unit 703 is specifically configured to adjust the initial classification result to determine the target classification result when the target confidence is less than the preset threshold; If the initial classification result is indoor, it is determined that the target classification result is outdoor; if the initial classification result is outdoor, it is determined that the target classification result is indoor.
- the white balance correction device 70 may further include a maintaining unit 707 configured to determine that the target classification result is to maintain the initial value when the target confidence is greater than or equal to the preset threshold. Classification result; wherein, if the initial classification result is indoor, it is determined that the target classification result is indoor; if the initial classification result is outdoor, it is determined that the target classification result is outdoor.
- the correction unit 704 is specifically configured to call indoor parameters if the target classification result is indoor, and obtain the target white balance parameters from the indoor parameters, and compare the image according to the target white balance parameters.
- White balance correction is performed on the data; and if the target classification result is outdoor, outdoor parameters are called, the target white balance parameters are obtained from the outdoor parameters, and the image data is white balance corrected according to the target white balance parameters.
- the white balance correction device 70 may further include a query unit 708, configured to query the first color temperature corresponding to the infrared band ratio from a pre-established comparison table according to the infrared band ratio. information;
- the judging unit 706 is specifically configured to judge the light source according to the color temperature information and the first color temperature information obtained by the query.
- the determining unit 706 is specifically configured to calculate the difference between the color temperature information and the first color temperature information; and when the difference is less than a preset difference threshold, from the color temperature Selecting the minimum color temperature information from the information and the first color temperature information; and comparing the minimum color temperature information with a preset color temperature threshold; and if the minimum color temperature information is greater than the preset color temperature threshold, determining that the light source is sunlight Light source; if the minimum color temperature information is less than or equal to the preset color temperature threshold, it is determined that the light source is a non-daylight light source.
- a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, or it may also be non-modular.
- the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be realized in the form of hardware or software function module.
- the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
- the technical solution of this embodiment is essentially or It is said that the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product.
- the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment.
- the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
- this embodiment provides a computer storage medium that stores a white balance correction program that implements the method described in any one of the foregoing embodiments when the white balance correction program is executed by at least one processor.
- FIG. 13 shows the specific hardware structure of the white balance correction device 70 provided by the embodiment of the present application, which may include: a communication interface 801, a memory 802, and a processor 803:
- the components are coupled together through the bus system 804.
- the bus system 804 is used to implement connection and communication between these components.
- the bus system 804 also includes a power bus, a control bus, and a status signal bus.
- various buses are marked as the bus system 804 in FIG. 13.
- the communication interface 801 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
- the memory 802 is configured to store a computer program that can run on the processor 803;
- the processor 803 is configured to execute: when the computer program is running:
- the target classification result is obtained by adjusting the initial classification result
- the memory 802 in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
- the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
- the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
- RAM static random access memory
- DRAM dynamic random access memory
- DRAM synchronous dynamic random access memory
- DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
- Enhanced SDRAM, ESDRAM Synchronous Link Dynamic Random Access Memory
- Synchlink DRAM Synchronous Link Dynamic Random Access Memory
- DRRAM Direct Rambus RAM
- the processor 803 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 803 or instructions in the form of software.
- the aforementioned processor 803 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
- DSP digital signal processor
- ASIC application specific integrated circuit
- FPGA field programmable gate array
- the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
- the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
- the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
- the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
- the storage medium is located in the memory 802, and the processor 803 reads the information in the memory 802, and completes the steps of the foregoing method in combination with its hardware.
- the embodiments described in this application can be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof.
- the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, and others for performing the functions described in this application Electronic unit or its combination.
- ASICs application specific integrated circuits
- DSP digital signal processors
- DSP Device digital signal processing devices
- DSPD digital signal processing devices
- PLD programmable Logic Device
- Field-Programmable Gate Array Field-Programmable Gate Array
- FPGA Field-Programmable Gate Array
- the technology described in this application can be implemented through modules (for example, procedures, functions, etc.) that perform the functions
- the processor 803 is further configured to execute the steps of the method described in any one of the foregoing embodiments when the computer program is running.
- the terminal device in the embodiments of the present application may be implemented in various forms.
- the terminal equipment may include smart phones, tablet computers, notebook computers, handheld computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, and wearable devices.
- PDA Personal Digital Assistant
- PMP portable media players
- FIG. 14 shows a schematic diagram of the composition structure of a terminal device provided by an embodiment of the present application.
- the terminal device 90 may at least include the white balance correction device 70 described in any one of the foregoing embodiments.
- the initial classification result and initial confidence of the light source are determined based on the image data acquired by the camera; the infrared band ratio and color temperature information of the light source are determined based on the data acquired by the color temperature sensor; according to the infrared band ratio, color temperature information and initial The confidence is calculated to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; the target white balance parameter is determined according to the target classification result, and the target white balance is determined according to the target white balance Parameters perform white balance correction on the image data; in this way, after the light source is judged once to obtain the initial classification result and initial confidence, the light source is judged twice according to the determined infrared band ratio and color temperature information, which can effectively correct the result after the first judgment.
- the existence of misjudgment scenes can not only better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve a better and more stable white balance effect, so that the terminal
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Color Television Image Signal Generators (AREA)
Abstract
Description
相关申请的交叉引用Cross-references to related applications
本申请基于申请号为201911174624.4、申请日为2019年11月26日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。This application is filed based on a Chinese patent application with application number 201911174624.4 and an application date of November 26, 2019, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated into this application by way of introduction.
本申请涉及图像处理技术领域,尤其涉及一种白平衡校正方法、装置、存储介质及终端设备。This application relates to the field of image processing technology, and in particular to a white balance correction method, device, storage medium, and terminal equipment.
白平衡(White Balance)是摄像领域的一个重要概念,通过白平衡可以解决色彩还原和色调处理等系列问题。对于不同的光源,其发出的光线颜色不同,导致物体反射出的光线颜色也不同。那么当通过终端设备对物体进行拍照时,由于光源的影响,很可能会导致所拍摄的物体发生偏色现象,这时候需要对室内光源和室外光源进行区分,根据室内/室外光源选择对应的参数来对白平衡进行调整,从而提高色彩还原度。White balance (White Balance) is an important concept in the field of photography. White balance can solve a series of problems such as color restoration and tone processing. For different light sources, the color of the light emitted by it is different, which causes the color of the light reflected by the object to be different. Then when the object is photographed through the terminal device, due to the influence of the light source, it is likely to cause the color cast of the photographed object. At this time, it is necessary to distinguish the indoor light source from the outdoor light source, and select the corresponding parameters according to the indoor/outdoor light source To adjust the white balance to improve color reproduction.
针对室内/室外的判断,已经存在一些解决方案。但是这些解决方案考虑不全面,比如没有考虑到钨丝灯和日光光源的相似性,而且判断过于简单,容易出现误判现象,使得室内/室外判断的准确率偏低。For indoor/outdoor judgments, there are already some solutions. However, these solutions are not considered comprehensively. For example, the similarity between tungsten filament lamps and daylight sources is not considered, and the judgment is too simple, which is prone to misjudgment, which makes the accuracy of indoor/outdoor judgments low.
发明内容Summary of the invention
本申请实施例提出一种白平衡校正方法、装置、存储介质及终端设备,可以提高室内/室外判断的准确率,能够更好地区分室内/室外的场景,从而达到更好的、更稳定的白平衡效果。The embodiments of the present application propose a white balance correction method, device, storage medium, and terminal equipment, which can improve the accuracy of indoor/outdoor judgment, and can better distinguish indoor/outdoor scenes, thereby achieving better and more stable White balance effect.
本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:
第一方面,本申请实施例提供了一种白平衡校正方法,该方法包括:In the first aspect, an embodiment of the present application provides a white balance correction method, which includes:
基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;Based on the image data obtained by the camera, determine the initial classification result and initial confidence of the light source;
基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;Based on the data obtained by the color temperature sensor, determine the infrared band ratio and color temperature information of the light source;
根据红外波段比值、色温信息及初始置信度进行计算,获得目标置信度;Calculate according to infrared band ratio, color temperature information and initial confidence to obtain target confidence;
当目标置信度小于预设阈值时,通过对初始分类结果的调整得到目标分类结果;When the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result;
根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正。Determine the target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
第二方面,本申请实施例提供了一种白平衡校正装置,该白平衡校正装置包括确定单元、计算单元、调整单元和校正单元,其中,In a second aspect, an embodiment of the present application provides a white balance correction device, which includes a determination unit, a calculation unit, an adjustment unit, and a correction unit, wherein:
确定单元,配置为基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;以及还配置为基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;The determining unit is configured to determine the initial classification result and initial confidence of the light source based on the image data obtained by the camera; and is further configured to determine the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor;
计算单元,配置为根据红外波段比值、色温信息及初始置信度进行计算,获得目标置信度;The calculation unit is configured to perform calculations based on the infrared band ratio, color temperature information and initial confidence to obtain the target confidence;
调整单元,配置为当目标置信度小于预设阈值时,通过对初始分类结果的调整得到目标分类结果;The adjustment unit is configured to obtain the target classification result by adjusting the initial classification result when the target confidence is less than the preset threshold;
校正单元,配置为根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正。The correction unit is configured to determine the target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
第三方面,本申请实施例提供了一种白平衡校正装置,该白平衡校正装置包括存储器和处理器;其中,In a third aspect, an embodiment of the present application provides a white balance correction device, which includes a memory and a processor; wherein,
存储器,用于存储能够在处理器上运行的计算机程序;The memory is used to store computer programs that can run on the processor;
处理器,用于在运行所述计算机程序时,执行如第一方面所述的方法。The processor is configured to execute the method described in the first aspect when the computer program is running.
第四方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有白平衡校正程序,白平衡校正程序被至少一个处理器执行时实现如第一方面所述的方法。In a fourth aspect, an embodiment of the present application provides a computer storage medium that stores a white balance correction program, which implements the method described in the first aspect when the white balance correction program is executed by at least one processor.
第五方面,本申请实施例提供了一种终端设备,该终端设备至少包括如第二方面或第三方面所述的白平衡校正装置。In a fifth aspect, an embodiment of the present application provides a terminal device, which at least includes the white balance correction device as described in the second aspect or the third aspect.
本申请实施例所提供的一种白平衡校正方法、装置、存储介质及终端设备,基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;根据红外波段比值、色温信息及初始置信度进行计算,获得目标置信度;当目标置信度小于预设阈值时,通过对初始分类结果的调整得到目标分类结果;根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正;这样,在对光源进行一次判断获得初始分类结果和初始置信度之后,根据确定的红外波段比值和色温信息对光源进行二次判断,可以有效修正一次判断后所存在的误判断场景,不仅能够更好地区分室内/室外的场景,还能够提高室内/室外判断的准确率,从而达到更好的、更稳定的白平衡效果,使得终端设备能够更好的色彩还原。The white balance correction method, device, storage medium and terminal equipment provided by the embodiments of the present application determine the initial classification result and initial confidence of the light source based on the image data acquired by the camera; determine the light source's initial classification result and initial confidence based on the data acquired by the color temperature sensor Infrared band ratio and color temperature information; calculate according to the infrared band ratio, color temperature information and initial confidence to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; according to the target The classification result determines the target white balance parameters, and performs white balance correction on the image data according to the determined target white balance parameters; in this way, after the light source is judged once to obtain the initial classification result and initial confidence, the ratio of infrared bands and the The color temperature information performs a second judgment on the light source, which can effectively correct the misjudgment scenes that exist after the first judgment. It can not only better distinguish the indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve better , A more stable white balance effect, so that the terminal equipment can better color reproduction.
图1为相关技术方案提供的一种白平衡校正的流程示意图;FIG. 1 is a schematic diagram of a white balance correction process provided by related technical solutions;
图2为本申请实施例提供的一种白平衡校正方法的流程示意图;2 is a schematic flowchart of a white balance correction method provided by an embodiment of the application;
图3为本申请实施例提供的一种色温传感器的摆放位置示意图一;3 is a schematic diagram 1 of the placement position of a color temperature sensor according to an embodiment of the application;
图4为本申请实施例提供的一种色温传感器的摆放位置示意图二;4 is a second schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application;
图5为本申请实施例提供的一种色温传感器的摆放位置示意图三;FIG. 5 is a third schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application;
图6为本申请实施例提供的一种色温传感器的摆放位置示意图四;FIG. 6 is a fourth schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application;
图7为本申请实施例提供的一种色温传感器的摆放位置示意图五;FIG. 7 is a fifth schematic diagram of the placement position of a color temperature sensor according to an embodiment of the application; FIG.
图8为本申请实施例提供的另一种白平衡校正方法的流程示意图;FIG. 8 is a schematic flowchart of another white balance correction method provided by an embodiment of the application;
图9为本申请实施例提供的又一种白平衡校正方法的流程示意图;FIG. 9 is a schematic flowchart of another white balance correction method provided by an embodiment of the application;
图10为本申请实施例提供的一种目标置信度获取的详细流程示意图;FIG. 10 is a schematic diagram of a detailed process of obtaining a target confidence level according to an embodiment of this application;
图11为本申请实施例提供的一种白平衡校正方法的详细流程示意图;FIG. 11 is a detailed flowchart of a white balance correction method provided by an embodiment of the application;
图12为本申请实施例提供的一种白平衡校正装置的组成结构示意图;FIG. 12 is a schematic diagram of the composition structure of a white balance correction device provided by an embodiment of the application;
图13为本申请实施例提供的一种白平衡校正装置的具体硬件结构示意图;FIG. 13 is a schematic diagram of a specific hardware structure of a white balance correction device provided by an embodiment of the application;
图14为本申请实施例提供的一种终端设备的组成结构示意图。FIG. 14 is a schematic diagram of the composition structure of a terminal device provided by an embodiment of the application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It is understandable that the specific embodiments described here are only used to explain the related application, but not to limit the application. In addition, it should be noted that, for ease of description, only the parts related to the relevant application are shown in the drawings.
白平衡(White Balance)是摄像领域的一个重要概念,通过白平衡可以解决色彩还原 和色调处理等系列问题。其中,一种颜色在不同光源的照射下会呈现出不同的颜色,例如,灰色在白炽灯照射下会呈现黄色,而在冷光照射下会呈现青色,即通常所言的偏色现象。这时候需要对输入的原始图像的颜色进行处理,使之在不同的光源照射下呈现正常的灰色。目前来说,常见的校正方法是白平衡校正,但是现有的白平衡很难准确区分出光源信息(室内/室外),导致在一些场景下校正的结果仍然存在偏色或者白平衡跳变现象。White balance is an important concept in the field of photography. White balance can solve a series of problems such as color reproduction and tone processing. Among them, a color will appear different colors under the illumination of different light sources. For example, gray will appear yellow under the illumination of incandescent lamp, and will appear cyan under the illumination of cold light, which is the commonly referred to as color cast phenomenon. At this time, the color of the input original image needs to be processed to make it appear normal gray under the illumination of different light sources. At present, the common correction method is white balance correction, but the existing white balance is difficult to accurately distinguish the light source information (indoor/outdoor), resulting in the result of correction in some scenes, there is still color cast or white balance jump phenomenon .
针对室内/室外的判断,目前已经存在一些解决方案。但是目前的解决方案大多仅根据红外波段信息来进行室内/室外的判断。具体判断过程为,如果红外波段比值(即,红外波段相对于全光谱波段所占的比例)低于20%,那么可以确定当前环境为室内;如果红外波段比值高于35%,或者如果当前环境为晴天且红外波段比值高于45%,那么可以确定当前环境为室外。There are already some solutions for indoor/outdoor judgments. However, most of the current solutions only make indoor/outdoor judgments based on infrared band information. The specific judgment process is that if the infrared band ratio (that is, the ratio of the infrared band to the full spectrum band) is less than 20%, then the current environment can be determined to be indoor; if the infrared band ratio is higher than 35%, or if the current environment If it is sunny and the infrared band ratio is higher than 45%, it can be determined that the current environment is outdoor.
然而,目前的解决方案中,室内/室外的判断方法过于简单,而且还存在理论上的错误逻辑,例如,当红外波段比值低于20%时,根据目前的解决方案可以确定出当前环境为室内;但是室内的钨丝灯的光源光谱是逐步上升的,而且其红外波段比值也非常高,这时候当钨丝灯的光源所对应的红外波段比值高于45%时,根据目前的解决方案可以确定出当前环境为室外,此时会造成误判断,即将钨丝灯光源误判成室外的情况。同理,针对室内的混合光源场景,比如钨丝灯和荧光灯的混合光源或者钨丝灯和发光二极管(Light Emitting Diode,LED)的混合光源,根据目前的解决方案也可能会造成误判断,即将其误判成室外的情况。另外,目前的解决方案还存在的一个缺陷在于没有考虑平滑机制,比如实际场景中的红外波段比值可能在30%~40%之间波动,而目前的解决方案会在该红外波段比值小于35%判断当前环境为室内,在该红外波段比值大于35%判断当前环境为室外,将可能会造成室内/室外的判断结果来回切换,从而导致白平衡算法效果上的跳变,不够稳定。也就是说,目前的解决方案没有考虑钨丝灯和日光光源的相似性,也没有考虑增加其他维度来进一步区分室内/室外,导致室内/室外判断的准确率偏低,而且没有考虑时域上的稳定性,导致室内/室外的判断结果可能存在频繁切换的异常现象,稳定性差。However, in the current solution, the indoor/outdoor judgment method is too simple, and there are theoretically wrong logic. For example, when the infrared band ratio is lower than 20%, according to the current solution, it can be determined that the current environment is indoor ; But the light source spectrum of the indoor tungsten lamp is gradually rising, and its infrared band ratio is also very high. At this time, when the corresponding infrared band ratio of the tungsten lamp light source is higher than 45%, the current solution can be It is determined that the current environment is outdoor, which will cause misjudgment, that is, misjudge the tungsten light source as outdoor. Similarly, for indoor mixed light source scenes, such as a mixed light source of tungsten filament lamps and fluorescent lamps or a mixed light source of tungsten filament lamps and Light Emitting Diodes (LED), the current solutions may also cause misjudgments. It was misjudged as an outdoor situation. In addition, the current solution still has a defect that it does not consider the smoothing mechanism. For example, the infrared band ratio in the actual scene may fluctuate between 30% and 40%, while the current solution will have the infrared band ratio less than 35%. If the current environment is judged to be indoor, if the infrared band ratio is greater than 35%, judging that the current environment is outdoor, which may cause the indoor/outdoor judgment result to switch back and forth, resulting in a jump in the effect of the white balance algorithm, which is not stable enough. In other words, the current solution does not consider the similarity between tungsten filament lamps and daylight sources, nor does it consider adding other dimensions to further distinguish indoor/outdoor, resulting in low accuracy of indoor/outdoor judgment, and does not consider the time domain. Due to the stability of the indoor/outdoor judgment result, there may be an abnormal phenomenon of frequent switching, and the stability is poor.
参见图1,其示出了相关技术方案提供的一种白平衡校正的流程示意图。如图1所示,该流程主要是采用一个二分类器进行室内/室外的判断,根据该判断结果进行白平衡校正。具体地,首先执行步骤S101,输入待处理的原始(Raw)图像数据;在将原始图像数据输入到二分类器之后,然后执行步骤S102,通过二分类器进行判断;根据二分类器的判断结果,执行步骤S103,确定判断结果是否为室内;若确定判断结果为室内,则执行步骤S104,调用室内参数,然后执行步骤S105,根据室内参数,获得白平衡的校正结果;若确定判断结果为室外,则执行步骤S106,调用室外参数,然后执行步骤S107,根据室外参数,获得白平衡的校正结果。Refer to FIG. 1, which shows a schematic flowchart of a white balance correction provided by related technical solutions. As shown in Figure 1, the process is mainly to use a two-classifier to make indoor/outdoor judgments, and perform white balance corrections based on the judgment results. Specifically, step S101 is first performed to input raw image data to be processed; after the raw image data is input to the second classifier, then step S102 is performed to judge by the second classifier; according to the judgment result of the second classifier , Execute step S103 to determine whether the judgment result is indoor; if it is determined that the judgment result is indoor, execute step S104 to call indoor parameters, and then execute step S105 to obtain the white balance correction result according to the indoor parameters; if it is determined that the judgment result is outdoor , Step S106 is executed to call the outdoor parameters, and then step S107 is executed to obtain the white balance correction result according to the outdoor parameters.
需要说明的是,基于图1所示的流程,由于室内基本是以人造光源为主,比如钨丝灯(Tungsten Lamp)、荧光灯(Fluorescent Lamp)、LED等光源;而室外基本是以日光光源(Day Light或者Natural Light)为主。在确定室内还是室外之后,基本可以确定出光源种类,从而能够在白平衡算法的计算时排除一些干扰区域,以提高白平衡算法的效果。例如,当判断当前环境为室外时,针对荧光灯和LED的光源落点区域可以确定为干扰区域,这时候在统计光源颜色时进行排除。但是由于目前的二分类器判断的准确性不能够达到100%,而且在使用时还会存在5%~10%的概率判断错误,导致室内/室外判断的准确率为90%~95%,也就无法精准地确定出干扰区域,使得白平衡算法在误判时的效果较差。It should be noted that, based on the process shown in Figure 1, since indoors are basically artificial light sources, such as tungsten lamps (Tungsten Lamp), fluorescent lamps (Fluorescent Lamp), LEDs and other light sources; while outdoor light sources are basically daylight sources ( Day Light or Natural Light) mainly. After determining whether it is indoor or outdoor, the type of light source can basically be determined, so that some interference areas can be eliminated in the calculation of the white balance algorithm, so as to improve the effect of the white balance algorithm. For example, when it is judged that the current environment is outdoor, the light source landing area for fluorescent lamps and LEDs can be determined as the interference area, and at this time, the color of the light source is excluded from the statistics. However, the accuracy of the current two-classifiers cannot reach 100%, and there will be 5% to 10% probability of judgment errors during use, resulting in the accuracy of indoor/outdoor judgments being 90% to 95%. It is impossible to accurately determine the interference area, which makes the white balance algorithm less effective in misjudgment.
本申请实施例提供一种白平衡校正方法,基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;根据红外波段比值、色温信息及初始置信度进行计算,获得目标置信度;当目标置信度小于预设阈值时,通过对初始分类结果的调整得到目标分类结果;根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正;这样, 在对当前的光源进行一次判断获得初始分类结果和初始置信度之后,根据色温传感器所确定的红外波段比值和色温信息对光源进行二次判断,可以有效修正一次判断后所存在的误判断场景,不仅能够更好地区分室内/室外的场景,还能够提高室内/室外判断的准确率,从而达到更好的、更稳定的白平衡效果,使得终端设备能够更好的色彩还原。The embodiment of the application provides a white balance correction method, which determines the initial classification result and initial confidence of the light source based on the image data acquired by the camera; determines the infrared band ratio and color temperature information of the light source based on the data acquired by the color temperature sensor; The ratio, color temperature information and initial confidence are calculated to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; the target white balance parameter is determined according to the target classification result, and the target white balance parameter is determined according to the target classification result. The determined target white balance parameter performs white balance correction on the image data; in this way, after the current light source is judged once to obtain the initial classification result and initial confidence, the light source is performed according to the infrared band ratio and color temperature information determined by the color temperature sensor. The second judgment can effectively correct the misjudgment scenes that exist after the first judgment. It can not only better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve better and more stable whiteness. The balance effect enables better color reproduction of the terminal equipment.
下面将结合附图对本申请各实施例进行详细说明。Hereinafter, each embodiment of the present application will be described in detail with reference to the accompanying drawings.
本申请的一实施例中,参见图2,其示出了本申请实施例提供的一种白平衡校正方法的流程示意图。如图2所示,该方法可以包括:In an embodiment of the present application, refer to FIG. 2, which shows a schematic flowchart of a white balance correction method provided by an embodiment of the present application. As shown in Figure 2, the method may include:
S201:基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;S201: Determine the initial classification result and initial confidence of the light source based on the image data acquired by the camera;
需要说明的是,在执行本申请实施例的白平衡校正方法之前,可以首先得到一个光源的初始分类结果和初始置信度。这里,可以是根据预设分类器(比如二分类器)来获得光源的初始分类结果和初始置信度,也可以是根据其他分类方式(比如仅根据红外波段信息进行分类)来获得光源的初始分类结果和初始置信度,本申请实施例不作具体限定。It should be noted that before performing the white balance correction method of the embodiment of the present application, the initial classification result and initial confidence of a light source can be obtained first. Here, it can be based on a preset classifier (such as a two-classifier) to obtain the initial classification result and initial confidence of the light source, or it can be based on other classification methods (such as only based on infrared band information) to obtain the initial classification of the light source The results and initial confidence are not specifically limited in the embodiments of the present application.
另外,光源的初始分类结果通常可以包括室内和室外两种,那么针对每一种的初始分类结果,初始置信度均可以设置为50%,但是本申请实施例也不作具体限定。In addition, the initial classification results of the light source may generally include indoor and outdoor two types, and for each of the initial classification results, the initial confidence can be set to 50%, but the embodiment of the present application does not specifically limit it.
在一些实施例中,当根据二分类器来获得光源的初始分类结果和初始置信度时,对于S201来说,所述基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度,可以包括:In some embodiments, when the initial classification result and initial confidence of the light source are obtained according to the two classifiers, for S201, the initial classification result and initial confidence of the light source are determined based on the image data obtained by the camera. include:
将摄像头获取的图像数据输入预设分类器;Input the image data obtained by the camera into the preset classifier;
通过所述预设分类器,输出光源的初始分类结果和初始置信度。Through the preset classifier, the initial classification result and initial confidence of the light source are output.
需要说明的是,预设分类器可以是二分类器,即将当前环境分类为室内或者室外。具体地,将所获取的图像数据输入预设分类器,通过该预设分类器,可以得到光源的初始分类结果和初始置信度。例如,当初始分类结果为室内时,初始置信度可以设置为50%;当初始分类结果为室外时,初始置信度也可以设置为50%。It should be noted that the preset classifier may be a two-classifier, that is, the current environment is classified as indoor or outdoor. Specifically, the acquired image data is input into a preset classifier, through which the initial classification result and initial confidence of the light source can be obtained. For example, when the initial classification result is indoor, the initial confidence can be set to 50%; when the initial classification result is outdoor, the initial confidence can also be set to 50%.
S202:基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;S202: Determine the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor;
需要说明的是,红外波段比值通常是指红外波段相对于全光谱波段所占的比例;色温信息通常是指相对色温(Correlated Color Temperature,CCT),具体表示光源发射光的颜色和黑体在某一温度下辐射光色相同时,黑体的温度即是光源的色温;也即,相关色温是指最接近黑体辐射温度的相对值。It should be noted that the infrared band ratio usually refers to the ratio of the infrared band to the full-spectrum band; the color temperature information usually refers to the relative color temperature (CCT), which specifically indicates that the color of the light emitted by the light source and the black body are in a certain range. When the radiant light color is the same at temperature, the temperature of the black body is the color temperature of the light source; that is, the correlated color temperature refers to the relative value closest to the radiant temperature of the black body.
这里,针对S201和S202来,两者没有先后顺序之分,本申请实施例可以并行执行S201和S202,以得到光源的初始分类结果、初始置信度以及红外波段比值和色温信息。Here, for S201 and S202, there is no priority between them. The embodiment of the present application can execute S201 and S202 in parallel to obtain the initial classification result, initial confidence, infrared band ratio and color temperature information of the light source.
在一些实施例中,通过色温传感器可以得到光源中多个频谱波段各自对应的频谱通道值,从而能够确定出光源的红外波段比值和色温信息。因此,对于S202来说,所述基于色温传感器获取的数据,确定光源的红外波段比值和色温信息,可以包括:In some embodiments, the color temperature sensor can be used to obtain the spectral channel values corresponding to each of the multiple spectral bands in the light source, so that the infrared band ratio and color temperature information of the light source can be determined. Therefore, for S202, the determination of the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor may include:
通过色温传感器获得光源中多个频谱波段各自对应的频谱通道值;Obtain the corresponding spectral channel values of multiple spectral bands in the light source through the color temperature sensor;
基于所获得的频谱通道值,计算得到光源的红外波段比值和色温信息。Based on the obtained spectrum channel value, the infrared band ratio and color temperature information of the light source are calculated.
需要说明的是,色温是可见光在摄影、录像等领域具有重要应用的特征。理论上,色温是指绝对黑体从绝对零度(-273℃)开始加温后所呈现的颜色。黑体在受热后,逐渐由黑变红,转黄,发白,最后发出蓝色光。当加热到一定的温度,黑体发出的光所包含的光谱成分,就称为这一温度下的色温,计量单位为开尔文(用K表示)。这里,CCT是指最接近黑体辐射温度的相对值。It should be noted that the color temperature is a characteristic that visible light has important applications in photography, video and other fields. Theoretically, color temperature refers to the color that an absolute black body will appear after being heated from absolute zero (-273°C). After the black body is heated, it gradually turns from black to red, turns yellow, turns white, and finally emits blue light. When heated to a certain temperature, the spectral component of the light emitted by the black body is called the color temperature at this temperature, and the unit of measurement is Kelvin (indicated by K). Here, CCT refers to the relative value closest to the black body radiation temperature.
还需要说明的是,针对终端设备上所设置的色温传感器,具体的,该色温传感器可以设置在终端设备的前置摄像头一侧,如图3所示,在终端设备的前置摄像头左侧配置有色温传感器;也可以设置在终端设备的后置摄像头一侧,如图4所示,在终端设备的后置摄像头下侧配置有色温传感器。It should also be noted that for the color temperature sensor set on the terminal device, specifically, the color temperature sensor can be set on the side of the front camera of the terminal device. As shown in Figure 3, it is configured on the left side of the front camera of the terminal device. There is a color temperature sensor; it can also be set on the side of the rear camera of the terminal device. As shown in Figure 4, a color temperature sensor is configured on the lower side of the rear camera of the terminal device.
色温传感器也可以设置在全面屏的刘海区域中,具体地,图5为色温传感器的一种设 置示意图,如图5所示,终端设备将色温传感器放置于刘海区域的油墨下方。The color temperature sensor can also be set in the fringe area of the full screen. Specifically, Fig. 5 is a schematic diagram of setting the color temperature sensor. As shown in Fig. 5, the terminal device places the color temperature sensor under the ink in the fringe area.
终端设备还可以将色温传感器设置在顶部的狭缝中。具体地,图6为在终端设备的显示屏一侧,色温传感器的摆放位置示意图;图7为在终端设备的后置摄像头一侧,色温传感器的摆放位置示意图。The terminal device can also set the color temperature sensor in the slit on the top. Specifically, FIG. 6 is a schematic diagram of the placement of the color temperature sensor on the side of the display screen of the terminal device; FIG. 7 is a schematic diagram of the placement of the color temperature sensor on the side of the rear camera of the terminal device.
本申请实施例中,通过色温传感器可以确定出当前的光源中红外波段比值和色温信息。具体地,色温传感器通常可以输出五个通道值,这五个通道分别是红光波段(用R表示)、绿光波段(用G表示)、蓝光波段(用B表示)、红外波段(用IR表示)、可见光及红外全范围波段(用C表示)等五个频谱波段对应的通道。也就是说,通过色温传感器,可以获得光源中五个频谱波段各自对应的频谱通道值;然后基于这五个频谱通道值,可以计算出红外波段比值(即红外波段相对于全光谱波段所占的比例,用IR%表示)以及光源的色温信息(用CCT表示)。在人造光源和日光光源中,钨丝灯和低色温的日光光源(3000K左右)拥有最高的IR%,而高色温的日光光源(4000K~7500K之间)拥有较高的IR%,荧光灯和LED光源几乎没有IR%值,具体参见表1,其示出了不同光源下IR%的取值范围的示例(具体数值随色温传感器的五个通道响应曲线不同而不同)。In the embodiment of the present application, the color temperature sensor can determine the infrared band ratio and color temperature information of the current light source. Specifically, the color temperature sensor can usually output five channel values. The five channels are red light band (represented by R), green light band (represented by G), blue light band (represented by B), and infrared band (represented by IR). Shows), visible light and infrared full-range bands (indicated by C) and the corresponding channels of the five spectrum bands. In other words, through the color temperature sensor, the corresponding spectral channel values of the five spectral bands in the light source can be obtained; then based on the five spectral channel values, the infrared band ratio (that is, the infrared band relative to the full-spectrum band) can be calculated Ratio, expressed in IR%) and the color temperature information of the light source (expressed in CCT). Among artificial light sources and daylight sources, tungsten filament lamps and low color temperature daylight sources (around 3000K) have the highest IR%, while high color temperature daylight sources (between 4000K and 7500K) have higher IR%. Fluorescent lamps and LEDs The light source has almost no IR% value. For details, see Table 1, which shows an example of the IR% value range under different light sources (the specific value varies with the response curves of the five channels of the color temperature sensor).
表1Table 1
在表1中,日光光源对应的IR%的取值范围是49%~70%,荧光灯光源对应的IR%的取值范围是8%~21%,LED光源对应的IR%的取值范围是12%~18%;可以看出,荧光灯和LED光源对应的IR%很低,几乎没有红外波段。因此,可以根据不同的IR%值来区分光源;而针对混合光源来说,还可以结合色温传感器输出得到的红外波段比值和色温信息进行辅助判断,从而提高了室内/室外判断的准确率。In Table 1, the value range of IR% corresponding to daylight light source is 49%~70%, the value range of IR% corresponding to fluorescent light source is 8%~21%, and the value range of IR% corresponding to LED light source is 12%-18%; it can be seen that the IR% corresponding to fluorescent lamps and LED light sources is very low, and there is almost no infrared band. Therefore, light sources can be distinguished according to different IR% values; and for mixed light sources, the infrared band ratio and color temperature information output by the color temperature sensor can also be combined for auxiliary judgment, thereby improving the accuracy of indoor/outdoor judgment.
S203:根据所述红外波段比值、所述色温信息及所述初始置信度进行计算,获得目标 置信度;S203: Calculate according to the infrared band ratio, the color temperature information, and the initial confidence to obtain the target confidence;
需要说明的是,针对初始分类结果,可以将所得到的红外波段比值与预设的红外波段阈值进行比较,然后根据红外波段比值和色温信息对初始置信度进行相关运算,以得到目标置信度。It should be noted that for the initial classification result, the obtained infrared band ratio can be compared with a preset infrared band threshold, and then the initial confidence level can be correlated according to the infrared band ratio and color temperature information to obtain the target confidence level.
具体地,预设的红外波段阈值可以包括第一阈值和第二阈值,其中,第一阈值表示初始分类结果为室内时所预先设定的红外波段阈值,第二阈值表示初始分类结果为室外时所预先设定的红外波段阈值;这里,第一阈值和第二阈值均为可调参数,具体数值根据实际应用场景进行设定,本申请实施例不作具体限定。Specifically, the preset infrared band threshold may include a first threshold and a second threshold, where the first threshold represents a preset infrared band threshold when the initial classification result is indoor, and the second threshold represents when the initial classification result is outdoor. The preset infrared band threshold; here, the first threshold and the second threshold are both adjustable parameters, and the specific values are set according to actual application scenarios, which are not specifically limited in the embodiment of the present application.
可选地,在一些实施例中,当所述初始分类结果为室内时,如图8所示,对于S203来说,所述根据所述红外波段比值、所述色温信息及所述初始置信度进行计算,获得目标置信度,可以包括:Optionally, in some embodiments, when the initial classification result is indoors, as shown in FIG. 8, for S203, according to the infrared band ratio, the color temperature information, and the initial confidence level Perform calculations to obtain target confidence, which can include:
S301:将所述红外波段比值与第一阈值进行比较;S301: Compare the infrared band ratio with a first threshold;
S302:当所述红外波段比值大于或等于所述第一阈值时,根据所述红外波段比值和所述色温信息对光源进行判断;S302: When the infrared waveband ratio is greater than or equal to the first threshold, judge the light source according to the infrared waveband ratio and the color temperature information;
S303:若判断光源为日光光源,则将所述初始置信度与第一预设值进行相减运算,得到所述目标置信度;S303: If it is determined that the light source is a daylight light source, perform a subtraction operation on the initial confidence level and a first preset value to obtain the target confidence level;
S304:若判断光源为非日光光源,则将所述初始置信度与第二预设值进行相加运算,得到所述目标置信度。S304: If it is determined that the light source is a non-daylight light source, perform an addition operation on the initial confidence level and a second preset value to obtain the target confidence level.
进一步地,在S301之后,该方法还可以包括:Further, after S301, the method may further include:
S305:当所述红外波段比值小于所述第一阈值时,将所述初始置信度与第三预设值进行相加运算,得到所述目标置信度。S305: When the infrared band ratio is less than the first threshold, add the initial confidence level and a third preset value to obtain the target confidence level.
需要说明的是,第一预设值、第二预设值和第三预设值均为可调参数,具体数值根据实际应用场景进行设定,本申请实施例不作具体限定。It should be noted that the first preset value, the second preset value, and the third preset value are all adjustable parameters, and the specific values are set according to actual application scenarios, which are not specifically limited in the embodiment of the present application.
还需要说明的是,在将红外波段比值与第一阈值进行比较之后,如果红外波段比值大于或等于第一阈值,说明了当前的光源中具有一定的IR分量,即该光源存在三种可能性,可能是日光光源,也可能是钨丝灯光源,还可能是混合光源(比如钨丝灯与荧光灯的混合光源或者钨丝灯与LED的混合光源);其中,日光光源属于室外,钨丝灯以及混合光源则属于室内,这时候需要执行步骤S302,根据红外波段比值和所述色温信息对光源进行判断,以判断光源是否为日光光源;若光源为日光光源,则当前环境可能是室外,这时候需要执行步骤S303,即将初始置信度减去第一预设值,以得到目标置信度;若光源为非日光光源,则当前环境可能是室内,这时候需要执行步骤S304,即将初始置信度加上第二预设值,以得到目标置信度。It should also be noted that after comparing the infrared band ratio with the first threshold, if the infrared band ratio is greater than or equal to the first threshold, it indicates that the current light source has a certain IR component, that is, the light source has three possibilities , It may be a daylight light source, it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight source belongs to the outdoor, and the tungsten lamp And the mixed light source belongs to indoors. At this time, step S302 needs to be performed to judge the light source according to the infrared band ratio and the color temperature information to determine whether the light source is a daylight light source; if the light source is a daylight light source, the current environment may be outdoor. At this time, step S303 needs to be performed, that is, the initial confidence level is subtracted from the first preset value to obtain the target confidence level; if the light source is a non-daylight light source, the current environment may be indoors. At this time, step S304 needs to be performed, that is, the initial confidence level is added. Set the second preset value to obtain the target confidence.
此外,如果红外波段比值小于第一阈值,说明了当前的光源中IR分量很少,可以大概率确定判断结果为室内,这时候需要执行步骤S305,即将初始置信度加上第三预设值,以得到目标置信度。In addition, if the infrared band ratio is less than the first threshold, it means that there are few IR components in the current light source, and it can be determined with a high probability that the judgment result is indoor. At this time, step S305 needs to be performed, that is, the initial confidence level is added to the third preset value. To get the target confidence.
可选地,在一些实施例中,当所述初始分类结果为室外时,如图9所示,对于S203来说,所述根据所述红外波段比值、所述色温信息及所述初始置信度进行计算,获得目标置信度,可以包括:Optionally, in some embodiments, when the initial classification result is outdoor, as shown in FIG. 9, for S203, according to the infrared band ratio, the color temperature information, and the initial confidence level Perform calculations to obtain target confidence, which can include:
S401:将所述红外波段比值与第二阈值进行比较;S401: Compare the infrared band ratio with a second threshold;
S402:当所述红外波段比值大于或等于所述第二阈值时,根据所述红外波段比值和所述色温信息对光源进行判断;S402: When the infrared waveband ratio is greater than or equal to the second threshold, judge the light source according to the infrared waveband ratio and the color temperature information;
S403:若判断光源为日光光源,则将所述初始置信度与第四预设值进行相加运算,得到所述目标置信度;S403: If it is determined that the light source is a daylight source, perform an addition operation on the initial confidence level and a fourth preset value to obtain the target confidence level;
S404:若判断光源为非日光光源,则将所述初始置信度与第五预设值进行相减运算,得到所述目标置信度。S404: If it is determined that the light source is a non-daylight light source, perform a subtraction operation on the initial confidence level and a fifth preset value to obtain the target confidence level.
进一步地,在S401之后,该方法还可以包括:Further, after S401, the method may further include:
S405:当所述红外波段比值小于所述第二阈值时,将所述初始置信度与第六预设值进行相减计算,得到所述目标置信度。S405: When the infrared band ratio is less than the second threshold, perform a subtraction calculation on the initial confidence level and a sixth preset value to obtain the target confidence level.
需要说明的是,第四预设值、第五预设值和第六预设值均为可调参数,具体数值根据实际应用场景进行设定,本申请实施例不作具体限定。It should be noted that the fourth preset value, the fifth preset value, and the sixth preset value are all adjustable parameters, and the specific values are set according to actual application scenarios, which are not specifically limited in the embodiment of the present application.
还需要说明的是,在将红外波段比值与第二阈值进行比较之后,如果红外波段比值大于或等于第二阈值,说明了当前的光源中具有一定的IR分量,即该光源存在三种可能性,可能是日光光源,也可能是钨丝灯光源,还可能是混合光源(比如钨丝灯与荧光灯的混合光源或者钨丝灯与LED的混合光源);其中,日光光源属于室外,钨丝灯以及混合光源则属于室内,这时候需要执行步骤S402,根据红外波段比值和所述色温信息对光源进行判断,以判断光源是否为日光光源;若光源为日光光源,则当前环境可能是室外,这时候需要执行步骤S403,即将初始置信度加上第四预设值,以得到目标置信度;若光源为非日光光源,则当前环境可能是室内,这时候需要执行步骤S404,即将初始置信度减去第五预设值,以得到目标置信度。It should also be noted that after comparing the infrared band ratio with the second threshold, if the infrared band ratio is greater than or equal to the second threshold, it indicates that the current light source has a certain IR component, that is, the light source has three possibilities , It may be a daylight light source, it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight source belongs to the outdoor, and the tungsten lamp And the mixed light source belongs to indoors. At this time, step S402 needs to be executed to judge the light source according to the infrared band ratio and the color temperature information to determine whether the light source is a daylight light source; if the light source is a daylight light source, the current environment may be outdoor. At this time, step S403 needs to be performed, that is, the initial confidence level is added to the fourth preset value to obtain the target confidence level; if the light source is a non-daylight light source, the current environment may be indoors. At this time, step S404 needs to be performed, that is, the initial confidence level is reduced. Go to the fifth preset value to get the target confidence.
此外,如果红外波段比值小于第二阈值,说明了当前的光源中IR分量很少,可以大概率确定判断结果为室内,而判断结果为室外的概率就很低,这时候需要执行步骤S405,即将初始置信度减去第六预设值,以得到目标置信度。In addition, if the infrared band ratio is less than the second threshold, it means that there are few IR components in the current light source. It can be determined with a high probability that the judgment result is indoor, and the probability that the judgment result is outdoor is very low. In this case, step S405 is required, namely The sixth preset value is subtracted from the initial confidence level to obtain the target confidence level.
这样,在得到目标置信度之后,可以将目标置信度与预设阈值进行比较,根据比较的结果来确定是否需要改变初始分类结果,即是否需要对初始分类结果进行调整。In this way, after the target confidence level is obtained, the target confidence level can be compared with a preset threshold, and based on the result of the comparison, it is determined whether the initial classification result needs to be changed, that is, whether the initial classification result needs to be adjusted.
S204:当所述目标置信度小于预设阈值时,通过对所述初始分类结果的调整得到目标分类结果;S204: When the target confidence is less than a preset threshold, obtain a target classification result by adjusting the initial classification result;
需要说明的是,预设阈值是预先设定的用于判断初始分类结果是否可靠的判定值。这里,预设阈值为可调参数,具体数值根据实际应用场景进行设定,本申请实施例不作具体限定。通常而言,预设阈值需要设定的比较小,比如预设阈值设定为30%;这样,当目标置信度小于30%时,可以判断出初始分类结果很不可靠,这时候存在误判的情况,需要改变分类结果,即对初始分类结果进行调整,以得到目标分类结果。It should be noted that the preset threshold is a preset judgment value used to judge whether the initial classification result is reliable. Here, the preset threshold is an adjustable parameter, and the specific value is set according to actual application scenarios, which is not specifically limited in the embodiment of the present application. Generally speaking, the preset threshold value needs to be set relatively small, for example, the preset threshold value is set to 30%; in this way, when the target confidence is less than 30%, it can be judged that the initial classification result is very unreliable, and there is a misjudgment at this time In the situation, the classification result needs to be changed, that is, the initial classification result is adjusted to obtain the target classification result.
在一些实施例中,对于S204来说,所述当所述目标置信度小于预设阈值时,通过对所述初始分类结果的调整得到目标分类结果,可以包括:In some embodiments, for S204, when the target confidence is less than a preset threshold, obtaining a target classification result by adjusting the initial classification result may include:
当所述目标置信度小于所述预设阈值时,对所述初始分类结果进行调整,确定出所述目标分类结果;其中,When the target confidence is less than the preset threshold, the initial classification result is adjusted to determine the target classification result; wherein,
若所述初始分类结果为室内,则确定所述目标分类结果为室外;If the initial classification result is indoor, it is determined that the target classification result is outdoor;
若所述初始分类结果为室外,则确定所述目标分类结果为室内。If the initial classification result is outdoor, it is determined that the target classification result is indoor.
进一步地,在一些实施例中,在S203之后,该方法还可以包括:Further, in some embodiments, after S203, the method may further include:
当所述目标置信度大于或等于所述预设阈值时,确定所述目标分类结果为维持所述初始分类结果;其中,When the target confidence is greater than or equal to the preset threshold, it is determined that the target classification result is to maintain the initial classification result; wherein,
若初始分类结果为室内,则确定所述目标分类结果为室内;If the initial classification result is indoor, it is determined that the target classification result is indoor;
若初始分类结果为室外,则确定所述目标分类结果为室外。If the initial classification result is outdoor, it is determined that the target classification result is outdoor.
需要说明的是,将目标置信度与预设阈值进行比较,如果目标置信度小于预设阈值,表明了当前的初始分类结果是不可靠的,这时候需要调整初始分类结果,例如,若初始分类结果为室内,则调整之后所得到的目标分类结果为室外;若初始分类结果为室外,则调整之后所得到的目标分类结果为室内。另外,如果目标置信度大于或等于预设阈值,表明了当前的初始分类结果是可靠的,这时候需要维持初始分类结果,即若初始分类结果为室内,则目标分类结果也为室内;若初始分类结果为室外,则目标分类结果也为室外;这样,所得到的目标分类结果是可靠的,提高了室内/室外判断的准确率;而且较小的预设阈值也保证了在误判概率较大时才调整分类结果,也可以看作是考虑了时域上的平滑机制,有利 于保持白平衡算法的稳定性,从而避免了白平衡算法频繁切换的异常现象。It should be noted that the target confidence is compared with the preset threshold. If the target confidence is less than the preset threshold, it indicates that the current initial classification result is unreliable. At this time, the initial classification result needs to be adjusted, for example, if the initial classification If the result is indoor, the target classification result obtained after adjustment is outdoor; if the initial classification result is outdoor, the target classification result obtained after adjustment is indoor. In addition, if the target confidence is greater than or equal to the preset threshold, it indicates that the current initial classification result is reliable. At this time, the initial classification result needs to be maintained, that is, if the initial classification result is indoor, the target classification result is also indoor; If the classification result is outdoor, the target classification result is also outdoor; in this way, the target classification result obtained is reliable, which improves the accuracy of indoor/outdoor judgment; and the smaller preset threshold also ensures that the probability of misjudgment is relatively high. Adjusting the classification result only when it is large can also be regarded as considering the smoothing mechanism in the time domain, which helps maintain the stability of the white balance algorithm, thereby avoiding the abnormal phenomenon of frequent switching of the white balance algorithm.
S205:根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正。S205: Determine the target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
需要说明的是,由于所得到的目标分类结果同时考虑了红外波段比值和色温信息,使得目标分类结果是可靠的,这时候对待处理的图像数据进行白平衡校正,可以达到更好的白平衡效果。It should be noted that since the obtained target classification result takes into account the infrared band ratio and color temperature information at the same time, the target classification result is reliable. At this time, the white balance correction of the image data to be processed can achieve a better white balance effect. .
进一步地,在一些实施例中,所述根据所述目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正,可以包括:Further, in some embodiments, determining the target white balance parameter according to the target classification result, and performing white balance correction on the image data according to the determined target white balance parameter may include:
若所述目标分类结果为室内,则调用室内参数,并从所述室内参数中获得目标白平衡参数,根据所述目标白平衡参数对图像数据进行白平衡校正;If the target classification result is indoor, call indoor parameters, obtain target white balance parameters from the indoor parameters, and perform white balance correction on the image data according to the target white balance parameters;
若所述目标分类结果为室外,则调用室外参数,并从所述室外参数中获得目标白平衡参数,根据所述目标白平衡参数对图像数据进行白平衡校正。If the target classification result is outdoor, call outdoor parameters, obtain target white balance parameters from the outdoor parameters, and perform white balance correction on the image data according to the target white balance parameters.
需要说明的是,如果目标分类结果为室内,这时候可以调用室内参数,然后从室内参数中获得目标白平衡参数,根据目标白平衡参数对图像数据进行白平衡校正;如果目标分类结果为室外,这时候可以调用室外参数,然后从室外参数中获得目标白平衡参数,根据目标白平衡参数对图像数据进行白平衡校正,如此能够提升白平衡算法的效果,消除原始图像中的偏色现象,从而能够更好地实现色彩还原。It should be noted that if the target classification result is indoor, you can call the indoor parameters at this time, and then obtain the target white balance parameters from the indoor parameters, and perform white balance correction on the image data according to the target white balance parameters; if the target classification result is outdoor, At this time, you can call the outdoor parameters, and then obtain the target white balance parameters from the outdoor parameters, and perform white balance correction on the image data according to the target white balance parameters. This can improve the effect of the white balance algorithm and eliminate the color cast in the original image. Can better achieve color reproduction.
除此之外,当所得到的红外波段比值大于或等于预设的红外波段阈值(比如第一阈值或者第二阈值)时,当前的光源存在三种可能性,可能是日光光源,也可能是钨丝灯光源,还可能是混合光源(比如钨丝灯与荧光灯的混合光源或者钨丝灯与LED的混合光源);其中,日光光源属于室外,钨丝灯以及混合光源则属于室内,这时候需要对光源作进一步区分。因此,在一些实施例中,所述根据所述红外波段比值和所述色温信息对光源进行判断,可以包括:In addition, when the obtained infrared band ratio is greater than or equal to the preset infrared band threshold (such as the first threshold or the second threshold), there are three possibilities for the current light source, which may be daylight or tungsten. The filament light source may also be a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED); among them, the daylight light source belongs to the outdoor, and the tungsten lamp and the mixed light source belong to the indoor. Further distinguish the light source. Therefore, in some embodiments, the judging the light source based on the infrared band ratio and the color temperature information may include:
根据所述红外波段比值,从预先建立的对照表中查询出与所述红外波段比值对应的第一色温信息;According to the infrared band ratio, query the first color temperature information corresponding to the infrared band ratio from a pre-established comparison table;
根据所述色温信息以及查询得到的第一色温信息对光源进行判断。The light source is judged according to the color temperature information and the first color temperature information obtained by the query.
进一步地,所述根据所述色温信息以及查询得到的第一色温信息对光源进行判断,可以包括:Further, the judging the light source according to the color temperature information and the first color temperature information obtained by the query may include:
计算所述色温信息与所述第一色温信息之间的差值;Calculating the difference between the color temperature information and the first color temperature information;
当所述差值小于预设差值阈值时,从所述色温信息和所述第一色温信息中选取最小的色温信息;When the difference is less than a preset difference threshold, selecting the smallest color temperature information from the color temperature information and the first color temperature information;
将最小的色温信息与预设色温阈值进行比较;Compare the minimum color temperature information with the preset color temperature threshold;
若最小的色温信息大于预设色温阈值,则确定光源为日光光源;If the minimum color temperature information is greater than the preset color temperature threshold, it is determined that the light source is a daylight light source;
若最小的色温信息小于或等于预设色温阈值,则确定光源为非日光光源。If the minimum color temperature information is less than or equal to the preset color temperature threshold, it is determined that the light source is a non-daylight light source.
需要说明的是,在红外波段比值大于或等于预设的红外波段阈值(比如第一阈值或者第二阈值)的前提下,光源存在三种可能性,这时候红外波段比值(IR%)的范围是比较相似的,只通过IR%无法进行区分,此时还需要考虑色温传感器所输出的色温信息,以及从预先建立的对照表中查询出与该IR%对应的第一色温信息,这样可以从多个维度来区分光源,从而能够提高准确率。It should be noted that under the premise that the infrared band ratio is greater than or equal to the preset infrared band threshold (such as the first threshold or the second threshold), there are three possibilities for the light source. At this time, the range of the infrared band ratio (IR%) They are relatively similar and cannot be distinguished only by IR%. At this time, the color temperature information output by the color temperature sensor needs to be considered, and the first color temperature information corresponding to the IR% can be queried from the pre-established comparison table. Multiple dimensions to distinguish the light source, which can improve the accuracy.
具体来讲,在获得色温信息与第一色温信息之后,计算色温信息与第一色温信息之间的差值,然后将差值与预设差值阈值进行比较,如果差值大于或等于预设差值阈值,那么表明了光源为混合光源,比如钨丝灯与荧光灯的混合光源或者钨丝灯与LED的混合光源;如果差值小于预设差值阈值,那么表明了光源为纯色光源,比如日光光源或者钨丝灯光源;这时候还需要从色温信息和第一色温信息中选取最小的色温信息,然后将最小的色温信息与预设色温阈值进行比较;若最小的色温信息大于预设色温阈值(比如3000K),则确定光 源为日光光源;若最小的色温信息小于或等于预设色温阈值,则确定光源为钨丝灯光源,即该光源为非日光光源。Specifically, after obtaining the color temperature information and the first color temperature information, calculate the difference between the color temperature information and the first color temperature information, and then compare the difference with a preset difference threshold. If the difference is greater than or equal to the preset The difference threshold indicates that the light source is a mixed light source, such as a mixed light source of a tungsten lamp and a fluorescent lamp or a mixed light source of a tungsten lamp and LED; if the difference is less than the preset difference threshold, it indicates that the light source is a pure color light source, such as Daylight light source or tungsten light source; At this time, it is also necessary to select the smallest color temperature information from the color temperature information and the first color temperature information, and then compare the smallest color temperature information with the preset color temperature threshold; if the smallest color temperature information is greater than the preset color temperature Threshold (for example, 3000K), the light source is determined to be a daylight source; if the minimum color temperature information is less than or equal to the preset color temperature threshold, the light source is determined to be a tungsten light source, that is, the light source is a non-daylight light source.
示例性地,目前存在有两个典型场景容易错判:第一典型场景为室内属于高亮度且高CCT场景,由于颜色特征接近室外,而造成容易将其被错判成室外;但该场景的光源是荧光灯或者LED,其IR分量很少,通过本申请实施例的方法可以极大地纠正错判,并且保证判断成室内的正确率可达到99%左右。第二典型场景为室外属于低亮度的场景,比如接近傍晚的室外,这时候容易将其错判成室内;但是该场景的光源是日光,其IR分量很高,通过本申请实施例的方法可以较好地纠正错判,并且保证判断成室外的正确率可达到97%左右。Exemplarily, there are currently two typical scenes that are easy to be misjudged: The first typical scene is an indoor scene with high brightness and high CCT. Because the color feature is close to outdoor, it is easy to be wrongly judged as outdoor; The light source is a fluorescent lamp or an LED, and its IR component is very small. The method of the embodiment of the present application can greatly correct the misjudgment, and ensure that the accuracy of the indoor judgment can reach about 99%. The second typical scene is an outdoor scene with low brightness, such as the outdoor near the evening, it is easy to be mistakenly judged as indoor at this time; but the light source of this scene is sunlight, and its IR component is very high. It can better correct misjudgments, and ensure that the correct rate of judgement outdoor can reach about 97%.
也就是说,本申请实施例的方法可以有效地修正原有白平衡算法中预设分类器(比如二分类器)存在室内/室外误判断的场景,提高室内/室外分类的准确率;尤其是室内光源为荧光灯或者LED,或者仅有室外的日光光源时,可以使得判断的准确率达到99%左右。这样,不仅调用了正确且合适的白平衡参数(假定白平衡参数包括室内参数和室外参数等两套参数),而且还能够更好地提前区分场景,使得调试人员可以在不增加额外参数去消除某些错判场景的影响,还不用增加额外参数去区分混淆场景或者混淆色,能够达到更好地、更稳定地、更加方便调试的白平衡算法的效果。That is to say, the method of the embodiment of the present application can effectively correct the scene of indoor/outdoor misjudgment in the preset classifier (such as the two classifier) in the original white balance algorithm, and improve the accuracy of indoor/outdoor classification; especially When the indoor light source is a fluorescent lamp or LED, or there is only an outdoor daylight light source, the accuracy of the judgment can reach about 99%. In this way, not only the correct and appropriate white balance parameters are called (assuming that the white balance parameters include two sets of parameters such as indoor parameters and outdoor parameters), but also the scene can be better distinguished in advance, so that the debugger can eliminate the problem without adding additional parameters. For some misjudged scenes, there is no need to add additional parameters to distinguish between confusing scenes or confusing colors, which can achieve the effect of a better, more stable, and more convenient debugging white balance algorithm.
本实施例提供了一种白平衡校正方法,基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;根据红外波段比值、色温信息及初始置信度进行计算,获得目标置信度;当目标置信度小于预设阈值时,通过对初始分类结果的调整得到目标分类结果;根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正;这样,在对光源进行一次判断获得初始分类结果和初始置信度之后,还能够根据红外波段比值和色温信息对光源进行二次判断,可以有效修正一次判断后所存在的误判断场景,不仅能够更好地区分室内/室外的场景,还能够提高室内/室外判断的准确率,从而达到更好的、更稳定的白平衡效果,使得终端设备能够更好的色彩还原。This embodiment provides a white balance correction method, which determines the initial classification result and initial confidence of the light source based on the image data acquired by the camera; determines the infrared band ratio and color temperature information of the light source based on the data acquired by the color temperature sensor; The ratio, color temperature information and initial confidence are calculated to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; the target white balance parameter is determined according to the target classification result, and the target white balance parameter is determined according to the target classification result. The determined target white balance parameter performs white balance correction on the image data; in this way, after the light source is judged once to obtain the initial classification result and initial confidence, the light source can also be judged twice based on the infrared band ratio and color temperature information. Effectively correct the misjudgment scene that exists after a judgment, not only can better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve a better and more stable white balance effect, and make the terminal The equipment is capable of better color reproduction.
本申请的另一实施例中,参见图10,其示出了本申请实施例提供的一种目标置信度获取的详细流程示意图。如图10所示,该方法可以包括:In another embodiment of the present application, refer to FIG. 10, which shows a detailed flowchart of a target confidence acquisition provided by an embodiment of the present application. As shown in Figure 10, the method may include:
S501:获取预设分类器的初始分类结果和初始置信度;S501: Obtain the initial classification result and initial confidence of the preset classifier;
需要说明的是,预设分类器可以是二分类器,也可以是支持向量机(Support Vector Machine,SVM)分类器;根据预设分类器,可以获得光源的初始分类结果和初始置信度。通常而言,初始置信度的取值为50%,但是本申请实施例不作具体限定。It should be noted that the preset classifier may be a two-class classifier or a Support Vector Machine (SVM) classifier; according to the preset classifier, the initial classification result and initial confidence of the light source can be obtained. Generally speaking, the initial confidence value is 50%, but the embodiment of the present application does not specifically limit it.
S502:若初始分类结果为室内,执行步骤S503;S502: If the initial classification result is indoor, perform step S503;
S503:将获取的红外波段比值与第一阈值进行比较;S503: Compare the acquired infrared band ratio with the first threshold;
S504:若红外波段比值不小于第一阈值,则根据红外波段比值和色温信息对光源进行判断;S504: If the infrared band ratio is not less than the first threshold, judge the light source according to the infrared band ratio and the color temperature information;
S505:若判断光源为日光光源,则目标置信度等于初始置信度减去第一预设值;S505: If it is determined that the light source is a daylight source, the target confidence is equal to the initial confidence minus the first preset value;
S506:若判断光源为非日光光源,则目标置信度等于初始置信度加上第二预设值;S506: If it is determined that the light source is a non-daylight source, the target confidence is equal to the initial confidence plus the second preset value;
S507:若红外波段比值小于第一阈值,则目标置信度等于初始置信度加上第三预设值;S507: If the infrared band ratio is less than the first threshold, the target confidence is equal to the initial confidence plus the third preset value;
S508:获取初始分类结果为室内时的目标置信度;S508: Obtain the target confidence when the initial classification result is indoor;
需要说明的是,如果初始分类结果为室内(Indoor),这时候需要判断红外波段比值(用IR%表示)是否小于第一阈值(用THR1表示);如果IR%不小于THR1,即IR%大于或等于THR1,说明当前的光源具有一定IR分量,此时光源存在三种可能性,可能是日光光源,也可能是钨丝灯光源,也可能是混合光源(比如钨丝灯与荧光灯的混合光源或者钨丝灯与LED灯的混合光源);其中,日光光源属于室外,钨丝灯以及混合光源属于室内,这时候需要区分这三种可能性。由于钨丝灯光源的IR%最高,以及其对应的CCT为2850K左右, 可以很容易地区分出钨丝灯光源;但是日光光源和混合光源的IR%值的范围是相似的,无法只通过IR%进行区分,此时需要加上CCT值;也就是说,根据红外波段比值和所述色温信息对光源进行判断,如果判断出光源为日光光源,则当前环境可能是室外,这时候需要执行步骤S505,目标置信度等初始置信度减去第一预设值(用X1%表示),即目标置信度可以为(50-X1)%;如果判断出光源为非日光光源,则当前环境可能是室内,这时候需要执行步骤S506,目标置信度等初始置信度加上第二预设值(用X2%表示),即目标置信度可以为(50+X2)%;此外,如果IR%小于THR1,说明了当前的光源中IR分量非常少,那么可以判断光源大概率是荧光灯或者LED灯,即大概率是室内场景,这时候执行S507,目标置信度等于初始置信度加上第三预设值(用X3%表示),即目标置信度可以为(50+X3)%;而且所得到的目标置信度越接近于100%,越能够确定为室内场景。如此,经过这些步骤后,可计算出初始分类结果为室内时的目标置信度(Confidence Level,CL)。It should be noted that if the initial classification result is Indoor, it is necessary to judge whether the infrared band ratio (expressed in IR%) is less than the first threshold (expressed in THR1); if the IR% is not less than THR1, that is, the IR% is greater than Or equal to THR1, indicating that the current light source has a certain IR component. At this time, there are three possibilities for the light source. It may be a daylight source, it may be a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp) Or a mixed light source of a tungsten lamp and an LED lamp); among them, the daylight light source belongs to the outdoor, and the tungsten lamp and the mixed light source belong to the indoor. At this time, it is necessary to distinguish the three possibilities. Because the IR% of the tungsten light source is the highest, and its corresponding CCT is about 2850K, it is easy to distinguish the tungsten light source; however, the IR% value range of the daylight source and the mixed light source are similar, and it is impossible to pass only IR. % To distinguish, the CCT value needs to be added at this time; that is to say, the light source is judged according to the infrared band ratio and the color temperature information. If it is judged that the light source is a daylight source, the current environment may be outdoor. At this time, you need to perform steps S505: The initial confidence level such as the target confidence level is subtracted from the first preset value (indicated by X1%), that is, the target confidence level can be (50-X1)%; if it is determined that the light source is a non-sunlight light source, the current environment may be Indoors, step S506 needs to be performed at this time, the initial confidence level such as the target confidence level plus the second preset value (indicated by X2%), that is, the target confidence level can be (50+X2)%; in addition, if the IR% is less than THR1 , Which shows that the IR component of the current light source is very small, so it can be judged that the light source is most likely to be fluorescent or LED, that is, the most likely to be an indoor scene. At this time, execute S507, and the target confidence is equal to the initial confidence plus the third preset value (Expressed by X3%), that is, the target confidence can be (50+X3)%; and the closer the target confidence is to 100%, the more it can be determined as an indoor scene. In this way, after these steps, the target confidence level (CL) when the initial classification result is indoor can be calculated.
S509:若初始分类结果为室外,执行步骤S510;S509: If the initial classification result is outdoor, perform step S510;
S510:将获取的红外波段比值与第二阈值进行比较;S510: Compare the acquired infrared band ratio with a second threshold;
S511:若红外波段比值不小于第二阈值,则根据红外波段比值和色温信息对光源进行判断;S511: If the infrared band ratio is not less than the second threshold, judge the light source according to the infrared band ratio and the color temperature information;
S512:若判断光源为日光光源,则目标置信度等于初始置信度加上第四预设值;S512: If it is determined that the light source is a daylight source, the target confidence is equal to the initial confidence plus the fourth preset value;
S513:若判断光源为非日光光源,则目标置信度等于初始置信度减去第五预设值;S513: If it is determined that the light source is a non-daylight source, the target confidence is equal to the initial confidence minus the fifth preset value;
S514:若红外波段比值小于第二阈值,则目标置信度等于初始置信度减去第六预设值;S514: If the infrared band ratio is less than the second threshold, the target confidence is equal to the initial confidence minus the sixth preset value;
S515:获取初始分类结果为室外时的目标置信度。S515: Obtain the target confidence when the initial classification result is outdoor.
需要说明的是,如果初始分类结果为室外(Outdoor),这时候需要判断红外波段比值(用IR%表示)是否小于第二阈值(用THR2表示);如果IR%不小于THR2,即IR%大于或等于THR2,说明当前的光源具有一定IR分量,此时光源存在三种可能性,可能是日光光源,也可能是钨丝灯光源,也可能是混合光源(比如钨丝灯与荧光灯的混合光源或者钨丝灯与LED灯的混合光源);其中,日光光源属于室外,钨丝灯以及混合光源属于室内,这时候需要区分这三种可能性。根据红外波段比值和所述色温信息对光源进行判断,如果判断出光源为日光光源,则当前环境可能是室外,这时候需要执行步骤S512,目标置信度等初始置信度加上第四预设值(用X4%表示),即目标置信度可以为(50+X4)%;如果判断出光源为非日光光源,则当前环境可能是室内,这时候需要执行步骤S513,目标置信度等初始置信度减去第五预设值(用X5%表示),即目标置信度可以为(50-X5)%;此外,如果IR%小于THR2,说明了当前的光源中IR分量非常少,那么可以判断光源大概率是荧光灯或者LED灯,即大概率是室内场景,判断结果为室外的概率就非常低,这时候执行S514,目标置信度等于初始置信度减去第六预设值(用X6%表示),即目标置信度可以为(50-X6)%;这时候所得到的目标置信度越接近于0%,越能够确定为室内场景。如此,经过这些步骤后,可计算出初始分类结果为室外时的目标置信度(Confidence Level,CL)。It should be noted that if the initial classification result is Outdoor, it is necessary to judge whether the infrared band ratio (represented by IR%) is less than the second threshold (represented by THR2); if the IR% is not less than THR2, that is, the IR% is greater than Or equal to THR2, indicating that the current light source has a certain IR component. At this time, the light source has three possibilities. It may be a daylight light source, a tungsten light source, or a mixed light source (such as a mixed light source of a tungsten lamp and a fluorescent lamp). Or a mixed light source of a tungsten lamp and an LED lamp); among them, the daylight source belongs to the outdoor, and the tungsten lamp and the mixed light source belong to the indoor. At this time, it is necessary to distinguish the three possibilities. The light source is judged according to the infrared band ratio and the color temperature information. If it is judged that the light source is a daylight light source, the current environment may be outdoor. At this time, step S512 needs to be performed, and the initial confidence level such as the target confidence level plus the fourth preset value (Expressed by X4%), that is, the target confidence level can be (50+X4)%; if it is determined that the light source is a non-daylight light source, the current environment may be indoors. At this time, step S513 needs to be performed, the target confidence level and other initial confidence levels Subtract the fifth preset value (indicated by X5%), that is, the target confidence can be (50-X5)%; in addition, if the IR% is less than THR2, it means that the current light source has very little IR component, then the light source can be judged The high probability is a fluorescent lamp or LED light, that is, the high probability is an indoor scene, and the probability that the judgment result is outdoor is very low. At this time, execute S514, and the target confidence is equal to the initial confidence minus the sixth preset value (indicated by X6%) , That is, the target confidence level can be (50-X6)%; the closer the target confidence level obtained at this time is to 0%, the more it can be determined as an indoor scene. In this way, after these steps, the target confidence level (CL) when the initial classification result is outdoor can be calculated.
在确定出目标置信度(用CL表示)之后,可以根据该目标置信度来确定是否需要改变当前的判断结果。具体地,可以将目标置信度与预设阈值进行比较,该预设阈值是预先设定的用于判断初始分类结果是否可靠的判定值,预设阈值的设定比较小,可以为置信度最低阈值(用Y%表示);本申请实施例中,预设阈值可以设定为30%,但是本申请实施例不作具体限定。After the target confidence level (represented by CL) is determined, the target confidence level can be used to determine whether the current judgment result needs to be changed. Specifically, the target confidence level can be compared with a preset threshold. The preset threshold is a predetermined judgment value used to determine whether the initial classification result is reliable. The preset threshold is set to be relatively small, which may be the lowest confidence level. Threshold (represented by Y%); in the embodiment of the present application, the preset threshold may be set to 30%, but the embodiment of the present application does not specifically limit it.
其中,如果CL小于30%,那么初始分类结果不太可靠,这时候可以对初始分类结果进行调整,即若初始分类结果为室内,则调整后的目标分类结果为室外;若初始分类结果为室外,则调整后的目标分类结果为室内。如果CL大于或等于30%,那么初始分类结果是可靠的,这时候的目标分类结果可以维持初始分类结果,即若初始分类结果为室内,则目标分类结果也为室内;若初始分类结果为室外,则目标分类结果也为室外。Among them, if the CL is less than 30%, then the initial classification result is not reliable. At this time, the initial classification result can be adjusted, that is, if the initial classification result is indoor, the adjusted target classification result is outdoor; if the initial classification result is outdoor , The adjusted target classification result is indoor. If CL is greater than or equal to 30%, then the initial classification result is reliable, and the target classification result at this time can maintain the initial classification result, that is, if the initial classification result is indoor, the target classification result is also indoor; if the initial classification result is outdoor , The target classification result is also outdoor.
值得注意的是,预设阈值通常需要设定的比较小,这样,当目标置信度低于预设阈值 时,可以确定当前的初始分类结果很不可靠,即大概率确定该初始分类结果属于误判的情况,这时候需要改变初始分类结果。也就是说,由于改变初始分类结果是一件具有风险的操作,因此需要在大概率确定误判的情况下,才会改变初始分类结果。而在中等的置信度区间内,如果不能确定是否误判的时候,这时候可以选择维持原来的初始分类结果。该过程可以看作是时域上的平滑机制,如此有利于保持白平衡算法的稳定性,避免了白平衡算法频繁切换的异常现象,同时还能够避免造成同一场景下的白平衡效果的不稳定。It is worth noting that the preset threshold usually needs to be set relatively small, so that when the target confidence is lower than the preset threshold, it can be determined that the current initial classification result is very unreliable, that is, the initial classification result is determined to be incorrect. In the case of judgment, the initial classification result needs to be changed at this time. That is to say, because changing the initial classification result is a risky operation, it is necessary to change the initial classification result only when the misjudgment is determined with a high probability. In the medium confidence interval, if it is not certain whether it is a misjudgment, you can choose to maintain the original initial classification result at this time. This process can be regarded as a smoothing mechanism in the time domain, which helps maintain the stability of the white balance algorithm, avoids the abnormal phenomenon of frequent switching of the white balance algorithm, and also avoids the instability of the white balance effect in the same scene. .
参见图11,其示出了本申请实施例提供的一种白平衡校正方法的详细流程示意图。在图1的基础上,该详细流程增加了四个步骤:Refer to FIG. 11, which shows a detailed flowchart of a white balance correction method provided by an embodiment of the present application. On the basis of Figure 1, the detailed process adds four steps:
S601:根据红外波段比值和色温信息对初始置信度进行计算,获得目标置信度;S601: Calculate the initial confidence level according to the infrared band ratio and color temperature information to obtain the target confidence level;
S602:判断目标置信度是否小于预设阈值;S602: Determine whether the target confidence level is less than a preset threshold;
S603:若目标置信度大于或等于预设阈值,则目标分类结果为维持初始分类结果;S603: If the target confidence is greater than or equal to the preset threshold, the target classification result is to maintain the initial classification result;
S604:若目标置信度小于预设阈值,则目标分类结果为调整初始分类结果。S604: If the target confidence is less than the preset threshold, the target classification result is the adjusted initial classification result.
也就是说,在增加色温传感器之后,通过色温传感器可以获得IR%和CCT;根据IR%和CCT可以计算出当前室内/室外初始分类结果的目标置信度;在目标置信度较低(即目标置信度小于预设阈值)的时候,改变初始分类结果,即修正较低置信度下的错判结果;这样,通过结合色温传感器进行辅助判断,不仅可以提高室内/室外判断的准确率,而且还可以达到更好的白平衡效果。In other words, after adding the color temperature sensor, the IR% and CCT can be obtained through the color temperature sensor; the target confidence of the current indoor/outdoor initial classification results can be calculated according to the IR% and CCT; the target confidence is low (ie, the target confidence When the degree is less than the preset threshold), change the initial classification result, that is, correct the misjudgment result under lower confidence; in this way, by combining the color temperature sensor for auxiliary judgment, not only can the accuracy of indoor/outdoor judgment be improved, but also Achieve a better white balance effect.
通过上述实施例,对前述实施例的具体实现进行了详细阐述,从中可以看出,通过前述实施例的技术方案,在对光源进行一次判断获得初始分类结果和初始置信度之后,还能够根据确定的红外波段比值和色温信息对光源进行二次判断,可以有效修正一次判断后所存在的误判断场景,不仅能够更好地区分室内/室外的场景,还能够提高室内/室外判断的准确率,从而达到更好的、更稳定的白平衡效果,使得终端设备能够更好的色彩还原。Through the foregoing embodiments, the specific implementation of the foregoing embodiments is described in detail. It can be seen from the technical solutions of the foregoing embodiments that after the light source is judged once to obtain the initial classification result and the initial confidence, it can also be determined according to the Infrared band ratio and color temperature information for the second judgment of the light source, which can effectively correct the misjudgment scene after the first judgment, not only can better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments. So as to achieve a better and more stable white balance effect, so that the terminal device can better color reproduction.
基于前述实施例相同的发明构思,参见图12,其示出了本申请实施例提供的一种白平衡校正装置70的组成结构示意图。如图12所示,白平衡校正装置70可以包括:确定单元701、计算单元702、调整单元703和校正单元704,其中,Based on the same inventive concept as the foregoing embodiment, refer to FIG. 12, which shows a schematic diagram of the composition structure of a white
所述确定单元701,配置为基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;以及还配置为基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;The determining unit 701 is configured to determine the initial classification result and initial confidence of the light source based on the image data obtained by the camera; and is also configured to determine the infrared band ratio and color temperature information of the light source based on the data obtained by the color temperature sensor;
所述计算单元702,配置为根据所述红外波段比值、所述色温信息及所述初始置信度进行计算,获得目标置信度;The calculation unit 702 is configured to perform calculation according to the infrared band ratio, the color temperature information, and the initial confidence to obtain the target confidence;
所述调整单元703,配置为当所述目标置信度小于预设阈值时,通过对所述初始分类结果的调整得到目标分类结果;The adjustment unit 703 is configured to obtain a target classification result by adjusting the initial classification result when the target confidence is less than a preset threshold;
所述校正单元704,配置为根据所述目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正。The correction unit 704 is configured to determine a target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
在上述方案中,所述确定单元701,具体配置为将摄像头获取的图像数据输入预设分类器;以及通过所述预设分类器,输出光源的初始分类结果和初始置信度。In the above solution, the determining unit 701 is specifically configured to input the image data obtained by the camera into a preset classifier; and output the initial classification result and the initial confidence of the light source through the preset classifier.
在上述方案中,所述确定单元701,具体配置为通过色温传感器获得光源中多个频谱波段各自对应的频谱通道值;以及基于所获得的频谱通道值,计算得到光源的红外波段比值和色温信息。In the above solution, the determining unit 701 is specifically configured to obtain the spectral channel value corresponding to each of the multiple spectral bands in the light source through the color temperature sensor; and calculate the infrared band ratio and color temperature information of the light source based on the obtained spectral channel value .
在上述方案中,参见图12,白平衡校正装置70还可以包括比较单元705和判断单元706,其中,In the above solution, referring to FIG. 12, the white
所述比较单元705,配置为当所述初始分类结果为室内时,将所述红外波段比值与第一阈值进行比较;The comparing unit 705 is configured to compare the infrared band ratio with a first threshold when the initial classification result is indoor;
所述判断单元706,配置为当所述红外波段比值大于或等于所述第一阈值时,根据所述红外波段比值和所述色温信息对光源进行判断;The judging unit 706 is configured to judge the light source according to the infrared waveband ratio and the color temperature information when the infrared waveband ratio is greater than or equal to the first threshold;
所述计算单元702,具体配置为若判断光源为日光光源,则将所述初始置信度与第一预设值进行相减运算,得到所述目标置信度;以及若判断光源为非日光光源,则将所述初始置信度与第二预设值进行相加运算,得到所述目标置信度。The calculation unit 702 is specifically configured to, if it is determined that the light source is a daylight light source, perform a subtraction operation between the initial confidence level and a first preset value to obtain the target confidence level; and if it is determined that the light source is a non-daylight light source, Then, the initial confidence level and the second preset value are added together to obtain the target confidence level.
在上述方案中,所述计算单元702,还配置为当所述红外波段比值小于所述第一阈值时,将所述初始置信度与第三预设值进行相加运算,得到所述目标置信度。In the above solution, the calculation unit 702 is further configured to add the initial confidence level and a third preset value to obtain the target confidence when the infrared band ratio is less than the first threshold. degree.
在上述方案中,所述比较单元705,还配置为当所述初始分类结果为室外时,将所述红外波段比值与第二阈值进行比较;In the above solution, the comparing unit 705 is further configured to compare the infrared band ratio with a second threshold when the initial classification result is outdoor;
所述判断单元706,还配置为当所述红外波段比值大于或等于所述第二阈值时,根据所述红外波段比值和所述色温信息对光源进行判断;The judging unit 706 is further configured to judge the light source according to the infrared waveband ratio and the color temperature information when the infrared waveband ratio is greater than or equal to the second threshold;
所述计算单元702,具体配置为若判断光源为日光光源,则将所述初始置信度与第四预设值进行相加运算,得到所述目标置信度;以及若判断光源为非日光光源,则将所述初始置信度与第五预设值进行相减运算,得到所述目标置信度。The calculation unit 702 is specifically configured to, if it is determined that the light source is a daylight light source, add the initial confidence level and a fourth preset value to obtain the target confidence level; and if it is determined that the light source is a non-daylight light source, Then, the initial confidence level is subtracted from the fifth preset value to obtain the target confidence level.
在上述方案中,所述计算单元702,还配置为当所述红外波段比值小于所述第二阈值时,将所述初始置信度与第六预设值进行相减计算,得到所述目标置信度。In the above solution, the calculation unit 702 is further configured to perform a subtraction calculation between the initial confidence level and a sixth preset value when the infrared band ratio is less than the second threshold value to obtain the target confidence degree.
在上述方案中,所述调整单元703,具体配置为当所述目标置信度小于所述预设阈值时,对所述初始分类结果进行调整,确定出所述目标分类结果;其中,若所述初始分类结果为室内,则确定所述目标分类结果为室外;若所述初始分类结果为室外,则确定所述目标分类结果为室内。In the above solution, the adjustment unit 703 is specifically configured to adjust the initial classification result to determine the target classification result when the target confidence is less than the preset threshold; If the initial classification result is indoor, it is determined that the target classification result is outdoor; if the initial classification result is outdoor, it is determined that the target classification result is indoor.
在上述方案中,参见图12,白平衡校正装置70还可以包括维持单元707,配置为当所述目标置信度大于或等于所述预设阈值时,确定所述目标分类结果为维持所述初始分类结果;其中,若初始分类结果为室内,则确定所述目标分类结果为室内;若初始分类结果为室外,则确定所述目标分类结果为室外。In the above solution, referring to FIG. 12, the white
在上述方案中,所述校正单元704,具体配置为若所述目标分类结果为室内,则调用室内参数,并从所述室内参数中获得目标白平衡参数,根据所述目标白平衡参数对图像数据进行白平衡校正;以及若所述目标分类结果为室外,则调用室外参数,并从所述室外参数中获得目标白平衡参数,根据所述目标白平衡参数对图像数据进行白平衡校正。In the above solution, the correction unit 704 is specifically configured to call indoor parameters if the target classification result is indoor, and obtain the target white balance parameters from the indoor parameters, and compare the image according to the target white balance parameters. White balance correction is performed on the data; and if the target classification result is outdoor, outdoor parameters are called, the target white balance parameters are obtained from the outdoor parameters, and the image data is white balance corrected according to the target white balance parameters.
在上述方案中,参见图12,白平衡校正装置70还可以包括查询单元708,配置为根据所述红外波段比值,从预先建立的对照表中查询出与所述红外波段比值对应的第一色温信息;In the above solution, referring to FIG. 12, the white
所述判断单元706,具体配置为根据所述色温信息以及查询得到的第一色温信息对光源进行判断。The judging unit 706 is specifically configured to judge the light source according to the color temperature information and the first color temperature information obtained by the query.
在上述方案中,所述判断单元706,具体配置为计算所述色温信息与所述第一色温信息之间的差值;以及当所述差值小于预设差值阈值时,从所述色温信息和所述第一色温信息中选取最小的色温信息;以及将所述最小的色温信息与预设色温阈值进行比较;以及若所述最小的色温信息大于预设色温阈值,则确定光源为日光光源;若所述最小的色温信息小于或等于预设色温阈值,则确定光源为非日光光源。In the above solution, the determining unit 706 is specifically configured to calculate the difference between the color temperature information and the first color temperature information; and when the difference is less than a preset difference threshold, from the color temperature Selecting the minimum color temperature information from the information and the first color temperature information; and comparing the minimum color temperature information with a preset color temperature threshold; and if the minimum color temperature information is greater than the preset color temperature threshold, determining that the light source is sunlight Light source; if the minimum color temperature information is less than or equal to the preset color temperature threshold, it is determined that the light source is a non-daylight light source.
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, or it may also be non-modular. Moreover, the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be realized in the form of hardware or software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台 计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or It is said that the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment. The aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
因此,本实施例提供了一种计算机存储介质,该计算机存储介质存储有白平衡校正程序,所述白平衡校正程序被至少一个处理器执行时实现前述实施例中任一项所述的方法。Therefore, this embodiment provides a computer storage medium that stores a white balance correction program that implements the method described in any one of the foregoing embodiments when the white balance correction program is executed by at least one processor.
基于上述白平衡校正装置70的组成以及计算机存储介质,参见图13,其示出了本申请实施例提供的白平衡校正装置70的具体硬件结构,可以包括:通信接口801、存储器802和处理器803;各个组件通过总线系统804耦合在一起。可理解,总线系统804用于实现这些组件之间的连接通信。总线系统804除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图13中将各种总线都标为总线系统804。其中,通信接口801,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;Based on the above composition of the white
存储器802,用于存储能够在处理器803上运行的计算机程序;The
处理器803,用于在运行所述计算机程序时,执行:The
基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;Based on the image data obtained by the camera, determine the initial classification result and initial confidence of the light source;
基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;Based on the data obtained by the color temperature sensor, determine the infrared band ratio and color temperature information of the light source;
根据所述红外波段比值、所述色温信息及所述初始置信度进行计算,获得目标置信度;Calculate according to the infrared band ratio, the color temperature information and the initial confidence to obtain the target confidence;
当所述目标置信度小于预设阈值时,通过对所述初始分类结果的调整得到目标分类结果;When the target confidence is less than a preset threshold, the target classification result is obtained by adjusting the initial classification result;
根据所述目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正。Determine the target white balance parameter according to the target classification result, and perform white balance correction on the image data according to the determined target white balance parameter.
可以理解,本申请实施例中的存储器802可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本文描述的系统和方法的存储器802旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the
而处理器803可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器803中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器803可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器802,处理器803读取存储器802中的信息,结合其硬件完成上述方法的步骤。The
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It can be understood that the embodiments described in this application can be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, and others for performing the functions described in this application Electronic unit or its combination. For software implementation, the technology described in this application can be implemented through modules (for example, procedures, functions, etc.) that perform the functions described in this application. The software codes can be stored in the memory and executed by the processor. The memory can be implemented in the processor or external to the processor.
可选地,作为另一个实施例,处理器803还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法的步骤。Optionally, as another embodiment, the
本申请实施例中的终端设备可以以各种形式来实施。例如,该终端设备可以包括诸如智能手机、平板电脑、笔记本电脑、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、便捷式媒体播放器(Portable Media Player,PMP)、导航装置、可穿戴设备、数码相机、摄像机等移动终端,以及诸如数字TV、台式计算机等固定终端。参见图14,其示出了本申请实施例提供的一种终端设备的组成结构示意图。如图14所示,终端设备90至少可以包括前述实施例中任一项所述的白平衡校正装置70。The terminal device in the embodiments of the present application may be implemented in various forms. For example, the terminal equipment may include smart phones, tablet computers, notebook computers, handheld computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, and wearable devices. , Digital cameras, video cameras and other mobile terminals, and fixed terminals such as digital TVs and desktop computers. Refer to FIG. 14, which shows a schematic diagram of the composition structure of a terminal device provided by an embodiment of the present application. As shown in FIG. 14, the
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that in this application, the terms "including", "including" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements , And also include other elements not explicitly listed, or elements inherent to the process, method, article, or device. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or device that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority or inferiority of the embodiments.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided in this application can be combined arbitrarily without conflict to obtain new product embodiments.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in the several method or device embodiments provided in this application can be combined arbitrarily without conflict to obtain a new method embodiment or device embodiment.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the scope of protection of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
本申请实施例中,基于摄像头获取的图像数据,确定光源的初始分类结果和初始置信度;基于色温传感器获取的数据,确定光源的红外波段比值和色温信息;根据红外波段比值、色温信息及初始置信度进行计算,获得目标置信度;当目标置信度小于预设阈值时,通过对初始分类结果的调整得到目标分类结果;根据目标分类结果确定目标白平衡参数,并根据所确定的目标白平衡参数对图像数据进行白平衡校正;这样,在对光源进行一次判断获得初始分类结果和初始置信度之后,根据确定的红外波段比值和色温信息对光源进行二次判断,可以有效修正一次判断后所存在的误判断场景,不仅能够更好地区分室内/室外的场景,还能够提高室内/室外判断的准确率,从而达到更好的、更稳定的白平衡效果,使得终端设备能够更好的色彩还原。In the embodiment of this application, the initial classification result and initial confidence of the light source are determined based on the image data acquired by the camera; the infrared band ratio and color temperature information of the light source are determined based on the data acquired by the color temperature sensor; according to the infrared band ratio, color temperature information and initial The confidence is calculated to obtain the target confidence; when the target confidence is less than the preset threshold, the target classification result is obtained by adjusting the initial classification result; the target white balance parameter is determined according to the target classification result, and the target white balance is determined according to the target white balance Parameters perform white balance correction on the image data; in this way, after the light source is judged once to obtain the initial classification result and initial confidence, the light source is judged twice according to the determined infrared band ratio and color temperature information, which can effectively correct the result after the first judgment. The existence of misjudgment scenes can not only better distinguish indoor/outdoor scenes, but also improve the accuracy of indoor/outdoor judgments, so as to achieve a better and more stable white balance effect, so that the terminal device can have better colors reduction.
Claims (20)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911174624.4 | 2019-11-26 | ||
CN201911174624.4A CN112866656B (en) | 2019-11-26 | 2019-11-26 | A white balance correction method, device, storage medium and terminal device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021104352A1 true WO2021104352A1 (en) | 2021-06-03 |
Family
ID=75984765
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/131682 WO2021104352A1 (en) | 2019-11-26 | 2020-11-26 | White balance correction method and apparatus, storage medium, and terminal device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112866656B (en) |
WO (1) | WO2021104352A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114979608A (en) * | 2022-05-06 | 2022-08-30 | 维沃移动通信有限公司 | White balance adjustment method, apparatus, electronic device and storage medium |
US20230070353A1 (en) * | 2021-09-09 | 2023-03-09 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
CN115802018A (en) * | 2021-09-08 | 2023-03-14 | 广州视源电子科技股份有限公司 | White balance automatic correction method and device and computer equipment |
EP4270977A1 (en) * | 2022-04-25 | 2023-11-01 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, program, and storage medium |
EP4404578A4 (en) * | 2021-10-27 | 2024-08-21 | SZ DJI Technology Co., Ltd. | IMAGING METHOD AND IMAGING DEVICE FOR IMMERSION SCENE |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118632134A (en) * | 2021-08-12 | 2024-09-10 | 荣耀终端有限公司 | A method for determining chromaticity information and related electronic equipment |
CN113676663B (en) * | 2021-08-13 | 2023-07-18 | 驭新智行科技(宁波)有限公司 | Camera white balance adjustment method, device, storage medium and terminal equipment |
KR20230045461A (en) | 2021-09-28 | 2023-04-04 | 삼성전자주식회사 | Image acquisition apparatus providing white balance function and electronic apparatus including the same |
CN114596593B (en) * | 2022-05-10 | 2022-07-29 | 慧医谷中医药科技(天津)股份有限公司 | Health-preserving data recommendation method and system based on image processing |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080252748A1 (en) * | 2007-04-10 | 2008-10-16 | Aricent Inc. | System and computer-readable medium for automatic white balancing |
US20160165202A1 (en) * | 2014-12-04 | 2016-06-09 | Samsung Electronics Co., Ltd. | Method and apparatus for controlling white balance |
CN105898264A (en) * | 2016-05-26 | 2016-08-24 | 努比亚技术有限公司 | Device and method for obtaining image processing manner |
CN107801012A (en) * | 2017-10-30 | 2018-03-13 | 广东欧珀移动通信有限公司 | White balancing treatment method and device, electronic installation and computer-readable recording medium |
CN107836115A (en) * | 2015-10-16 | 2018-03-23 | 谷歌有限责任公司 | Use infrared and/or UV signal AWB |
CN111163302A (en) * | 2019-12-24 | 2020-05-15 | Oppo广东移动通信有限公司 | Scene color restoration method, terminal and storage medium |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7869019B2 (en) * | 2007-04-06 | 2011-01-11 | Sony Corporation | Device, method, and program for estimating light source |
US8357899B2 (en) * | 2010-07-30 | 2013-01-22 | Aptina Imaging Corporation | Color correction circuitry and methods for dual-band imaging systems |
CN104113743B (en) * | 2013-04-18 | 2017-09-15 | 深圳中兴力维技术有限公司 | Colour TV camera AWB processing method and processing device under low-light (level) |
US9756222B2 (en) * | 2013-06-26 | 2017-09-05 | Nvidia Corporation | Method and system for performing white balancing operations on captured images |
KR102170686B1 (en) * | 2014-03-18 | 2020-10-27 | 한화테크윈 주식회사 | Apparatus and method for interpolating white balance |
CN105187810B (en) * | 2014-11-11 | 2017-06-06 | 怀效宁 | An automatic white balance method and electronic media device based on facial color features |
JP6563751B2 (en) * | 2015-09-09 | 2019-08-21 | 三星電子株式会社Samsung Electronics Co.,Ltd. | Image processing apparatus and image processing method |
JP6734647B2 (en) * | 2015-12-23 | 2020-08-05 | マクセル株式会社 | Imaging device |
CN106488209A (en) * | 2016-09-29 | 2017-03-08 | 杭州雄迈集成电路技术有限公司 | A kind of color calibration method of the RGB IR imageing sensor based on infrared environmental |
CN108024106B (en) * | 2016-11-04 | 2019-08-23 | 上海富瀚微电子股份有限公司 | Support the color correction device and method of RGBIR and RGBW format |
CN108063891B (en) * | 2017-12-07 | 2020-04-24 | Oppo广东移动通信有限公司 | Image processing method, image processing device, computer-readable storage medium and computer equipment |
CN109729332B (en) * | 2018-12-12 | 2021-06-15 | 珠海亿智电子科技有限公司 | Automatic white balance correction method and system |
CN109714582B (en) * | 2019-01-04 | 2021-08-06 | Oppo广东移动通信有限公司 | White balance adjustment method, device, storage medium and terminal |
-
2019
- 2019-11-26 CN CN201911174624.4A patent/CN112866656B/en active Active
-
2020
- 2020-11-26 WO PCT/CN2020/131682 patent/WO2021104352A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080252748A1 (en) * | 2007-04-10 | 2008-10-16 | Aricent Inc. | System and computer-readable medium for automatic white balancing |
US20160165202A1 (en) * | 2014-12-04 | 2016-06-09 | Samsung Electronics Co., Ltd. | Method and apparatus for controlling white balance |
CN107836115A (en) * | 2015-10-16 | 2018-03-23 | 谷歌有限责任公司 | Use infrared and/or UV signal AWB |
CN105898264A (en) * | 2016-05-26 | 2016-08-24 | 努比亚技术有限公司 | Device and method for obtaining image processing manner |
CN107801012A (en) * | 2017-10-30 | 2018-03-13 | 广东欧珀移动通信有限公司 | White balancing treatment method and device, electronic installation and computer-readable recording medium |
CN111163302A (en) * | 2019-12-24 | 2020-05-15 | Oppo广东移动通信有限公司 | Scene color restoration method, terminal and storage medium |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115802018A (en) * | 2021-09-08 | 2023-03-14 | 广州视源电子科技股份有限公司 | White balance automatic correction method and device and computer equipment |
CN115802018B (en) * | 2021-09-08 | 2024-06-04 | 广州视源电子科技股份有限公司 | White balance automatic correction method, white balance automatic correction device and computer equipment |
US20230070353A1 (en) * | 2021-09-09 | 2023-03-09 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
US12256157B2 (en) * | 2021-09-09 | 2025-03-18 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
EP4404578A4 (en) * | 2021-10-27 | 2024-08-21 | SZ DJI Technology Co., Ltd. | IMAGING METHOD AND IMAGING DEVICE FOR IMMERSION SCENE |
EP4270977A1 (en) * | 2022-04-25 | 2023-11-01 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, program, and storage medium |
CN114979608A (en) * | 2022-05-06 | 2022-08-30 | 维沃移动通信有限公司 | White balance adjustment method, apparatus, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112866656B (en) | 2022-05-31 |
CN112866656A (en) | 2021-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021104352A1 (en) | White balance correction method and apparatus, storage medium, and terminal device | |
CN108024055B (en) | White balance processing method and device, mobile terminal and storage medium | |
US10511821B2 (en) | Method and apparatus for controlling white balance | |
CN105898260B (en) | A kind of method and device for adjusting camera white balance | |
CN106716243B (en) | Image capture system and method | |
CN110827365B (en) | Method and device for determining light source information, electronic equipment and storage medium | |
EP3363196B1 (en) | Auto white balance using infrared and ultraviolet signals | |
CN107959851A (en) | Color temperature detection method and device, computer readable storage medium and computer equipment | |
CN108174172B (en) | Photographing method and apparatus, computer-readable storage medium, and computer device | |
CN107682685A (en) | White balance processing method and device, electronic device, and computer-readable storage medium | |
CN101159879A (en) | Digital image acquisition device and white balance adjustment method thereof | |
WO2022257396A1 (en) | Method and apparatus for determining color fringe pixel point in image and computer device | |
JP2008172422A (en) | Imaging device | |
CN108063934A (en) | Image processing method and device, computer readable storage medium and computer device | |
CN118509717A (en) | Image processing method, device, terminal device, storage medium and program product | |
WO2016184167A1 (en) | Method and device for realizing auto white balance function | |
CN113473101A (en) | Color correction method and device, electronic equipment and storage medium | |
CN113793291B (en) | Image fusion method and device, electronic equipment and storage medium | |
CN113676715B (en) | Image processing method and device | |
CN117692788B (en) | Image processing method and electronic equipment | |
CN112584057A (en) | Illuminance detection method and device | |
US9369685B2 (en) | Mobile electronic device having camera with improved auto white balance | |
CN116233381A (en) | A color correction method, device, electronic device and storage medium | |
CN116249237A (en) | Control method and control device, electronic equipment and computer readable storage medium | |
CN116801113A (en) | Automatic white balance adjustment method and automatic white balance adjustment system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20892551 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20892551 Country of ref document: EP Kind code of ref document: A1 |