WO2022257574A1 - Ai自动白平衡和自动白平衡的融合算法以及电子设备 - Google Patents
Ai自动白平衡和自动白平衡的融合算法以及电子设备 Download PDFInfo
- Publication number
- WO2022257574A1 WO2022257574A1 PCT/CN2022/084902 CN2022084902W WO2022257574A1 WO 2022257574 A1 WO2022257574 A1 WO 2022257574A1 CN 2022084902 W CN2022084902 W CN 2022084902W WO 2022257574 A1 WO2022257574 A1 WO 2022257574A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- color temperature
- correlated color
- image
- chromaticity distance
- value
- Prior art date
Links
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 170
- 230000004927 fusion Effects 0.000 title claims abstract description 77
- 230000002596 correlated effect Effects 0.000 claims description 247
- 238000000034 method Methods 0.000 claims description 62
- 238000012937 correction Methods 0.000 claims description 61
- 238000004364 calculation method Methods 0.000 claims description 35
- 230000000875 corresponding effect Effects 0.000 claims description 32
- 238000006243 chemical reaction Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 14
- 238000004891 communication Methods 0.000 claims description 2
- 210000004027 cell Anatomy 0.000 description 60
- 230000008569 process Effects 0.000 description 31
- 238000012545 processing Methods 0.000 description 21
- 238000010586 diagram Methods 0.000 description 17
- 101100098985 Caenorhabditis elegans cct-3 gene Proteins 0.000 description 9
- 230000006870 function Effects 0.000 description 7
- 239000013598 vector Substances 0.000 description 7
- 230000008859 change Effects 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000003062 neural network model Methods 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 4
- 210000000988 bone and bone Anatomy 0.000 description 4
- 239000011159 matrix material Substances 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000005855 radiation Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 3
- 238000012549 training Methods 0.000 description 3
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000005457 Black-body radiation Effects 0.000 description 1
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 239000010985 leather Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000011269 treatment regimen Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/73—Colour balance circuits, e.g. white balance circuits or colour temperature control
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- This application relates to the field of image processing, and in particular to an AI automatic white balance and automatic white balance fusion algorithm and electronic equipment.
- White balance is an adjustment that digital camera equipment or associated software can make to a captured image to ensure that the whites in the image properly reflect the actual whites in the real-world scene in which the image was taken.
- White balance is related to color temperature, which is a measure of the quality of light, measured in Kelvin, based on the ratio of the amount of blue light to the amount of red light in images and scenes. Images or scenes with a higher color temperature have more blue than those with a lower color temperature. Thus, "cooler” light has a higher color temperature and “hotter” light has a lower color temperature.
- the human eye and brain can adapt to different color temperatures. For example, whether it is in sunlight or under various lights, the human eye perceives white objects as white, that is, the human eye has color constancy. Because the charge-coupled device circuit (Charge-coupled Device, CCD) or CMOS circuit used to convert the optical signal into an electrical signal in the camera cannot correct the color change of the light source like the human eye. Therefore, it is necessary to estimate the chromaticity of the light source of the captured image through a white balance algorithm, and adjust the color of the image through the estimated chromaticity of the light source, so that the color of the adjusted image is consistent with the color actually observed by the human eye. How to improve the accuracy of the white balance algorithm, that is, how to improve the estimated chromaticity of the light source to be more accurate, is a problem that technicians pay more and more attention to.
- CCD Charge-coupled Device
- CMOS circuit used to convert the optical signal into an electrical signal in the camera cannot correct the color change of the light source like the human eye. Therefore, it is
- the embodiment of the present application provides an AI automatic white balance and automatic white balance fusion algorithm, which solves the problems of limited application scenarios of the AI automatic white balance algorithm and low accuracy of the automatic white balance algorithm.
- the embodiment of the present application provides an AI automatic white balance and automatic white balance fusion algorithm, including: based on the correlated color temperature fusion table, the first correlated color temperature of the first image and the second correlated color temperature of the first image Calculate the correlated color temperature to obtain the third correlated color temperature of the first image; based on the chromaticity distance fusion table, calculate the first chromaticity distance of the first image and the second chromaticity distance of the first image based on the chromaticity distance fusion table , to obtain the third chromaticity distance of the first image; calculate the adjustment value of the first image based on the third correlated color temperature and the third chromaticity distance, and the adjustment value is used to adjust the color of the first image; wherein, the first correlation The color temperature is the CCT of the first image calculated by the automatic white balance algorithm, the first chromaticity distance is the Duv of the first image calculated by the automatic white balance algorithm, and the second correlated color temperature is calculated by the AI automatic white balance algorithm The CCT of the
- the AI automatic white balance and the automatic white balance fusion algorithm respectively fuse the AI automatic white balance algorithm and the CCT output by the automatic white balance algorithm to obtain the fused CCT (third correlated color temperature).
- the AI automatic white balance algorithm and the Duv output by the automatic white balance algorithm are fused to obtain the fused Duv (third chromaticity distance).
- the electronic device calculates an adjustment value (RGB_GAIN) of the image based on the fused CCT and fused Duv. Under different shooting environments, the accuracy of RGB_GAIN calculated by the above fusion algorithm is extremely high. It solves the problem that the accuracy of RGB_GAIN output by the traditional automatic white balance algorithm is not high, and the application scenarios of the AI automatic white balance algorithm are limited.
- the first correlated color temperature of the first image is calculated to obtain the third correlated color temperature of the first image.
- it also includes: determining the first correlated color temperature correction value in the correlated color temperature conversion table according to the second correlated color temperature, the second chromaticity distance and the brightness value of the first image; The second correlated color temperature correction value is obtained through interpolation calculation; the second correlated color temperature is set as the second correlated color temperature correction value.
- the first correlated color temperature of the first image is calculated and the second correlated color temperature of the first image is calculated to obtain the third correlated color temperature of the first image, It also includes: determining the first chromaticity distance correction value in the chromaticity distance conversion table according to the second correlated color temperature, the second chromaticity distance and the brightness value of the first image; performing trilinear interpolation calculation on the first chromaticity distance correction value , get the second chromaticity distance correction value; set the second chromaticity distance as the second chromaticity distance correction value.
- the electronic device fuses the first correlated color temperature and the second correlated color temperature through the above formula to obtain the third correlated color temperature with high accuracy, which is beneficial for the electronic device to calculate based on the third correlated color temperature with high accuracy High accuracy RGB_GAIN of the image.
- the first chromaticity distance of the first image and the second chromaticity distance of the first image are calculated based on the chromaticity distance fusion table, and the first chromaticity distance is obtained.
- the third chromaticity distance of an image specifically includes: determining the third probability value in the chromaticity distance fusion table according to the second correlated color temperature, the second chromaticity distance, and the brightness value of the first image; or according to the second correlated color temperature,
- the electronic device fuses the first chromaticity distance and the second chromaticity distance through the above formula to obtain the third chromaticity distance with high accuracy, which is beneficial to the electronic device based on the third chromaticity distance with high accuracy.
- the chroma distance computes the RGB_GAIN of this image with high accuracy.
- the electronic device calculates the RGB_GAIN of the image based on the adjusted third correlated color temperature, so that the electronic device adjusts the color of the image based on the RGB_GAIN, so that the color of the image Meet user expectations.
- the electronic device calculates the RGB_GAIN of the image based on the adjusted third chromaticity distance, so that the electronic device adjusts the color of the image based on the RGB_GAIN, so that the image The colors are as expected by the user.
- an embodiment of the present application provides an electronic device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program codes,
- the computer program code includes computer instructions invoked by the one or more processors to cause the electronic device to execute: based on the correlated color temperature fusion table, the first correlated color temperature of the first image is adjusted to the second correlated color temperature of the first image Calculate the correlated color temperature to obtain the third correlated color temperature of the first image; based on the chromaticity distance fusion table, calculate the first chromaticity distance of the first image and the second chromaticity distance of the first image based on the chromaticity distance fusion table , to obtain the third chromaticity distance of the first image; calculate the adjustment value of the first image based on the third correlated color temperature and the third chromaticity distance, and the adjustment value is used to adjust the color of the first image; wherein, the first correlation The color temperature is the CCT of the first image
- the electronic device fuses the AI automatic white balance and the fusion algorithm of the automatic white balance to respectively fuse the AI automatic white balance algorithm and the CCT output by the automatic white balance algorithm to obtain the fused CCT (the third correlated color temperature ).
- the AI automatic white balance algorithm and the Duv output by the automatic white balance algorithm are fused to obtain the fused Duv (third chromaticity distance).
- the electronic device calculates an adjustment value (RGB_GAIN) of the image based on the fused CCT and fused Duv. Under different shooting environments, the accuracy of RGB_GAIN calculated by the above fusion algorithm is extremely high. It solves the problem that the accuracy of RGB_GAIN output by the traditional automatic white balance algorithm is not high, and the application scenarios of the AI automatic white balance algorithm are limited.
- the one or more processors are further configured to call the computer instructions to make the electronic device execute: according to the second correlated color temperature, the second chromaticity distance, and the brightness of the first image value, determine the first correlated color temperature correction value in the correlated color temperature conversion table; perform trilinear interpolation calculation on the first correlated color temperature correction value to obtain the second correlated color temperature correction value; set the second correlated color temperature as the second correlated color temperature correction value.
- the electronic device corrects the CCT output by the AI automatic white balance algorithm, so as to avoid the problem that the accuracy of the third correlated color temperature is affected due to the excessive error of the CCT output by the AI automatic white balance algorithm.
- the one or more processors are further configured to call the computer instructions to make the electronic device execute: according to the second correlated color temperature, the second chromaticity distance, and the brightness of the first image Determine the first chromaticity distance correction value in the chromaticity distance conversion table; perform trilinear interpolation calculation on the first chromaticity distance correction value to obtain the second chromaticity distance correction value; set the second chromaticity distance as the second Chroma distance correction value.
- the electronic device corrects the Duv output by the AI automatic white balance algorithm, so as to avoid the problem that the accuracy of the third chromaticity distance is affected due to the excessive error of the Duv output by the AI automatic white balance algorithm.
- the electronic device corrects the Conf output by the AI automatic white balance algorithm, so as to avoid the accuracy of the third correlated color temperature and the third chromaticity distance being affected by the excessive error of the Conf output by the AI automatic white balance algorithm. question of degree.
- the electronic device fuses the first correlated color temperature and the second correlated color temperature through the above formula to obtain the third correlated color temperature with high accuracy, which is beneficial for the electronic device to calculate based on the third correlated color temperature with high accuracy High accuracy RGB_GAIN of the image.
- the one or more processors are further configured to call the computer instructions to make the electronic device execute: according to the second correlated color temperature, the second chromaticity distance, and the brightness of the first image value determines the third probability value in the chromaticity distance fusion table; or determines the third probability value in the chromaticity distance fusion table according to the brightness value of the second correlated color temperature, the second chromaticity distance and the first image; for the third probability
- the electronic device fuses the first chromaticity distance and the second chromaticity distance through the above formula to obtain the third chromaticity distance with high accuracy, which is beneficial to the electronic device based on the third chromaticity distance with high accuracy.
- the chroma distance computes the RGB_GAIN of this image with high accuracy.
- the second correlated color temperature adjustment value is further configured to call the computer instructions to make the electronic device perform: according to the third correlated color temperature, the third chromaticity distance and the brightness of the first image In the correlated color temperature tendency adjustment
- the electronic device adjusts the inclination of the third correlated color temperature, and the electronic device calculates the RGB_GAIN of the image based on the adjusted third correlated color temperature, so that the electronic device adjusts the color of the image based on the RGB_GAIN, so that the image The colors are as expected by the user.
- the one or more processors are further configured to call the computer instructions to make the electronic device perform: according to the third correlated color temperature, the third chromaticity distance and the brightness of the first image Value is in the chromaticity distance tendency adjustment table, determines the first chromaticity distance adjustment value;
- the first chromaticity distance adjustment value is carried out trilinear interpolation calculation, obtains the second chromaticity distance adjustment value;
- Duv_new Duv_new*(1 +Delta_Duv') to obtain the adjusted third chromaticity distance; wherein, Duv_new on the left side of the equal sign of the formula is the adjusted third chromaticity distance, and Duv_new on the right side of the equal sign of the formula is the third color before adjustment chromaticity distance, Delta_Duv' is the second chromaticity distance adjustment value.
- the electronic device adjusts the inclination of the third chromaticity distance, and the electronic device calculates the RGB_GAIN of the image based on the adjusted third chromaticity distance, so that the electronic device adjusts the color of the image based on the RGB_GAIN, so that The color of the image is as expected by the user.
- the embodiment of the present application provides a chip system, the chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to invoke computer instructions so that the electronic device executes the first Aspect or the method described in any implementation of the first aspect.
- the AI automatic white balance and the fusion algorithm of the automatic white balance respectively fuse the CCT output by the AI automatic white balance algorithm and the automatic white balance algorithm to obtain the fused CCT (third correlated color temperature).
- the AI automatic white balance algorithm and the Duv output by the automatic white balance algorithm are fused to obtain the fused Duv (third chromaticity distance).
- the electronic device calculates an adjustment value (RGB_GAIN) of the image based on the fused CCT and fused Duv. Under different shooting environments, the accuracy of RGB_GAIN calculated by the above fusion algorithm is extremely high. It solves the problem that the accuracy of RGB_GAIN output by the traditional automatic white balance algorithm is not high, and the application scenarios of the AI automatic white balance algorithm are limited.
- the embodiment of the present application provides a computer program product containing instructions, and when the computer program product is run on the electronic device, the electronic device is made to execute any one of the first aspect or the first aspect. method described.
- the AI automatic white balance and the automatic white balance fusion algorithm respectively fuse the AI automatic white balance algorithm and the CCT output by the automatic white balance algorithm to obtain the fused CCT (third correlated color temperature).
- the AI automatic white balance algorithm and the Duv output by the automatic white balance algorithm are fused to obtain the fused Duv (third chromaticity distance).
- the electronic device calculates an adjustment value (RGB_GAIN) of the image based on the fused CCT and fused Duv. Under different shooting environments, the accuracy of RGB_GAIN calculated by the above fusion algorithm is extremely high. It solves the problem that the accuracy of RGB_GAIN output by the traditional automatic white balance algorithm is not high, and the application scenarios of the AI automatic white balance algorithm are limited.
- the embodiment of the present application provides a computer-readable storage medium, including instructions, and when the instructions are run on the electronic device, the electronic device executes any one of the first aspect or the first aspect. method described.
- the AI automatic white balance and the automatic white balance fusion algorithm respectively fuse the AI automatic white balance algorithm and the CCT output by the automatic white balance algorithm to obtain the fused CCT (third correlated color temperature).
- the AI automatic white balance algorithm and the Duv output by the automatic white balance algorithm are fused to obtain the fused Duv (third chromaticity distance).
- the electronic device calculates an adjustment value (RGB_GAIN) of the image based on the fused CCT and fused Duv. Under different shooting environments, the accuracy of RGB_GAIN calculated by the above fusion algorithm is extremely high. It solves the problem that the accuracy of RGB_GAIN output by the traditional automatic white balance algorithm is not high, and the application scenarios of the AI automatic white balance algorithm are limited.
- FIG. 1 is a schematic diagram of a hardware structure of an electronic device 100 provided in an embodiment of the present application
- Fig. 2A-Fig. 2D is the application scenario diagram of a kind of AWB and AI AWB fusion algorithm provided by the embodiment of the present application;
- Fig. 3 is a system architecture diagram of a kind of AWB and AI AWB fusion algorithm provided by the embodiment of the application;
- Fig. 4 is the flowchart of a kind of AWB and AI AWB fusion algorithm that the embodiment of the application provides;
- Figure 5 is a uv chromaticity coordinate diagram provided by the embodiment of the present application.
- Fig. 6 is a correlated color temperature conversion table provided by the embodiment of the present application.
- Fig. 7 is a kind of Duv conversion table provided by the embodiment of the present application.
- FIG. 8 is a confidence table provided by the embodiment of the present application.
- Fig. 9 is a kind of CCT fusion table provided by the embodiment of the present application.
- FIG. 10 is a Duv fusion table provided by the embodiment of the present application.
- Fig. 11 is a correlated color temperature inclination adjustment table provided by the embodiment of the present application.
- Fig. 12 is a kind of chromaticity distance tendency adjustment table provided by the embodiment of the present application.
- Fig. 13 is a Planckian locus diagram provided by the embodiment of the present application.
- FIG. 14 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
- a unit may be, but is not limited to being limited to, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or distributed between two or more computers.
- these units can execute from various computer readable media having various data structures stored thereon.
- a unit may, for example, be based on a signal having one or more data packets (eg, data from a second unit interacting with another unit between a local system, a distributed system, and/or a network. For example, the Internet via a signal interacting with other systems) Communicate through local and/or remote processes.
- Planckian locus An object that neither reflects nor completely projects under the action of radiation, but can absorb all the radiation falling on it is called a black body or a complete radiator.
- the black body When the black body is continuously heated, the maximum value of its relative spectral power distribution will move to the short-wave direction, and the corresponding light color will change in the order of red, yellow, white, and blue. At different temperatures, the light color corresponding to the black body will change.
- the arc locus formed on the chromaticity coordinate diagram is called the black body locus or Planck locus.
- Correlated color temperature refers to the temperature of the black body radiator closest to the color with the same brightness stimulus, expressed in K temperature, used to describe the color of light located near the Planckian locus measure.
- K temperature used to describe the color of light located near the Planckian locus measure.
- Light sources other than thermal radiation light sources have linear spectra, and their radiation characteristics are quite different from black body radiation characteristics. Therefore, the light color of these light sources may not exactly fall on the black body locus on the chromaticity diagram.
- CCT is usually used to describe the color characteristics of the light source.
- Duv refers to the distance from the chromaticity coordinates of the test light source to the closest point on the Planckian locus, and Duv represents the color shift (green or pink) between the chromaticity coordinates of the test light source and the Planckian locus and directions information.
- RGB is a three-dimensional vector (R, G, B). Among them, R, G, and B respectively represent the amplitudes of the three color channels of red (Red), green (Green), and blue (Blue).
- Lighting Value (LV) used to estimate the ambient brightness, the specific calculation formula is as follows:
- Exposure is the exposure time
- Aperture is the aperture size
- Iso is the sensitivity
- Luma is the average value of Y in the XYZ color space of the image.
- RGB in the embodiment of this application is DeviceRGB
- the DeviceRGB color space is a color space related to the device, that is, different devices have different understandings of RGB. Therefore, DeviceRGB is not suitable for calculating parameters such as brightness values. Calculating LV requires converting the DeviceRGB color space to a device-independent XYZ space, that is: converting RGB to XYZ.
- the common method of converting RGB color space to XYZ space is: under different light source environments (typical light sources include A, H, U30, TL84, D50, D65, D75, etc.) to calibrate a color correction matrix with a size of 3*3 (Color Correction Matrix, CCM), and store the CCM of different light sources in the memory of the electronic device, through the formula:
- the corresponding light source is often matched according to the white balance reference point in the image, and the CCM corresponding to the light source is selected. If the RGB of the white balance reference point is between the two light sources (for example, the RGB of the image falls between D50 and D65), CCM can be obtained by bilinear interpolation between D50 and D65.
- the color correction matrix of D50 is CCM 1
- the correlated color temperature is CCT 1
- the color correction matrix of D60 is CCM 2
- the correlated color temperature is CCT 2
- the correlated color temperature of the image light source is CCT a .
- Electronics can be based on the formula:
- the CCM of the image can be calculated.
- FFCC Fast Fourier Color Constancy
- FIG. 1 is a schematic diagram of a hardware structure of an electronic device 100 provided in an embodiment of the present application.
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
- SIM subscriber identification module
- the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
- the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 .
- the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
- the illustrated components can be realized in hardware, software or a combination of software and hardware.
- the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- application processor application processor, AP
- modem processor graphics processing unit
- GPU graphics processing unit
- image signal processor image signal processor
- ISP image signal processor
- controller memory
- video codec digital signal processor
- DSP digital signal processor
- baseband processor baseband processor
- neural network processor neural-network processing unit
- a memory may also be provided in the processor 110 for storing instructions and data.
- the memory in processor 110 is a cache memory.
- the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
- the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
- Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the display screen 194 is used to display images, videos and the like.
- the display screen 194 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
- the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
- the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
- the ISP is used for processing the data fed back by the camera 193 .
- the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
- ISP can also perform algorithm optimization on image noise, brightness, and skin color.
- ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be located in the camera 193 .
- Camera 193 is used to capture still images or video.
- the object generates an optical image through the lens and projects it to the photosensitive element.
- the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
- the ISP outputs the digital image signal to the DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other image signals.
- the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
- Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
- the NPU is a neural-network (NN) computing processor.
- NN neural-network
- Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
- the internal memory 121 may be used to store computer-executable program codes including instructions.
- the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 .
- the internal memory 121 may include an area for storing programs and an area for storing data.
- the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
- the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
- the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
- the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
- pressure sensor 180A may be disposed on display screen 194 .
- the gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
- the angular velocity of the electronic device 100 around three axes ie, x, y and z axes
- the gyro sensor 180B can be used for image stabilization.
- the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
- the air pressure sensor 180C is used to measure air pressure.
- the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
- the magnetic sensor 180D includes a Hall sensor.
- the electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D.
- the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to recognize the posture of terminal equipment, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
- the distance sensor 180F is used to measure the distance.
- the electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
- Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
- the light emitting diodes may be infrared light emitting diodes.
- the electronic device 100 emits infrared light through the light emitting diode.
- the electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects, so as to automatically turn off the screen to save power.
- the proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
- the ambient light sensor 180L is used for sensing ambient light brightness.
- the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
- the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket, so as to prevent accidental touch.
- the fingerprint sensor 180H is used to collect fingerprints.
- the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
- the temperature sensor 180J is used to detect temperature.
- the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature treatment strategy.
- Touch sensor 180K also known as "touch panel”.
- the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
- the touch sensor 180K is used to detect a touch operation on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- Visual output related to the touch operation can be provided through the display screen 194 .
- the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
- the bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
- the traditional AWB algorithm adopts the popular grayscale world algorithm.
- the algorithm is based on the grayscale world assumption, that is, for an image with a large number of color changes, the average value of its RGB three-color components tends to the same grayscale value K.
- the gray value K is used to represent the brightness and darkness of a single color.
- the mean value of the average reflection of light by natural scenes is a constant value on the whole, and this constant value is approximately "gray”.
- the gray world algorithm enforces this assumption to the image to be processed, which can remove the influence of ambient light from the image and obtain the original scene image.
- the steps of the grayscale world algorithm are as follows:
- RGB_Gain (Gain R , Gain G , Gain B ) of the image light source according to formula (2) to formula (4).
- Formula (2) to formula (4) are as follows:
- R i , G i and B i in the formula (5) are the amplitudes of each pixel of the image on the red, green and blue color channels respectively, and R' i , G' i and B' i are respectively The adjusted magnitude of each pixel of the image on the red, green, and blue color channels.
- the AI AWB algorithm uses the image as the input of the trained model, for example, Fast Fourier Color Constancy (FFCC) model (FFCC model), neural network model, etc.
- the model in the AI AWB algorithm is an FFCC model as an example for illustration.
- the FFCC model will output the RGB_GAIN of the image light source and the confidence (Conf) of the FFCC model.
- the ISP can adjust the RGB of the image based on the RGB_GAIN of the image light source output through the FFCC model.
- the RGB of the image light source is (25, 150, 50)
- the RGB_GAIN output by the FFCC model is (6, 1, 3)
- the ISP multiplies (6, 1, 3) by the RGB of each pixel of the image to correct the image. Color cast, so as to realize the white balance adjustment of the image.
- the calculation amount is small and the application scenarios of the AWB algorithm are wide.
- the calculation logic is simple and the amount of calculation is generally small, it cannot cover a wide range of complex scenes.
- the accuracy of the RGB_GAIN of the image light source obtained by the traditional AWB algorithm is not high.
- the ISP uses this RGB_GAIN to adjust the RGB of the image , still cannot solve the color cast problem of the image very well, resulting in poor effect of white balance processing.
- the RGB_GAIN accuracy of the output image light source in most scenarios is very high.
- the FFCC model or neural network model needs to be trained on a computer or other device using training samples in advance. Due to the limited training samples, the FFCC model or neural network model cannot be applied to all application scenarios.
- the RGB_GAIN accuracy of the light source obtained through the FFCC model or the neural network model decreases.
- the accuracy of the output results of the AI AWB algorithm is polarized, that is, when images are taken in application scenarios with good generalization scenarios, the accuracy of the light source RGB_GAIN obtained by the AI AWB algorithm is extremely high, and in the generalization scenarios When shooting images in good application scenarios, the accuracy of the light source RGB_GAIN obtained by the AI AWB algorithm is extremely low.
- the embodiment of the present application provides a fusion algorithm of AWB and AI AWB.
- the principle of the fusion algorithm is: the image is processed by the AWB algorithm and the AI AWB algorithm respectively, and the Duv and CCT of the image light source calculated by the two AWB algorithms are obtained. Then, the Duv calculated by the AWB algorithm and the Duv calculated by the AI AWB algorithm are fused to obtain the fused Duv. The CCT calculated by the AWB algorithm and the CCT calculated by the AI AWB algorithm are fused to obtain the fused CCT. Finally, the fused RGB_GAIN is calculated based on the fused Duv and CCT.
- FIG. 2A is a diagram of a photographing interface of the electronic device 100 , and the photographing interface includes a photographing control 1011 and a preview control 1012 .
- the electronic device 100 detects an input operation (for example, click) on the photographing control 1011, the electronic device 100 starts to photograph, and displays a photographing processing interface as shown in FIG. 2B .
- the photographing processing interface displays the prompt words “Picturing, please hold the mobile phone steady”.
- the electronic device 100 detects an input operation (for example, click) on the preview control 1012, and displays as follows: The photo preview interface shown in Figure 2C.
- the electronic device When the user clicks on the photographing control 1011, the electronic device starts to photograph, and during the process of displaying the photographing processing interface in FIG. 2B , the electronic device 100 adjusts the white balance of the photographed image.
- the specific process is: the electronic device calculates and processes the image through the AI AWB algorithm to obtain the RGB gain value (RGB_GAIN) of the image light source. Then, the RGB gain value of each pixel of the image is multiplied by the RGB gain value to realize white balance adjustment of the image.
- image 1 has a color shift (the overall color of image 1 is gray), when the RGB of 70 pixels in image 1 is multiplied by AI AWB and AWB fusion algorithm After adjusting the RGB gain value of image 1, the color compensation of image 1 is realized. After color compensation, the overall color of image 1 is no longer grayish, which is consistent with the color actually observed by human eyes.
- FIG. 3 is a system architecture diagram of outputting an image light source RGB_GAIN through an AWB and AI AWB fusion algorithm provided by an embodiment of the present application.
- the system architecture includes AWB module, AI AWB module, CCT fusion module, Duv fusion module and calculation module.
- the image is used as the input of the AWB module and the AI AWB module respectively, the AWB module outputs CCT 1 and Duv 1 of the image based on its AWB algorithm, and the AI AWB module outputs CCT 2 , Duv 2 and all of the images based on its AI AWB algorithm.
- CCT 1 and CCT 2 were fused, and Duv 1 and Duv 2 were fused to obtain CCT 3 and Duv 3 , respectively.
- CCT 3 is the fused CCT
- Duv 3 is the fused Duv.
- take CCT 3 and Duv 3 as the input of the calculation module, and calculate the RGB_GAIN of the image through the calculation module.
- Fig. 4 is the flow chart of the fusion algorithm of a kind of AWB and AI AWB that the embodiment of the present application provides, and specific flow is as follows:
- Step S401 The electronic device respectively processes the image through the AWB algorithm and the AI AWB algorithm to obtain a first correlated color temperature, a second correlated color temperature, a first chromaticity distance, and a second chromaticity distance.
- the image is the first image
- the first correlated color temperature and the first chromaticity distance are the CCT and Duv obtained by the AWB algorithm of the image
- the second correlated color temperature and the second chromaticity distance are the AWB got CCT and Duv.
- the specific process for the electronic device to calculate and process the image through the AWB algorithm to obtain the first correlated color temperature and the first chromaticity distance is: the electronic device calculates and processes the image through the AWB algorithm to obtain the first adjustment value of the image.
- the first adjustment value may be the RGB of the image light source, may be the RGB_GAIN of the image light source, or may be the chromaticity coordinates (u′, v′) of the image light source. No restrictions. If the first adjustment value is the RGB of the image light source, the electronic device needs to convert the RGB to (u′, v′), and the conversion formula between RGB and chromaticity coordinates is as follows:
- the electronic device needs to convert the RGB_GAIN to the RGB of the image light source by taking the inverse of the three vectors in the RGB_GAIN of the image light source.
- the RGB_GAIN of the image light source is (1/25, 1/50, 1/150), taking the inverses of 1/25, 1/50, and 1/150 respectively to obtain a three-dimensional vector (25, 50, 150), the The three-dimensional vector (25, 50, 150) is the RGB of the image light source.
- the light source RGB is converted into the chromaticity coordinates of the light source.
- formula (7) to formula (8) which will not be described here.
- the electronic device After acquiring the chromaticity coordinates (u′, v′) of the image light source, the electronic device calculates the first correlated color temperature and the first chromaticity distance based on (u′, v′). Next, the calculation method of the first chromaticity distance (Duv) and the first correlated color temperature (CCT) is introduced:
- the first method is to obtain the coordinates (u 0 , v 0 ) of the point on the Planckian locus with the shortest distance from (u′, v′) on the chromaticity coordinate diagram. Then, the first chromaticity distance (Duv) is calculated according to the formula (8), and the formula (8) is as follows:
- the electronic device calculates L FP according to formula (9) based on (u′, v′), and formula (9) is as follows:
- the electronic device calculates the first parameter a according to the formula (10), and the formula (10) is as follows:
- the electronic device calculates L BB according to the formula (11), and the formula (11) is as follows:
- the electronic device calculates the Duv value of the image light source according to the formula (12), and the formula (12) is as follows:
- the method for calculating the first correlated color temperature (CCT) of the electronic device mainly adopts the image method, as shown in FIG. 5 , which is a uv chromaticity coordinate diagram provided in the embodiment of the present application.
- the CCT line corresponding to point M is 3500K
- the first correlated color temperature of the image light source is 3500K.
- the electronic device calculates and processes the image through the AWB algorithm to obtain the first correlated color temperature and the first chromaticity distance as follows: after the electronic device calculates and processes the image through the AI AWB algorithm, the second adjustment value and confidence degree are obtained Conf. Among them, Conf is used to characterize the reliability of the model for calculating and processing images in the AI AWB algorithm.
- the model in the AI AWB algorithm is an FFCC model as an example for illustration.
- the second adjustment value can be the RGB of the image light source calculated by the AI AWB algorithm, can be the RGB_GAIN of the image light source, or can be the chromaticity coordinates (u′′, v "), which is not limited in this embodiment of the present application.
- the second adjustment value is the RGB of the image light source
- the method and formula for converting RGB_GAIN to RGB and RGB to chromaticity coordinates can refer to the relevant description in the above-mentioned AWB algorithm, and will not be repeated here.
- the electronic device calculates the second correlated color temperature and the second chromaticity distance through (u′′, v′′).
- Step S402 the electronic device corrects the second correlated color temperature according to the correlated color temperature conversion table.
- the second adjustment value of the image output by it is very accurate in most scenarios.
- the FFCC model needs to be trained on the computer or other devices in advance. Due to the limited training samples, the FFCC model cannot be applied to all application scenarios.
- the accuracy of the second adjustment value output by the FFCC model is low, which in turn causes the accuracy of the second correlated color temperature (CCT) to be also low.
- the electronic device needs to correct the second correlated color temperature, and if the deviation between the second correlated color temperature and the corrected value is too large, limit it within a reasonable value range.
- the correction process of the electronic device to the second correlated color temperature is as follows: a CCT shift table (CCT Shift Table) is stored in the electronic device.
- CCT Shift Table is a three-dimensional coordinate table with three coordinate axes: CCT axis, Duv axis and LV axis.
- CCT axis In the three-dimensional space of the CCT Shift Table, there are many cells, and each cell corresponds to a CCT correction value.
- the CCT correction value contained in the CCT Shift Table almost covers the CCT of all light sources in the shooting scene.
- the electronic device finds a corresponding point in the CCT Shift Table three-dimensional coordinate system based on the LV of the image, the second correlated color temperature, and the second chromaticity distance, and determines the cell related to this point.
- the CCT corresponding to each relevant cell is the first correlated color temperature correction value.
- the weight of each relevant cell is calculated by Trilinear interpolation (trilinear interpolation), and the weight of the cell is multiplied by its corresponding first correlated color temperature correction value to obtain the product of each relevant cell, and each The products of the relevant cells are summed to obtain the second correlated color temperature correction value (CCT_new).
- the electronic device sets the second correlated color temperature as CCT_new to implement correction to the second correlated color temperature.
- Step S403 the electronic device corrects the second chromaticity distance according to the chromaticity distance conversion table.
- the FFCC model outputs a second chromaticity distance (Duv) with very low accuracy.
- the electronic device needs to correct the second chromaticity distance, and if the deviation between the second chromaticity distance and the corrected value is too large, limit it within a reasonable numerical range.
- Duv Shift Table is a three-dimensional coordinate table with three coordinate axes: Duv axis, CCT axis and LV axis.
- Duv axis In the three-dimensional space of the Duv Shift Table, there are many cells, and each cell corresponds to a Duv correction value.
- the Duv correction value contained in the Duv Shift Table almost covers the Duv of all light sources in the shooting scene.
- the electronic device finds a corresponding point in the Duv Shift Table three-dimensional coordinate system based on the LV of the image, the second chromaticity distance, and the second chromaticity distance, and determines the cell related to this point.
- the Duv corresponding to each relevant cell is the first chromaticity distance correction value.
- calculate the weight of each relevant cell by Trilinear interpolation (trilinear interpolation), and multiply the weight of the cell and its corresponding first chromaticity distance correction value to obtain the product of each relevant cell, and divide each The products of related cells are summed to obtain the second chromaticity distance correction value (Duv_new).
- the electronic device sets the second chromaticity distance as Duv_new to implement correction to the second chromaticity distance.
- Step S404 the electronic device corrects the confidence level of the AI automatic white balance algorithm according to the confidence level correction table.
- the electronic device can correct Conf, and when the Conf output by the FFCC model is quite different from the actual Conf, the Conf is limited within a reasonable value range.
- a confidence table (Confidence Table) is stored in the electronic device.
- the Confidence Table is a three-dimensional coordinate table with three coordinate axes: CCT axis, Duv axis and LV axis.
- CCT axis CCT axis
- Duv axis Duv axis
- LV axis In the three-dimensional space of the Confidence Table, there are many cells, and each cell corresponds to a confidence adjustment value (Mult_Conf).
- the electronic device finds a corresponding point in the three-dimensional coordinate system of the Confidence Table based on the LV of the image, the second correlated color temperature, and the second chromaticity distance, and determines a cell related to the point.
- the Mult_Conf corresponding to each relevant cell is the first confidence adjustment value.
- Equation (13) is as follows:
- the Conf_new is a confidence correction value
- the Mult_Conf is a confidence adjustment value
- the Conf is a confidence before correction. It should be noted that Conf_new may be greater than 1, and when Conf_new is greater than 1, set Conf_new to 1.
- Step S405 The electronic device calculates the first correlated color temperature and the second correlated color temperature based on the correlated color temperature fusion table to obtain a third correlated color temperature.
- CCT Merging Table is stored in the electronic device.
- the CCT Merging Table is a three-dimensional coordinate table with three coordinate axes, namely: Duv axis, CCT axis and LV axis.
- the electronic device finds a corresponding point in the CCT Merging Table three-dimensional coordinate system based on the LV of the image, the second correlated color temperature, and the second chromaticity distance, and determines the cell related to this point.
- the probability value corresponding to each relevant cell is the first probability value.
- Equation (14) is as follows:
- the CCT_3 is the third correlated color temperature
- the CCT_stat is the first correlated color temperature
- the CCT_ai is the second correlated color temperature
- the Conf is the confidence degree of the AI automatic white balance algorithm
- the X' is the second probability value.
- the electronic device can find a corresponding point in the CCT Merging Table three-dimensional coordinate system based on the LV of the image, the first correlated color temperature, and the first chromaticity distance, and determine the cell related to this point. Then, trilinear interpolation is performed based on the relevant cells to obtain the second probability value, and the third correlated color temperature is calculated according to the formula (14).
- Step S406 The electronic device calculates the first chromaticity distance and the second chromaticity distance based on the chromaticity distance fusion table to obtain a third chromaticity distance.
- Duv Merging Table is a three-dimensional coordinate table with three coordinate axes: Duv axis, CCT axis and LV axis.
- the electronic device finds a corresponding point in the CCT Merging Table three-dimensional coordinate system based on the LV of the image, the second correlated color temperature, and the second chromaticity distance, and determines the cell related to this point.
- the probability value corresponding to each relevant cell is the third probability value.
- the electronic device calculates the weight of each relevant cell through Trilinear interpolation (trilinear interpolation), and multiplies the weight of the cell with its corresponding third probability value to obtain the product of each relevant cell, and divides each The products of related cells are summed to obtain the fourth probability value. Finally, the electronic device calculates the third correlated color temperature through formula (15). Equation (15) is as follows:
- Duv_3 Conf*Y′*Duv_ai+(1-Conf*Y′)*Duv_stat (15)
- the Duv_3 is the third chromaticity distance
- the Duv_stat is the first chromaticity distance
- the Duv_ai is the second chromaticity distance
- the Conf is the confidence degree of the AI automatic white balance algorithm
- the Y' is Fourth probability value.
- the electronic device may find a corresponding point in the Duv Merging Table three-dimensional coordinate system based on the LV of the image, the first correlated color temperature, and the first chromaticity distance, and determine the cell related to this point. Then, the second probability value is obtained by performing trilinear interpolation calculation based on the relevant cells, and the third chromaticity distance is calculated according to the formula (15).
- Step S407 The electronic device adjusts the tendency of the third correlated color temperature according to the correlated color temperature tendency adjustment table, and obtains the adjusted third correlated color temperature.
- the specific process for the electronic device to adjust the third correlated color temperature is: a CCT Propensity Table (correlated color temperature propensity adjustment table) as shown in Figure 11 is stored in the electronic device.
- the CCT Propensity Table is a three-dimensional coordinate table with three The coordinate axes are: CCT axis, Duv axis and LV axis.
- each cell corresponds to a CCT adjustment value (Delta_CCT).
- the electronic device finds the corresponding point in the three-dimensional coordinate system of CCT Propensity Table based on the LV of the image, the third correlated color temperature and the third chromaticity distance, and determines the cell related to this point.
- the Delta_CCT corresponding to each relevant cell is the first correlated color temperature adjustment value.
- the weight of each relevant cell is calculated by Trilinear interpolation (trilinear interpolation), and the weight of the cell is multiplied by its corresponding first correlated color temperature adjustment value to obtain the product of each relevant cell, and each The products of the related cells are summed to obtain the second correlated color temperature adjustment value.
- the electronic device calculates the adjusted third correlated color temperature according to the formula (16), and the formula (16) is as follows:
- CCT_3 on the left side of the equation is the adjusted third correlated color temperature
- CCT_3 on the right side of the equation is the third correlated color temperature before adjustment
- the Delta_CCT′ is the adjusted value of the second correlated color temperature
- Step S408 The electronic device adjusts the inclination of the third chromaticity distance according to the chromaticity distance inclination adjustment table, and obtains the adjusted third chromaticity distance.
- the electronic device needs to adjust the tendency of the CCT and Duv of the image.
- the specific process for the electronic device to adjust the tendency of the third chromaticity distance is as follows: a DuvPropensity Table (chromaticity distance propensity adjustment table) as shown in Figure 12 is stored in the electronic device.
- the DuvPropensity Table is a three-dimensional coordinate table with three The coordinate axes are: CCT axis, Duv axis and LV axis.
- the electronic device finds the corresponding point in the three-dimensional coordinate system of CCT Propensity Table based on the LV of the image, the third correlated color temperature and the third chromaticity distance, and determines the cell related to this point.
- the Delta_Duv corresponding to each relevant cell is the first chromaticity distance adjustment value.
- Trilinear interpolation Trilinear interpolation
- the electronic device calculates the adjusted third correlated color temperature according to the formula (17), and the formula (17) is as follows:
- Duv_3 Duv_3*(1+Delta_Duv′) (17)
- Duv_3 on the left side of the equation is the adjusted third chromaticity distance
- Duv_3 on the right side of the equation is the third chromaticity distance before adjustment
- the Delta_Duv' is the second chromaticity distance Distance adjustment value.
- Step S409 The electronic device calculates the RGB gain value of the image light source based on the third correlated color temperature and the third chromaticity distance.
- step S407 and step S408 are optional steps. If the electronic device adjusts the third correlated color temperature and the third chromaticity distance, calculate the third correlated color temperature and third chromaticity coordinates of the RGB gain value of the image light source as the adjusted first step S407 and step S408 Tri-correlative color temperature and third chromaticity coordinates.
- the RGB gain value of the image light source needs to be obtained by converting the uv chromaticity coordinates of the image light source.
- the specific process of calculating the chromaticity coordinates (u, v) of the image light source by the electronic device by using CCT_3 and Duv_3 is introduced.
- the specific process is as follows: First, find the relevant The color temperature is point N of CCT_3, and the chromaticity coordinates (u 0 , v 0 ) of point N are calculated.
- the electronic device calculates the RGB_GAIN (Gain R , Gain G , Gain B ) of the image light source through formula (20) to formula (22), the formula (20) ⁇ formula (22) are as follows:
- the electronic device calculates the first correlated color temperature calculated by the AWB algorithm and the second correlated color temperature calculated by the AI AWB algorithm based on the correlated color temperature fusion table to obtain the third correlated color temperature.
- the first chromaticity distance calculated by the AWB algorithm and the second chromaticity distance calculated by the AI AWB algorithm are calculated based on the chromaticity distance fusion table to obtain the third chromaticity distance.
- calculate the RGB gain value of the image light source based on the third correlated color temperature and the third chromaticity distance.
- the RGB gain value is an RGB gain value with high accuracy.
- the fusion of the AWB algorithm and the AI AWB algorithm is realized, which not only solves the problem of low accuracy of the RGB gain value of the image light source calculated by the AWB algorithm, but also solves the problem of limited application scenarios of the AI AWB algorithm.
- the calculated RGB gain value has extremely high accuracy in various scenarios, which is beneficial for the ISP to use the RGB gain value to adjust the RGB of the image and solve the color cast problem of the image.
- FIG. 14 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
- the electronic device 100 includes a processor 1401 and a memory 1402, wherein the detailed description of each unit is as follows:
- Memory 1402 is used to store program codes
- the processor 1401 is used to call the program code stored in the memory to perform the following steps:
- the image is processed by the AWB algorithm and the AI AWB algorithm respectively to obtain the first correlated color temperature, the second correlated color temperature, the first chromaticity distance and the second chromaticity distance;
- the first correlated color temperature and the second correlated color temperature are calculated to obtain the third correlated color temperature
- the first chromaticity distance and the second chromaticity are calculated to obtain the third chromaticity distance;
- the correlated color temperature inclination degree adjustment table adjust the inclination degree of the third correlated color temperature to obtain the adjusted third correlated color temperature
- the third chromaticity distance is adjusted to obtain the third chromaticity distance after adjustment
- the RGB gain value of the image light source is calculated based on the third correlated color temperature and the third chromaticity distance.
- the embodiment of the present application also provides a computer program product containing instructions.
- the computer program product When the computer program product is run on the electronic device, the electronic device is executed as described in any one of steps S401-step S409 in the embodiment of FIG. 4 above. described method.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means.
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
- the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
- the processes can be completed by computer programs to instruct related hardware.
- the programs can be stored in computer-readable storage media.
- When the programs are executed may include the processes of the foregoing method embodiments.
- the aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Processing Of Color Television Signals (AREA)
Abstract
本申请提供了一种AI自动白平衡和自动白平衡的融合算法以及电子设备。其中,所述融合算法包括:电子设备将自动白平衡算法输出的CCT、AI自动白平衡算法输出的CCT进行融合,得到融合后的CCT。电子设备将自动白平衡算法输出的Duv、AI自动白平衡算法输出的Duv进行融合,得到融合后的Duv。电子设备根据融合后的CCT和融合后的Duv计算图像的RGB_GAIN。通过上述融合算法得到的RGB_GAIN准确度高,解决了AI自动白平衡算法应用场景有限,自动白平衡算法准确度不高的问题。
Description
本申请要求于2021年6月7日提交中国专利局、申请号为202110634365.X、发明名称为“AI自动白平衡和自动白平衡的融合算法以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及图像处理领域,尤其涉及一种AI自动白平衡和自动白平衡的融合算法以及电子设备。
白平衡是数码相机设备或相关软件能够对捕获图像进行的一种调整,用于确保图像中的白色能够适当地反映拍摄图像的真实世界场景中的实际白色。白平衡与色温相关,色温是基于图像和场景中的蓝光量与红光量的比率来衡量光的质量,以开尔文为单位。具有较高色温的图像或场景比具有较低色温的图像和场景具有更多的蓝色。因此,“较冷”的光具有较高的色温,“较热”的光具有较低的色温。
人眼和大脑可以适应不同的色温。例如,不管是在阳光下还是在各种灯光下,人眼将白色的物体视为白色,即人眼具有颜色恒常性。由于摄像机内用于将光信号转化为电信号的电荷耦合元件电路(Charge-coupled Device,CCD)或CMOS电路没有办法像人眼一样会对光源的颜色变化进行修正。因此,需要通过白平衡算法来估计捕获图像光源的色度,并通过估计的光源色度来调整图像颜色,使得调整后的图像的色彩与人眼真实观察的色彩一致。如何提高白平衡算法的准确度,即如何提高估计的光源色度更加准确,是技术人员日益关注的问题。
发明内容
本申请实施例提供了一种AI自动白平衡和自动白平衡的融合算法,解决了AI自动白平衡算法应用场景有限,自动白平衡算法准确度不高的问题。
第一方面,本申请实施例提供了一种AI自动白平衡和自动白平衡的融合算法,包括:基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到第一图像的第三相关色温;基于色度距离融合表,将第一图像的第一色度距离和第一图像的第二色度距离基于色度距离融合表进行计算,得到第一图像的第三色度距离;基于第三相关色温和第三色度距离计算得到第一图像的调节值,所述调节值用于调节第一图像的颜色;其中,第一相关色温为通过自动白平衡算法计算得到的第一图像的CCT,第一色度距离为通过自动白平衡算法计算得到的第一图像的Duv,第二相关色温为通过AI自动白平衡算法计算得到的第一图像的CCT,第二色度距离为通过AI自动白平衡算法计算得到的第一图像的Duv。
在上述实施例中,所述AI自动白平衡和自动白平衡的融合算法分别将AI自动白平衡算法和自动白平衡算法输出的CCT进行融合,得到融合后的CCT(第三相关色温)。将AI 自动白平衡算法和自动白平衡算法输出的Duv进行融合,得到融合后的Duv(第三色度距离)。电子设备基于所述融合后的CCT和融合后的Duv计算该图像的调节值(RGB_GAIN)。在不同拍摄环境下,通过上述融合算法计算出的RGB_GAIN准确度极高。解决了传统的自动白平衡算法输出的RGB_GAIN准确度不高,AI自动白平衡算法应用场景有限的问题。
结合第一方面,在一种实施例中,基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到所述第一图像的第三相关色温之前,还包括:根据第二相关色温、第二色度距离以及第一图像的亮度值,在相关色温转换表中确定第一相关色温修正值;对第一相关色温修正值进行三线性插值计算,得到第二相关色温修正值;将第二相关色温设置为所述第二相关色温修正值。
在上述实施例中,通过将AI自动白平衡算法输出的CCT进行修正,避免了因AI自动白平衡算法输出的CCT误差过大,而影响第三相关色温的准确度的问题。
结合第一方面,在一种实施例中,基于相关色温融合表,将第一图像的第一相关色温和第一图像的第二相关色温进行计算,得到第一图像的第三相关色温之前,还包括:根据第二相关色温、第二色度距离以及第一图像的亮度值在色度距离转换表中确定第一色度距离修正值;对第一色度距离修正值进行三线性插值计算,得到第二色度距离修正值;将第二色度距离设置为第二色度距离修正值。
在上述实施例中,通过将AI自动白平衡算法输出的Duv进行修正,避免了因AI自动白平衡算法输出的Duv误差过大,而影响第三色度距离的准确度的问题。
结合第一方面,在一种实施例中,基于相关色温融合表,将第一图像的第一相关色温和第一图像的第二相关色温进行计算,得到第一图像的第三相关色温之前,还包括:根据第二相关色温、第二色度距离以及第一图像的亮度值在置信度修正表中确定第一置信度调节值;对第一置信度调节值进行三线性插值计算,得到第二置信度调节值;根据公式Conf_new=Conf*Mult_Conf,计算得到置信度修正值;其中,Conf为AI自动白平衡算法的置信度,Mult_Conf为第二置信度调节值,Conf_new为置信度修正值;将AI自动白平衡算法的置信度设置为置信度修正值。
在上述实施例中,通过将AI自动白平衡算法输出的Conf进行修正,避免了因AI自动白平衡算法输出的Conf误差过大,而影响第三相关色温和第三色度距离的准确度的问题。
结合第一方面,在一种实施例中,基于相关色温融合表,将第一图像的第一相关色温和第一图像的第二相关色温进行计算,得到第一图像的第三相关色温,具体包括:根据第二相关色温、第二色度距离以及第一图像的亮度值在相关色温融合表中确定第一概率值;或根据第二相关色温、第二色度距离以及第一图像的亮度值在相关色温融合表中确定第一概率值;对第一概率值进行三线性插值计算,得到第二概率值;根据公式CCT_new=Conf*X′*CCT_ai+(1-Conf*X′)*CCT_stat,计算得到第三相关色温;其中,CCT_new为第三相关色温,CCT_stat为第一相关色温,CCT_ai为第二相关色温,Conf为AI自动白平衡算法的置信度,X′为第二概率值。
在上述实施例中,电子设备通过上述公式将第一相关色温和第二相关色温进行融合,得到准确度高的第三相关色温,有利于电子设备基于所述准确度高的第三相关色温计算该图像高准确度的RGB_GAIN。
结合第一方面,在一种实施例中,基于色度距离融合表,将第一图像的第一色度距离和第一图像的第二色度距离基于色度距离融合表进行计算,得到第一图像的第三色度距离,具体包括:根据第二相关色温、第二色度距离以及第一图像的亮度值在色度距离融合表中确定第三概率值;或根据第二相关色温、第二色度距离以及第一图像的亮度值在色度距离融合表中确定第三概率值;对第三概率值进行三线性插值计算,得到第四概率值;根据公式Duv_new=Conf*X′*Duv_ai+(1-Conf*Y′)*Duv_stat,计算得到第三色度距离;其中,Duv_new为第三色度距离,Duv_stat为第一色度距离,Duv_ai为第二色度距离,Conf为AI自动白平衡算法的置信度,Y′为第四概率值。
在上述实施例中,电子设备通过上述公式将第一色度距离和第二色度距离进行融合,得到准确度高的第三色度距离,有利于电子设备基于所述准确度高的第三色度距离计算该图像高准确度的RGB_GAIN。
结合第一方面,在一种实施例中,基于第三相关色温和第三色度距离计算得到第一图像的调节值之前,还包括:根据第三相关色温、第三色度距离以及第一图像的亮度值在相关色温倾向调节表中,确定第一相关色温调节值;对第一相关色温调节值进行三线性插值计算,得到第二相关色温调节值;通过公式CCT_new=CCT_new*(1+Delta_CCT′),得到调节后的第三相关色温;其中,所述公式等号左边的CCT_new为调节后的第三相关色温,所述公式等号右边的CCT_new为调节前的第三相关色温,Delta_CCT′为所述第二相关色温调节值。
在上述实施例中,通过对第三相关色温的倾向度进行调节,电子设备基于调节后的第三相关色温计算该图像的RGB_GAIN,以便电子设备基于该RGB_GAIN调节图像的颜色,使得该图像的颜色符合用户预期。
结合第一方面,在一种实施例中,基于第三相关色温和所述第三色度距离计算得到第一图像的调节值之前,还包括:根据第三相关色温、第三色度距离以及第一图像的亮度值在色度距离倾向调节表中,确定第一色度距离调节值;对第一色度距离调节值进行三线性插值计算,得到第二色度距离调节值;通过公式Duv_new=Duv_new*(1+Delta_Duv′),得到调节后的第三色度距离;其中,所述公式等号左边的Duv_new为调节后的第三色度距离,所述公式等号右边的Duv_new为调节前的第三色度距离,Delta_Duv′为所述第二色度距离调节值。
在上述实施例中,通过对第三色度距离的倾向度进行调节,电子设备基于调节后的第三色度距离计算该图像的RGB_GAIN,以便电子设备基于该RGB_GAIN调节图像的颜色,使得该图像的颜色符合用户预期。
第二方面,本申请实施例提供了一种电子设备,该电子设备包括:一个或多个处理器和存储器;该存储器与该一个或多个处理器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令,该一个或多个处理器调用该计算机指令以使得该电子设备执行:基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到第一图像的第三相关色温;基于色度距离融合表,将第一图像的第一色度距离和第一图像的第二色度距离基于色度距离融合表进行计算,得到第一图像的第三色度距离;基于第三相关色温和第三色度距离计算得到第一图像的调节值,所述调节值用于 调节第一图像的颜色;其中,第一相关色温为通过自动白平衡算法计算得到的第一图像的CCT,第一色度距离为通过自动白平衡算法计算得到的第一图像的Duv,第二相关色温为通过AI自动白平衡算法计算得到的第一图像的CCT,第二色度距离为通过AI自动白平衡算法计算得到的第一图像的Duv。
在上述实施例中,电子设备将所述AI自动白平衡和自动白平衡的融合算法分别将AI自动白平衡算法和自动白平衡算法输出的CCT进行融合,得到融合后的CCT(第三相关色温)。将AI自动白平衡算法和自动白平衡算法输出的Duv进行融合,得到融合后的Duv(第三色度距离)。电子设备基于所述融合后的CCT和融合后的Duv计算该图像的调节值(RGB_GAIN)。在不同拍摄环境下,通过上述融合算法计算出的RGB_GAIN准确度极高。解决了传统的自动白平衡算法输出的RGB_GAIN准确度不高,AI自动白平衡算法应用场景有限的问题。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第二相关色温、第二色度距离以及第一图像的亮度值,在相关色温转换表中确定第一相关色温修正值;对第一相关色温修正值进行三线性插值计算,得到第二相关色温修正值;将第二相关色温设置为所述第二相关色温修正值。
在上述实施例中,电子设备通过将AI自动白平衡算法输出的CCT进行修正,避免了因AI自动白平衡算法输出的CCT误差过大,而影响第三相关色温的准确度的问题。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第二相关色温、第二色度距离以及第一图像的亮度值在色度距离转换表中确定第一色度距离修正值;对第一色度距离修正值进行三线性插值计算,得到第二色度距离修正值;将第二色度距离设置为第二色度距离修正值。
在上述实施例中,电子设备通过将AI自动白平衡算法输出的Duv进行修正,避免了因AI自动白平衡算法输出的Duv误差过大,而影响第三色度距离的准确度的问题。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第二相关色温、第二色度距离以及第一图像的亮度值在置信度修正表中确定第一置信度调节值;对第一置信度调节值进行三线性插值计算,得到第二置信度调节值;根据公式Conf_new=Conf*Mult_Conf,计算得到置信度修正值;其中,Conf为AI自动白平衡算法的置信度,Mult_Conf为第二置信度调节值,Conf_new为置信度修正值;将AI自动白平衡算法的置信度设置为置信度修正值。
在上述实施例中,电子设备通过将AI自动白平衡算法输出的Conf进行修正,避免了因AI自动白平衡算法输出的Conf误差过大,而影响第三相关色温和第三色度距离的准确度的问题。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第二相关色温、第二色度距离以及第一图像的亮度值在相关色温融合表中确定第一概率值;或根据第二相关色温、第二色度距离以及第一图像的亮度值在相关色温融合表中确定第一概率值;对第一概率值进行三线性插值计算,得到第二概率值;根据公式CCT_new=Conf*X′*CCT_ai+(1-Conf*X′)*CCT_stat,计算得到第三相关色温;其中,CCT_new为第三相关色温,CCT_stat为第一相关色温,CCT_ai为第二相 关色温,Conf为AI自动白平衡算法的置信度,X′为第二概率值。
在上述实施例中,电子设备通过上述公式将第一相关色温和第二相关色温进行融合,得到准确度高的第三相关色温,有利于电子设备基于所述准确度高的第三相关色温计算该图像高准确度的RGB_GAIN。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第二相关色温、第二色度距离以及第一图像的亮度值在色度距离融合表中确定第三概率值;或根据第二相关色温、第二色度距离以及第一图像的亮度值在色度距离融合表中确定第三概率值;对第三概率值进行三线性插值计算,得到第四概率值;根据公式Duv_new=Conf*Y′*Duv_ai+(1-Conf*Y′)*Duv_stat,计算得到第三色度距离;其中,Duv_new为第三色度距离,Duv_stat为第一色度距离,Duv_ai为第二色度距离,Conf为AI自动白平衡算法的置信度,Y′为第四概率值。
在上述实施例中,电子设备通过上述公式将第一色度距离和第二色度距离进行融合,得到准确度高的第三色度距离,有利于电子设备基于所述准确度高的第三色度距离计算该图像高准确度的RGB_GAIN。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第三相关色温、第三色度距离以及第一图像的亮度值在相关色温倾向调节表中,确定第一相关色温调节值;对第一相关色温调节值进行三线性插值计算,得到第二相关色温调节值;通过公式CCT_new=CCT_new*(1+Delta_CCT′),得到调节后的第三相关色温;其中,所述公式等号左边的CCT_new为调节后的第三相关色温,所述公式等号右边的CCT_new为调节前的第三相关色温,Delta_CCT′为所述第二相关色温调节值。
在上述实施例中,电子设备通过对第三相关色温的倾向度进行调节,电子设备基于调节后的第三相关色温计算该图像的RGB_GAIN,以便电子设备基于该RGB_GAIN调节图像的颜色,使得该图像的颜色符合用户预期。
结合第二方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据第三相关色温、第三色度距离以及第一图像的亮度值在色度距离倾向调节表中,确定第一色度距离调节值;对第一色度距离调节值进行三线性插值计算,得到第二色度距离调节值;通过公式Duv_new=Duv_new*(1+Delta_Duv′),得到调节后的第三色度距离;其中,所述公式等号左边的Duv_new为调节后的第三色度距离,所述公式等号右边的Duv_new为调节前的第三色度距离,Delta_Duv′为所述第二色度距离调节值。
在上述实施例中,电子设备通过对第三色度距离的倾向度进行调节,电子设备基于调节后的第三色度距离计算该图像的RGB_GAIN,以便电子设备基于该RGB_GAIN调节图像的颜色,使得该图像的颜色符合用户预期。
第三方面,本申请实施例提供了一种芯片***,该芯片***应用于电子设备,该芯片***包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面或第一方面的任意一种实施方式所描述的方法。
在上述实施例中,所述AI自动白平衡和自动白平衡的融合算法分别将AI自动白平衡 算法和自动白平衡算法输出的CCT进行融合,得到融合后的CCT(第三相关色温)。将AI自动白平衡算法和自动白平衡算法输出的Duv进行融合,得到融合后的Duv(第三色度距离)。电子设备基于所述融合后的CCT和融合后的Duv计算该图像的调节值(RGB_GAIN)。在不同拍摄环境下,通过上述融合算法计算出的RGB_GAIN准确度极高。解决了传统的自动白平衡算法输出的RGB_GAIN准确度不高,AI自动白平衡算法应用场景有限的问题。
第四方面,本申请实施例提供了一种包含指令的计算机程序产品,当该计算机程序产品在电子设备上运行时,使得该电子设备执行如第一方面或第一方面的任意一种实施方式所描述的方法。
在上述实施例中,所述AI自动白平衡和自动白平衡的融合算法分别将AI自动白平衡算法和自动白平衡算法输出的CCT进行融合,得到融合后的CCT(第三相关色温)。将AI自动白平衡算法和自动白平衡算法输出的Duv进行融合,得到融合后的Duv(第三色度距离)。电子设备基于所述融合后的CCT和融合后的Duv计算该图像的调节值(RGB_GAIN)。在不同拍摄环境下,通过上述融合算法计算出的RGB_GAIN准确度极高。解决了传统的自动白平衡算法输出的RGB_GAIN准确度不高,AI自动白平衡算法应用场景有限的问题。
第五方面,本申请实施例提供了一种计算机可读存储介质,包括指令,当该指令在电子设备上运行时,使得该电子设备执行如第一方面或第一方面的任意一种实施方式所描述的方法。
在上述实施例中,所述AI自动白平衡和自动白平衡的融合算法分别将AI自动白平衡算法和自动白平衡算法输出的CCT进行融合,得到融合后的CCT(第三相关色温)。将AI自动白平衡算法和自动白平衡算法输出的Duv进行融合,得到融合后的Duv(第三色度距离)。电子设备基于所述融合后的CCT和融合后的Duv计算该图像的调节值(RGB_GAIN)。在不同拍摄环境下,通过上述融合算法计算出的RGB_GAIN准确度极高。解决了传统的自动白平衡算法输出的RGB_GAIN准确度不高,AI自动白平衡算法应用场景有限的问题。
图1是本申请实施例提供的一种电子设备100的硬件结构示意图;
图2A-图2D是本申请实施例提供的一种AWB和AI AWB融合算法的应用场景图;
图3是本申请实施例提供的一种AWB和AI AWB融合算法的***架构图;
图4是本申请实施例提供的一种AWB和AI AWB融合算法的流程图;
图5是本申请实施例提供的一种uv色度坐标图;
图6是本申请实施例提供的一种相关色温转换表;
图7是本申请实施例提供的一种Duv转换表;
图8是本申请实施例提供的一种置信度表;
图9是本申请实施例提供的一种CCT融合表;
图10是本申请实施例提供的一种Duv融合表;
图11是本申请实施例提供的一种相关色温倾向度调节表;
图12是本申请实施例提供的一种色度距离倾向度调节表;
图13是本申请实施例提供的一种普朗克轨迹图;
图14是本申请实施例提供的一种电子设备100的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或者特性可以包含在本实施例申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是相同的实施例,也不是与其它实施例互斥的独立的或是备选的实施例。本领域技术人员可以显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及所述附图中术语“第一”、“第二”、“第三”等是区别于不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如,包含了一系列步骤或单元,或者可选地,还包括没有列出的步骤或单元,或者可选地还包括这些过程、方法、产品或设备固有的其它步骤或单元。
附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前,应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
在本说明书中使用的术语“部件”、“模块”、“***”、“单元”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件或执行中的软件。例如,单元可以是但不限于在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或分布在两个或多个计算机之间。此外,这些单元可从在上面存储有各种数据结构的各种计算机可读介质执行。单元可例如根据具有一个或多个数据分组(例如来自与本地***、分布式***和/或网络间的另一单元交互的第二单元数据。例如,通过信号与其它***交互的互联网)的信号通过本地和/或远程进程来通信。
下面,对本申请实施例涉及的一些专有名词进行解释。
(1)普朗克轨迹:在辐射作用下既不反射也不完全投射,而能把落在它上面的辐射全部吸收的物体称为黑体或完全辐射体。当黑体连续加热时,它的相对光谱功率分布的最大值将向短波方向移动,相应的光色将按照红、黄、白、蓝的顺序进行变化,在不同温度下,黑体对应的光色变化在色度坐标图上形成的弧形轨迹,叫做黑体轨迹或普朗克轨迹。
(2)相关色温(Correlated Colour Temperature,CCT):是指与具有相同亮度刺激的颜色最相近的黑体辐射体的温度,用K氏温度表示,用于描述位于普朗克轨迹附近的光的颜色的度量。除热辐射光源以外的其它光源具有线状光谱,其辐射特性与黑体辐射特性差别较 大,所以这些光源的光色在色度图上不一定准确地落在黑体轨迹上,对这样一类光源,通常用CCT来描述光源的颜色特性。
(3)Duv:是指从测试光源的色度坐标到普朗克轨迹上的最近点的距离,Duv表征了测试光源的色度坐标与普朗克轨迹的颜色偏移(绿色或粉红色)和方向的信息。
(4)RGB:RGB是一个三维向量(R,G,B)。其中,R、G、B分别代表在红(Red)、绿(Green)、蓝(Blue)三个颜色通道上的幅值。
(5)RGB_GAIN:RGB_GAIN是一个三维向量(GAIN_R,GAIN_G,GAIN_B),GAIN_R、GAIN_G、GAIN_B分别代表在红(Red)、绿(Green)、蓝(Blue)三个颜色通道上的比例,也叫作RGB增益值,当图像光源的RGB_GAIN与图像光源的RGB相乘后,得到一个三维向量(R*GAIN_R,G*GAIN_G,B*GAIN_B)。其中,R*GAIN_R=G*GAIN_G=B*GAIN_B。
(6)亮度值(Lighting Value,LV):用于估计环境亮度,其具体计算公式如下:
其中,Exposure为曝光时间,Aperture为光圈大小,Iso为感光度,Luma为图像在XYZ颜色空间中,Y的平均值。
(7)XYZ空间:本申请实施例中的RGB是DeviceRGB,DeviceRGB颜色空间是与设备相关的颜色空间,即:不同设备对RGB的理解不同。因此,DeviceRGB不适合用于计算亮度值等参数。计算LV需要将DeviceRGB颜色空间转换为与设备无关的XYZ空间,即:将RGB转换为XYZ。
RGB颜色空间转换为XYZ空间的常用方法为:在不同光源环境下(典型的光源包括A、H、U30、TL84、D50、D65、D75等等)标定出一个大小为3*3的颜色校正矩阵(Color Correction Matrix,CCM),并将不同光源的CCM存储在电子设备的内存中,通过公式:
得到图像在XYZ空间对应的三维向量,从而实现RGB空间到XYZ空间的转化。在拍摄过程中,往往根据图像中的白平衡基准点来匹配对应的光源,并选择该光源对应的CCM。若存在白平衡基准点的RGB在两个光源之间(例如图像的RGB落在D50和D65之间),CCM可由D50和D65进行双线性插值所得到。例如,D50的颜色校正矩阵为CCM
1,相关色温为CCT
1,D60的颜色校正矩阵为CCM
2,相关色温为CCT
2,图像光源的相关色温为CCT
a。电子设备可以根据公式:
计算出比例值g,基于比例值,根据公式:
CCM=g*CCM
1+(1-g)*CCM
2
可以计算出图像的CCM。
(8)快速傅里叶颜色恒常性(Fast Fourier Color Constancy,FFCC)模型:使用快速傅里叶算法在图像的uv色度图上进行卷积计算,最大响应的位置对应光源的uv色度坐标,从而获取该图像光源的RGB或RGB_GAIN或光源的uv色度坐标。
请参见图1,图1是本申请实施例提供的一种电子设备100的硬件结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed, Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套 的开合。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别终端设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。
由于,数码相机或手机等电子设备中的CCD电路或CMOS电路不能对光源的颜色变化作出修正,为了防止拍摄出的图像出现色温等问题,需要将图像进行白平衡处理。应用最多的白平衡算法主要有两种,一种是自动白平衡(Automatic white balance,AWB)算法,另一种是AI AWB算法。下面对两种白平衡速算法进行介绍。
传统的AWB算法采用流行的灰度世界算法。该算法以灰度世界假设为基础的,即对于一幅有着大量色彩变化的图像,其RGB三颜色分量的平均值趋近于同一灰度值K。其中,灰度值K用于表征单个颜色的亮暗程度。假设自然界景物对于光线的平均反射的均值在总体上是个定值,这个定值近似地为“灰色”。灰度世界算法将这一假设强制应用于待处理图像,可以从图像中消除环境光的影响,获得原始场景图像。灰度世界算法的步骤如下:
1、计算灰度值K。具体地,灰度值K的计算方式有两种:一种是取最亮灰度值的一半(灰度值的取值范围为0~255),即灰度值K为128。另一种是计算图像R、G、B的平均值
然后,通过公式(1)得到灰度值K,公式(1)如下所示:
2、根据公式(2)~公式(4)计算该图像光源的RGB_Gain(Gain
R,Gain
G,Gain
B),公式(2)~公式(4)如下所示:
3、根据Von Kries对角模型,计算该图像每个像素调整后的RGB:
其中,公式(5)中的R
i、G
i和B
i分别为该图像每个像素的在红、绿、蓝三颜色通道上的幅值,R′
i、G′
i和B′
i分别为该图像每个像素在红、绿、蓝三颜色通道上调整后的幅值。
AI AWB算法则是将图像作为训练好的模型的输入,例如,快速傅里叶颜色恒常性(Fast Fourier Color Constancy,FFCC)模型(FFCC模型)、神经网络模型等。本申请实施例以AI AWB算法中的模型为FFCC模型为例,进行说明。当将图像输入FFCC模型后,FFCC模型会输出该图像光源的RGB_GAIN以及该FFCC模型的置信度(Conf)。然后,ISP可以基于通过FFCC模型输出的图像光源的RGB_GAIN对图像的RGB进行调整。例如,图像光源的RGB为(25,150,50),FFCC模型输出的RGB_GAIN为(6,1,3),ISP用(6,1,3)乘以该图像每个像素的RGB,纠正该图像的色偏,从而实现对图像的白平衡调节。
使用传统的AWB算法计算图像光源的RGB_GAIN,计算量小且AWB算法的应用场景广。但是,由于计算逻辑简单且计算量一般较小,不能覆盖大范围的复杂场景,导致经过传统AWB算法得到的图像光源的RGB_GAIN的准确度不高,当ISP使用该RGB_GAIN对图像的RGB进行调节时,仍然不能很好地解决图像的偏色问题,导致白平衡处理的效果不佳。
对于AI AWB算法,由于使用FFCC模型或神经网络模型对图像进行复杂的计算处理,其在绝大部分的场景下输出的图像光源的RGB_GAIN准确度很高。但是,FFCC模型或神经网络模型需要预先在电脑端或其它设备上使用训练样本对其进行训练。由于训练样本有限,使得FFCC模型或神经网络模型不能适用于所有的应用场景。当用户在泛化场景不好的应用场景下进行拍照时,通过FFCC模型或神经网络模型得到的光源的RGB_GAIN准确度降低。因此,AI AWB算法的输出结果的准确度呈现两极分化的情况,即:在泛化场景较好的应用场景下拍摄图像,通过AI AWB算法得到的光源RGB_GAIN准确度极高,在泛化场景不好的应用场景下拍摄图像,通过AI AWB算法得到的光源RGB_GAIN准确度极低。
为了解决通过传统的AWB算法得到图像光源的RGB_GAIN准确度不足,以及AI AWB算法的应用场景有限的问题,本申请实施例提供一种AWB和AI AWB的融合算法。该融合算法的原理为:将图像分别通过AWB算法和AI AWB算法进行处理,得到这两种AWB算法计算的图像光源的Duv和CCT。然后,将通过AWB算法计算得到的Duv和通过AI AWB算法计算得到的Duv进行融合,得到融合后的Duv。将通过AWB算法计算得到的CCT和 通过AI AWB算法计算得到的CCT进行融合,得到融合后的CCT。最后,基于融合后的Duv和CCT计算得到融合后的RGB_GAIN。
下面,结合图2A-图2D对AWB和AI AWB融合算法的应用场景进行介绍。
图2A是电子设备100的拍照界面图,在该拍照界面中,包括拍照控件1011和预览控件1012。当电子设备100检测到针对拍照控件1011的输入操作后(例如,单击),电子设备100开始拍照,并显示如图2B所示的拍照处理界面。如图2B所示,拍照处理界面显示“拍照中,请持稳手机”的提示字样,当拍照完成后,电子设备100检测到针对预览控件1012的输入操作(例如,单击)后,显示如图2C所示的照片预览界面。
当用户单击拍照控件1011后,电子设备开始拍照,在显示图2B的拍照处理界面的过程中,电子设备100对其拍摄的图像进行白平衡的调节。具体过程为:电子设备将图像通过AI AWB算法进行计算处理,得到该图像光源的RGB增益值(RGB_GAIN)。然后,给图像每个像素的RGB乘以所述RGB增益值,实现对图像的白平衡调节。如图2D所示,由于拍摄环境光源的色温不同,导致图像1出现色偏(图像1整体颜色偏灰),当把图像1的70个像素的RGB都乘以AI AWB和AWB融合算法计算的图像1的RGB增益值后,实现对图像1的颜色补偿,经过颜色补偿后的图像1其整体颜色不再偏灰,与人眼真实观察的颜色一致。
上述图2A-图2D对AWB算法和AI AWB算法融合的应用场景进行介绍,下面结合图3对AWB和AI AWB融合算法的***架构图进行介绍。请参见图3,图3是本申请实施例提供的一种通过AWB和AI AWB融合算法输出图像光源RGB_GAIN的***架构图。
如图3所示,在该***架构中包括AWB模块、AI AWB模块、CCT融合模块、Duv融合模块以及计算模块。将图像分别作为AWB模块和AI AWB模块的输入,AWB模块基于其AWB算法输出所述图像的CCT
1和Duv
1,AI AWB模块基于其AI AWB算法输出所述图像的CCT
2、Duv
2以及所述AI AWB算法的置信度Conf。将CCT
1和CCT
2进行融合,将Duv
1和Duv
2进行融合,分别得到CCT
3和Duv
3。其中,CCT
3为融合后的CCT,Duv
3为融合后的Duv。然后,将CCT
3和Duv
3作为计算模块的输入,通过计算模块计算得到图像的RGB_GAIN。
上述图2A-图2D实施例介绍了AWB和AI AWB的融合算法的应用场景。下面,结合附图介绍传统AWB和AI AWB融合算法的流程图。请参见图4,图4是本申请实施例提供的一种AWB和AI AWB的融合算法的流程图,具体流程如下:
步骤S401:电子设备分别将图像通过AWB算法和AI AWB算法进行处理,得到第一相关色温、第二相关色温、第一色度距离以及第二色度距离。
具体地,所述图像为第一图像,第一相关色温和第一色度距离为所述图像通过AWB算法得到的CCT和Duv,第二相关色温和第二色度距离为所述图像通过AI AWB得到的CCT和Duv。
电子设备将所述图像通过AWB算法计算处理,得到第一相关色温和第一色度距离的具体过程为:电子设备将所述图像通过AWB算法计算处理,得到所述图像的第一调节值。其 中,该第一调节值可以是所述图像光源的RGB,可以是所述图像光源的RGB_GAIN,也可以是所述图像光源的色度坐标(u′,v′),本申请实施例对此不做限制。若第一调节值为所述图像光源的RGB,电子设备需要将该RGB转换为(u′,v′),RGB与色度坐标的转换公式如下:
若第一调节值为该图像光源的RGB_GAIN,电子设备需要将该RGB_GAIN换算成该图像光源的RGB,换算的方法为将该图像光源的RGB_GAIN中的三个向量分别取倒数。例如,该图像光源的RGB_GAIN为(1/25、1/50、1/150)将1/25、1/50、1/150分别取倒数,得到一个三维向量(25,50,150),该三维向量(25,50,150)为所述图像光源的RGB。然后,再将光源RGB转换为光源色度坐标,转换公式请参考公式(7)~公式(8),在此不再叙述。
电子设备在获取所述图像光源的色度坐标(u′,v′)后,基于(u′,v′)计算第一相关色温和第一色度距离。下面,对第一色度距离(Duv)和第一相关色温(CCT)的计算方法进行介绍:
首先,介绍第一色度距离的计算方法,第一色度距离的计算方法主要有两种:
第一种方法,在色度坐标图上获取在普朗克轨迹上与(u′,v′)最短距离点的坐标(u
0,v
0)。然后,根据公式(8)计算第一色度距离(Duv),公式(8)如下所示:
Duv=sgn(v′-v
0)*[(u′-u
0)
2+(v′-v
0)
2]
1/2 (8);
其中,当v′-v
0≥0时,sgn(v′-v
0)=1;当v′-v
0<0时,sgn(v′-v
0)=-1。
第二种方法,电子设备基于(u′,v′),根据公式(9)计算L
FP,公式(9)如下所示:
然后,电子设备根据公式(10)计算得到第一参数a,公式(10)如下所示:
然后,电子设备根据公式(11),计算得到L
BB,公式(11)如下所示:
L
BB=k
6*a
6+k
5*a
5+k
4*a
4+k
3*a
3+k
2*a
2+k
1*a
1+k
0 (11)
其中,k
6=-0.00616793,k
5=0.0893944,k
3=1.5317403,k
2=-0.5179722,k
1=1.925865,k
0=-0.475106。在计算出L
BB后,电子设备根据公式(12)计算得到所述图像光源的Duv值,公式(12)如下所示:
Duv=L
FP-L
BB (12)。
电子设备计算第一相关色温(CCT)的方法主要采用图像法,如图5所示,图5是本申请实施例提供的一种uv色度坐标图。在图5的色度坐标图中找到色度坐标(u′,v′)对应的点P。然后,在普朗克轨迹上找与点P距离最近的点M,点M对应的CCT为该图像光源的第一相关色温。例如,在图5中,点M对应的CCT直线为3500K,则该图像光源的第一相关色温为3500K。
电子设备将所述图像通过AWB算法计算处理,得到第一相关色温和第一色度距离的具体过程为:电子设备将图像通过AI AWB算法进行计算处理后,得到第二条调节值和置 信度Conf。其中,Conf用于表征AI AWB算法中对图像进行计算处理的模型的可靠程度,本申请实施例以AI AWB算法中的模型为FFCC模型为例,进行说明。与第一调节值类似,第二调节值可以是通过AI AWB算法计算出的所述图像光源的RGB,可以是该图像光源的RGB_GAIN,也可以是该图像光源的色度坐标(u″,v″),本申请实施例对此不做限制。当第二调节值为该图像光源的RGB时,需要将其转换为该图像光源的色度坐标(u″,v″)。其中,RGB_GAIN转换为RGB、RGB转换为色度坐标的方法和公式请参考上述AWB算法中的相关描述,在此不做赘述。然后,电子设备通过(u″,v″)计算第二相关色温和第二色度距离。电子设备通过(u″,v″)计算第二相关色温和第二色度距离的方法和过程,请参考电子设备计算第一相关色温和第一色度距离的过程,在此不再赘述。
步骤S402:电子设备根据相关色温转换表对第二相关色温进行修正。
具体地,由于AI AWB算法中的FFCC模型对图像进行复杂的计算处理,其在绝大部分的场景下输出的图像的第二调节值准确度很高。但是,FFCC模型需要预先在电脑端或其它设备上进行训练,由于训练样本有限,使得FFCC模型不能适用于所有的应用场景。当用户在FFCC模型未被训练过的应用场景下进行拍照时,FFCC模型输出的第二调节值准确性低,进而造成第二相关色温(CCT)准确度也很低。为了有效解决上述问题,电子设备需要将第二相关色温进行修正,在第二相关色温与修正值偏离程度过大的情况下,将其限制在合理的数值范围内。
电子设备对第二相关色温的修正过程为:在电子设备内存储有CCT转换表(CCT Shift Table)。如图6所示,CCT Shift Table是一个三维坐标表,有三个坐标轴,分别是:CCT轴、Duv轴以及LV轴。在CCT Shift Table的三维空间中,存在许多单元格,每个单元格对应一个CCT修正值,在CCT Shift Table包含的CCT修正值几乎涵盖了所有拍摄场景中光源的CCT。电子设备基于所述图像的LV、第二相关色温以及第二色度距离在CCT Shift Table三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的CCT为第一相关色温修正值。然后通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第一相关色温修正值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第二相关色温修正值(CCT_new)。最后,电子设备将第二相关色温设置为CCT_new,实现对第二相关色温的修正。
步骤S403:电子设备根据色度距离转换表对第二色度距离进行修正。
具体地,当用户在FFCC模型未被训练过的应用场景下进行拍照时,FFCC模型输出第二色度距离(Duv)准确度很低。为了有效解决上述问题,电子设备需要将第二色度距离进行修正,在第二色度距离与修正值偏离程度过大的情况下,将其限制在合理的数值范围内。
电子设备对第二色度距离的修正过程为:在电子设备内存储有Duv转换表(Duv Shift Table)。如图7所示,Duv Shift Table是一个三维坐标表,有三个坐标轴,分别是:Duv轴、CCT轴以及LV轴。在Duv Shift Table的三维空间中,存在许多单元格,每个单元格对应一个Duv修正值,在Duv Shift Table包含的Duv修正值几乎涵盖了所有拍摄场景中光源的Duv。电子设备基于所述图像的LV、第二色度距离以及第二色度距离在Duv Shift Table三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的Duv 为第一色度距离修正值。然后通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第一色度距离修正值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第二色度距离修正值(Duv_new)。最后,电子设备将第二色度距离设置为Duv_new,实现对第二色度距离的修正。
步骤S404:电子设备根据置信度修正表对所述AI自动白平衡算法的置信度进行修正。
具体地,当用户在FFCC模型未被训练过的应用场景下进行拍照时,FFCC模型输出的置信度(Conf)与其实际的Conf相比,差异较大。为了有效解决该问题,电子设备可以对Conf进行修正,在FFCC模型输出的Conf与其实际的Conf相差较大的情况下,将Conf限制在合理的数值范围之内。
电子设备对Conf的修正过程为:在电子设备内存储有置信度表(Confidence Table)。如图8所示,Confidence Table是一个三维坐标表,有三个坐标轴,分别是:CCT轴、Duv轴以及LV轴。在Confidence Table的三维空间中,存在许多单元格,每个单元格对应一个置信度调节值(Mult_Conf)。电子设备基于所述图像的LV、第二相关色温以及第二色度距离在Confidence Table这个三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的Mult_Conf为第一置信度调节值。然后通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第一置信度调节值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第二置信度调节值。然后,电子设备根据公式(13)计算置信度修正值,并将AI自动白平衡算法的置信度设置为置信度修正值,实现对置信度的修正。公式(13)如下所示:
Conf_new=Conf*Mult_Conf (13)
在公式(13)中,所述Conf_new为置信度修正值,所述Mult_Conf为置信度调节值,所述Conf为修正前的置信度。需要说明的是,Conf_new可能存在大于1的情况,当Conf_new大于1时,将Conf_new置1。
步骤S405:电子设备基于相关色温融合表,将第一相关色温和第二相关色温进行计算,得到第三相关色温。
具体地,在电子设备内存储有CCT融合表(CCT Merging Table)。如图9所示,CCT Merging Table是一个三维坐标表,有三个坐标轴,分别是:Duv轴、CCT轴以及LV轴。在CCT Merging Table的三维空间中,存在许多单元格,每个单元格对应一个概率值X。电子设备基于所述图像的LV、第二相关色温以及第二色度距离在CCT Merging Table三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的概率值为第一概率值。然后,电子设备通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第一概率值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第二概率值。最后,电子设备通过公式(14)计算第三相关色温。公式(14)如下所示:
CCT_3=Conf*X′*CCT_ai+(1-Conf*X′)*CCT_stat (14)
其中,所述CCT_3为第三相关色温,所述CCT_stat为第一相关色温,所述CCT_ai为第二相关色温,所述Conf为AI自动白平衡算法的置信度,所述X′为第二概率值。
在一些实施例中,电子设备可以基于所述图像的LV、第一相关色温以及第一色度距离 在CCT Merging Table三维坐标系中找到对应的点,确定与这个点相关的单元格。然后,基于相关的单元格进行三线性插值计算得到第二概率值,在根据公式(14)计算第三相关色温。
步骤S406:电子设备基于色度距离融合表,将第一色度距离和第二色度进行计算,得到第三色度距离。
具体地,在电子设备内存储有Duv融合表(Duv Merging Table)。如图10所示,Duv Merging Table是一个三维坐标表,有三个坐标轴,分别是:Duv轴、CCT轴以及LV轴。在CCT Merging Table的三维空间中,存在许多单元格,每个单元格对应一个概率值Y。电子设备基于所述图像的LV、第二相关色温以及第二色度距离在CCT Merging Table三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的概率值为第三概率值。然后,电子设备通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第三概率值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第四概率值。最后,电子设备通过公式(15)计算第三相关色温。公式(15)如下所示:
Duv_3=Conf*Y′*Duv_ai+(1-Conf*Y′)*Duv_stat (15)
其中,所述Duv_3为第三色度距离,所述Duv_stat为第一色度距离,所述Duv_ai为第二色度距离,所述Conf为AI自动白平衡算法的置信度,所述Y′为第四概率值。
在一些实施例中,电子设备可以基于所述图像的LV、第一相关色温以及第一色度距离在Duv Merging Table三维坐标系中找到对应的点,确定与这个点相关的单元格。然后,基于相关的单元格进行三线性插值计算得到第二概率值,在根据公式(15)计算第三色度距离。
步骤S407:电子设备根据相关色温倾向度调节表,对第三相关色温进行倾向度调节,得到调节后的第三相关色温。
具体地,对于部分用户而言,在使用电子设备拍照后,对图像的颜色有其他的要求。例如,有些用户希望图像的颜色整体呈现暖色系,有些用户希望图像的颜色整体呈现冷色系等等。为了令图像的整体颜色更倾向于用户希望的颜色,电子设备需要对图像的CCT和Duv进行倾向度的调节。电子设备对第三相关色温进行倾向度调节的具体过程为:在电子设备中存储有如图11所示的CCT Propensity Table(相关色温倾向度调节表),CCT Propensity Table是一个三维坐标表,有三个坐标轴,分别是:CCT轴、Duv轴以及LV轴。在CCT Propensity Table的三维空间中,存在许多单元格,每个单元格对应一个CCT调节值(Delta_CCT)。电子设备基于所述图像的LV、第三相关色温以及第三色度距离在CCT Propensity Table这个三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的Delta_CCT为第一相关色温调节值。然后通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第一相关色温调节值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第二相关色温调节值。然后,电子设备根据公式(16)计算调节后的第三相关色温,公式(16)如下所示:
CCT_3=CCT_3*(1+Delta_CCT′) (16)
在公式(16)中,等式左边的CCT_3为调节后的第三相关色温,等式右边的CCT_3为调节前的第三相关色温,所述Delta_CCT′为第二相关色温调节值。
步骤S408:电子设备根据色度距离倾向度调节表,对第三色度距离进行倾向度调节,得到调节后的第三色度距离。
具体地,对于部分用户而言,在使用电子设备拍照后,对图像的颜色有其他的要求。例如,有些用户希望图像的颜色整体呈现暖色系,有些用户希望图像的颜色整体呈现冷色系等等。为了令图像的整体颜色更倾向于用户希望的颜色,电子设备需要对图像的CCT和Duv进行倾向度的调节。电子设备对第三色度距离进行倾向度调节的具体过程为:在电子设备中存储有如图12所示的DuvPropensity Table(色度距离倾向度调节表),DuvPropensity Table是一个三维坐标表,有三个坐标轴,分别是:CCT轴、Duv轴以及LV轴。在DuvPropensity Table的三维空间中,存在许多单元格,每个单元格对应一个Duv调节值(Delta_Duv)。电子设备基于所述图像的LV、第三相关色温以及第三色度距离在CCT Propensity Table这个三维坐标系中找到对应的点,确定与这个点相关的单元格。其中,每个相关单元格对应的Delta_Duv为第一色度距离调节值。然后通过Trilinear插值(三线性插值)计算每个相关单元格的权值,并将单元格的权值与其对应的第一色度距离调节值相乘,得到每个相关单元格的乘积,将每个相关单元格的乘积进行求和,得到第二色度距离调节值。然后,电子设备根据公式(17)计算调节后的第三相关色温,公式(17)如下所示:
Duv_3=Duv_3*(1+Delta_Duv′) (17)
在公式(17)中,所述等式左边的Duv_3为调节后的第三色度距离,所述等式右边的Duv_3为调节前的第三色度距离,所述Delta_Duv′为第二色度距离调节值。
步骤S409:电子设备基于第三相关色温和第三色度距离计算得到所述图像光源的RGB增益值。
具体地,步骤S407和步骤S408是可选步骤。若电子设备对第三相关色温和第三色度距离进行倾向度调节,计算所述图像光源的RGB增益值的第三相关色温和第三色度坐标为经过步骤S407和步骤S408调节后的第三相关色温和第三色度坐标。
所述图像光源的RGB增益值需要通过所述图像光源的uv色度坐标转换得到。下面,对电子设备通过使用CCT_3和Duv_3计算所述图像光源的色度坐标(u,v)的具体过程进行介绍,具体过程为:首先,在如图13所示的普朗克轨迹上找到相关色温为CCT_3的点N,并计算出点N的色度坐标(u
0,v
0)。将点N作为普朗克轨迹的切点,作出普朗克轨迹的切线L,确定点F的色度坐标(u,v),使得线段FN的长度等于Duv_3。然后,在切线L上计算出ΔT处的点R的色度坐标(u
1,v
1)。其中,ΔT为CCT_3的微小变化。然后,电子设备使用公式(18)和公式(19)计算所述图像光源的色度坐标(u,v),公式(18)和公式(19)如下所示:
在计算出所述图像光源的色度坐标(u,v)后,电子设备通过公式(20)~公式(22)计算得到所述图像光源的RGB_GAIN(Gain
R,Gain
G,Gain
B),公式(20)~公式(22)如下所示:
本申请实施例,电子设备将通过AWB算法计算得到的第一相关色温、通过AI AWB算法计算得到的第二相关色温基于相关色温融合表进行计算,得到第三相关色温。将通过AWB算法计算得到第一色度距离、通过AI AWB算法计算得到的第二色度距离基于色度距离融合表进行计算,得到第三色度距离。并基于第三相关色温和第三色度距离计算出所述图像光源的RGB增益值。其中,该RGB增益值是准确度高的RGB增益值。通过上述方法,实现了AWB算法与AI AWB算法的融合,既解决了AWB算法计算图像光源RGB增益值准确度不高的问题,又解决AI AWB算法的应用场景有限的问题,通过所述融合算法计算出的RGB增益值,在各种场景下的准确度极高,从而有利于ISP利用该RGB增益值对图像的RGB进行调节,解决图像的偏色问题。
上述实施例详细阐述了本申请实施例的方法,下面介绍本实施例的相关设备。
请参见图14,图14是本申请实施例提供的一种电子设备100的结构示意图。所述电子设备100包括处理器1401和存储器1402,其中,各个单元的详细描述如下:
存储器1402用于存储程序代码;
处理器1401用于调用存储器存储的程序代码执行如下步骤:
分别将图像通过AWB算法和AI AWB算法进行处理,得到第一相关色温、第二相关色温、第一色度距离以及第二色度距离;
根据相关色温转换表对第二相关色温进行修正;
根据色度距离转换表对第二色度距离进行修正;
根据置信度修正表对所述AI自动白平衡算法的置信度进行修正;
基于相关色温融合表,将第一相关色温和第二相关色温进行计算,得到第三相关色温;
基于色度距离融合表,将第一色度距离和第二色度进行计算,得到第三色度距离;
根据相关色温倾向度调节表,对第三相关色温进行倾向度调节,得到调节后的第三相关色温;
根据色度距离倾向度调节表,对第三色度距离进行倾向度调节,得到调节后的第三色度距离;
基于第三相关色温和第三色度距离计算得到所述图像光源的RGB增益值。
本申请实施例还提供一种包含指令的计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如上述图4实施例步骤S401-步骤S409中任意一项所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
Claims (11)
- 一种AI自动白平衡和自动白平衡的融合算法,其特征在于,包括:基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到所述第一图像的第三相关色温;基于色度距离融合表,将所述第一图像的第一色度距离和所述第一图像的第二色度距离基于色度距离融合表进行计算,得到所述第一图像的第三色度距离;基于所述第三相关色温和所述第三色度距离计算得到所述第一图像的调节值,所述调节值用于调节所述第一图像的颜色;其中,所述第一相关色温为通过自动白平衡算法计算得到的所述第一图像的CCT,所述第一色度距离为通过自动白平衡算法计算得到的所述第一图像的Duv,所述第二相关色温为通过AI自动白平衡算法计算得到的所述第一图像的CCT,所述第二色度距离为通过AI自动白平衡算法计算得到的所述第一图像的Duv。
- 如权利要求1所述的方法,其特征在于,所述基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到所述第一图像的第三相关色温之前,还包括:根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值,在相关色温转换表中确定第一相关色温修正值;对所述第一相关色温修正值进行三线性插值计算,得到第二相关色温修正值;将所述第二相关色温设置为所述第二相关色温修正值。
- 如权利要求1或2任一项所述的方法,其特征在于,所述基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到所述第一图像的第三相关色温之前,还包括:根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值在色度距离转换表中确定第一色度距离修正值;对所述第一色度距离修正值进行三线性插值计算,得到第二色度距离修正值;将所述第二色度距离设置为所述第二色度距离修正值。
- 如权利要求1所述的方法,其特征在于,所述基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到所述第一图像的第三相关色温之前,还包括:根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值在置信度修正表中确定第一置信度调节值;对所述第一置信度调节值进行三线性插值计算,得到第二置信度调节值;根据公式Conf_new=Conf*Mult_Conf,计算得到置信度修正值;其中,所述Conf为所述AI自动白平衡算法的置信度,所述Mult_Conf为所述第二置信度调节值,所述Conf_new 为置信度修正值;将所述AI自动白平衡算法的置信度设置为所述置信度修正值。
- 如权利要求4所述的方法,其特征在于,所述基于相关色温融合表,将第一图像的第一相关色温和所述第一图像的第二相关色温进行计算,得到所述第一图像的第三相关色温,具体包括:根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值在相关色温融合表中确定第一概率值;或根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值在相关色温融合表中确定第一概率值;对所述第一概率值进行三线性插值计算,得到第二概率值;根据公式CCT_new=Conf*X′*CCT_ai+(1-Conf*X′)*CCT_stat,计算得到所述第三相关色温;其中,所述CCT_new为第三相关色温,所述CCT_stat为第一相关色温,所述CCT_ai为第二相关色温,所述Conf为AI自动白平衡算法的置信度,所述X′为第二概率值。
- 如权利要求4或5任一项所述的方法,其特征在于,所述基于色度距离融合表,将所述第一图像的第一色度距离和所述第一图像的第二色度距离基于色度距离融合表进行计算,得到所述第一图像的第三色度距离,具体包括:根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值在色度距离融合表中确定第三概率值;或根据所述第二相关色温、所述第二色度距离以及所述第一图像的亮度值在色度距离融合表中确定第三概率值;对所述第三概率值进行三线性插值计算,得到第四概率值;根据公式Duv_new=Conf*Y′*Duv_ai+(1-Conf*Y′)*Duv_stat,计算得到所述第三色度距离;其中,所述Duv_new为第三色度距离,所述Duv_stat为第一色度距离,所述Duv_ai为第二色度距离,所述Conf为AI自动白平衡算法的置信度,所述Y′为第四概率值。
- 如权利要求1-6任一项所述的方法,其特征在于,所述基于所述第三相关色温和所述第三色度距离计算得到所述第一图像的调节值之前,还包括:根据所述第三相关色温、所述第三色度距离以及所述第一图像的亮度值在相关色温倾向调节表中,确定第一相关色温调节值;对所述第一相关色温调节值进行三线性插值计算,得到第二相关色温调节值;通过公式CCT_new=CCT_new*(1+Delta_CCT′),得到调节后的第三相关色温;其中,所述公式等号左边的CCT_new为调节后的第三相关色温,所述公式等号右边的CCT_new为调节前的第三相关色温,所述Delta_CCT′为所述第二相关色温调节值。
- 如权利要求1-7任一项所述的方法,其特征在于,所述基于所述第三相关色温和所述第三色度距离计算得到所述第一图像的调节值之前,还包括:根据所述第三相关色温、所述第三色度距离以及所述第一图像的亮度值在色度距离倾向调节表中,确定第一色度距离调节值;对所述第一色度距离调节值进行三线性插值计算,得到第二色度距离调节值;通过公式Duv_new=Duv_new*(1+Delta_Duv′),得到调节后的第三色度距离;其中,所述公式等号左边的Duv_new为调节后的第三色度距离,所述公式等号右边的Duv_new为调节前的第三色度距离,所述Delta_Duv′为所述第二色度距离调节值。
- 一种电子设备,其特征在于,所述电子设备包括:通信装置、显示装置、存储器以及耦合于所述存储器的处理器,多个应用程序,以及一个或多个程序;所述存储器中存储有计算机可执行指令,所述显示装置用于显示图像,所述处理器执行所述指令时使得所述电子设备实现如权利要求1-8中任一项所述的方法。
- 一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序包括可执行指令,所述可执行指令当被处理器执行时使该处理器执行如权利要求1-8中任一项所提供的方法对应的操作。
- 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1-8中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110634365.X | 2021-06-07 | ||
CN202110634365.XA CN115514948B (zh) | 2021-06-07 | 2021-06-07 | 图像调节方法以及电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022257574A1 true WO2022257574A1 (zh) | 2022-12-15 |
Family
ID=84424729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/084902 WO2022257574A1 (zh) | 2021-06-07 | 2022-04-01 | Ai自动白平衡和自动白平衡的融合算法以及电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115514948B (zh) |
WO (1) | WO2022257574A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117119314B (zh) * | 2023-02-25 | 2024-06-07 | 荣耀终端有限公司 | 一种图像处理方法及相关电子设备 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013198119A (ja) * | 2012-03-22 | 2013-09-30 | Nikon Corp | 画像処理装置、画像処理方法およびプログラム |
US20190045163A1 (en) * | 2018-10-02 | 2019-02-07 | Intel Corporation | Method and system of deep learning-based automatic white balancing |
CN110913194A (zh) * | 2019-11-22 | 2020-03-24 | Oppo广东移动通信有限公司 | 一种自动白平衡的补偿方法、终端以及计算机存储介质 |
WO2020142871A1 (zh) * | 2019-01-07 | 2020-07-16 | 华为技术有限公司 | 图像的白平衡处理方法和装置 |
CN111587573A (zh) * | 2018-05-30 | 2020-08-25 | 华为技术有限公司 | 一种图像处理方法及装置 |
CN111818318A (zh) * | 2020-06-12 | 2020-10-23 | 北京阅视智能技术有限责任公司 | 图像处理器的白平衡调谐方法、装置、设备及存储介质 |
WO2021075321A1 (ja) * | 2019-10-18 | 2021-04-22 | ソニー株式会社 | 撮像装置、電子機器及び撮像方法 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102147860A (zh) * | 2011-05-16 | 2011-08-10 | 杭州华三通信技术有限公司 | 一种基于白平衡的车牌识别方法和装置 |
KR101896386B1 (ko) * | 2011-11-22 | 2018-09-11 | 삼성전자주식회사 | 화이트 밸런스 조절장치 및 방법 |
JP5948997B2 (ja) * | 2012-03-15 | 2016-07-06 | 株式会社リコー | 撮像装置及び撮像方法 |
EP3449628B1 (en) * | 2016-04-25 | 2022-12-14 | Zhejiang Dahua Technology Co., Ltd | Methods, systems, and media for image white balance adjustment |
CN108551576B (zh) * | 2018-03-07 | 2019-12-20 | 浙江大华技术股份有限公司 | 一种白平衡方法及装置 |
-
2021
- 2021-06-07 CN CN202110634365.XA patent/CN115514948B/zh active Active
-
2022
- 2022-04-01 WO PCT/CN2022/084902 patent/WO2022257574A1/zh active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013198119A (ja) * | 2012-03-22 | 2013-09-30 | Nikon Corp | 画像処理装置、画像処理方法およびプログラム |
CN111587573A (zh) * | 2018-05-30 | 2020-08-25 | 华为技术有限公司 | 一种图像处理方法及装置 |
US20190045163A1 (en) * | 2018-10-02 | 2019-02-07 | Intel Corporation | Method and system of deep learning-based automatic white balancing |
WO2020142871A1 (zh) * | 2019-01-07 | 2020-07-16 | 华为技术有限公司 | 图像的白平衡处理方法和装置 |
WO2021075321A1 (ja) * | 2019-10-18 | 2021-04-22 | ソニー株式会社 | 撮像装置、電子機器及び撮像方法 |
CN110913194A (zh) * | 2019-11-22 | 2020-03-24 | Oppo广东移动通信有限公司 | 一种自动白平衡的补偿方法、终端以及计算机存储介质 |
CN111818318A (zh) * | 2020-06-12 | 2020-10-23 | 北京阅视智能技术有限责任公司 | 图像处理器的白平衡调谐方法、装置、设备及存储介质 |
Non-Patent Citations (2)
Title |
---|
BARRON JONATHAN T.; TSAI YUN-TA: "Fast Fourier Color Constancy", 2017 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), IEEE COMPUTER SOCIETY, US, 21 July 2017 (2017-07-21), US , pages 6950 - 6958, XP033250061, ISSN: 1063-6919, DOI: 10.1109/CVPR.2017.735 * |
QIAN YANLIN; CHEN KE; YU HUANGLIN: "Fast Fourier Color Constancy and Grayness Index for ISPA Illumination Estimation Challenge", 2019 11TH INTERNATIONAL SYMPOSIUM ON IMAGE AND SIGNAL PROCESSING AND ANALYSIS (ISPA), IEEE, 23 September 2019 (2019-09-23), pages 352 - 354, XP033634366, DOI: 10.1109/ISPA.2019.8868451 * |
Also Published As
Publication number | Publication date |
---|---|
CN115514948B (zh) | 2023-08-08 |
CN115514948A (zh) | 2022-12-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11532076B2 (en) | Image processing method, electronic device and storage medium | |
KR20090125124A (ko) | 휴대용 기기에서의 화상 색 보정을 위한 장치 및 방법 | |
WO2023279862A1 (zh) | 图像处理方法、装置和电子设备 | |
WO2021238351A1 (zh) | 一种图像校正方法与电子设备 | |
WO2023040725A1 (zh) | 白平衡处理方法与电子设备 | |
WO2022257574A1 (zh) | Ai自动白平衡和自动白平衡的融合算法以及电子设备 | |
WO2023015993A9 (zh) | 一种色度信息的确定方法及相关电子设备 | |
WO2021051307A1 (zh) | 图像的颜色校正方法、拍摄设备、图像的颜色校正*** | |
CN113727085B (zh) | 一种白平衡处理方法、电子设备、芯片***和存储介质 | |
CN116668656B (zh) | 图像处理方法及电子设备 | |
WO2024027331A1 (zh) | 拍照方法和相关装置 | |
CN116055699B (zh) | 一种图像处理方法及相关电子设备 | |
CN116668838B (zh) | 图像处理方法与电子设备 | |
CN117135471A (zh) | 一种图像处理方法和电子设备 | |
CN113271450B (zh) | 白平衡调整方法、影像处理装置与影像处理*** | |
CN116761081B (zh) | 一种ai自动白平衡的算法和电子设备 | |
CN116051434B (zh) | 一种图像处理方法及相关电子设备 | |
WO2023124165A1 (zh) | 一种图像处理方法及相关电子设备 | |
WO2022257713A1 (zh) | 一种ai自动白平衡的算法和电子设备 | |
WO2023035919A1 (zh) | 控制曝光的方法、装置与电子设备 | |
WO2022267612A1 (zh) | 一种动态调节光谱传感器曝光参数的方法及电子设备 | |
CN116437060B (zh) | 一种图像处理方法及相关电子设备 | |
CN116668862B (zh) | 图像处理方法与电子设备 | |
US20230325986A1 (en) | Image processing method and related apparatus | |
EP4258676A1 (en) | Automatic exposure method and electronic device |
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: 22819179 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: 22819179 Country of ref document: EP Kind code of ref document: A1 |