WO2022267612A1 - 一种动态调节光谱传感器曝光参数的方法及电子设备 - Google Patents

一种动态调节光谱传感器曝光参数的方法及电子设备 Download PDF

Info

Publication number
WO2022267612A1
WO2022267612A1 PCT/CN2022/084926 CN2022084926W WO2022267612A1 WO 2022267612 A1 WO2022267612 A1 WO 2022267612A1 CN 2022084926 W CN2022084926 W CN 2022084926W WO 2022267612 A1 WO2022267612 A1 WO 2022267612A1
Authority
WO
WIPO (PCT)
Prior art keywords
spectral sensor
exposure time
threshold
gain
analog gain
Prior art date
Application number
PCT/CN2022/084926
Other languages
English (en)
French (fr)
Inventor
钱彦霖
金萌
朱聪超
邓斌
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Priority to US18/262,101 priority Critical patent/US20240080568A1/en
Priority to EP22827115.1A priority patent/EP4254939A1/en
Publication of WO2022267612A1 publication Critical patent/WO2022267612A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/10Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void
    • G01J1/20Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void intensity of the measured or reference value being varied to equalise their effects at the detectors, e.g. by varying incidence angle
    • G01J1/28Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void intensity of the measured or reference value being varied to equalise their effects at the detectors, e.g. by varying incidence angle using variation of intensity or distance of source
    • G01J1/30Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void intensity of the measured or reference value being varied to equalise their effects at the detectors, e.g. by varying incidence angle using variation of intensity or distance of source using electric radiation detectors
    • G01J1/32Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void intensity of the measured or reference value being varied to equalise their effects at the detectors, e.g. by varying incidence angle using variation of intensity or distance of source using electric radiation detectors adapted for automatic variation of the measured or reference value
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J3/00Spectrometry; Spectrophotometry; Monochromators; Measuring colours
    • G01J3/02Details
    • G01J3/027Control of working procedures of a spectrometer; Failure detection; Bandwidth calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • H04N23/11Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths for generating image signals from visible and infrared light wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • H04N23/13Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths with multiple sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/633Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
    • H04N23/634Warning indications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/10Circuitry of solid-state image sensors [SSIS]; Control thereof for transforming different wavelengths into image signals
    • H04N25/11Arrangement of colour filter arrays [CFA]; Filter mosaics
    • H04N25/13Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements
    • H04N25/133Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements including elements passing panchromatic light, e.g. filters passing white light

Definitions

  • the present application relates to the field of image processing, in particular to a method and electronic equipment for dynamically adjusting exposure parameters of a spectral sensor.
  • the built-in spectral sensor of the camera When a user takes a photo with an electronic device such as a digital camera or a mobile phone, the built-in spectral sensor of the camera will capture the spectral data of the shooting environment, and send the spectral data to the processor for calculation, and obtain the relevant color temperature, brightness, and color of the light source of the captured image. And spectral data and other information, the electronic device adjusts the white balance of the image based on this information.
  • the spectral sensor based on the narrow-band filter design often cannot obtain enough exposure, which causes the processor to Information such as correlated color temperature calculated from the data is inaccurate. Therefore, directly using the color temperature provided by the spectral sensor for white balance in the night scene will lead to the verification of the color cast problem of the image, that is, the white balance processing effect of the electronic device on the image is not good. How to adjust the exposure parameters of the spectral sensor in different shooting environments so as to solve the problem of color cast of the captured image is a problem that technicians pay more and more attention to.
  • the embodiment of the present application provides a method for dynamically adjusting the exposure parameters of the spectral sensor, which solves the problem that the accuracy of the spectral data output by the spectral sensor is not high, which further affects the adjustment effect of the image white balance.
  • the embodiment of the present application provides a method for dynamically adjusting the exposure parameters of the spectral sensor, including: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than or equal to the first threshold, judging whether the spectral sensor Whether the analog gain reaches the second threshold; the second threshold is the upper threshold of the analog gain of the spectral sensor; if it is judged to be yes, prolong the exposure time of the spectral sensor; if it is judged to be no, increase the spectral sensor Analog gain; if the Clear value is greater than the first threshold, judge whether the exposure time of the spectral sensor reaches the fourth threshold; the fourth threshold is the lower limit threshold of the spectral sensor exposure time; if judged to be , reduce the analog gain of the spectral sensor; if judged as no, shorten the exposure time of the spectral sensor; wherein, the exposure time of the spectral sensor and the analog gain of the spectral sensor are the exposure parameters of the spect
  • the electronic device divides the shooting environment into strong light environment (Clear value is greater than the first threshold value) and dark light environment (Clear value is less than or equal to the first threshold value) with the first threshold as the critical point.
  • the exposure parameters (exposure time and analog gain) of the spectral sensor are dynamically adjusted, so that the spectral data output by the spectral sensor is more accurate, and the accuracy of the CCT calculated based on the spectral data is more accurate. Higher makes the white balance of the image better.
  • appropriately prolonging the exposure time of the spectral sensor is beneficial to increasing the amount of light entering the spectral sensor, so that the spectral sensor outputs rich spectral data (avoiding the absence of certain spectral data), thereby The accuracy of the CCT of the image light source calculated based on the spectral data is ensured.
  • appropriately increasing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately reducing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately shortening the exposure time of the spectral sensor is conducive to reasonably increasing the amount of light entering the spectral sensor, and avoiding excessive light entering of the spectral sensor that exceeds the maximum amplitude of the optical channel response of the spectral sensor.
  • the spectral data output by the spectral sensor is abnormal, thereby affecting the accuracy of the CCT of the image light source calculated based on the spectral data.
  • the embodiment of the present application provides a method for dynamically adjusting the exposure parameters of the spectral sensor, including: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than or equal to the first threshold, judging whether the spectral sensor Whether the exposure time reaches a third threshold, and the third threshold is the upper threshold of the exposure time of the spectral sensor; if it is judged to be yes, increase the analog gain of the spectral sensor; if it is judged to be no, extend the spectral sensor exposure time; if the Clear value is greater than the first threshold, judge whether the analog gain of the spectral sensor reaches the fifth threshold, and the fifth threshold is the lower limit threshold of the analog gain; if judged to be yes, shorten the The exposure time of the spectral sensor; if the judgment is no, reduce the analog gain of the spectral sensor; wherein, the exposure time of the spectral sensor and the analog gain of the spectral sensor are the exposure parameters of the spectral
  • the electronic device divides the shooting environment into strong light environment (Clear value is greater than the first threshold value) and dark light environment (Clear value is less than or equal to the first threshold value) with the first threshold as the critical point.
  • the exposure parameters (exposure time and analog gain) of the spectral sensor are dynamically adjusted, so that the spectral data output by the spectral sensor is more accurate, and the accuracy of the CCT calculated based on the spectral data is more accurate. Higher makes the white balance of the image better.
  • appropriately prolonging the exposure time of the spectral sensor is beneficial to increasing the amount of light entering the spectral sensor, so that the spectral sensor outputs rich spectral data (avoiding the absence of certain spectral data), thereby The accuracy of the CCT of the image light source calculated based on the spectral data is ensured.
  • appropriately increasing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately reducing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately shortening the exposure time of the spectral sensor is conducive to reasonably increasing the amount of light entering the spectral sensor, and avoiding excessive light entering of the spectral sensor that exceeds the maximum amplitude of the optical channel response of the spectral sensor.
  • the spectral data output by the spectral sensor is abnormal, thereby affecting the accuracy of the CCT of the image light source calculated based on the spectral data.
  • the embodiment of the present application provides a method for dynamically adjusting the exposure parameters of the spectral sensor, including: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than or equal to the first threshold, judging the analog Whether the gain reaches the second threshold; the second threshold is the upper threshold of the analog gain of the spectral sensor; if it is judged to be yes, extend the exposure time of the spectral sensor; if it is judged to be no, increase the exposure time of the spectral sensor Analog gain; if the Clear value is greater than the first threshold, judge whether the analog gain of the spectral sensor reaches the fifth threshold; the fifth threshold is the lower limit threshold of the analog gain of the spectral sensor; if judged to be yes, Shorten the exposure time of the spectral sensor; if the judgment is no, reduce the analog gain of the spectral sensor; wherein, the exposure time of the spectral sensor and the analog gain of the spectral sensor are exposure parameters of the spect
  • the electronic device divides the shooting environment into strong light environment (Clear value is greater than the first threshold value) and dark light environment (Clear value is less than or equal to the first threshold value) with the first threshold as the critical point.
  • the exposure parameters (exposure time and analog gain) of the spectral sensor are dynamically adjusted, so that the spectral data output by the spectral sensor is more accurate, and the accuracy of the CCT calculated based on the spectral data is more accurate. Higher makes the white balance of the image better.
  • appropriately prolonging the exposure time of the spectral sensor is beneficial to increasing the amount of light entering the spectral sensor, so that the spectral sensor outputs rich spectral data (avoiding the absence of certain spectral data), thereby The accuracy of the CCT of the image light source calculated based on the spectral data is ensured.
  • appropriately increasing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately reducing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately shortening the exposure time of the spectral sensor is conducive to reasonably increasing the amount of light entering the spectral sensor, and avoiding excessive light entering of the spectral sensor that exceeds the maximum amplitude of the optical channel response of the spectral sensor.
  • the spectral data output by the spectral sensor is abnormal, thereby affecting the accuracy of the CCT of the image light source calculated based on the spectral data.
  • the embodiment of the present application provides a method for dynamically adjusting the exposure parameters of the spectral sensor, which is characterized in that it includes: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than or equal to the first threshold, Judging whether the exposure time of the spectral sensor reaches a third threshold, the third threshold is the upper threshold of the exposure time of the spectral sensor; if it is judged to be yes, increase the analog gain of the spectral sensor; if it is judged to be no, extend The exposure time of the spectral sensor; if the Clear value is greater than the first threshold, it is judged whether the exposure time of the spectral sensor reaches a fourth threshold, and the fourth threshold is the lower threshold of the exposure time of the spectral sensor; If judged as yes, reduce the analog gain of the spectral sensor; if judged as no, shorten the exposure time of the spectral sensor; wherein, the exposure time of the spectral sensor and the analog gain of the
  • the electronic device divides the shooting environment into strong light environment (Clear value is greater than the first threshold value) and dark light environment (Clear value is less than or equal to the first threshold value) with the first threshold as the critical point.
  • the exposure parameters (exposure time and analog gain) of the spectral sensor are dynamically adjusted, so that the spectral data output by the spectral sensor is more accurate, and the accuracy of the CCT calculated based on the spectral data is more accurate. Higher makes the white balance of the image better.
  • appropriately prolonging the exposure time of the spectral sensor is beneficial to increasing the amount of light entering the spectral sensor, so that the spectral sensor outputs rich spectral data (avoiding the absence of certain spectral data), thereby The accuracy of the CCT of the image light source calculated based on the spectral data is ensured.
  • appropriately increasing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately reducing the analog gain of the spectral sensor is beneficial to amplifying the spectral data output by the spectral sensor to a reasonable range of values, increasing the signal-to-noise ratio of the spectral data, thereby improving the Accuracy of CCT calculated from spectral data.
  • appropriately shortening the exposure time of the spectral sensor is conducive to reasonably increasing the amount of light entering the spectral sensor, and avoiding excessive light entering of the spectral sensor that exceeds the maximum amplitude of the optical channel response of the spectral sensor.
  • the spectral data output by the spectral sensor is abnormal, thereby affecting the accuracy of the CCT of the image light source calculated based on the spectral data.
  • 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, and the one or more processors call the computer instructions so that the electronic device executes: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than or equal to the first threshold, judging the spectral sensor whether the analog gain of the spectral sensor reaches the second threshold; the second threshold is the upper limit threshold of the analog gain of the spectral sensor; if judged as yes, prolong the exposure time of the spectral sensor; if judged as no, increase the analog gain of the spectral sensor; If the Clear value is greater than the first threshold, it is judged whether the exposure time of the spectral sensor reaches the fourth threshold; the fourth threshold is the lower threshold of the exposure time of the spectral sensor; if it is judged to be yes, the analog gain of the spect
  • the Gain is the current analog gain of the spectral sensor, the Gain_1' is the first analog gain, and the Y is a second gain coefficient greater than 1; determine whether the first analog gain is greater than the second threshold; if If the judgment is yes, the analog gain of the spectrum sensor is set to the second threshold; if the judgment is no, the analog gain of the spectrum sensor is set to the first analog gain.
  • the one or more processors are further configured to invoke the computer instructions to enable the electronic device to execute: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than Or equal to the first threshold, judge whether the exposure time of the spectral sensor reaches the third threshold, the third threshold is the upper threshold of the exposure time of the spectral sensor; if judged to be yes, increase the analog gain of the spectral sensor; If the judgment is no, extend the exposure time of the spectral sensor; if the Clear value is greater than the first threshold, judge whether the analog gain of the spectral sensor reaches the fifth threshold, and the fifth threshold is the lower limit of the analog gain threshold; if judged as yes, shorten the exposure time of the spectral sensor; if judged as no, reduce the analog gain of the spectral sensor; wherein, the exposure time of the spectral sensor and the analog gain of the spectral sensor are the Exposure parameter for the spectral sensor.
  • the one or more processors are further configured to invoke the computer instructions to enable the electronic device to execute: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than Or equal to the first threshold, judge whether the analog gain of the spectral sensor reaches the second threshold; the second threshold is the upper threshold of the analog gain of the spectral sensor; if judged to be yes, prolong the exposure time of the spectral sensor; if If the judgment is no, increase the analog gain of the spectral sensor; if the Clear value is greater than the first threshold, judge whether the analog gain of the spectral sensor reaches the fifth threshold; the fifth threshold is the spectral sensor The lower limit threshold of the analog gain; if judged as yes, shorten the exposure time of the spectral sensor; if judged as no, reduce the analog gain of the spectral sensor; wherein, the exposure time of the spectral sensor and the spectral sensor Analog gain is an exposure parameter of the spectral sensor.
  • the one or more processors are further configured to invoke the computer instructions to enable the electronic device to execute: judging whether the Clear value is less than or equal to the first threshold; if the Clear value is less than Or equal to the first threshold, judge whether the exposure time of the spectral sensor reaches the third threshold, the third threshold is the upper threshold of the exposure time of the spectral sensor; if judged to be yes, increase the analog gain of the spectral sensor; If the judgment is no, extend the exposure time of the spectral sensor; if the Clear value is greater than the first threshold, judge whether the exposure time of the spectral sensor reaches a fourth threshold, and the fourth threshold is the spectral sensor The lower limit threshold of the exposure time; if it is judged as yes, reduce the analog gain of the spectral sensor; if it is judged as no, shorten the exposure time of the spectral sensor; wherein, the exposure time of the spectral sensor and the analog gain of the spectral sensor Gain is an exposure parameter of the
  • an embodiment of the present application provides an electronic device, including: a touch screen, a camera, one or more processors, and one or more memories; the one or more processors and the touch screen , the camera, the one or more memories are coupled, the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions , so that the electronic device executes the method according to the first aspect or any implementation manner of the first aspect.
  • 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 call a computer instruction so that the electronic device executes the first Aspect or the method described in any one embodiment of the first aspect.
  • 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. the method described.
  • 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. the method described.
  • FIG. 1 is a schematic diagram of a hardware structure of an electronic device 100 provided by an embodiment of the present application
  • FIG. 2 is a system architecture diagram of calculating RGB_GAIN of an image light source provided by an embodiment of the present application
  • Fig. 3 is the response function diagram of the AS7341 spectral sensor provided by the embodiment of the present application.
  • Fig. 4A-Fig. 4D are application scene diagrams of the algorithm for adjusting the exposure parameters of the spectral sensor
  • Fig. 5 is a schematic flow diagram of dynamically adjusting the exposure parameters of the spectral sensor provided by the embodiment of the present application;
  • Fig. 6 is a schematic flow diagram of another dynamic adjustment of the exposure parameters of the spectral sensor provided by the embodiment of the present application.
  • Fig. 7 is a schematic flow diagram of another dynamic adjustment of the exposure parameters of the spectral sensor provided by the embodiment of the present application.
  • Fig. 8 is a schematic flow diagram of another dynamic adjustment of the exposure parameters of the spectral sensor provided by the 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.
  • Multi-spectral sensor used to obtain spectral data of the shooting environment.
  • the housing of the sensor is equipped with an entrance aperture for receiving the measured radiation.
  • the optical device splits the incident beam into several filters, which have different Spectral transmission ranges, outside of these ranges, they are all reflective. Radiation sensitive elements are installed in the radiation path of the partial beams behind these filters.
  • 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.
  • Exposure time refers to the time interval from the opening to closing of the shutter.
  • the shutter is a device used in the camera to control the time when the light illuminates the photosensitive element. The longer the exposure time, the greater the amount of light entering, and the shorter the exposure time, the less the amount of light entering.
  • 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).
  • FIG. 1 is a schematic diagram of a hardware structure of an electronic device 100 provided by 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
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • 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 wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • 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 external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • 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 storage 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 electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • 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 use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
  • 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 CCD circuit or CMOS circuit in the digital camera or mobile phone camera cannot correct the change in the color of the light source. Therefore, in order to prevent the color cast of the captured image, it is often necessary to process the image through a white balance algorithm built into the digital camera or mobile phone to correct the color cast of the image.
  • White balance is aimed at different color temperature conditions, by adjusting the signal gain corresponding to the color temperature inside the camera to make the captured image counteract the color cast, which is closer to the visual habits of the human eye. Because the camera is not as smart as the human eye (the human eye automatically performs color correction when seeing an object), the camera has set a range. If the average color of the captured photo falls within the set range, no correction is required. , if it deviates from this range, you need to adjust the parameters to make it fall within this range. This is the white balance correction process.
  • the red, green, and blue color values (RGB of the light source) of the light source of the adjusted image are (25, 50, 150), and the ratio of the red light, green light, and blue light of the light source is 1:2:6. Therefore, the color of this image is bluish compared to what the human eye actually sees.
  • the image is processed by the AWB algorithm in the mobile phone, and the RGB_GAIN of the image light source is output, so that the ISP can adjust the RGB value of the image according to this RGB_GAIN, thereby correcting the color cast of the image.
  • RGB_GAIN is 3 gain values.
  • the RGB_GAIN of the light source is (6, 3, 1)
  • the RGB of the original light source is (25, 50, 150)
  • the original light source is multiplied by the light source RGB_GAIN to obtain the adjusted RGB of the original light source (150, 150, 150). That is, the RGB of the white point in the image are equal, thereby eliminating the color cast.
  • the CCT of the image light source is calculated by the processor based on spectral data output by the spectral sensor.
  • the electronic device has a built-in spectral sensor. When the user uses the electronic device to take pictures, the light from the external environment enters the spectral sensor through the camera. The radiation sensitive element in the spectral sensor will respond after receiving the light and output relevant data. This data is The spectral data output by the spectral sensor.
  • spectral sensors include AS7341 spectral sensor, SC4236 spectral sensor and so on.
  • Fig. 2 is a system architecture diagram for calculating RGB_GAIN of an image light source provided by an embodiment of the present application, and the system architecture diagram includes an AS7341 spectral sensor and a processor.
  • the AS7341 spectral sensor includes 8 visible light channels (F1 light channel to F8 light channel) and a Clear channel.
  • F1 optical channel to F8 optical channel correspond to a filter (filter 1 to filter 8) and a radiation sensitive element (radiation sensitive element 1 to radiation sensitive element 8) respectively
  • the Clear channel corresponds to filter 9 and radiation sensitive elements9.
  • Each filter is set to a different wavelength range. The wavelength range of the filter is consistent with the wavelength range of the corresponding optical channel. Only light within the wavelength range can pass through the filter.
  • the filter setting corresponding to the Clear channel The wavelength range of is larger than the wavelength range of the filter setting corresponding to the visible light channel. For example, if the wavelength range of the optical filter is 300nm to 350nm, then the optical filter only allows light in the wavelength range of 300nm to 350nm to pass through, and the optical filter reflects light in other wavelength ranges.
  • the light in the shooting environment enters the spectral sensor through the incident aperture, and the beam splitter divides the light incident into the spectral sensor into multiple beams, and then projects the multiple beams onto the filter. Since the wavelength range set by each filter is different, the filter only allows the light of the wavelength within the wavelength range set by the filter to pass through, and the light of other wavelengths is reflected by the filter.
  • the light-transmitting filter irradiates the radiation-sensitive element, the radiation-sensitive element responds and outputs the amplitude of the response, which is the spectral data output by the optical channel.
  • Fig. 3 is the response function diagram of the AS7341 spectral sensor provided by the embodiment of the present application. It can be seen from Fig.
  • the wavelength range of the F1 optical channel is about 375nm to 455nm
  • the wavelength range of the F2 optical channel is about 410nm to 470nm
  • the wavelength range of the F3 optical channel The wavelength range is about 440nm-500nm
  • the wavelength range of the F4 optical channel is about 470nm-550nm
  • the wavelength range of the F5 optical channel is about 500nm-590nm
  • the wavelength range of the F6 optical channel is about 550nm-610nm
  • the wavelength range of the F7 optical channel It is about 590nm-680nm
  • the wavelength range of the F8 optical channel is about 610nm-710nm
  • the wavelength range of the Clear channel is about 350nm-1050nm.
  • the light beam includes at least seven visible lights of red, orange, yellow, green, blue, indigo, and violet, and the corresponding wavelength ranges are 622nm ⁇ 780nm, 597nm ⁇ 622nm, 577nm ⁇ 597nm, 492nm ⁇ 577nm, 455nm ⁇ 492nm, 455nm ⁇ 492nm, 400nm ⁇ 455nm.
  • the optical filter 1 since the wavelength range set by the optical filter 1 is 375nm-455nm (the wavelength range of the F1 optical channel), the optical filter 1 only allows the violet light in the optical beam to pass through.
  • the radiation sensitive element When the violet light is irradiated on the radiation sensitive element 1, the radiation sensitive element outputs an excitation value based on the response function of the F1 optical channel, and this excitation value is the spectral data 1 output by the F1 optical channel.
  • the F2 optical channel to the F8 optical channel and the Clear channel respectively output the spectral data 2 to the spectral data 9, and send the spectral data 1 to the spectral data 9 to the processor, realizing the conversion of the optical signal to the electrical signal.
  • the spectral data output by the spectral sensor is a raw data. It can be seen from Fig. 3 that the raw data is in a small amplitude range (the amplitude range of the raw data is 0-1). If the amplitude of the raw data is too small, it means that the relative proportion of noise in the raw data (including dark current noise, analog amplifier noise, digital-to-analog conversion noise, etc.) will increase, indicating that most of the data we collect is invalid data. This further leads to an inaccurate calculation result of the CCT, thereby affecting the accuracy of the RGB_GAIN calculated based on the CCT.
  • the electronic device will multiply the raw data output by the F1 optical channel to the F8 optical channel by an Analog_Gain (analog gain) to amplify the raw data, and the effect of multiplying the raw data by the analog gain is equivalent Because of the effect of adjusting the ISO or using a film with better sensitivity, it is beneficial to improve the signal-to-noise ratio of the spectral raw data.
  • the spectral raw data is amplified by analog gain, the amplified raw data contains more useful signals due to the increase in the signal-to-noise ratio (the noise ratio is reduced).
  • the processor uses the amplified raw data to calculate the CCT of the image light source When , the accuracy of the obtained CCT is higher.
  • the 8 amplified spectral data are interpolated to obtain a plurality of finer spectral data.
  • the plurality of finer spectral data are obtained by classifying more finely on the basis of the original 8 spectral data.
  • spectral data 1 is the excitation value output in the wavelength range of 400nm to 455nm.
  • the processor can refine spectral data 1 into multiple spectral data by interpolating the amplified spectral data 1. The more the spectral data is refined, the more , the higher the accuracy of the CCT calculated by the processor using these spectral data.
  • the wavelength range corresponding to the enlarged spectral data 1 is 400nm to 455nm.
  • the corresponding wavelength ranges are 400nm ⁇ 425nm, 425nm ⁇ 440nm, 440nm ⁇ 455nm.
  • the spectral data 1 is divided into spectral data of three wavelength ranges, the spectral data of purple light with a wavelength range of 400nm to 455nm is refined into the spectral data of purple light with a wavelength range of 400nm to 425nm, and the spectral data of purple light with a wavelength range of The spectral data of violet light and the spectral data of violet light with a wavelength range of 440nm to 455nm.
  • interpolation calculation can be performed on the enlarged spectral data 2 to the enlarged spectral data 8 to obtain multiple spectral data. In this way, the useful data in the spectral data is increased.
  • the processor integrates the spectral data obtained by interpolation with the standard observer curve (XYZ curve) of the human eye to obtain the XYZ three-dimensional vector of the image light source in the XYZ space.
  • This three-dimensional vector has nothing to do with the device and is based on this three-dimensional vector Calculates the CCT of the image light source.
  • the CCT calculated by the XYZ three-dimensional vector is consistent with the cognition of the human visual system.
  • FIG. 4A is a diagram of a photographing interface of the electronic device 100 .
  • the current photographing environment is a night scene.
  • 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. 4B .
  • the photographing processing interface displays the prompt words "Picture taking, please hold the mobile phone steady".
  • the photo preview interface shown in Figure 4C.
  • the electronic device 100 displays the photo-taking processing interface as shown in FIG. 4B , the electronic device prolongs the exposure time so that the multi-spectral sensor can acquire spectral data in the night scene, and then calculates the RGB_GAIN value of the image light source, and corrects the color cast of the image based on the RGB_GAIN.
  • the overall color of the unprocessed image taken under the night scene is grayish, while the overall color of the image processed by RGB_GAIN is improved.
  • FIG. 5 is a schematic flowchart of dynamically adjusting the exposure parameters of the spectral sensor provided by the embodiment of the present application. Below, the flow is described in conjunction with Figure 5:
  • Step S501 the electronic device determines whether the Clear value is less than or equal to a first threshold.
  • the Clear value is the spectral data output by the Clear Channel of the spectral sensor.
  • the Clear channel corresponds to a wide range of wavelengths. For example, for the AS7341 spectral sensor, the wavelength range of the Clear channel almost includes all wavelength ranges of visible light. Therefore, the light intensity of the shooting environment can be measured by the Clear value output by the Clear channel.
  • the Clear value is greater than the first threshold, the electronic device determines that the shooting environment is a strong light environment.
  • the Clear value is less than or equal to the first threshold, the electronic device determines that the shooting environment is a low-light environment.
  • the first threshold may be obtained based on historical data, or may be obtained based on analysis of experimental data, and the numerical setting of the first threshold is not limited in this embodiment of the present application.
  • the electronic device needs to adjust the white balance of the image.
  • the electronic device first obtains the spectral data of the shooting environment through the spectral sensor in the camera, and then, the processor calculates the CCT of the shooting environment based on the spectral data, and adjusts the color of the image according to the CCT.
  • the processor calculates the CCT of the shooting environment based on the spectral data, and adjusts the color of the image according to the CCT.
  • Steps S502 to S510 are steps performed by the electronic device where the shooting environment is a low-light environment (the Clear value is less than or equal to the first threshold).
  • Step S502 the electronic device judges whether the current analog gain of the spectrum sensor reaches the second threshold.
  • the second threshold is the upper threshold of the analog gain, and the second threshold can be obtained from historical data, experimental data, or empirical values, which is not limited in this embodiment of the present application.
  • the optical channel of the spectral sensor After the optical channel of the spectral sensor receives light within its set wavelength range, it will output a response, which is the spectral data output by the optical channel. However, the output response of the optical channel is a raw data, and the value of this raw data is very small. If the processor calculates the CCT of the image light source based on these raw data, the accuracy of the calculated CCT is not high, which will cause color cast in the image. . In order to solve the above problems, it is usually necessary to properly amplify the spectral data (naked data) output by the optical channel to improve the accuracy of the processor in calculating the CCT of the image light source. The most common way is to multiply the raw data by an analog gain.
  • the conversion noise is the sensor’s conversion of optical signals into electrical signals error. If the analog gain is too large, the noise in the spectral data will be too large, which will affect the accuracy of CCT. If the analog gain is too small, the raw data is not amplified enough, which affects the accuracy of the raw data and also affects the accuracy of the CCT.
  • Step S503 The electronic device calculates a first exposure time.
  • step S502 if the analog gain is too large, the noise ratio in the spectral data will be too large, thereby affecting the accuracy of the CCT of the image light source. Therefore, in a low-light shooting environment, if the analog gain of the spectral sensor has reached the highest value, to improve the accuracy of the processor in calculating the CCT of the image light source, the exposure time of the spectral sensor can be appropriately extended. In a low-light shooting environment, prolonging the exposure time will increase the light input of the multi-spectral sensor, and the spectral sensor can capture more sufficient spectral data, thus making the spectral data output by some optical channels more accurate. When the processor uses the analog gain-amplified spectral data to calculate the CCT of the image light source, the calculated CCT is more accurate.
  • the first exposure time is the target value of the exposure time to be adjusted, and the first exposure time can be obtained by the formula (1), and the formula (1) is as follows:
  • the Expo is the current exposure time of the spectral sensor
  • the Exop' is the first exposure time
  • the X is the first gain coefficient greater than 1.
  • X may be obtained from empirical values, historical data, or experimental data, which is not limited in this embodiment of the present application.
  • Step S504 the electronic device determines whether the first exposure time is greater than a third threshold.
  • the third threshold is the upper limit threshold of the exposure time, and the third threshold can be obtained based on empirical values, historical data, or experimental data, which is not limited in this embodiment of the present application .
  • step S503 increasing the exposure time will increase the amount of light entering the spectral sensor.
  • the spectral sensor will receive too much light, resulting in overexposure of the pixels, making the overall color of the image white. For example, if you take a picture of the sun at noon, the sun and the surrounding area are all white. This is because the light signal is too strong, exceeding the maximum response of the spectral sensor, resulting in a whitish image.
  • the exposure time should not exceed the set upper threshold and lower threshold.
  • the upper limit threshold of the exposure time is the third threshold.
  • Step S505 the electronic device sets the exposure time of the spectral sensor as a third threshold.
  • the electronic device sets the exposure time of the spectral sensor to the first exposure time, the image will be "overexposed", resulting in the overall color of the image Off white. Therefore, the electronic device sets the exposure time as the upper limit threshold (third threshold) of the exposure time. In this way, while increasing the amount of light entering the spectral sensor, the problem of overexposure of the image due to excessive light entering does not occur, so that the overall color of the image is whitish.
  • Step S506 the electronic device sets the exposure time of the spectral sensor as the first exposure time.
  • the electronic device sets the exposure time of its spectral sensor as the first exposure time. In this way, the amount of light entering the spectral sensor can be reasonably increased, making the spectral bare data output by the optical channel more accurate and comprehensive.
  • the processor uses the raw data amplified by analog gain to calculate the CCT of the image light source, the accuracy of the calculated CCT is extremely high, thereby solving the color shift problem of the image.
  • Step S507 the electronic device calculates a first analog gain.
  • step S502 when the analog gain of the spectral sensor has not reached its upper threshold (second threshold), the electronic device can appropriately increase the numerical value of the analog gain of the spectral sensor under low-light conditions, and convert the spectral
  • the spectral raw data output by the optical channel of the sensor is amplified to a reasonable value range to improve the signal-to-noise ratio of these spectral raw data.
  • the processor uses the raw data amplified by analog gain to calculate the CCT of the light source of the image, the calculated CCT is more accurate.
  • the first analog gain is the target value of the analog gain to be adjusted, and the first analog gain can be obtained by formula (2), and formula (2) is as follows:
  • the Gain is the current analog gain of the spectral sensor
  • the Gain_1′ is the first analog gain
  • the Y is the second gain coefficient greater than 1.
  • Y may be obtained from empirical values, historical data, or experimental data, which is not limited in this embodiment of the present application.
  • Step S508 the electronic device determines whether the first analog gain is greater than a second threshold.
  • step S502 the larger the value of the analog gain, the better. While amplifying the spectral raw data output by the optical channel, we also amplify the conversion noise in the spectral raw data.
  • the conversion noise is the The error in converting an optical signal to an electrical signal. If the analog gain is too large, the signal-to-noise ratio of the raw data amplified by the analog gain will decrease instead, thereby affecting the accuracy of the CCT of the image light source.
  • Step S509 the electronic device sets the analog gain of the spectrum sensor as the second threshold.
  • the electronic device sets the analog gain as the second threshold, and while amplifying the spectral raw data, the signal-to-noise ratio of the raw data is improved to a certain extent, so as to ensure the accuracy of the processor in calculating the CCT of the image light source.
  • the electronic device may also extend the exposure time of the camera of the electronic device while adjusting the analog gain. If the current exposure time of the electronic device does not exceed the third threshold, the electronic device may calculate the first exposure time based on formula (1). When the first exposure time exceeds the third threshold, the exposure time of the electronic device camera is set to the third threshold, and when the first exposure time does not exceed the third threshold, the exposure time of the electronic device camera is set to the third threshold. an exposure time.
  • Step S510 the electronic device sets the analog gain of the spectrum sensor as the first analog gain.
  • the electronic device sets the analog gain of the camera to the first analog gain.
  • the electronic device can amplify the raw data output by the optical channel to a reasonable value range based on the first analog gain, and the processor can accurately calculate the CCT of the image light source based on the amplified raw data, so that the ISP can adjust the white balance of the image The adjustment effect is better.
  • the electronic device may also extend the exposure time of the camera of the electronic device while adjusting the analog gain. If the current exposure time of the electronic device does not exceed the third threshold, the electronic device may calculate the first exposure time based on formula (1). When the first exposure time exceeds the third threshold, the exposure time of the electronic device camera is set to the third threshold, and when the first exposure time does not exceed the third threshold, the exposure time of the electronic device camera is set to the third threshold. an exposure time.
  • Steps S511 to S519 are steps performed by the electronic device where the shooting environment is a strong light environment (the Clear value is greater than the first threshold).
  • Step S511 the electronic device judges whether the current exposure time of the spectrum sensor reaches the fourth threshold.
  • the fourth threshold is the lower threshold of the exposure time, which can be obtained from historical data, experimental data, or empirical values, which is not limited in this embodiment of the present application.
  • the spectral sensor In a strong light environment, even if the exposure time is short, the spectral sensor will receive a lot of light. When the spectral sensor receives too much light, the image pixels will be overexposed, resulting in the overall color of the image being white. Therefore, the electronic device needs to judge whether the current exposure time of its camera reaches the lower limit threshold (the fourth threshold) of the exposure time. If the lower threshold is not reached, the exposure time of the spectral sensor needs to be adjusted.
  • the lower limit threshold the fourth threshold
  • Step S512 The electronic device calculates a second exposure time.
  • the second exposure time is the target value of the exposure time to be adjusted, and the second exposure time can be obtained by the formula (3), and the formula (3) is as follows:
  • the Expo is the current exposure time of the spectral sensor
  • the X' is the third gain coefficient less than 1
  • the Exop_2' is the second exposure time.
  • X' can be obtained based on empirical values, historical data, or experimental data, which is not limited in this embodiment of the present application.
  • Step S513 the electronic device determines whether the second exposure time is less than a fourth threshold.
  • Step S514 the electronic device sets the exposure time of the spectral sensor as the second exposure time.
  • the electronic device sets the exposure time of its camera to the second exposure time, and reasonably reduces the exposure time of the camera in a strong light environment, which can avoid
  • the accuracy of the spectral raw data output by the optical channel is improved, and the accuracy of the processor to calculate the CCT of the image light source is improved.
  • the electronic device may also reduce the analog gain of the electronic device while adjusting the exposure time. If the current analog gain of the electronic device is greater than the fifth threshold (the lower limit threshold of the analog gain), the electronic device may calculate the second analog gain based on formula (4). When the second analog gain exceeds the fifth threshold, the exposure time of the electronic device camera is set to the second analog gain, and when the second analog gain does not exceed the fifth threshold, the electronic device camera is set to the analog gain fifth threshold.
  • the fifth threshold the lower limit threshold of the analog gain
  • Step S515 the electronic device sets the exposure time of the spectrum sensor as the fourth threshold.
  • step S511 and step S514 in a strong light environment, reasonably reducing the exposure time of the camera can improve the output of the optical channel on the basis of avoiding the overall color of the image being white due to too long exposure time.
  • the accuracy of the spectral raw data thereby improving the accuracy of the processor to calculate the CCT of the image light source.
  • the exposure time is too short (lower than the fourth threshold)
  • the spectral raw data output by the optical channel will be missing or inaccurate, thereby affecting the accuracy of the CCT of the image light source.
  • the exposure time of the camera of the electronic device is set to the second exposure time when the second exposure time is less than the fourth threshold, the accuracy of the CCT of the image light source will be affected. Therefore, when the second exposure time is less than the fourth threshold, the electronic device sets the exposure time of its camera to the fourth threshold.
  • the electronic device may also reduce the analog gain of the electronic device while adjusting the exposure time. If the current analog gain of the electronic device is greater than the fifth threshold (the lower limit threshold of the analog gain), the electronic device may calculate the second analog gain based on formula (4). When the second analog gain exceeds the fifth threshold, the exposure time of the electronic device camera is set to the second analog gain, and when the second analog gain does not exceed the fifth threshold, the electronic device camera is set to the analog gain fifth threshold.
  • the fifth threshold the lower limit threshold of the analog gain
  • Step S516 the electronic device calculates a second analog gain.
  • the analog gain can be reduced.
  • the second analog gain is the target value of the analog gain to be adjusted in a strong light environment, and the second analog gain can be obtained by the formula (4), and the formula (4) is as follows:
  • the Gain is the current analog gain of the spectrum sensor
  • the Gain_2' is the second analog gain
  • the Y' is the fourth gain coefficient less than 1.
  • Y' may be obtained from empirical values, historical data, or experimental data, which is not limited in this embodiment of the present application. In this way, reducing the analog gain under strong light conditions is beneficial to control the spectral data (analog signal), so that after the spectral data is converted into a digital signal, the digital signal can be controlled within a reasonable range of values, so that the final generated image does not As for overexposure, which causes the overall color of the image to be white.
  • Step S517 the electronic device judges whether the second analog gain is greater than the fifth threshold.
  • the fifth threshold is the lower limit threshold of the analog gain, and the fifth threshold may be obtained from empirical values, historical data, or experimental data, which is not limited in this embodiment of the present application.
  • Step S518 the electronic device sets the analog gain of the spectrum sensor to the fifth threshold.
  • the second analog gain is less than the lower limit threshold (fifth threshold) of the analog gain, the spectral raw data output by the optical channel of the spectral sensor cannot be amplified to a reasonable range, resulting in the accuracy of the amplified raw data. Not high, thus affecting the accuracy of the CCT of the image light source.
  • the analog gain is set to the fifth threshold, so as to ensure that the raw data output by the optical channel can be amplified to a reasonable value range through the analog gain, ensuring that after amplification The accuracy of the spectral data.
  • Step S519 the electronic device sets the analog gain of the spectrum sensor to the second analog gain.
  • the electronic device sets the analog gain to the second analog gain, so that the electronic device can
  • the raw data output by the optical channel is amplified to a reasonable value range, and the processor can accurately calculate the CCT of the image light source based on the amplified raw data, so that the ISP can adjust the white balance of the image better.
  • the electronic device judges whether the current shooting environment is a strong light environment or a low light environment according to the spectral data output by the Clear Channel of the spectral sensor.
  • the electronic device prolongs the exposure time of the camera of the electronic device or increases the analog gain of the electronic device according to a relevant formula.
  • the electronic device shortens the exposure time of the camera of the electronic device and the analog gain of the electronic device according to a related formula.
  • the electronic device dynamically adjusts the exposure time and analog gain of the camera in different shooting environments (strong light environment/weak light environment), which is beneficial for the spectral sensor to output accurate and comprehensive spectral data in different shooting environments, so that The processor can accurately calculate the CCT of the image light source based on these spectral data, thereby accurately adjusting the white balance of the image.
  • FIG. 6 is a schematic flowchart of another dynamic adjustment of the exposure parameters of the spectral sensor provided by the embodiment of the present application. In the following, the process will be described in conjunction with Figure 6:
  • Step S601 the electronic device determines whether the Clear value is less than or equal to a first threshold.
  • step S601 please refer to the relevant description of step S501, which will not be repeated in this embodiment of the present application. If it is judged as yes, execute step S602; if it is judged as no, execute step S611.
  • Steps S602 to S610 are steps performed by the electronic device where the shooting environment is a low-light environment (the Clear value is less than or equal to the first threshold).
  • Step S602 the electronic device determines whether the current exposure time of the spectral sensor reaches a third threshold.
  • Step S603 the electronic device calculates a first analog gain.
  • step S507 for the process of calculating the first analog gain by the electronic device, which will not be described again in this embodiment of the present application.
  • Step S604 the electronic device determines whether the first analog gain is greater than a second threshold.
  • step S508 for the related description of the electronic device judging whether the first analog gain is greater than the second threshold, which will not be repeated in this embodiment of the present application.
  • Step S605 the electronic device sets the analog gain of the spectrum sensor as the second threshold.
  • Step S606 the electronic device sets the analog gain of the spectrum sensor to the first analog gain.
  • steps S605 to S606 please refer to steps S509 to S510, which will not be repeated in this embodiment of the present application.
  • Step S607 The electronic device calculates a first exposure time.
  • step S503 for the method for the electronic device to calculate the first exposure time, please refer to step S503, which will not be repeated in this embodiment of the present application.
  • Step S608 the electronic device determines whether the first exposure time is greater than a third threshold.
  • step S504 Please refer to step S504 for the relevant description of the electronic device judging whether the first exposure time is greater than the third threshold, which will not be repeated in this embodiment of the present application.
  • Step S609 the electronic device sets the exposure time of the spectral sensor as a third threshold.
  • Step S610 the electronic device sets the exposure time of the spectral sensor as the first exposure time.
  • steps S609 to S610 please refer to steps S505 to S506, which will not be repeated in this embodiment of the present application.
  • Steps S611 to S619 are steps executed by the electronic device where the shooting environment is a strong light environment (the Clear value is greater than the first threshold).
  • Step S611 the electronic device judges whether the current analog gain of the spectrum sensor reaches the fifth threshold.
  • step S612 if the judgment is no, it means that the current analog gain of the spectral sensor is greater than the fifth threshold, and step S612 is executed; if the judgment is yes, step S616 is executed.
  • Step S612 the electronic device calculates a second analog gain.
  • step S566 for the method for the electronic device to calculate the second analog gain of the spectral sensor, please refer to step S516, which will not be repeated in this embodiment of the present application.
  • Step S613 the electronic device judges whether the second analog gain is greater than the fifth threshold.
  • step S517 Please refer to step S517 for the relevant description of the electronic device judging whether the second analog gain is greater than the fifth threshold, which will not be repeated in this embodiment of the present application.
  • Step S614 the electronic device sets the analog gain of the spectrum sensor to the fifth threshold.
  • Step S615 the electronic device sets the analog gain of the spectrum sensor to the second analog gain.
  • step S614 to step S615 please refer to step S518 to step S519, which will not be repeated in this embodiment of the present application.
  • Step S616 the second exposure time calculated by the electronic device.
  • step S512 for the method for the electronic device to calculate the second exposure time of the spectral sensor, which will not be repeated in this embodiment of the present application.
  • Step S617 the electronic device determines whether the second exposure time is less than the fourth threshold.
  • step S513 Please refer to step S513 for descriptions about whether the electronic device determines whether the second exposure time is smaller than the fourth threshold.
  • Step S618 the electronic device sets the exposure time of the spectral sensor as the second exposure time.
  • Step S619 the electronic device sets the exposure time of the spectrum sensor as the fourth threshold.
  • steps S618 to S619 please refer to steps S514 to S515, which will not be repeated in this embodiment of the present application.
  • the electronic device judges whether the current shooting environment is a strong light environment or a low light environment according to the spectral data output by the Clear Channel of the spectral sensor.
  • the electronic device prolongs the exposure time of the camera of the electronic device or increases the analog gain of the electronic device according to a relevant formula.
  • the electronic device shortens the exposure time of the camera of the electronic device and the analog gain of the electronic device according to relevant formulas.
  • the electronic device dynamically adjusts the exposure time and analog gain of the camera in different shooting environments (strong light environment/weak light environment), which is beneficial for the spectral sensor to output accurate and comprehensive spectral data in different shooting environments, so that The processor can accurately calculate the CCT of the image light source based on these spectral data, thereby accurately adjusting the white balance of the image.
  • FIG. 7 is a schematic flowchart of another dynamic adjustment of the exposure parameters of the spectral sensor provided by the embodiment of the present application. Below, the flow is described in conjunction with Figure 7:
  • Step S701 the electronic device determines whether the Clear value is less than or equal to a first threshold.
  • step S701 please refer to the relevant description of step S501, which will not be repeated in this embodiment of the present application. If it is judged as yes, execute step S702; if it is judged as no, execute step S711.
  • step S501 For the electronic device to determine whether the Clear value is less than or equal to the first threshold, please refer to step S501, which will not be repeated in this embodiment of the present application.
  • Steps S702 to S710 are steps performed by the electronic device where the shooting environment is a low-light environment (the Clear value is less than or equal to the first threshold).
  • Step S702 the electronic device judges whether the current analog gain of the spectrum sensor reaches the second threshold.
  • step S502 Please refer to step S502 for the relevant description of the electronic device judging whether the analog gain of the spectrum sensor reaches the second threshold, and the embodiment of the present application will not repeat it here.
  • Step S703 The electronic device calculates a first exposure time.
  • step S503 for the method for calculating the first exposure time by the electronic device, which will not be repeated in this embodiment of the present application.
  • Step S704 the electronic device determines whether the first exposure time is greater than a third threshold.
  • Step S705 the electronic device sets the exposure time of the spectral sensor as a third threshold.
  • Step S706 the electronic device sets the exposure time of the spectrum sensor as the first exposure time.
  • step S705 to step S706, please refer to the related description of step S505 to step S506, and the embodiment of the present application will not repeat them here.
  • Step S707 the electronic device calculates a first analog gain.
  • step S507 for the method for the electronic device to calculate the first analog gain, please refer to step S507, which will not be repeated in this embodiment of the present application.
  • Step S708 the electronic device determines whether the first analog gain is greater than a second threshold.
  • step S508 for the related description of the electronic device judging whether the first analog gain is greater than the second threshold, which will not be repeated in this embodiment of the present application.
  • Step S709 the electronic device sets the analog gain of the spectrum sensor as the second threshold.
  • Step S710 the electronic device sets the analog gain of the spectrum sensor as the first analog gain.
  • steps S709 to S710 please refer to the relevant descriptions of steps S509 to S510, which will not be repeated in this embodiment of the present application.
  • Steps S711 to S719 are steps performed by the electronic device where the shooting environment is a strong light environment (the Clear value is greater than the first threshold).
  • Step S711 the electronic device judges whether the current analog gain of the spectrum sensor reaches the fifth threshold.
  • step S712 if the judgment is no, it means that the current analog gain of the spectral sensor is greater than the fifth threshold, and step S712 is executed; if the judgment is yes, step S716 is executed.
  • Step S712 the electronic device calculates a second analog gain.
  • step S566 for the method for the electronic device to calculate the second analog gain, please refer to step S516, which will not be repeated in this embodiment of the present application.
  • Step S713 the electronic device determines whether the second analog gain is greater than a fifth threshold.
  • step S517 Please refer to step S517 for the relevant description of the electronic device judging whether the second analog gain is greater than the fifth threshold, which will not be repeated in this embodiment of the present application.
  • Step S714 the electronic device sets the analog gain of the spectrum sensor to the fifth threshold.
  • Step S715 the electronic device sets the analog gain of the spectrum sensor to the second analog gain.
  • step S714 to step S715 please refer to step S518 to step S519, which will not be repeated in this embodiment of the present application.
  • Step S716 The electronic device calculates the second exposure time.
  • step S512 for the method for calculating the second exposure time by the electronic device, which will not be repeated in this embodiment of the present application.
  • Step S717 the electronic device determines whether the second exposure time is less than a fourth threshold.
  • step S513 Please refer to step S513 for descriptions about whether the electronic device determines whether the second exposure time is smaller than the fourth threshold.
  • Step S718 the electronic device sets the exposure time of the spectral sensor as the second exposure time.
  • Step S719 the electronic device sets the exposure time of the spectral sensor as the fourth threshold.
  • steps S718 to S719 please refer to steps S514 to S515, which will not be repeated in this embodiment of the present application.
  • the electronic device judges whether the current shooting environment is a strong light environment or a low light environment according to the spectral data output by the Clear Channel of the spectral sensor.
  • the electronic device prolongs the exposure time of the camera of the electronic device or increases the analog gain of the electronic device according to a relevant formula.
  • the electronic device shortens the exposure time of the camera of the electronic device and the analog gain of the electronic device according to a related formula.
  • the electronic device dynamically adjusts the exposure time and analog gain of the camera in different shooting environments (strong light environment/weak light environment), which is beneficial for the spectral sensor to output accurate and comprehensive spectral data in different shooting environments, so that The processor can accurately calculate the CCT of the image light source based on these spectral data, thereby accurately adjusting the white balance of the image.
  • FIG. 8 is a schematic flowchart of another dynamic adjustment of the exposure parameters of the spectral sensor provided by the embodiment of the present application. In the following, the process will be described in conjunction with Figure 8:
  • Step S801 the electronic device determines whether the Clear value is less than or equal to a first threshold.
  • step S801 please refer to the relevant description of step S501, which will not be repeated in this embodiment of the present application. If it is judged as yes, execute step S802; if it is judged as no, execute step S811.
  • step S501 For the electronic device to determine whether the Clear value is less than or equal to the first threshold, please refer to step S501, which will not be repeated in this embodiment of the present application.
  • Steps S802 to S810 are steps performed by the electronic device where the shooting environment is a low-light environment (the Clear value is less than or equal to the first threshold).
  • Step S802 the electronic device judges whether the current exposure time of the spectral sensor reaches a third threshold.
  • Step S803 the electronic device calculates a first analog gain.
  • step S807 for the process of calculating the first analog gain by the electronic device, which will not be repeated in this embodiment of the present application.
  • Step S804 the electronic device determines whether the first analog gain is greater than a second threshold.
  • step S508 for the related description of the electronic device judging whether the first analog gain is greater than the second threshold, which will not be repeated in this embodiment of the present application.
  • Step S805 the electronic device sets the analog gain of the spectral sensor as the second threshold.
  • Step S806 the electronic device sets the analog gain of the spectrum sensor to the first analog gain.
  • steps S805 to S806 please refer to steps S509 to S510, which will not be repeated here in this embodiment of the present application.
  • Step S807 The electronic device calculates a first exposure time.
  • step S503 for the method for the electronic device to calculate the first exposure time, please refer to step S503, which will not be repeated in this embodiment of the present application.
  • Step S808 the electronic device determines whether the first exposure time is greater than a third threshold.
  • step S504 Please refer to step S504 for the relevant description of the electronic device judging whether the first exposure time is greater than the third threshold, which will not be repeated in this embodiment of the present application.
  • Step S809 the electronic device sets the exposure time of the spectral sensor as a third threshold.
  • Step S810 the electronic device sets the exposure time of the spectral sensor as the first exposure time.
  • steps S809 to S810 please refer to steps S505 to S506, which will not be repeated in this embodiment of the present application.
  • Steps S811 to S819 are steps executed by the electronic device where the shooting environment is a strong light environment (the Clear value is greater than the first threshold).
  • Step S811 the electronic device judges whether the current exposure time of the spectrum sensor reaches the fourth threshold.
  • step S816 is performed; .
  • step S81 reference may be made to the related description of step S511, which will not be repeated in this embodiment of the present application.
  • Step S812 the electronic device calculates a second exposure time.
  • step S512 for the method and process of calculating the second exposure time by the electronic device, which will not be repeated in this embodiment of the present application.
  • Step S813 the electronic device determines whether the second exposure time is less than a fourth threshold.
  • Step S814 the electronic device sets the exposure time of the spectral sensor as the second exposure time.
  • Step S815 the electronic device sets the exposure time of the spectral sensor as the fourth threshold.
  • step S814 to step S815 please refer to the related description of step S514 to step S515, which will not be repeated in this embodiment of the present application.
  • Step S816 the electronic device calculates a second analog gain.
  • step S516 for the related method and process of calculating the second analog gain by the electronic device, which will not be repeated in this embodiment of the present application.
  • Step S817 the electronic device judges whether the second analog gain is greater than the fifth threshold.
  • step S517 Please refer to step S517 for the relevant description of the electronic device judging whether the second analog gain is greater than the fifth threshold, which will not be repeated in this embodiment of the present application.
  • Step S818 the electronic device sets the analog gain of the spectrum sensor to the fifth threshold.
  • Step S819 the electronic device sets the analog gain of the spectrum sensor to the second analog gain.
  • steps S818 to S819 please refer to the relevant descriptions of steps S518 to S519, which will not be repeated in this embodiment of the present application.
  • the electronic device judges whether the current shooting environment is a strong light environment or a low light environment according to the spectral data output by the Clear Channel of the spectral sensor.
  • the electronic device prolongs the exposure time of the camera of the electronic device or increases the analog gain of the electronic device according to a relevant formula.
  • the electronic device shortens the exposure time of the camera of the electronic device and the analog gain of the electronic device according to a related formula.
  • the electronic device dynamically adjusts the exposure time and analog gain of the camera in different shooting environments (strong light environment/weak light environment), which is beneficial for the spectral sensor to output accurate and comprehensive spectral data in different shooting environments, so that The processor can accurately calculate the CCT of the image light source based on these spectral data, thereby accurately adjusting the white balance of the image.
  • 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)
  • Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Human Computer Interaction (AREA)
  • General Physics & Mathematics (AREA)
  • Studio Devices (AREA)
  • Spectrometry And Color Measurement (AREA)

Abstract

本申请提供一种动态调节光谱传感器曝光参数的方法及电子设备,所述方法包括:电子设备判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,电子设备判断光谱传感器的模拟增益是否达到第二阈值。若判断为是,电子设备延长所述光谱传感器的曝光时间;若判断为否,电子设备增大所述光谱传感器的模拟增益;若所述Clear值大于所述第一阈值,电子设备判断所述光谱传感器的曝光时间是否达到第四阈值;所述第四阈值为所述光谱传感器曝光时间的下限阈值;若判断为是,电子设备减小所述光谱传感器的模拟增益;若判断为否,电子设备缩短所述光谱传感器的曝光时间。

Description

一种动态调节光谱传感器曝光参数的方法及电子设备
本申请要求于2021年6月26日提交中国专利局、申请号为202110715278.7、发明名称为“一种动态调节光谱传感器曝光参数的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理领域,尤其涉及一种动态调节光谱传感器曝光参数的方法及电子设备。
背景技术
用户使用数码相机或手机等电子设备进行拍照时,相机内置的光谱传感器会捕捉拍摄环境的光谱数据,并将该光谱数据发送给处理器进行计算,得到拍摄图像光源的相关色温、亮度、光源颜色和光谱数据等信息,电子设备并基于这些信息对图像进行白平衡的调节。
但是,当拍摄环境为夜晚等暗光环境时,由于夜晚的光线不足,当用户在夜晚进行拍照时,基于窄带滤光设计的光谱传感器往往不能获取足够的曝光,从而导致处理器基于拍摄环境光谱数据计算出的相关色温等信息不准确。因此,在夜景下直接使用光谱传感器提供的色温来做白平衡,会导致图像偏色问题验证,即:电子设备对图像的白平衡处理效果不好。如何在不同的拍摄环境下调节光谱传感器的曝光参数,进而解决拍摄图像的偏色问题,是技术人员日益关注的问题。
发明内容
本申请实施例提供了一种动态调节光谱传感器曝光参数的方法,解决了光谱传感器输出的光谱数据准确度不高,进而影响图像白平衡调节效果的问题。
第一方面,本申请实施例提供了一种动态调节光谱传感器曝光参数的方法,包括:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的模拟增益是否达到第二阈值;所述第二阈值为所述光谱传感器的模拟增益的上限阈值;若判断为是,延长所述光谱传感器的曝光时间;若判断为否,增大所述光谱传感器的模拟增益;若所述Clear值大于所述第一阈值,判断所述光谱传感器的曝光时间是否达到第四阈值;所述第四阈值为所述光谱传感器曝光时间的下限阈值;若判断为是,减小所述光谱传感器的模拟增益;若判断为否,缩短所述光谱传感器的曝光时间;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
在上述实施例中,电子设备以第一阈值为临界点,将拍摄环境分成了强光环境(Clear值大于第一阈值)和暗光环境(Clear值小于或等于第一阈值),根据拍摄环境所处的类型,按照相应的调整方案,动态地调整光谱传感器的曝光参数(曝光时间和模拟增益),从而使得光谱传感器输出的光谱数据更加准确,从而使得基于光谱数据计算出的CCT准确度更高,使得图像的白平衡效果更好。
结合第一方面,在一种实施方式中,延长光谱传感器的曝光时间,具体包括:根据公 式Exop_1′=Expo*X计算光谱传感器的第一曝光时间;Expo为光谱传感器当前的曝光时间,Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断第一曝光时间是否大于第三阈值,第三阈值为该光谱传感器的曝光时间的上限阈值;若判断为是,将该光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将该光谱传感器的曝光时间设置为所述第一曝光时间。
在上述实施例中,在弱光环境下,适当延长光谱传感器的曝光时间,有利于增加光谱传感器的进光量,使得光谱传感器输出丰富的光谱数据(避免存在某一光谱数据缺失的情况),从而确保了基于光谱数据计算出的图像光源CCT的准确性。
结合第一方面,在一种实施方式中,增大所述光谱传感器的模拟增益,具体包括:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;Gain为光谱传感器当前的模拟增益,Gain_1′为第一模拟增益,Y为大于1的第二增益系数;判断第一模拟增益是否大于第二阈值;若判断为是,将光谱传感器的模拟增益设置为第二阈值;若判断为否,将光谱传感器的模拟增益设置为第一模拟增益。
在上述实施例中,在弱光环境下,适当增大光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第一方面,在一种实施方式中,减小所述光谱传感器的模拟增益,具体包括:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;Gain为光谱传感器当前的模拟增益,Gain_2′为第二模拟增益,Y′为小于1的第四增益系数;判断第二模拟增益是否小于第五阈值;第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为第二模拟增益。
在上述实施例中,在强光环境下,适当减小光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第一方面,在一种实施方式中,所述缩短所述光谱传感器的曝光时间,具体包括:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
在上述实施例中,在强光环境下,适当缩短光谱传感器的曝光时间,有利于合理增加光谱传感器的进光量,避免光谱传感器的进光量过多而超出光谱传感器光通道响应的最大幅值而使得光谱传感器输出的光谱数据出现异常,从而影响基于光谱数据计算出的图像光源CCT的准确性。
第二方面,本申请实施例提供了一种动态调节光谱传感器曝光参数的方法,包括:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的曝光时间是否达到第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值; 若判断为是,增大所述光谱传感器的模拟增益;若判断为否,延长所述光谱传感器的曝光时间;若所述Clear值大于所述第一阈值,判断所述光谱传感器的模拟增益是否达到第五阈值,所述第五阈值为模拟增益的下限阈值;若判断为是,缩短所述光谱传感器的曝光时间;若判断为否,缩小所述光谱传感器的模拟增益;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
在上述实施例中,电子设备以第一阈值为临界点,将拍摄环境分成了强光环境(Clear值大于第一阈值)和暗光环境(Clear值小于或等于第一阈值),根据拍摄环境所处的类型,按照相应的调整方案,动态地调整光谱传感器的曝光参数(曝光时间和模拟增益),从而使得光谱传感器输出的光谱数据更加准确,从而使得基于光谱数据计算出的CCT准确度更高,使得图像的白平衡效果更好。
结合第二方面,在一种实施方式中,所述延长所述光谱传感器的曝光时间,具体包括:根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
在上述实施例中,在弱光环境下,适当延长光谱传感器的曝光时间,有利于增加光谱传感器的进光量,使得光谱传感器输出丰富的光谱数据(避免存在某一光谱数据缺失的情况),从而确保了基于光谱数据计算出的图像光源CCT的准确性。
结合第二方面,在一种实施方式中,所述增大所述光谱传感器的模拟增益,具体包括:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
在上述实施例中,在弱光环境下,适当增大光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第二方面,在一种实施方式中,所述减小所述光谱传感器的模拟增益,具体包括:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
在上述实施例中,在强光环境下,适当减小光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第二方面,在一种实施方式中,所述缩短所述光谱传感器的曝光时间,具体包括:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传 感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
在上述实施例中,在强光环境下,适当缩短光谱传感器的曝光时间,有利于合理增加光谱传感器的进光量,避免光谱传感器的进光量过多而超出光谱传感器光通道响应的最大幅值而使得光谱传感器输出的光谱数据出现异常,从而影响基于光谱数据计算出的图像光源CCT的准确性。
第三方面,本申请实施例提供一种动态调节光谱传感器曝光参数的方法,包括:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的模拟增益是否达到第二阈值;所述第二阈值为所述光谱传感器的模拟增益的上限阈值;若判断为是,延长所述光谱传感器的曝光时间;若判断为否,增大所述光谱传感器的模拟增益;若所述Clear值大于所述第一阈值,判断所述光谱传感器的模拟增益是否达到第五阈值;所述第五阈值为所述光谱传感器模拟增益的下限阈值;若判断为是,缩短所述光谱传感器的曝光时间;若判断为否,减小所述光谱传感器的模拟增益;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
在上述实施例中,电子设备以第一阈值为临界点,将拍摄环境分成了强光环境(Clear值大于第一阈值)和暗光环境(Clear值小于或等于第一阈值),根据拍摄环境所处的类型,按照相应的调整方案,动态地调整光谱传感器的曝光参数(曝光时间和模拟增益),从而使得光谱传感器输出的光谱数据更加准确,从而使得基于光谱数据计算出的CCT准确度更高,使得图像的白平衡效果更好。
结合第三方面,在一种实施方式中,所述延长所述光谱传感器的曝光时间,具体包括:根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
在上述实施例中,在弱光环境下,适当延长光谱传感器的曝光时间,有利于增加光谱传感器的进光量,使得光谱传感器输出丰富的光谱数据(避免存在某一光谱数据缺失的情况),从而确保了基于光谱数据计算出的图像光源CCT的准确性。
结合第三方面,所述增大所述光谱传感器的模拟增益,具体包括:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
在上述实施例中,在弱光环境下,适当增大光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光 谱数据计算的CCT的准确度。
结合第三方面,在一种实施方式中,所述减小所述光谱传感器的模拟增益,具体包括:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
在上述实施例中,在强光环境下,适当减小光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第三方面,在一种实施方式中,所述缩短所述光谱传感器的曝光时间,具体包括:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
在上述实施例中,在强光环境下,适当缩短光谱传感器的曝光时间,有利于合理增加光谱传感器的进光量,避免光谱传感器的进光量过多而超出光谱传感器光通道响应的最大幅值而使得光谱传感器输出的光谱数据出现异常,从而影响基于光谱数据计算出的图像光源CCT的准确性。
第四方面,本申请实施例提供了一种动态调节光谱传感器曝光参数的方法,其特征在于,包括:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的曝光时间是否达到第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,增大所述光谱传感器的模拟增益;若判断为否,延长所述光谱传感器的曝光时间;若所述Clear值大于所述第一阈值,判断所述光谱传感器的曝光时间是否达到第四阈值,所述第四阈值为所述光谱传感器曝光时间的下限阈值;若判断为是,缩小所述光谱传感器的模拟增益;若判断为否,缩短所述光谱传感器的曝光时间;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
在上述实施例中,电子设备以第一阈值为临界点,将拍摄环境分成了强光环境(Clear值大于第一阈值)和暗光环境(Clear值小于或等于第一阈值),根据拍摄环境所处的类型,按照相应的调整方案,动态地调整光谱传感器的曝光参数(曝光时间和模拟增益),从而使得光谱传感器输出的光谱数据更加准确,从而使得基于光谱数据计算出的CCT准确度更高,使得图像的白平衡效果更好。
结合第四方面,在一种实施方式中,所述延长所述光谱传感器的曝光时间,具体包括:根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上 限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
在上述实施例中,在弱光环境下,适当延长光谱传感器的曝光时间,有利于增加光谱传感器的进光量,使得光谱传感器输出丰富的光谱数据(避免存在某一光谱数据缺失的情况),从而确保了基于光谱数据计算出的图像光源CCT的准确性。
结合第四方面,在一种实施方式中,所述增大所述光谱传感器的模拟增益,具体包括:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
在上述实施例中,在弱光环境下,适当增大光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第四方面,在一种实施方式中,所述减小所述光谱传感器的模拟增益,具体包括:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
在上述实施例中,在强光环境下,适当减小光谱传感器的模拟增益,有利于将光谱传感器输出的光谱数据放大到合理地数值范围内,增大光谱数据的信噪比,从而提高基于光谱数据计算的CCT的准确度。
结合第四方面,在一种实施方式中,所述缩短所述光谱传感器的曝光时间,具体包括:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
在上述实施例中,在强光环境下,适当缩短光谱传感器的曝光时间,有利于合理增加光谱传感器的进光量,避免光谱传感器的进光量过多而超出光谱传感器光通道响应的最大幅值而使得光谱传感器输出的光谱数据出现异常,从而影响基于光谱数据计算出的图像光源CCT的准确性。
第五方面,本申请实施例提供了一种电子设备,该电子设备包括:一个或多个处理器和存储器;该存储器与该一个或多个处理器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令,该一个或多个处理器调用该计算机指令以使得该电子设备执行:判断Clear值是否小于或等于第一阈值;若Clear值小于或等于第一阈值,判断光谱传感器的模拟增益是否达到第二阈值;第二阈值为该光谱传感器的模拟增益的上限阈值; 若判断为是,延长该光谱传感器的曝光时间;若判断为否,增大该光谱传感器的模拟增益;若Clear值大于所述第一阈值,判断该光谱传感器的曝光时间是否达到第四阈值;第四阈值为所述光谱传感器曝光时间的下限阈值;若判断为是,减小光谱传感器的模拟增益;若判断为否,缩短该光谱传感器的曝光时间;其中,光谱传感器的曝光时间和光谱传感器的模拟增益为光谱传感器的曝光参数。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_1′=Expo*X计算该光谱传感器的第一曝光时间;Expo为光谱传感器当前的曝光时间,Exop′为第一曝光时间,X为大于1的第一增益系数;判断第一曝光时间是否大于第三阈值,第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_1′=Gain*Y计算该光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的曝光时间是否达到第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,增大所述光谱传感器的模拟增益;若判断为否,延长所述光谱传感器的曝光时间;若所述Clear值大于所述第一阈值,判断所述光谱传感器的模拟增益是否达到第五阈值,所述第五阈值为模拟增益的下限阈值;若判断为是,缩短所述光谱传感器的曝光时间;若判断为否,缩小所述光谱传感器的模拟增益;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以 使得该电子设备执行:根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的模拟增益是否达到第二阈值;所述第二阈值为所述光谱传感器的模拟增益的上限阈值;若判断为是,延长所述光谱传感器的曝光时间;若判断为否,增大所述光谱传感器的模拟增益;若所述Clear值大于所述第一阈值,判断所述光谱传感器的模拟增益是否达到第五阈值;所述第五阈值为所述光谱传感器模拟增益的下限阈值;若判断为是,缩短所述光谱传感器的曝光时间;若判断为否,减小所述光谱传感器的模拟增益;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的曝光时间是否达到第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,增大所述光谱传感器的模拟增益;若判断为否,延长所述光谱传感器的曝光时间;若所述Clear值大于所述第一阈值,判断所述光谱传感器的曝光时间是否达到第四阈值,所述第四阈值为所述光谱传感器曝光时间的下限阈值;若判断为是,缩小所述光谱传感器的模拟增益;若判断为否,缩短所述光谱传感器的曝光时间;其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;判断所述第一模拟增益是否大于所述第二阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;若判断为否,将所述光谱传感器的模拟增益设置 为所述第一模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
结合第五方面,在一种实施方式中,该一个或多个处理器还用于调用该计算机指令以使得该电子设备执行:根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;判断所述第二曝光时间是否小于所述第四阈值;若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
第六方面,本申请实施例提供了一种电子设备,包括:触控屏、摄像头、一个或多个处理器和一个或多个存储器;所述一个或多个处理器与所述触控屏、所述摄像头、所述一个或多个存储器耦合,所述一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当所述一个或多个处理器执行所述计算机指令时,使得所述电子设备执行如第一方面或第一方面的任意一种实施方式所述的方法。
第七方面,本申请实施例提供了一种芯片***,该芯片***应用于电子设备,该芯片***包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面或第一方面的任意一种实施方式所述的方法。
第八方面,本申请实施例提供了一种包含指令的计算机程序产品,当该计算机程序产品在电子设备上运行时,使得该电子设备执行如第一方面或第一方面的任意一种实施方式所述的方法。
第九方面,本申请实施例提供了一种计算机可读存储介质,包括指令,当该指令在电子设备上运行时,使得该电子设备执行如第一方面或第一方面的任意一种实施方式所述的方法。
附图说明
图1是本申请实施例提供的电子设备100的硬件结构示意图;
图2是本申请实施例提供的一种计算图像光源的RGB_GAIN的***架构图;
图3是本申请实施例提供的AS7341光谱传感器的响应函数图;
图4A-图4D对调节光谱传感器曝光参数的算法的应用场景图;
图5是本申请实施例提供的一种动态调节光谱传感器曝光参数的流程示意图;
图6是本申请实施例提供的另一种动态调节光谱传感器曝光参数的流程示意图;
图7是本申请实施例提供的另一种动态调节光谱传感器曝光参数的流程示意图;
图8是本申请实施例提供的另一种动态调节光谱传感器曝光参数的流程示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或者特性可以包含在本实施例申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是相同的实施例,也不是与其它实施例互斥的独立的或是备选的实施例。本领域技术人员可以显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及所述附图中术语“第一”、“第二”、“第三”等是区别于不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如,包含了一系列步骤或单元,或者可选地,还包括没有列出的步骤或单元,或者可选地还包括这些过程、方法、产品或设备固有的其它步骤或单元。
附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前,应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。
在本说明书中使用的术语“部件”、“模块”、“***”、“单元”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件或执行中的软件。例如,单元可以是但不限于在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或分布在两个或多个计算机之间。此外,这些单元可从在上面存储有各种数据结构的各种计算机可读介质执行。单元可例如根据具有一个或多个数据分组(例如来自与本地***、分布式***和/或网络间的另一单元交互的第二单元数据。例如,通过信号与其它***交互的互联网)的信号通过本地和/或远程进程来通信。
下面,对本申请实施例涉及的一些专有名词进行解释。
(1)光谱(Spectrum):是复色光经过色散***(如棱镜、光栅)分光后,被色散开的单色光按波长(或频率)大小而依次排列的图案,全称为光学频谱。
(2)多光谱传感器:用于获取拍摄环境的光谱数据。传感器的外壳内装有一个用于接收被测辐射的入射孔径,在入射孔径后面的辐射路径中,光学装置将入射光束***,使其进入若干个滤光片,这些滤光片具有各不相同的光谱透射范围,超出这些范围,它们都是反射的。在这些滤光片后面的部分光束的辐射通路中装有辐射敏感元件。
(3)相关色温(Correlated Colour Temperature,CCT):是指与具有相同亮度刺激的颜色最相近的黑体辐射体的温度,用K氏温度表示,用于描述位于普朗克轨迹附近的光的颜色的度量。除热辐射光源以外的其它光源具有线状光谱,其辐射特性与黑体辐射特性差别较大,所以这些光源的光色在色度图上不一定准确地落在黑体轨迹上,对这样一类光源,通常用CCT来描述光源的颜色特性。
(4)曝光时间(Exposure time):指从快门打开到关闭的时间间隔,快门是相机中用来控制光线照射感光元件时间的装置。曝光时间越长,进光量就越大,曝光时间越短,进光量就越少。
(5)RGB:RGB是一个三维向量(R,G,B)。其中,R、G、B分别代表在红(Red)、绿(Green)、蓝(Blue)三个颜色通道上的幅值。
(6)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。
下面对电子设备100的硬件结构进行介绍。请参阅图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)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
电子设备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在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等) 等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
压力传感器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电路不能对光源颜色的变化作出修正。因此,为了防止拍摄出的图像发生偏色的问题,常常需要将图像通过数码相机或手机内置的白平衡算法进行处理,以修正图像的色偏。
白平衡就是针对不同色温条件下,通过调整摄像机内部的色温对应的信号增益使拍摄出来的影像抵消偏色,更接近人眼的视觉***均值落在该设定范围内,则无需修正,如果偏离出该范围,则需要调整参数让其落在该范围内。这就是白平衡修正过程。例如,被调图像的光源的红、绿、蓝三色值(光源的RGB)为(25,50,150),该光源的红光、绿光以及蓝光的比例值为1:2:6。因此,该图像的颜色与人眼真实观察相比偏蓝。为了解决图像偏色的问题,将图像通过手机内的AWB算法进行处理,输出该图像光源的RGB_GAIN,使得ISP能够根据这个RGB_GAIN来调节图像的RGB值,从而纠正图像产生的色偏。其中,RGB_GAIN是3个增益值。例如,光源RGB_GAIN为(6,3,1),原光源的RGB为(25,50,150),将原光源与光源RGB_GAIN相乘,得到原光源调整后的RGB(150,150,150),即图像中白点的RGB相等,从而消除色偏。
解决图像的色偏问题,首先要准确计算图像光源的CCT,然后,根据CCT计算图像的RGB_GAIN,最后,再将图像每个像素的RGB都乘以所述RGB_GAIN,实现对图像整体颜色的调节,解决图像的色偏问题。图像光源的CCT是处理器基于光谱传感器的输出的光谱数据计算得到的。电子设备内置有光谱传感器,当用户使用电子设备拍照时,外部环境的光线通过摄像头进入光谱传感器,光谱传感器内的辐射敏感元件接收到光后会做出响应,并输出相关的数据,这个数据就是光谱传感器输出的光谱数据。目前,常用的光谱传感器有AS7341光谱传感器、SC4236光谱传感器等。下面,结合图2对电子设备通过光谱传感器输出的光谱数据计算图像的RGB_GAIN的过程进行说明。
图2是本申请实施例提供的一种计算图像光源的RGB_GAIN的***架构图,在该***架构图中包括AS7341光谱传感器和处理器。如图2所示,AS7341光谱传感器包括8个可见光通道(F1光通道~F8光通道)和一个Clear通道。其中,F1光通道~F8光通道分别对应一个滤光片(滤光片1~滤光片8)和一个辐射敏感元件(辐射敏感元件1~辐射敏感元件8),Clear通道对应滤光片9和辐射敏感元件9。每个滤光片设置了不同的波长范围,滤光片的波长范围与其对应的光通道的波长范围一致,只有在波长范围内的光才能透过滤光片,Clear通道对应的滤光片设置的波长范围相较于可见光通道对应的滤光片设置的波长范围较大。例如,滤光片的波长范围为300nm~350nm,那么,滤光片仅允许波长范围在300nm~350nm的光通过,对于在其他波长范围内的光,滤光片将其反射。
如图2所示,拍摄环境的光线通过入射孔径进入光谱传感器,分光器将入射进光谱传感器内的光线分成多道光束,再将这多道光束投射到滤光片上。由于每个滤光片设置的波长范围不同,因此,滤光片只允许光束内波长在滤光片设置的波长范围内的光透过,其它 波长的光则被滤光片反射。当光透过滤光片照射到辐射敏感元件后,辐射敏感元件作出响应,并将响应的幅值输出,这个响应的幅值为光通道输出的光谱数据。图3是本申请实施例提供的AS7341光谱传感器的响应函数图,由图3可知:F1光通道的波长范围约为375nm~455nm,F2光通道的波长范围约为410nm~470nm,F3光通道的波长范围约为440nm~500nm,F4光通道的波长范围约为470nm~550nm,F5光通道的波长范围约为500nm~590nm,F6光通道的波长范围约为550nm~610nm,F7光通道的波长范围约为590nm~680nm,F8光通道的波长范围约为610nm~710nm,Clear通道的波长范围约为350nm~1050nm。在光束中至少包括红、橙、黄、绿、蓝、靛、紫这七种可见光,其对应的波长范围分别为622nm~780nm、597nm~622nm、577nm~597nm、492nm~577nm、455nm~492nm、455nm~492nm、400nm~455nm。当光束照射到滤光片1时,由于滤光片1设置的波长范围为375nm~455nm(F1光通道的波长范围),因此,滤光片1只允许光束中的紫光通过。当紫光照射到辐射敏感元件1上时,辐射敏感元件基于F1光通道的响应函数输出一个激励值,这个激励值就是F1光通道输出的光谱数据1。同理,F2光通道~F8光通道、Clear通道分别输出光谱数据2~光谱数据9,并将光谱数据1~光谱数据9发送给处理器,实现了光信号到电信号的转化。
光谱传感器输出的光谱数据是一个裸数据,从图3可知,裸数据处在一个较小的幅值范围(裸数据的幅值范围为0~1)。裸数据的幅值太小,意味着裸数据中的噪声(包含暗电流噪声、模拟放大器噪声、数模转换噪声等)的相对比例就会增大,说明我们采集的大部分数据为无效数据,进而导致CCT的计算结果不准确,从而影响基于CCT计算得到的RGB_GAIN的准确性。因此,为了解决上述问题,电子设备在计算CCT之前,会给F1光通道~F8光通道输出的裸数据都乘以一个Analog_Gain(模拟增益)来放大裸数据,裸数据乘以模拟增益的效果相当于调整了ISO或者用了感光更好的胶卷所带来的效果,有利于提升光谱裸数据的信噪比。当采用模拟增益将光谱裸数据放大后,放大后的裸数据由于信噪比提升(噪声比例减小),包含了更多的有用信号,当处理器使用放大后的裸数据计算图像光源的CCT时,得到的CCT的准确度更高。
电子设备将光谱数据1~光谱数据8通过模拟增益放大后,将这8个放大的光谱数据进行插值计算得到多个更加精细光谱数据。其中,这多个更加精细的光谱数据是在原有的8个光谱数据的基础上进行更加精细地分类得到的。例如,光谱数据1是在波长范围为400nm~455nm输出的激励值,处理器将放大后的光谱数据1进行插值就可以光谱数据1细化成多个光谱数据,光谱数据细化的个数越多,处理器使用这些光谱数据计算出的CCT的准确度越高。例如,放大后的光谱数据1对应的波长范围为400nm~455nm,通过对放大后的光谱数据1进行插值计算,可能得到光谱数据11、光谱数据12、光谱数据13,其对应的波长范围分别为400nm~425nm、425nm~440nm、440nm~455nm。这样,将光谱数据1分成了三个波长范围的光谱数据,由波长范围为400nm~455nm的紫光的光谱数据细化为了波长范围为400nm~425nm的紫光的光谱数据、波长范围为425nm~440nm的紫光的光谱数据和波长范围为440nm~455nm的紫光的光谱数据。同理,可对放大后的光谱数据2~放大后的光谱数据8进行插值计算,得到多个光谱数据。这样,增加了光谱数据中的有用数据。然后,处理器将通过插值计算得到的光谱数据与人眼标准观察者曲线(XYZ曲线)进行积分, 得到图像光源在XYZ空间中的XYZ三维向量,这个三维向量与设备无关,并基于这个三维向量计算出图像光源的CCT。通过所述XYZ三维向量计算出的CCT与人眼视觉***的认知一致。
下面,结合图4A-图4D对调节光谱传感器曝光参数的算法的应用场景进行介绍。
图4A是电子设备100的拍照界面图,当前的拍摄环境为夜景,在该拍照界面中,包括拍照控件1011和预览控件1012。当电子设备100检测到针对拍照控件1011的输入操作后(例如,单击),电子设备100开始拍照,并显示如图4B所示的拍照处理界面。如图4B所示,拍照处理界面显示“拍照中,请持稳手机”的提示字样,当拍照完成后,电子设备100检测到针对预览控件1012的输入操作(例如,单击)后,显示如图4C所示的照片预览界面。
电子设备100在显示如图4B的拍照处理界面时,电子设备延长曝光时间,使得多光谱传感器能够获取夜景下的光谱数据,进而计算图像光源的RGB_GAIN值,并基于该RGB_GAIN修正图像的色偏。如图4D所示,在夜景下拍摄的未处理的图像,其整体颜色偏灰,而通过RGB_GAIN处理后的图像,其整体颜色有所改善。
请参见图5,图5是本申请实施例提供的一种动态调节光谱传感器曝光参数的流程示意图。下面,结合图5对该流程进行展开说明:
步骤S501:电子设备判断Clear值是否小于或等于第一阈值。
具体地,若判断为是,执行步骤S502,若判断为否,执行步骤S511。
所述Clear值为光谱传感器的Clear Channel输出的光谱数据,Clear通道对应的波长范围很广,例如,对于AS7341光谱传感器,其Clear通道的波长范围几乎包括了所有的可见光的波长范围。因此,可以通过Clear通道输出的Clear值来衡量拍摄环境的光强。当Clear值大于第一阈值,电子设备判断拍摄环境为强光环境。当Clear值小于或等于第一阈值,电子设备判断拍摄环境为弱光环境。其中,第一阈值可以基于历史数据得到,也可以基于实验数据分析得到,对于第一阈值的数值设定,本申请实施例对此不做限制。
由于不同光源的色温不同,因此,在不同拍摄环境下拍摄出来的图像存在偏色问题。为了解决上述问题,电子设备要对图像的白平衡进行调节。在拍照过程中,电子设备首先要通过摄像头内光谱传感器获取拍摄环境的光谱数据,然后,处理器基于该光谱数据计算得到拍摄环境的CCT,并根据CCT对图像的颜色进行调节。通过将拍摄环境分成强光环境和弱光环境,根据不同的拍摄环境动态调节光谱传感器的曝光参数(曝光时间和模拟增益),有利于获取高精确度的光谱数据,从而计算得到准确度极高的所述图像光源的CCT。
步骤S502~步骤S510为拍摄环境为弱光环境(Clear值小于或等于第一阈值)电子设备所执行的步骤。
步骤S502:电子设备判断光谱传感器当前的模拟增益是否达到第二阈值。
具体地,若判断为是,执行步骤S503,若判断为否,执行步骤S507。
所述第二阈值是模拟增益的上限阈值,所述第二阈值可以由历史数据所得,也可以由 实验数据可得到,也可以由经验值得到,本申请实施例对此不做限制。
光谱传感器的光通道接收到在其设置的波长范围之内的光之后,会输出一个响应,这个响应就是光通道输出的光谱数据。但是,光通道输出的响应是一个裸数据,这个裸数据的数值非常小,若处理器根据这些的裸数据计算图像光源的CCT,计算出的CCT的精确度不高,会导致图像出现偏色。为了解决上述问题,通常需要对光通道输出的光谱数据(裸数据)进行适当地放大,以提高处理器计算图像光源CCT的准确度,最常用的方式就是给裸数据乘以一个模拟增益。
但是,模拟增益的数值并不是越大越好,我们在对光通道输出的裸数据进行放大的同时,也放大了裸数据中的转换噪声,所述转换噪声为传感器将光信号转换为电信号的误差。若模拟增益过大,导致光谱数据中的噪声过大,进而影响CCT的准确度。若模拟增益过小,裸数据未被足够放大,影响裸数据的精确度,也会影响CCT的准确度。因此,当多谱传感器的模拟增益未达到上限阈值的时候,需要增大多谱传感器的模拟增益,以防止光谱裸数据的信噪比过小,而影响CCT的准确度。
步骤S503:电子设备计算第一曝光时间。
具体地,如步骤S502所述,若模拟增益过大会导致光谱数据中的噪声比例过大,从而影响图像光源CCT的准确度。因此,在弱光的拍摄环境下,若光谱传感器的模拟增益已经达到最高值,若要提高处理器计算图像光源CCT的准确度,可以适当延长光谱传感器的曝光时间。在弱光的拍摄环境下,延长曝光时间会增加多光谱传感器的进光量,光谱传感器能够捕获更加充足的光谱数据,从而使得部分光通道输出的光谱数据更加准确。当处理器使用这些经过模拟增益放大的光谱数据计算图像光源的CCT时,计算出来的CCT的准确度更高。
第一曝光时间为待调整曝光时间的目标值,第一曝光时间可以通过公式(1)得到,公式(1)如下所示:
Exop_1′=Expo*X   (1)
其中,所述Expo为光谱传感器当前的曝光时间,所述Exop′为第一曝光时间,所述X为大于1的第一增益系数。其中,X可以由经验值得到,也可以由历史数据得到,也可以由实验数据得到,本申请实施例对此不做限制。
步骤S504:电子设备判断第一曝光时间是否大于第三阈值。
具体地,若判断为是,执行步骤S505,若判断为否,执行步骤S506。
所述第三阈值为曝光时间的上限阈值,第三阈值可以是基于经验值得到的,也可以是基于历史数据得到的,还可以是基于实验数据得到的,本申请实施例对此不做限制。
如上述步骤S503所述,提高曝光时间会增加光谱传感器的进光量。但是,曝光时间过长,会导致光谱传感器的进光量过多,造成像素过曝,使得图像的整体颜色偏白。例如,正午对着太阳拍照,拍摄出来的太阳包括周边区域都是白色,这是因为光照信号太强,超过了光谱传感器响应的最大值,导致图像发白。曝光时间过短会导致光通道输出的光谱裸数据缺失或者不准确,进而影响图像光源的CCT的准确性。因此,曝光时间不应该超过设定的上限阈值和下限阈值。其中,曝光时间的上限阈值为第三阈值。
步骤S505:电子设备将光谱传感器的曝光时间设置为第三阈值。
具体地,若第一曝光时间超过预设的曝光时间的上限阈值(第三阈值),电子设备若将光谱传感器的曝光时间设置为第一曝光时间会导致图像“过曝”,造成图像整体颜色偏白。因此,电子设备将曝光时间设置为曝光时间的上限阈值(第三阈值)。这样,在增加光谱传感器进光量的同时,又不产生因进光量过多而导致图像发生过曝,从而使得图像整体颜色偏白的问题。
步骤S506:电子设备将光谱传感器的曝光时间设置为第一曝光时间。
具体地,当第一曝光时间未超过第三阈值,电子设备将其光谱传感器的曝光时间设置为第一曝光时间。这样,能够合理地增加光谱传感器的进光量,使得光通道输出的光谱裸数据更加准确、全面。当处理器使用这些经过模拟增益放大的裸数据计算图像光源的CCT时,计算出的CCT的准确度极高,从而解决图像的色偏问题。
步骤S507:电子设备计算第一模拟增益。
具体地,在上述步骤S502中,在光谱传感器的模拟增益未达到其上限阈值(第二阈值)的情况下,电子设备在弱光条件下可以适当增大光谱传感器的模拟增益的数值,将光谱传感器的光通道输出的光谱裸数据放大到合理的数值区间内,提高这些光谱裸数据的信噪比。当处理器使用这些经过模拟增益放大的裸数据计算图像的光源CCT时,计算出的CCT准确度较高。
第一模拟增益为待调整的模拟增益的目标值,第一模拟增益可以通过公式(2)得到,公式(2)如下所示:
Gain_1′=Gain*Y   (2)
其中,所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数。其中,Y可以由经验值得到,也可以由历史数据得到,也可以由实验数据得到,本申请实施例对此不做限制。
步骤S508:电子设备判断第一模拟增益是否大于第二阈值。
具体地,若判断为是,执行步骤S509,若判断为否,执行步骤S510。
如上述步骤S502所述,模拟增益的数值并不是越大越好,我们在对光通道输出的光谱裸数据进行放大的同时,也放大了光谱裸数据中的转换噪声,所述转换噪声为传感器将光信号转换为电信号的误差。若模拟增益过大,通过模拟增益放大后的裸数据,其信噪比反而会降低,从而影响图像光源的CCT的准确度。
步骤S509:电子设备将光谱传感器的模拟增益设置为第二阈值。
具体地,若第一模拟增益大于模拟增益的上限阈值(第二阈值),会导致光谱裸数据的信噪比降低,增加无用信号的比例,进而影响处理器基于放大后的光谱裸数据计算的CCT的准确度。因此,电子设备将模拟增益设置为第二阈值,在放大了光谱裸数据的同时,在一定程度上提高裸数据的信噪比,保证处理器计算图像光源的CCT的准确性。
可选地,在拍摄环境为弱光环境的情况下,电子设备在调节模拟增益的同时也可以延长电子设备相机的曝光时间。若电子设备当前的曝光时间未超过第三阈值,电子设备可以基于公式(1)计算第一曝光时间。在第一曝光时间超过第三阈值的情况下,将电子设备相机的曝光时间设置为第三阈值,在第一曝光时间未超过第三阈值的情况下,将电子设备相机的曝光时间设置为第一曝光时间。
步骤S510:电子设备将光谱传感器的模拟增益设置为第一模拟增益。
具体地,在拍摄环境为弱光环境下,若第一模拟增益小于第二阈值,电子设备将相机的模拟增益设置为第一模拟增益。这样,电子设备能够基于第一模拟增益将光通道输出的裸数据放大到合理的数值范围内,处理器能够基于这些放大的裸数据准确地计算出图像光源的CCT,从而使得ISP对图像白平衡的调节效果更好。
可选地,在拍摄环境为弱光环境的情况下,电子设备在调节模拟增益的同时也可以延长电子设备相机的曝光时间。若电子设备当前的曝光时间未超过第三阈值,电子设备可以基于公式(1)计算第一曝光时间。在第一曝光时间超过第三阈值的情况下,将电子设备相机的曝光时间设置为第三阈值,在第一曝光时间未超过第三阈值的情况下,将电子设备相机的曝光时间设置为第一曝光时间。
步骤S511~步骤S519为拍摄环境为强光环境(Clear值大于第一阈值)电子设备所执行的步骤。
步骤S511:电子设备判断光谱传感器当前的曝光时间是否达到第四阈值。
具体地,若判断为是,则说明光谱传感器当前的曝光时间为曝光时间的下限阈值,执行步骤S516,若判断为否,则说明光谱传感器当前的曝光时间大于曝光时间的下限阈值,执行步骤S512。其中,所述第四阈值为曝光时间的下限阈值,可以由历史数据所得,可以由实验数据可得到,也可以由经验值得到,本申请实施例对此不做限制。
在强光环境下,即使曝光时间很短,光谱传感器也会有许多进光量,当光谱传感器的进光量过多时,会导致图像像素过曝,从而造成图像的整体颜色偏白。因此,电子设备需要判断其相机当前的曝光时间是否达到曝光时间的下限阈值(第四阈值)。若未达到下限阈值,则需要调整光谱传感器的曝光时间。
步骤S512:电子设备计算第二曝光时间。
具体地,如步骤S511所述,在拍摄环境为强光环境的情况下,需要缩短曝光时间,减少光谱传感器的进光量。第二曝光时间为待调整曝光时间的目标值,第二曝光时间可以通过公式(3)得到,公式(3)如下所示:
Exop_2′=Expo*X′   (3)
其中,所述Expo为光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间。X′可以基于经验值得到,也可以基于历史数据得到,还可以基于实验数据得到,本申请实施例对此不做限制。
步骤S513:电子设备判断第二曝光时间是否小于第四阈值。
具体地,若判断为否,执行步骤S514,若判断为是,执行步骤S515。
步骤S514:电子设备将光谱传感器的曝光时间设置为第二曝光时间。
具体地,若第二曝光时间大于第四阈值,电子设备将其相机的曝光时间设置为第二曝光时间,在强光环境下合理地减少相机的曝光时间,可以在避免因曝光时间过长导致图像整体颜色偏白的基础上,提高光通道输出的光谱裸数据的准确性,进而提高处理器计算图像光源的CCT的准确度。
可选地,在拍摄环境为强光环境的情况下,电子设备在调节曝光时间的同时也可以减 小电子设备的模拟增益。若电子设备当前的模拟增益大于第五阈值(模拟增益的下限阈值),电子设备可以基于公式(4)计算第二模拟增益。在第二模拟增益超过第五阈值的情况下,将电子设备相机的曝光时间设置为第二模拟增益,在第二模拟增益未超过第五阈值的情况下,将电子设备相机的模拟增益设置为第五阈值。
步骤S515:电子设备将光谱传感器的曝光时间设置为第四阈值。
具体地,如上述步骤S511和步骤S514所述,在强光环境下,合理的减少相机的曝光时间,可以在避免因曝光时间过长导致图像整体颜色偏白的基础上,提高光通道输出的光谱裸数据的准确性,进而提高处理器计算图像光源的CCT的准确度。但是,当曝光时间过短(低于第四阈值)会导致光通道输出的光谱裸数据缺失或者不准确,进而影响图像光源的CCT的准确性。若在第二曝光时间小于第四阈值的情况下将电子设备相机的曝光时间设置为第二曝光时间,会影响图像光源的CCT的准确性。因此,当第二曝光时间小于第四阈值时,电子设备将其相机的曝光时间设置为第四阈值。
可选地,在拍摄环境为强光环境的情况下,电子设备在调节曝光时间的同时也可以减小电子设备的模拟增益。若电子设备当前的模拟增益大于第五阈值(模拟增益的下限阈值),电子设备可以基于公式(4)计算第二模拟增益。在第二模拟增益超过第五阈值的情况下,将电子设备相机的曝光时间设置为第二模拟增益,在第二模拟增益未超过第五阈值的情况下,将电子设备相机的模拟增益设置为第五阈值。
步骤S516:电子设备计算第二模拟增益。
在上述步骤S511中,由于光谱传感器当前的曝光时间为第四阈值(曝光时间的下限阈值),在强光环境下为了提高处理器计算图像光源的CCT的准确度,可以减小模拟增益。第二模拟增益为在强光环境下待调整模拟增益的目标值,第二模拟增益可以通过公式(4)得到,公式(4)如下所示:
Gain_2′=Gain*Y′   (4)
其中,所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数。其中,Y′可以由经验值得到,也可以由历史数据得到,也可以由实验数据得到,本申请实施例对此不做限制。这样,在强光条件下减小模拟增益有利于控制光谱数据(模拟信号),从而在将光谱数据转换为数字信号后,可以将数字信号控制在合理地数值范围内,使得最后生成的图像不至于过曝,从而引起图像颜色整体偏白。
步骤S517:电子设备判断第二模拟增益是否大于第五阈值。
具体地,若判断为是,执行步骤S518,若判断为否,执行步骤S519。
所述第五阈值为模拟增益的下限阈值,第五阈值可以由经验值得到,也可以由历史数据得到,还可以由实验数据得到,本申请实施例对此不做限制。
步骤S518:电子设备将光谱传感器的模拟增益设置为第五阈值。
具体地,在强光条件下,若第二模拟增益小于模拟增益的下限阈值(第五阈值),不能将光谱传感器光通道输出的光谱裸数据放大到合理区间,导致放大后的裸数据精确度不高,从而影响图像光源的CCT的准确度。为了解决上述问题,在第二模拟增益小于第五阈值的情况下,将模拟增益设置为第五阈值,以保证光通道输出的裸数据能够通过模拟增益被放大到合理的数值区间,保证放大后的光谱数据的精确度。
步骤S519:电子设备将光谱传感器的模拟增益设置为第二模拟增益。
具体地,在拍摄环境为强光环境下,若第二模拟增益大于第五阈值(模拟增益的下限阈值),电子设备将模拟增益设置为第二模拟增益,使得电子设备能够基于第二模拟增益将光通道输出的裸数据放大到合理的数值范围内,处理器能够基于这些放大的裸数据准确地计算出图像光源的CCT,从而使得ISP对图像白平衡的调节效果更好。
本申请实施例,电子设备根据光谱传感器的Clear Channel输出的光谱数据,判断当前拍摄环境为强光环境还是弱光环境。在当前拍摄环境为弱光环境的情况下,电子设备根据相关公式延长电子设备相机的曝光时间或增大电子设备的模拟增益。在当前拍摄环境为强光环境的情况下,电子设备根据相关公式来缩短电子设备相机的曝光时间和电子设备的模拟增益。电子设备通过上述方式,在不同拍摄环境下(强光环境/弱光环境)动态地调整相机的曝光时间和模拟增益,有利于光谱传感器在不同拍摄环境下输出准确、全面的光谱数据,从而使得处理器能够基于这些光谱数据准确地计算出图像光源的CCT,从而准确地调节图像的白平衡。
请参见图6,图6是本申请实施例提供的另一种动态调节光谱传感器曝光参数的流程示意图。下面,结合图6对该流程进行展开说明:
步骤S601:电子设备判断Clear值是否小于或等于第一阈值。
具体地,步骤S601请参见步骤S501的相关描述,本申请实施例在此不再赘述。若判断为是,执行步骤S602,若判断为否,执行步骤S611。
步骤S602~步骤S610为拍摄环境为弱光环境(Clear值小于或等于第一阈值)电子设备所执行的步骤。
步骤S602:电子设备判断光谱传感器当前的曝光时间是否达到第三阈值。
具体地,若判断为是,则执行步骤S603,若判断为否,则执行步骤S607。
步骤S603:电子设备计算第一模拟增益。
具体地,电子设备计算第一模拟增益的过程请参考步骤S507,本申请实施例在此不再赘述。
步骤S604:电子设备判断第一模拟增益是否大于第二阈值。
具体地,若判断为是,执行步骤S605,若判断为否,执行步骤S606。
电子设备判断第一模拟增益是否大于第二阈值的相关描述请参考步骤S508,本申请实施例在此不再赘述。
步骤S605:电子设备将光谱传感器的模拟增益设置为第二阈值。
步骤S606:电子设备将光谱传感器的模拟增益设置为第一模拟增益。
步骤S605~步骤S606的相关描述请参考步骤S509~步骤S510,本申请实施例在此不再赘述。
步骤S607:电子设备计算第一曝光时间。
具体地,电子设备计算第一曝光时间的方法,请参考步骤S503,本申请实施例在此不再赘述。
步骤S608:电子设备判断第一曝光时间是否大于第三阈值。
具体地,若判断为是,执行步骤S609,若判断为否,执行步骤S610。
电子设备判断第一曝光时间是否大于第三阈值的相关描述请参考步骤S504,本申请实施例在此不再赘述。
步骤S609:电子设备将光谱传感器的曝光时间设置为第三阈值。
步骤S610:电子设备将光谱传感器的曝光时间设置为第一曝光时间。
步骤S609~步骤S610的相关描述请参考步骤S505~步骤S506,本申请实施例在此不再赘述。
步骤S611~步骤S619为拍摄环境为强光环境(Clear值大于第一阈值)电子设备所执行的步骤。
步骤S611:电子设备判断光谱传感器当前的模拟增益是否达到第五阈值。
具体地,若判断为否,则说明光谱传感器当前的模拟增益大于第五阈值,执行步骤S612,若判断为是,执行步骤S616。
步骤S612:电子设备计算第二模拟增益。
具体地,电子设备计算光谱传感器的第二模拟增益的方法,请参考步骤S516,本申请实施例在此不再赘述。
步骤S613:电子设备判断第二模拟增益是否大于第五阈值。
具体地,若判断为是,执行步骤S614,若判断为否,执行步骤S615.
电子设备判断第二模拟增益是否大于第五阈值的相关描述请参考步骤S517,本申请实施例在此不再赘述。
步骤S614:电子设备将光谱传感器的模拟增益设置为第五阈值。
步骤S615:电子设备将光谱传感器的模拟增益设置为第二模拟增益。
步骤S614~步骤S615的相关描述请参考步骤S518~步骤S519,本申请实施例在此不再赘述。
步骤S616:电子设备计算的第二曝光时间。
具体地,电子设备计算光谱传感器的第二曝光时间的方法请参考步骤S512,本申请实施例在此不再赘述。
步骤S617:电子设备判断第二曝光时间是否小于第四阈值。
具体地,若判断为是,执行步骤S618,若判断为否,执行步骤S619。
电子设备判断第二曝光时间是否小于第四阈值的相关描述,请参考步骤S513。
步骤S618:电子设备将光谱传感器的曝光时间设置为第二曝光时间。
步骤S619:电子设备将光谱传感器的曝光时间设置为第四阈值。
步骤S618~步骤S619的相关描述请参考步骤S514~步骤S515,本申请实施例在此不再赘述。
本申请实施例,电子设备根据光谱传感器的Clear Channel输出的光谱数据,判断当前拍摄环境为强光环境还是弱光环境。在当前拍摄环境为弱光环境的情况下,电子设备根据相关公式延长电子设备相机的曝光时间或增大电子设备的模拟增益。在当前拍摄环境为强 光环境的情况下,电子设备根据相关公式来缩短电子设备相机的曝光时间和电子设备的模拟增益。电子设备通过上述方式,在不同拍摄环境下(强光环境/弱光环境)动态地调整相机的曝光时间和模拟增益,有利于光谱传感器在不同拍摄环境下输出准确、全面的光谱数据,从而使得处理器能够基于这些光谱数据准确地计算出图像光源的CCT,从而准确地调节图像的白平衡。
请参见图7,图7是本申请实施例提供的另一种动态调节光谱传感器曝光参数的流程示意图。下面,结合图7对该流程进行展开说明:
步骤S701:电子设备判断Clear值是否小于或等于第一阈值。
具体地,步骤S701请参见步骤S501的相关描述,本申请实施例在此不再赘述。若判断为是,执行步骤S702,若判断为否,执行步骤S711。
电子设备判断Clear值是否小于或等于第一阈值请参考步骤S501,本申请实施例在此不再赘述。
步骤S702~步骤S710为拍摄环境为弱光环境(Clear值小于或等于第一阈值)电子设备所执行的步骤。
步骤S702:电子设备判断光谱传感器当前的模拟增益是否达到第二阈值。
具体地,若判断为是,执行步骤S703,若判断为否,执行步骤S707。
电子设备判断光谱传感器的模拟增益是否达到第二阈值的相关叙述请参考步骤S502,本申请实施例在此不再赘述。
步骤S703:电子设备计算第一曝光时间。
具体地,电子设备计算第一曝光时间的方法请参考步骤S503,本申请实施例在此不再赘述。
步骤S704:电子设备判断第一曝光时间是否大于第三阈值。
具体地,若判断为是,执行步骤S705,若判断为否,执行步骤S706。
步骤S705:电子设备将光谱传感器的曝光时间设置为第三阈值。
步骤S706:电子设备将光谱传感器的曝光时间设置为第一曝光时间。
步骤S705~步骤S706请参考步骤S505~步骤S506的相关叙述,本申请实施例在此不再赘述。
步骤S707:电子设备计算第一模拟增益。
具体地,电子设备计算第一模拟增益的方法,请参考步骤S507,本申请实施例在此不再赘述。
步骤S708:电子设备判断第一模拟增益是否大于第二阈值。
具体地,若判断为是,执行步骤S709,若判断为否,执行步骤S710。
电子设备判断第一模拟增益是否大于第二阈值的相关叙述,请参考步骤S508,本申请实施例在此不再赘述。
步骤S709:电子设备将光谱传感器的模拟增益设置为第二阈值。
步骤S710:电子设备将光谱传感器的模拟增益设置为第一模拟增益。
具体地,步骤S709~步骤S710请参考步骤S509~步骤S510的相关叙述,本申请实施例在此不再赘述。
步骤S711~步骤S719为拍摄环境为强光环境(Clear值大于第一阈值)电子设备所执行的步骤。
步骤S711:电子设备判断光谱传感器当前的模拟增益是否达到第五阈值。
具体地,若判断为否,则说明光谱传感器当前的模拟增益大于第五阈值,执行步骤S712,若判断为是,执行步骤S716。
步骤S712:电子设备计算第二模拟增益。
具体地,电子设备计算第二模拟增益的方法,请参考步骤S516,本申请实施例在此不再赘述。
步骤S713:电子设备判断第二模拟增益是否大于第五阈值。
具体地,若判断为是,执行步骤S614,若判断为否,执行步骤S615.
电子设备判断第二模拟增益是否大于第五阈值的相关描述请参考步骤S517,本申请实施例在此不再赘述。
步骤S714:电子设备将光谱传感器的模拟增益设置为第五阈值。
步骤S715:电子设备将光谱传感器的模拟增益设置为第二模拟增益。
步骤S714~步骤S715的相关描述请参考步骤S518~步骤S519,本申请实施例在此不再赘述。
步骤S716:电子设备计算第二曝光时间。
具体地,电子设备计算第二曝光时间的方法请参考步骤S512,本申请实施例在此不再赘述。
步骤S717:电子设备判断第二曝光时间是否小于第四阈值。
具体地,若判断为是,执行步骤S618,若判断为否,执行步骤S619。
电子设备判断第二曝光时间是否小于第四阈值的相关描述,请参考步骤S513。
步骤S718:电子设备将光谱传感器的曝光时间设置为第二曝光时间。
步骤S719:电子设备将光谱传感器的曝光时间设置为第四阈值。
步骤S718~步骤S719的相关描述请参考步骤S514~步骤S515,本申请实施例在此不再赘述。
本申请实施例,电子设备根据光谱传感器的Clear Channel输出的光谱数据,判断当前拍摄环境为强光环境还是弱光环境。在当前拍摄环境为弱光环境的情况下,电子设备根据相关公式延长电子设备相机的曝光时间或增大电子设备的模拟增益。在当前拍摄环境为强光环境的情况下,电子设备根据相关公式来缩短电子设备相机的曝光时间和电子设备的模拟增益。电子设备通过上述方式,在不同拍摄环境下(强光环境/弱光环境)动态地调整相机的曝光时间和模拟增益,有利于光谱传感器在不同拍摄环境下输出准确、全面的光谱数据,从而使得处理器能够基于这些光谱数据准确地计算出图像光源的CCT,从而准确地调节图像的白平衡。
请参见图8,图8是本申请实施例提供的另一种动态调节光谱传感器曝光参数的流程示意图。下面,结合图8对该流程进行展开说明:
步骤S801:电子设备判断Clear值是否小于或等于第一阈值。
具体地,步骤S801请参见步骤S501的相关描述,本申请实施例在此不再赘述。若判断为是,执行步骤S802,若判断为否,执行步骤S811。
电子设备判断Clear值是否小于或等于第一阈值请参考步骤S501,本申请实施例在此不再赘述。
步骤S802~步骤S810为拍摄环境为弱光环境(Clear值小于或等于第一阈值)电子设备所执行的步骤。
步骤S802:电子设备判断光谱传感器当前的曝光时间是否达到第三阈值。
具体地,若判断为是,则执行步骤S803,若判断为否,则执行步骤S807。
步骤S803:电子设备计算第一模拟增益。
具体地,电子设备计算第一模拟增益的过程请参考步骤S807,本申请实施例在此不再赘述。
步骤S804:电子设备判断第一模拟增益是否大于第二阈值。
具体地,若判断为是,执行步骤S805,若判断为否,执行步骤S806。
电子设备判断第一模拟增益是否大于第二阈值的相关描述请参考步骤S508,本申请实施例在此不再赘述。
步骤S805:电子设备将光谱传感器的模拟增益设置为第二阈值。
步骤S806:电子设备将光谱传感器的模拟增益设置为第一模拟增益。
步骤S805~步骤S806的相关描述请参考步骤S509~步骤S510,本申请实施例在此不再赘述。
步骤S807:电子设备计算第一曝光时间。
具体地,电子设备计算第一曝光时间的方法,请参考步骤S503,本申请实施例在此不再赘述。
步骤S808:电子设备判断第一曝光时间是否大于第三阈值。
具体地,若判断为是,执行步骤S809,若判断为否,执行步骤S810。
电子设备判断第一曝光时间是否大于第三阈值的相关描述请参考步骤S504,本申请实施例在此不再赘述。
步骤S809:电子设备将光谱传感器的曝光时间设置为第三阈值。
步骤S810:电子设备将光谱传感器的曝光时间设置为第一曝光时间。
步骤S809~步骤S810的相关描述请参考步骤S505~步骤S506,本申请实施例在此不再赘述。
步骤S811~步骤S819为拍摄环境为强光环境(Clear值大于第一阈值)电子设备所执行的步骤。
步骤S811:电子设备判断光谱传感器当前的曝光时间是否达到第四阈值。
具体地,若判断为是,则说明光谱传感器当前的曝光时间为曝光时间的下限阈值,执行步骤S816,若判断为否,则说明光谱传感器当前的曝光时间大于曝光时间的下限阈值,执行步骤S812。
步骤S811可以参考步骤S511的相关叙述,本申请实施例对此不再赘述。
步骤S812:电子设备计算第二曝光时间。
具体地,电子设备计算第二曝光时间的方法和过程请参考步骤S512,本申请实施例在此不再赘述。
步骤S813:电子设备判断第二曝光时间是否小于第四阈值。
具体地,若判断为否,执行步骤S814,若判断为是,执行步骤S815。
步骤S814:电子设备将光谱传感器的曝光时间设置为第二曝光时间。
步骤S815:电子设备将光谱传感器的曝光时间设置为第四阈值。
具体地,步骤S814~步骤S815请参考步骤S514~步骤S515的相关叙述,本申请实施例对此不再赘述。
步骤S816:电子设备计算第二模拟增益。
具体地,电子设备计算第二模拟增益的相关方法和过程请参考步骤S516,本申请实施例在此不再赘述。
步骤S817:电子设备判断第二模拟增益是否大于第五阈值。
具体地,若判断为是,执行步骤S818,若判断为否,执行步骤S819。
电子设备判断第二模拟增益是否大于第五阈值的相关叙述请参考步骤S517,本申请实施例在此不再赘述。
步骤S818:电子设备将光谱传感器的模拟增益设置为第五阈值。
步骤S819:电子设备将光谱传感器的模拟增益设置为第二模拟增益。
步骤S818~步骤S819请参见步骤S518~步骤S519的相关叙述,本申请实施例在此不再赘述。
本申请实施例,电子设备根据光谱传感器的Clear Channel输出的光谱数据,判断当前拍摄环境为强光环境还是弱光环境。在当前拍摄环境为弱光环境的情况下,电子设备根据相关公式延长电子设备相机的曝光时间或增大电子设备的模拟增益。在当前拍摄环境为强光环境的情况下,电子设备根据相关公式来缩短电子设备相机的曝光时间和电子设备的模拟增益。电子设备通过上述方式,在不同拍摄环境下(强光环境/弱光环境)动态地调整相机的曝光时间和模拟增益,有利于光谱传感器在不同拍摄环境下输出准确、全面的光谱数据,从而使得处理器能够基于这些光谱数据准确地计算出图像光源的CCT,从而准确地调节图像的白平衡。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或 者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (23)

  1. 一种动态调节光谱传感器曝光参数的方法,其特征在于,包括:
    判断Clear值是否小于或等于第一阈值;
    若所述Clear值小于或等于第一阈值,判断光谱传感器的模拟增益是否达到第二阈值;所述第二阈值为所述光谱传感器的模拟增益的上限阈值;
    若判断为是,延长所述光谱传感器的曝光时间;
    若判断为否,增大所述光谱传感器的模拟增益;
    若所述Clear值大于所述第一阈值,判断所述光谱传感器的曝光时间是否达到第四阈值;所述第四阈值为所述光谱传感器曝光时间的下限阈值;
    若判断为是,减小所述光谱传感器的模拟增益;
    若判断为否,缩短所述光谱传感器的曝光时间;
    其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
  2. 如权利要求1所述的方法,其特征在于,所述延长所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;
    判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
  3. 如权利要求1所述的方法,其特征在于,所述增大所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;
    判断所述第一模拟增益是否大于所述第二阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
  4. 如权利要求1所述的方法,其特征在于,所述减小所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;
    判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
  5. 如权利要求1所述的方法,其特征在于,所述缩短所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;
    判断所述第二曝光时间是否小于所述第四阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
  6. 一种动态调节光谱传感器曝光参数的方法,其特征在于,包括:
    判断Clear值是否小于或等于第一阈值;若所述Clear值小于或等于第一阈值,判断光谱传感器的曝光时间是否达到第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;
    若判断为是,增大所述光谱传感器的模拟增益;
    若判断为否,延长所述光谱传感器的曝光时间;
    若所述Clear值大于所述第一阈值,判断所述光谱传感器的模拟增益是否达到第五阈值,所述第五阈值为模拟增益的下限阈值;
    若判断为是,缩短所述光谱传感器的曝光时间;
    若判断为否,缩小所述光谱传感器的模拟增益;
    其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
  7. 如权利要求6所述的方法,其特征在于,所述延长所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;
    判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
  8. 如权利要求6所述的方法,其特征在于,所述增大所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;
    判断所述第一模拟增益是否大于所述第二阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
  9. 如权利要求6所述的方法,其特征在于,所述减小所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;
    判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
  10. 如权利要求6所述的方法,其特征在于,所述缩短所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;
    判断所述第二曝光时间是否小于所述第四阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
  11. 一种动态调节光谱传感器曝光参数的方法,其特征在于,包括:
    判断Clear值是否小于或等于第一阈值;
    若所述Clear值小于或等于第一阈值,判断光谱传感器的模拟增益是否达到第二阈值;所述第二阈值为所述光谱传感器的模拟增益的上限阈值;
    若判断为是,延长所述光谱传感器的曝光时间;
    若判断为否,增大所述光谱传感器的模拟增益;
    若所述Clear值大于所述第一阈值,判断所述光谱传感器的模拟增益是否达到第五阈值;所述第五阈值为所述光谱传感器模拟增益的下限阈值;
    若判断为是,缩短所述光谱传感器的曝光时间;
    若判断为否,减小所述光谱传感器的模拟增益;
    其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
  12. 如权利要求11所述的方法,其特征在于,所述延长所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;
    判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时 间的上限阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
  13. 如权利要求11所述的方法,其特征在于,所述增大所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;
    判断所述第一模拟增益是否大于所述第二阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
  14. 如权利要求11所述的方法,其特征在于,所述减小所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;
    判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
  15. 如权利要求11所述的方法,其特征在于,所述缩短所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;
    判断所述第二曝光时间是否小于所述第四阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
  16. 一种动态调节光谱传感器曝光参数的方法,其特征在于,包括:
    判断Clear值是否小于或等于第一阈值;
    若所述Clear值小于或等于第一阈值,判断光谱传感器的曝光时间是否达到第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;
    若判断为是,增大所述光谱传感器的模拟增益;
    若判断为否,延长所述光谱传感器的曝光时间;
    若所述Clear值大于所述第一阈值,判断所述光谱传感器的曝光时间是否达到第四阈值,所述第四阈值为所述光谱传感器曝光时间的下限阈值;
    若判断为是,缩小所述光谱传感器的模拟增益;
    若判断为否,缩短所述光谱传感器的曝光时间;
    其中,所述光谱传感器的曝光时间和所述光谱传感器的模拟增益为所述光谱传感器的曝光参数。
  17. 如权利要求16所述的方法,其特征在于,所述延长所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_1′=Expo*X计算所述光谱传感器的第一曝光时间;所述Expo为光谱传感器当前的曝光时间,所述Exop′为所述第一曝光时间,所述X为大于1的第一增益系数;
    判断所述第一曝光时间是否大于第三阈值,所述第三阈值为所述光谱传感器的曝光时间的上限阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第三阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第一曝光时间。
  18. 如权利要求16所述的方法,其特征在于,所述增大所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_1′=Gain*Y计算所述光谱传感器的第一模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_1′为第一模拟增益,所述Y为大于1的第二增益系数;
    判断所述第一模拟增益是否大于所述第二阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第二阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第一模拟增益。
  19. 如权利要求16所述的方法,其特征在于,所述减小所述光谱传感器的模拟增益,具体包括:
    根据公式Gain_2′=Gain*Y′计算所述光谱传感器的第二模拟增益;所述Gain为光谱传感器当前的模拟增益,所述Gain_2′为第二模拟增益,所述Y′为小于1的第四增益系数;
    判断所述第二模拟增益是否小于所述第五阈值;所述第五阈值为所述光谱传感器的模拟增益的下限阈值;
    若判断为是,将所述光谱传感器的模拟增益设置为所述第五阈值;
    若判断为否,将所述光谱传感器的模拟增益设置为所述第二模拟增益。
  20. 如权利要求16所述的方法,其特征在于,所述缩短所述光谱传感器的曝光时间,具体包括:
    根据公式Exop_2′=Expo*X′计算所述光谱传感器的第二曝光时间;所述Expo为所述光谱传感器当前的曝光时间,所述X′为小于1的第三增益系数,所述Exop_2′为第二曝光时间;
    判断所述第二曝光时间是否小于所述第四阈值;
    若判断为是,将所述光谱传感器的曝光时间设置为所述第四阈值;
    若判断为否,将所述光谱传感器的曝光时间设置为所述第二曝光时间。
  21. 一种电子设备,其特征在于,所述电子设备包括:通信装置、显示装置、存储器以及耦合于所述存储器的处理器,多个应用程序,以及一个或多个程序;所述存储器中存储有计算机可执行指令,所述显示装置用于显示图像,所述处理器执行所述指令时使得所述电子设备实现如权利要求1-20中任一项所述的方法。
  22. 一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序包括可执行指令,所述可执行指令当被处理器执行时使该处理器执行如权利要求1-20中任一项所提供的方法对应的操作。
  23. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1-20中任一项所述的方法。
PCT/CN2022/084926 2021-06-26 2022-04-01 一种动态调节光谱传感器曝光参数的方法及电子设备 WO2022267612A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/262,101 US20240080568A1 (en) 2021-06-26 2022-04-01 Electronic Device and Method for Dynamically Adjusting Exposure Parameter of Spectral Sensor
EP22827115.1A EP4254939A1 (en) 2021-06-26 2022-04-01 Method for dynamically adjusting exposure parameter of spectral sensor, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110715278.7 2021-06-26
CN202110715278.7A CN115529420A (zh) 2021-06-26 2021-06-26 一种动态调节光谱传感器曝光参数的方法及电子设备

Publications (1)

Publication Number Publication Date
WO2022267612A1 true WO2022267612A1 (zh) 2022-12-29

Family

ID=84545200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084926 WO2022267612A1 (zh) 2021-06-26 2022-04-01 一种动态调节光谱传感器曝光参数的方法及电子设备

Country Status (4)

Country Link
US (1) US20240080568A1 (zh)
EP (1) EP4254939A1 (zh)
CN (1) CN115529420A (zh)
WO (1) WO2022267612A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104270575A (zh) * 2014-10-22 2015-01-07 中国科学院光电研究院 成像光谱仪自适应调整曝光时间的方法及装置
CN106768323A (zh) * 2017-01-05 2017-05-31 浙江大学 一种适用于寒冷环境下的光谱仪自适应控制方法
CN109561260A (zh) * 2018-12-28 2019-04-02 深慧视(深圳)科技有限公司 一种自动曝光控制方法
WO2021037934A1 (en) * 2019-08-28 2021-03-04 ams Sensors Germany GmbH Systems for characterizing ambient illumination
CN112585450A (zh) * 2018-08-28 2021-03-30 索尼公司 光谱成像装置和荧光观察装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100361020C (zh) * 2003-12-05 2008-01-09 北京中星微电子有限公司 一种数字亮度增益与曝光时间协同工作的自动曝光方法
CA2779984A1 (en) * 2011-06-24 2012-12-24 Research In Motion Limited Apparatus, and associated method, for facilitating automatic-exposure at camera device
CN102291538A (zh) * 2011-08-17 2011-12-21 浙江博视电子科技股份有限公司 摄像机的自动曝光方法及控制装置
CN104754240B (zh) * 2015-04-15 2017-10-27 中国电子科技集团公司第四十四研究所 Cmos图像传感器自动曝光方法及装置
EP3576494A1 (en) * 2017-01-25 2019-12-04 Ledmotive Technologies, S.L. Controlling lighting devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104270575A (zh) * 2014-10-22 2015-01-07 中国科学院光电研究院 成像光谱仪自适应调整曝光时间的方法及装置
CN106768323A (zh) * 2017-01-05 2017-05-31 浙江大学 一种适用于寒冷环境下的光谱仪自适应控制方法
CN112585450A (zh) * 2018-08-28 2021-03-30 索尼公司 光谱成像装置和荧光观察装置
CN109561260A (zh) * 2018-12-28 2019-04-02 深慧视(深圳)科技有限公司 一种自动曝光控制方法
WO2021037934A1 (en) * 2019-08-28 2021-03-04 ams Sensors Germany GmbH Systems for characterizing ambient illumination

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "AS7341 11-Channel Multi-Spectral Digital Sensor", AM5 DATASHEET-DS000504 V3-00, AMS OSRAM, XP009542102, Retrieved from the Internet <URL:https://ams.com/documents/20143/36005/AS7341_DS000504_3-00.pdf/5eca1f59-46e2-6fc5-daf5-d71ad90c9b2b> *
ANONYMOUS: "Spectral Sensor Calibration Methods AS7341 EVK Evaluation Kit", AM5 APPLICATION NOTE - AN000633 V2-00, AMS OSRAM, XP009542103, Retrieved from the Internet <URL:https://ams.com/documents/20143/36005/AS7341_AN000633_2-00.pdf> *

Also Published As

Publication number Publication date
EP4254939A1 (en) 2023-10-04
CN115529420A (zh) 2022-12-27
US20240080568A1 (en) 2024-03-07

Similar Documents

Publication Publication Date Title
US9426437B2 (en) Image processor performing noise reduction processing, imaging apparatus equipped with the same, and image processing method for performing noise reduction processing
KR102318013B1 (ko) 복수의 이미지들을 합성하는 전자장치 및 방법
EP3609175B1 (en) Apparatus and method for generating moving image data including multiple section images in electronic device
US20210084205A1 (en) Auto exposure for spherical images
US11889202B2 (en) Image processing apparatus, image processing method, and storage medium
WO2023279862A1 (zh) 图像处理方法、装置和电子设备
WO2023040725A1 (zh) 白平衡处理方法与电子设备
CN113727085B (zh) 一种白平衡处理方法、电子设备、芯片***和存储介质
WO2022267612A1 (zh) 一种动态调节光谱传感器曝光参数的方法及电子设备
US20230342977A1 (en) Method for Determining Chromaticity Information and Related Electronic Device
WO2022257574A1 (zh) Ai自动白平衡和自动白平衡的融合算法以及电子设备
US20230058472A1 (en) Sensor prioritization for composite image capture
US20170251136A1 (en) Image processing apparatus, image capturing apparatus, method of controlling the same, and storage medium
US20200344400A1 (en) Image processing apparatus and control method for same
CN116437060B (zh) 一种图像处理方法及相关电子设备
WO2023124165A1 (zh) 一种图像处理方法及相关电子设备
JP2015119436A (ja) 撮像装置
WO2023160190A1 (zh) 自动曝光方法与电子设备
WO2022257713A1 (zh) 一种ai自动白平衡的算法和电子设备
CN115526786B (zh) 图像处理方法及其相关设备
CN116051434B (zh) 一种图像处理方法及相关电子设备
CN115705663A (zh) 图像处理方法与电子设备
KR20230144855A (ko) 멀티스펙트럴 센서를 이용하여 영상을 획득하는 방법 및 장치
CN117652151A (zh) 控制曝光的方法、装置与电子设备
CN118102114A (zh) 图像处理方法及相关装置

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: 22827115

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022827115

Country of ref document: EP

Effective date: 20230626

WWE Wipo information: entry into national phase

Ref document number: 18262101

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE