WO2022174653A1 - 灯光调节方法及装置 - Google Patents

灯光调节方法及装置 Download PDF

Info

Publication number
WO2022174653A1
WO2022174653A1 PCT/CN2021/136367 CN2021136367W WO2022174653A1 WO 2022174653 A1 WO2022174653 A1 WO 2022174653A1 CN 2021136367 W CN2021136367 W CN 2021136367W WO 2022174653 A1 WO2022174653 A1 WO 2022174653A1
Authority
WO
WIPO (PCT)
Prior art keywords
light
pwm signal
parameter
brightness
wavelength
Prior art date
Application number
PCT/CN2021/136367
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 华为技术有限公司
Publication of WO2022174653A1 publication Critical patent/WO2022174653A1/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/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/56Cameras or camera modules comprising electronic image sensors; Control thereof provided with illuminating means
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Definitions

  • the present application relates to the technical field of terminals, and in particular, to a light adjustment method and device.
  • Mirrors are essential equipment for skin care and makeup, and the concept of smart mirrors with skin-measuring functions came into being.
  • the smart mirror can capture the user's face image through the camera, and then combine the image recognition algorithm to analyze the user's facial skin, and output a skin test analysis report.
  • the present application provides a light adjustment method and device, which can complete the shooting work without the user sensing the change in the brightness of the light, and the captured image is the best.
  • the present application provides a light adjustment method, which is applied to an electronic device including a camera and a fill light, and the fill light is controlled by a pulse width modulated PWM signal; the method includes: determining a user-set fill light. The first brightness level, and the first wavelength of the light emitted by the fill light under the first brightness level; determine the first illumination intensity of the ambient light in the environment where the electronic device is located; according to the first brightness level, the first wavelength and the first The light intensity determines the target parameters of the PWM signal.
  • the target parameters include the target duty cycle and the target pulse amplitude.
  • the light brightness provided by the fill light under the target parameters is the same as the fill light required by the camera to capture images under the current conditions.
  • the brightness of the light matches, and the brightness of the fill light perceived by the user under the target parameter is the same as the brightness of the fill light perceived by the user under the current conditions.
  • the current condition is that the brightness of the fill light is the first brightness level, and the fill light
  • the wavelength of the emitted light is the first wavelength, and the light intensity of the ambient light is the first illumination intensity;
  • the first parameter of the PWM signal under the current condition is adjusted to the target parameter, and the first parameter includes the first duty cycle and the first pulse. magnitude.
  • the electronic device based on the parameters of the light emitted by the fill light (ie, the brightness level and wavelength) and the parameters of the ambient light (ie, the light intensity), it is determined that the image is suitable for shooting under the current conditions and the user cannot perceive it.
  • the control parameters of the control signal of the fill light with changes in the brightness of the light, and the fill light is controlled based on the control parameters, so that the shooting work can be completed without the user perceiving the change in the brightness of the light, and the captured image optimal.
  • the method may be implemented after the skin detection function on the electronic device is turned on.
  • the method further includes: determining that the PWM signal is a high-level signal, and controlling the camera to capture an image. This allows the camera to shoot at the optimum brightness.
  • the duration of the high-level signal is greater than or equal to the exposure time of the camera. Therefore, the camera can have sufficient time to complete the shooting.
  • the method further includes: adjusting the target parameter to the first parameter.
  • the deviation value between the target calculated value of the pulse time integral corresponding to the target parameter and the first calculated value of the pulse time integral corresponding to the first parameter is within a preset range.
  • determining the target parameter of the PWM signal according to the first brightness level, the first wavelength and the first illumination intensity specifically including: querying the PWM signal according to the first brightness level, the first wavelength and the first illumination intensity
  • a pre-built PWM signal parameter correspondence table is used to obtain target parameters, wherein the PWM signal correspondence table includes a mapping relationship between the first brightness level, the first wavelength, the first light intensity and the target parameter.
  • determining the target parameter of the PWM signal according to the first brightness level, the first wavelength and the first light intensity specifically including: inputting the first brightness level, the first wavelength and the first light intensity to a The signal parameters determine the model and obtain the target parameters.
  • the electronic device has a skin detection function
  • the skin detection function is used to detect the user's skin based on an image captured by a camera
  • the method further includes: determining that the distance between the user and the electronic device is less than a preset distance threshold; start the camera to shoot the first image; determine that the first image contains a human face, and there is no obstruction on the human face, and activate the skin detection function on the electronic device. In this way, the skin detection function is enabled.
  • the electronic device is a smart mirror, and the smart mirror has a mirror surface.
  • the present application provides a light adjustment device, comprising:
  • At least one memory for storing programs
  • At least one processor for invoking a program stored in the memory to execute the method provided in the first aspect.
  • an embodiment of the present application provides a light adjustment device, the device runs computer program instructions to execute the method provided in the first aspect.
  • the device may be a chip or a processor.
  • the apparatus may include a processor, which may be coupled to a memory, to read instructions in the memory and perform the method as provided in the first aspect in accordance with the instructions.
  • the memory may be integrated in the chip or the processor, or may be independent of the chip or the processor.
  • the present application provides a computer storage medium, where instructions are stored in the computer storage medium, and when the instructions are executed on the computer, the computer is made to execute the method provided in the first aspect.
  • the present application provides a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the method provided in the first aspect.
  • the present application provides a chip, including at least one processor and an interface;
  • At least one processor obtains program instructions or data through an interface
  • At least one processor is configured to execute program line instructions to implement the method provided in the first aspect.
  • FIG. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • 3a is a schematic diagram of a PWM signal provided by an embodiment of the present application.
  • 3b is a schematic diagram of a PWM signal provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a PWM signal provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a light adjustment process provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a light adjustment provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario provided in an embodiment of the present application.
  • user A can use an electronic device with a skin detection function to perform skin detection.
  • the electronic device as the smart mirror 11 as an example
  • user A can use the smart mirror 11 to organize his appearance and attire.
  • the user A can adjust the brightness of the lights on the smart mirror 11 to achieve the brightness of the supplementary light expected by the user. For example, when the brightness of the ambient light in the environment where the smart mirror 11 is located is low, the user A can increase the brightness of the light on the smart mirror 11; when the brightness of the ambient light in the environment where the smart mirror 11 is located is high, User A can turn down the brightness of the lights on the smart mirror 11 .
  • the imaging effect of the camera of the smart mirror 11 varies greatly under different lighting brightness
  • user A can Adjust the brightness of the light on the smart mirror 11, determine the best light intensity required by the camera in the smart mirror 11 to take pictures under the current environment, and adjust the light in the smart mirror 11 when taking pictures on the premise that the user cannot feel the change in the brightness of the light
  • the brightness of the smart mirror 11 can be reduced, thereby reducing the difference in the imaging effect of the camera of the smart mirror 11 under different lighting brightness adjusted by the user, and improving the skin measurement accuracy of the smart mirror 11 .
  • the user when the user uses the smart mirror, the user can adjust the brightness of the light on the smart mirror at will, but when the smart mirror captures the user's face image, the light in the smart mirror is presented at the best brightness, thus The camera in the smart mirror is protected from the interference of the brightness of the light, so that the difference in the imaging effect of the camera in the smart mirror under different light brightness changes is small, and the accuracy of the skin measurement of the smart mirror is improved.
  • the electronic device may be a smart mirror, or may be an electronic device with a skin detection function, such as a mobile phone and a tablet computer.
  • a skin detection function such as a mobile phone and a tablet computer.
  • the fact that the electronic device has a skin detection function can be understood that the electronic device can detect the user's skin based on images captured by a camera or other image acquisition device.
  • FIG. 2 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.
  • the electronic device 200 may include: a processor 201, a memory 202, a camera 203, a fill light 204, and the like.
  • the processor 201 may support the electronic device 200 to implement the method provided in this solution.
  • the processor 201 may be a general-purpose processor, a special-purpose processor, or a neural network processor (Neural Network Processing Unit, NPU).
  • the processor 201 may include a central processing unit (CPU) and/or a baseband processor.
  • the baseband processor may be used to process communication data
  • the CPU may be used to implement corresponding control and processing functions, execute software programs, and process data of software programs.
  • the processor 201 can determine the corresponding pulse width modulation of the fill light 204 according to the brightness level of the fill light 204 set by the user, the wavelength of the light under the brightness level, and the illumination intensity of the ambient light in the current environment.
  • PWM pulse width modulation
  • the processor 201 can also adjust the parameters of the PWM signal corresponding to the fill light 204, and can also control the camera 203 to capture images and the like.
  • the memory 202 may store programs (or instructions or codes) thereon, and the programs may be executed by the processor 201, so that the processor 201 executes the method described in this solution.
  • data may also be stored in the memory 202 .
  • the processor 201 can also read the data stored in the memory 202, the data can be stored in the same storage address as the program, or the data can be stored in a different storage address with the program.
  • a pre-built PWM signal parameter correspondence table may be stored in the memory 202, and the PWM signal correspondence table includes the first brightness level, the first wavelength, the first light intensity and the target parameter. mapping relationship between.
  • the memory 202 can also store a calculation model for calculating the PWM signal parameters, by inputting the brightness level of the fill light 204 set by the user, the wavelength of the light under the brightness level, and the illumination intensity of the ambient light in the current environment.
  • the parameters for determining the pulse width modulation (pulse width modulation, PWM) signal corresponding to the fill light 204 can be obtained.
  • the processor 201 and the memory 202 can be provided separately, or can be integrated together, for example, integrated on a single board or a system on chip (system on chip, SOC).
  • SOC system on chip
  • the camera 203 can capture images. For example, an image of the user's face is captured.
  • the fill light 204 is the light source of the electronic device 200 , and can provide the user with lights of different brightness levels based on the user's needs.
  • the fill light 204 may be a light emitting diode (LED).
  • the control signal of the fill light 204 may be a pulse width modulated PWM signal.
  • the fill light 204 may be annularly arranged around the mirror surface of the smart mirror.
  • the electronic device 200 may further include a distance sensor, an ambient light sensor, and the like.
  • the distance sensor may be used to measure the distance between the electronic device 200 and the user.
  • the electronic device 200 can measure the distance through infrared or laser.
  • the ambient light sensor can be used to sense the light intensity of ambient light.
  • the electronic device 200 may have a mirror surface for the user to organize appearance and attire.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the light adjustment process in this solution is described in detail. It should be understood that the smart mirror can also be replaced by other electronic devices with a skin detection function.
  • the light intensity of the image taken by the camera is related to the light source of the smart mirror and the ambient light.
  • light intensity can be understood as light intensity.
  • the fill light intensity of the smart mirror corresponding to the marked light intensity suitable for taking pictures under the respective ambient light.
  • the marked light intensity is a and the ambient light is b
  • the pulse current under the corresponding supplementary light intensity can be determined based on the correspondence between the supplementary light intensity and the pulse current.
  • the determination of the pulse current under the corresponding fill light intensity can also be understood as determining the pulse voltage under the corresponding fill light intensity, that is, the determination of the pulse voltage corresponding to the fill light.
  • the pulse amplitude of the PWM signal since the current corresponds to the voltage, the determination of the pulse current under the corresponding fill light intensity.
  • the value of the luminance time integral (ie luminous flux) of the light perceived by the human eye is related to the value of the pulse time integral of the PWM signal corresponding to the fill light.
  • the value of the pulse time integral of the PWM signal corresponding to the fill light can be: DxImax +(1-D) xImin , D is the duty cycle of the PWM signal, Imax is the maximum pulse current, and Imin is the minimum pulse current.
  • the value of the pulse time integral of the PWM signal corresponding to the fill light can be understood as the area of the shaded portion in Fig. 3a.
  • the pulse amplitude of the PWM signal corresponding to the fill light determined above is different from the PWM signal corresponding to the fill light under the light brightness adjusted by the user
  • the duty cycle of the PWM signal corresponding to the fill light can be adjusted, so that the value of the pulse time integral of the PWM signal corresponding to the fill light before and after the adjustment is equal, so that the user cannot perceive the fill light on the smart mirror.
  • the light intensity of the lamp changes.
  • Figure 3b is the parameter of the PWM signal before adjustment
  • Figure 3a is the parameter of the PWM signal after adjustment, when the area of the shaded part in Figure 3a is the same as the shaded part in Figure 3b
  • the user cannot perceive the change in the brightness of the fill light on the smart mirror.
  • L eye is the value of the brightness time integral of the light perceived by the human eye
  • [D*I max +(1-D)*I min ] is the value of the pulse time integral of the PWM signal corresponding to the fill light
  • V( ⁇ ) is the relative visual acuity of the fill light at different wavelengths.
  • the value of the brightness time integral (i.e. luminous flux) of the light perceived by the human eye From the relationship between the value of the brightness time integral (i.e. luminous flux) of the light perceived by the human eye and the value of the pulse time integral of the PWM signal corresponding to the fill light, it can be known that when the wavelength of the light emitted by the fill light changes When , the value of the brightness time integral (ie luminous flux) of the light perceived by the human eye will also change. Therefore, in order to ensure that the user does not perceive a change in the brightness of the fill light on the smart mirror, the wavelength of the light emitted by the fill light needs to be used as a reference factor.
  • the wavelength of the light emitted by the fill light needs to be used as a reference factor.
  • the duty cycle of the PWM signal corresponding to each wavelength at each brightness level of the fill light under each ambient light can be calculated experimentally.
  • the PWM signal parameter correspondence table can be constructed.
  • the brightness level of the fill light is level 1
  • the wavelength of the light emitted by the fill light is a 1
  • the illumination intensity of the ambient light is b 1
  • the duty cycle of the PWM signal is d. 1
  • the pulse amplitude is I 1
  • the brightness level of the fill light is 2
  • the wavelength of the light emitted by the fill light is a 3
  • the illumination intensity of the ambient light is b 1
  • the duty cycle of the PWM signal is d 3
  • the pulse amplitude is I 3 .
  • a Gaussian process model a neural network model, a support vector machine, etc. can be used to train the determined parameters to obtain a corresponding calculation model.
  • the parameters under the current environment are subsequently input into the calculation model, and the duty cycle and pulse amplitude of the corresponding PWM signal can be determined.
  • the smart mirror when the smart mirror detects that the distance between the smart mirror and the user is smaller than the preset distance threshold, the smart mirror can activate the camera on it to capture the user's image. Next, the smart mirror can analyze the user image captured by the camera, and determine that the user image contains the user's face, and when there is no obstruction on the user's face, the skin detection function can be activated.
  • the smart mirror After the smart mirror activates the skin detection function, the smart mirror can determine the brightness level of the fill light on the smart mirror set by the user based on the user's light adjustment operation, and the wavelength of the light emitted by the fill light at the brightness level.
  • the smart mirror may have 5 brightness adjustment gears.
  • the smart mirror can determine the relationship between the preset brightness adjustment gears and the brightness level. The brightness level corresponding to 2 files is output.
  • the smart mirror can be determined based on the color temperature of the light emitted by the fill light.
  • the color temperature corresponding to the corresponding brightness level can be determined based on the preset correspondence between the brightness level and the color temperature; The relationship between color temperature and wavelength determines the wavelength corresponding to the corresponding color temperature.
  • the color temperature set by the user can be determined based on the user's color temperature adjustment operation; then, based on the relationship between the preset color temperature and wavelength, the corresponding color temperature is determined. wavelength.
  • the smart mirror can also sense the color temperature of the light emitted by the current fill light based on the color temperature sensor on it; then, based on the relationship between the preset color temperature and the wavelength, determine the wavelength corresponding to the corresponding color temperature.
  • the smart mirror can perceive the illumination intensity of ambient light in the environment in which it is located based on the ambient light sensor on the smart mirror.
  • the pre-built PWM signal parameter correspondence table determines the current required duty cycle and pulse amplitude of the PWM signal.
  • the duty cycle and pulse amplitude of the currently required PWM signal are the duty cycle and pulse amplitude of the PWM signal when the image captured by the camera on the smart mirror during the skin detection process reaches the most suitable skin detection image
  • the illumination intensity of the fill light under the duty cycle and pulse amplitude of the PWM signal is the optimal illumination intensity required by the camera in the smart mirror to capture images.
  • the determined brightness level of the fill light on the smart mirror set by the user, the wavelength of the light emitted by the fill light at the brightness level, and the illumination intensity of the ambient light in the environment where the smart mirror is located may also be determined. , input to the pre-built calculation model to obtain the duty cycle and pulse amplitude of the PWM signal currently required.
  • the current corresponding duty cycle and pulse amplitude of the PWM signal can be adjusted to adjust the current corresponding duty cycle and pulse amplitude of the PWM signal to the above Determine the duty cycle and pulse amplitude of the currently required PWM signal.
  • the lighting adjustment is completed. It can be understood that the brightness of the fill light perceived by the user before the parameters of the PWM signal are adjusted is the same as the brightness of the fill light perceived by the user after the parameters of the PWM signal are adjusted.
  • the camera can be controlled to capture an image.
  • the duration of the high-level signal may be greater than or equal to the exposure time of the camera, so that the camera can successfully complete the shooting.
  • the camera 41 can be controlled to complete shooting within the duration of the high-level signal.
  • the PWM signal corresponding to the fill light can be restored to the state before adjustment, and another light adjustment is completed.
  • the duty cycle of the PWM signal before adjustment is D 1
  • the pulse amplitude is I 1
  • the duty cycle of the PWM signal after adjustment is D 2
  • the pulse amplitude is I 2
  • the The duty cycle of the PWM signal is adjusted from D 2 to D 1
  • the pulse amplitude is adjusted from I 2 to I 1 .
  • the entire process is briefly described below.
  • the brightness level of the light source ie, the fill light in this article
  • the light wavelength ie, the ambient light intensity
  • the corresponding duty cycle D 1 and pulse amplitude I 1 of the fill light required for taking pictures are inquired;
  • the duty ratio D 0 of the fill light is adjusted to the duty ratio D 1
  • the pulse width I 0 of the fill light initially controlled by the user is adjusted to the pulse width I 1 .
  • the adjusted duty cycle D 1 of the fill light is adjusted back to the duty cycle D 0
  • the pulse amplitude I 1 is adjusted back to the pulse amplitude I 0 .
  • the non-sensing skin function may refer to the function of detecting the user's skin without the user's perception, and outputting a skin detection report.
  • the electronic device as a smart mirror as an example, on the premise that the fill light of the smart mirror is on, the camera on the smart mirror detects that there is a human face, and the position of the human face is within a suitable range from the smart mirror, The smart mirror can call the sensorless skin algorithm in the background and output the skin test report asynchronously.
  • the method can be performed by any apparatus, device, platform, or device cluster with computing and processing capabilities.
  • the device when the method is executed by a single device, the device may have a camera and a fill light; when the method is executed by a device cluster, some devices in the device cluster may have a camera, some devices have a fill light, or You can have a camera and fill light on the same device.
  • the fill light can be controlled by pulse width modulation PWM signal.
  • FIG. 6 is a schematic flowchart of a light adjustment method provided by an embodiment of the present application. As shown in Figure 6, the light adjustment method includes:
  • Step S102 Determine the first illumination intensity of ambient light in the environment where the electronic device is located.
  • the target parameters may include target duty cycle and target pulse amplitude.
  • the light brightness provided by the fill light under the target parameters matches the light brightness of the fill light required by the camera to capture images under the current conditions, and the brightness of the fill light perceived by the user under the target parameters is the same as that of the fill light under the current conditions.
  • the brightness of the fill light perceived by the user is the same, and the current condition is that the brightness of the fill light is the first brightness level, the wavelength of the light emitted by the fill light is the first wavelength, and the light intensity of the ambient light is the first light intensity.
  • a pre-built PWM signal parameter correspondence table can be queried to obtain the target parameters, wherein the PWM signal correspondence table includes the first brightness level , the mapping relationship between the first wavelength, the first illumination intensity and the target parameter.
  • the pre-built PWM signal parameter correspondence table may be Table 1 described above.
  • the first brightness level, the first wavelength and the first light intensity may be input into the signal parameter determination model to obtain the target parameter.
  • the signal parameter determination model may be the pre-built calculation model described above.
  • the deviation value between the target calculated value of the pulse time integral corresponding to the target parameter and the first calculated value of the pulse time integral corresponding to the first parameter is within a preset range.
  • the target calculated value may be the area of the shaded portion in Fig. 3a
  • the first calculated value may be the area of the shaded portion in Fig. 3b.
  • step S104 can be executed.
  • Step S104 adjusting the first parameter of the PWM signal under the current condition to the target parameter.
  • the first parameter may include a first duty cycle and a first pulse amplitude.
  • the camera can be controlled to capture an image.
  • the duration of the high-level signal may be greater than or equal to the exposure time of the camera, so that the camera can have sufficient time to complete the shooting.
  • the electronic device based on the parameters of the light emitted by the fill light (ie, the brightness level and wavelength) and the parameters of the ambient light (ie, the light intensity), it is determined that the image is suitable for shooting under the current conditions and the user cannot perceive it.
  • the control parameters of the control signal of the fill light with changes in the brightness of the light, and the fill light is controlled based on the control parameters, so that the shooting work can be completed without the user perceiving the change in the brightness of the light, and the captured image optimal.
  • the electronic device may have a skin detection function, wherein the skin detection function is used to detect the user's skin based on an image captured by a camera.
  • the skin detection function is used to detect the user's skin based on an image captured by a camera.
  • it can also be determined whether to activate the skin detection function on the electronic device.
  • it may be determined first that the distance between the user and the electronic device is less than a preset distance threshold, for example, the distance is detected based on a distance sensor in the electronic device. Then, start the camera again to capture the first image. Finally, the first image is analyzed, and when it is determined that the first image contains a human face and there is no obstruction on the human face, the skin detection function on the electronic device can be activated.
  • the electronic device may be a smart mirror, which may have a mirror surface.
  • the embodiments of the present application further provide a lighting adjustment device.
  • the light adjusting device may be the electronic device shown in FIG. 2 above.
  • the light adjustment apparatus may include at least one memory for storing programs, and at least one processor for executing the programs stored in the memory.
  • the processor implements the method provided in this solution.
  • the memory in the light adjusting device may be the memory 202 in FIG. 2
  • the processor may be the processor 201 in FIG. 2 .
  • the embodiments of the present application further provide a lighting adjustment device, which can run computer program instructions to execute the above-described methods.
  • the device may be a chip or a processor.
  • the apparatus may include a processor, which may be coupled to a memory, to read instructions in the memory and perform the methods described above in accordance with the instructions.
  • the memory may be integrated in the chip or the processor, or may be independent of the chip or the processor.
  • the memory in the light adjusting device may be the memory 202 in FIG. 2
  • the processor may be the processor 201 in FIG. 2 .
  • an embodiment of the present application further provides a chip.
  • FIG. 7 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • the chip 700 includes one or more processors 701 and an interface circuit 702 .
  • the chip 700 may also include a bus 703 . in:
  • the processor 701 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software.
  • the above-mentioned processor 701 may be a general-purpose processor, a neural network processor (Neural Network Processing Unit, NPU), a digital communicator (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable Logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • NPU Neural Network Processing Unit
  • DSP digital communicator
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the chip 700 may be applied to the electronic device shown in FIG. 2 , and at this time, the processor 701 may execute some or all of the steps in the foregoing embodiments.
  • the interface circuit 702 can be used for sending or receiving data, instructions or information.
  • the processor 701 can use the data, instructions or other information received by the interface circuit 702 to perform processing, and can send the processing completion information through the interface circuit 702 .
  • the interface circuit 702 can be used to output the skin test result.
  • the chip 700 further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor.
  • a portion of the memory may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory may be coupled with the processor 701 .
  • a pre-built PWM signal parameter correspondence table may be stored in the memory.
  • the memory stores executable software modules or data structures
  • the processor 701 may execute corresponding operations by calling operation instructions stored in the memory (the operation instructions may be stored in the operating system).
  • the interface circuit 702 may be used to output the execution result of the processor 701 .
  • processor 701 and the interface circuit 702 can be implemented by hardware design, software design, or a combination of software and hardware, which is not limited here.
  • the term "and/or" is only an association relationship for describing associated objects, indicating that there may be three relationships, for example, A and/or B, which may indicate: A alone exists, A alone exists There is B, and there are three cases of A and B at the same time.
  • the term "plurality" means two or more.
  • multiple systems refer to two or more systems
  • multiple terminals refer to two or more terminals
  • multiple video streams refer to two or more video streams.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implying the indicated technical features. Thus, a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • processor in the embodiments of the present application may be a central processing unit (central processing unit, CPU), and may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits (application specific integrated circuit, ASIC), field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
  • CPU central processing unit
  • DSP digital signal processors
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • a general-purpose processor may be a microprocessor or any conventional processor.
  • the method steps in the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (programmablerom, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, CD-ROM or any known in the art other forms of storage media.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may reside in an ASIC.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can 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 a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted over a computer-readable storage medium.
  • the computer instructions can be sent from one website site, computer, server, or data center to another website site by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) , computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

本申请提供了一种灯光调节方法及装置。该方法可以在电子设备运行过程中,基于补光灯发出的灯光的参数和环境光的参数,确定出当前条件下适宜拍摄图像且用户感知不到灯光亮度发生变化的补光灯的控制信号的控制参数,并基于该控制参数对补光灯进行控制,使得可以在用户感知不到灯光亮度发生变化的情况下完成拍摄工作,且拍摄到的图像最佳。

Description

灯光调节方法及装置
本申请要求于2021年2月22日提交中国国家知识产权局、申请号为2021101966457、申请名称为“灯光调节方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种灯光调节方法及装置。
背景技术
随着社会发展,越来越多的人开始关注科技测肤、科学护肤,以及使用拍照测肤类应用软件,进行肌肤健康情况的记录和跟踪。镜子作为护肤化妆环节必不可少的重要装备,具有测肤功能的智能镜的概念应运而生。在用户使用智能镜的过程中,智能镜可以通过相机拍摄用户的面部图像,然后结合图像识别算法对用户的面部肌肤进行分析,并输出测肤分析报告。
目前,用户在使用智能镜的过程中,其可以根据自身需求调节智能镜上的灯光亮度。但由于不同灯光亮度下的相机成像效果差异较大,这就使得智能镜在不同灯光亮度下输出的测肤结果差异较大,致使智能镜的测肤准确性较低。
发明内容
本申请提供了一种灯光调节方法及装置,能够在用户感知不到灯光亮度发生变化的情况下完成拍摄工作,且拍摄到的图像最佳。
第一方面,本申请提供了一种灯光调节方法,应用于包含相机和补光灯的电子设备,补光灯通过脉冲宽度调制PWM信号控制;该方法包括:确定用户设定的补光灯的第一亮度等级,及在第一亮度等级下补光灯发出的灯光的第一波长;确定电子设备所处环境的环境光的第一光照强度;根据第一亮度等级,第一波长和第一光照强度,确定PWM信号的目标参数,目标参数包括目标占空比和目标脉冲幅度,其中,补光灯在目标参数下提供的灯光亮度与相机在当前条件下拍摄图像所需的补光灯的灯光亮度相匹配,且在目标参数下用户感知的补光灯的亮度与在当前条件下用户感知的补光灯的亮度相同,当前条件为补光灯的亮度为第一亮度等级,补光灯发出的灯光波长为第一波长,且环境光的光强为第一光照强度;将PWM信号在当前条件下的第一参数调整至目标参数,第一参数包括第一占空比和第一脉冲幅度。
由此,在电子设备运行过程中,基于补光灯发出的灯光的参数(即亮度等级和波长)和环境光的参数(即光照强度),确定出当前条件下适宜拍摄图像且用户感知不到灯光亮度发生变化的补光灯的控制信号的控制参数,并基于该控制参数对补光灯进行控制,使得可以在用户感知不到灯光亮度发生变化的情况下完成拍摄工作,且拍摄到的图像最佳。
示例性的,当电子设备具有肌肤检测功能时,该方法可以在电子设备上的肌肤检测功能开启后实施。
在一种可能的实现方式中,将PWM信号在当前条件下的第一参数调整至目标参数之后,还包括:确定PWM信号为高电平信号,控制相机拍摄图像。由此,以使得相机在最佳亮度 下完成拍摄。
在一种可能的实现方式中,高电平信号的持续时间大于或等于相机的曝光时间。由此,以使得相机可以有充足的时间完成拍摄。
在一种可能的实现方式中,控制相机拍摄图像之后,还包括:将目标参数调整至第一参数。
在一种可能的实现方式中,目标参数对应的脉冲时间积分的目标计算值与第一参数对应的脉冲时间积分的第一计算值之间的偏差值处于预设范围内。
在一种可能的实现方式中,根据第一亮度等级,第一波长和第一光照强度,确定PWM信号的目标参数,具体包括:根据第一亮度等级,第一波长和第一光照强度,查询预先构建的PWM信号参数对应表,得到目标参数,其中,PWM信号对应表中包括第一亮度等级,第一波长,第一光照强度和目标参数之间的映射关系。
在一种可能的实现方式中,根据第一亮度等级,第一波长和第一光照强度,确定PWM信号的目标参数,具体包括:将第一亮度等级,第一波长和第一光照强度输入至信号参数确定模型,得到目标参数。
在一种可能的实现方式中,电子设备具有肌肤检测功能,肌肤检测功能用于基于相机拍摄的图像对用户的肌肤进行检测,方法还包括:确定用户与电子设备之间的距离小于预设距离阈值;启动相机拍摄第一图像;确定第一图像中包含人脸,且人脸上无遮挡物,启动电子设备上的肌肤检测功能。由此实现肌肤检测功能的开启。
在一种可能的实现方式中,电子设备为智能镜,智能镜具有镜面。
第二方面,本申请提供了一种灯光调节装置,包括:
至少一个存储器,用于存储程序;
至少一个处理器,用于调用存储器存储的程序,以执行第一方面中提供的方法。
第三方面,本申请实施例提供了一种灯光调节装置,该装置运行计算机程序指令,以执行如第一方面中所提供的方法。示例性的,该装置可以为芯片,或处理器。在一个例子中,该装置可以包括处理器,该处理器可以与存储器耦合,读取存储器中的指令并根据该指令执行如第一方面中所提供的方法。其中,该存储器可以集成在芯片或处理器中,也可以独立于芯片或处理器之外。
第四方面,本申请提供了一种计算机存储介质,计算机存储介质中存储有指令,当指令在计算机上运行时,使得计算机执行第一方面中提供的方法。
第五方面,本申请提供了一种包含指令的计算机程序产品,当指令在计算机上运行时,使得计算机执行第一方面中提供的方法。
第六方面,本申请提供了一种芯片,包括至少一个处理器和接口;
至少一个处理器通过接口获取程序指令或者数据;
至少一个处理器用于执行程序行指令,以实现第一方面中提供的方法。
附图说明
图1是本申请实施例中提供的一种应用场景示意图;
图2是本申请实施例提供的一种电子设备的硬件结构示意图;
图3a是本申请实施例提供的一种PWM信号的示意图;
图3b是本申请实施例提供的一种PWM信号的示意图;
图4是本申请实施例提供的一种PWM信号的示意图;
图5是本申请实施例提供的一种灯光调节过程示意图;
图6是本申请实施例提供的一种灯光调节的流程示意图;
图7是本申请实施例提供的一种芯片的结构示意图。
具体实施方式
为了使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图,对本申请实施例中的技术方案进行描述。
图1是本申请实施例中提供的一种应用场景示意图。如图1所示,用户A可以使用具有肌肤检测功能的电子设备进行肌肤检测。以电子设备为智能镜11为例,用户A可以使用智能镜11整理自己的仪容和装束。用户A使用智能镜11的过程中,其可以调节智能镜11上的灯光的亮度,以达到用户所期望的补光亮度。例如,当智能镜11所处环境中的环境光的亮度较低时,用户A可以调高智能镜11上的灯光的亮度;当智能镜11所处环境中的环境光的亮度较高时,用户A可以调低智能镜11上的灯光的亮度。由于智能镜11在不同灯光亮度下其相机成像效果差异较大,为了降低其相机在不同灯光亮度下的成像效果差异,本方案中,在用户A使用智能镜11的过程中,可以根据用户A调节的智能镜11上的灯光亮度,确定出当前环境下智能镜11中的相机拍照所需的最佳光照强度,并在用户感受不到灯光亮度变化的前提下调整拍照时智能镜11中灯光的亮度,从而降低智能镜11在用户调节的不同灯光亮度下其相机成像效果的差异,提升智能镜11的测肤准确性。换言之,本方案中,用户使用智能镜过程中,用户可以随意调节智能镜上灯光的亮度,但智能镜在拍摄用户的面部图像时,智能镜中的灯光则是以最佳的亮度呈现,从而使得智能镜中相机免受灯光亮度的干扰,进而使得智能镜中相机在不同灯光亮度下的成像效果差异变化较小,提升了智能镜的测肤准确性。
可以理解的是,本方案中,电子设备可以为智能镜,也可以为手机,平板电脑等具有肌肤检测功能的电子设备。在一个例子中,电子设备具有肌肤检测功能可以理解为电子设备可以基于相机或其他图像采集装置拍摄的图像对用户的肌肤进行检测。
接下来,对本方案中涉及的电子设备的硬件结构进行介绍。
请参阅图2,图2是本申请实施例提供的一种电子设备的硬件结构示意图。如图2所示,该电子设备200可以包括:处理器201,存储器202,相机203,补光灯204,等。
其中,处理器201可以支持电子设备200实现本方案中所提供的方法。该处理器201可以是通用处理器,专用处理器或者神经网络处理器(Neural Network Processing Unit,NPU)。例如,处理器201可以包括中央处理器(central processing unit,CPU)和/或基带处理器。其中,基带处理器可以用于处理通信数据,CPU可以用于实现相应的控制和处理功能,执行软件程序,处理软件程序的数据。示例性的,处理器201可以根据用户设定的补光灯204的亮度等级,该亮度等级下灯光的波长,和当前环境中环境光的光照强度,确定出补光灯204对应的脉冲宽度调制(pulse width modulation,PWM)信号的参数,例如占空比,脉冲幅度等。此外,处理器201也可以对补光灯204对应的PWM信号的参数进行调整,亦可以控制相机203拍摄图像等。
存储器202,其上可以存有程序(也可以是指令或者代码),程序可被处理器201运行, 使得处理器201执行本方案中描述的方法。可选地,存储器202中还可以存储有数据。可选地,处理器201还可以读取存储器202中存储的数据,该数据可以与程序存储在相同的存储地址,该数据也可以与程序存储在不同的存储地址。示例性的,存储器202中可以存储预先构建的PWM信号参数对应表,该PWM信号对应表中包括所述第一亮度等级,所述第一波长,所述第一光照强度和所述目标参数之间的映射关系。此外,存储器202中也可以存储用于计算PWM信号参数的计算模型,通过将用户设定的补光灯204的亮度等级,该亮度等级下灯光的波长,和当前环境中环境光的光照强度输入至该计算模型中,即可以获取到确定出补光灯204对应的脉冲宽度调制(pulse width modulation,PWM)信号的参数。
在一个例子中,处理器201和存储器202可以单独设置,也可以集成在一起,例如,集成在单板或者系统级芯片(system on chip,SOC)上。
相机203可以拍摄图像。例如拍摄用户的面部图像等。
补光灯204是电子设备200的光源,其可以基于用户的需求,为用户提供不同亮度等级的灯光。示例性的,补光灯204可以为发光二极管(light emitting diode,LED)。在一个例子中,补光灯204的控制信号可以为脉冲宽度调制PWM信号。在一个例子中,当电子设备200为智能镜时,补光灯204可以沿智能镜的镜面周围环形布置。
可选地,电子设备200中还可以包括距离传感器,环境光传感器,等。其中,距离传感器可以用于测量电子设备200与用户之间的距离。电子设备200可以通过红外或激光测量距离。环境光传感器可以用于感知环境光的光照强度。
可选地,电子设备200中可以具有用于供用户整理仪容和装束的镜面。
可以理解的是,本申请实施例示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
关于电子设备200在上述各种可能的设计中执行的操作的详细描述可以参照下文本方案提供的方法的实施例中的描述,在此就不再一一赘述。
接下来,基于图1所示的应用场景和图2所示的电子设备的硬件结构,以电子设备为智能镜为例,对本方案中的灯光调节过程进行详细说明。应理解的是,智能镜也可以替换为其他具有肌肤检测功能的电子设备。
(1)预先构建PWM信号参数对应表
一般地,在智能镜进行肌肤检测时,相机拍照时的图像的光照强度跟智能镜的光源以及环境光相关。在一个例子中,光照强度可以理解为光强。
本方案中,可以进行离线实验,在常见的居家环境下对智能镜进行补光,并获取到用户的肌肤图像。然后,对获取到的肌肤图像进行分析实验。经实验发现,若环境光的光强为L evn,智能镜的补光强度为L LED,已知最适合进行测肤分析的肌肤图像对应光强为L p,则它们三者之间的关系可以表示为:L p=f(L evn,L LED),即三者之间具有映射关系。其中,智能镜的补光强度可以理解为智能镜上补光灯发出的灯光的强度。
进一步地,可以根据实验得到各自环境光下为达到适合拍照的标注光强对应智能镜的补光光强。示例性的,若标注光强为a,环境光为b,则此时智能镜的补光光强c=a-b。
在确定出适合拍照的标注光强对应智能镜的补光光强后,即可以基于补光光强与脉冲电 流之间的对应关系,确定出相应的补光光强下的脉冲电流。示例性的,补光光强与脉冲电流之间的对应关系可以为:I pi=f(L ei),I pi为脉冲电流,L ei为补光光强。在一个例子中,由于电流与电压对应,因此,确定出相应的补光光强下的脉冲电流也可以理解为确定出相应的补光光强下的脉冲电压,即确定出补光灯对应的PWM信号的脉冲幅度。
进一步地,人眼感知到的灯光的亮度时间积分(即光通量)的值与补光灯对应的PWM信号的脉冲时间积分的值相关。其中,补光灯对应的PWM信号的脉冲时间积分的值可以为:DxI max+(1-D)xI min,D为PWM信号的占空比,I max为最大脉冲电流,I min为最小脉冲电流。示例性的,如图3a所示,补光灯对应的PWM信号的脉冲时间积分的值可以理解为图3a中阴影部分的面积。
为了使用户感知不到智能镜上补光灯的灯光亮度发生变化,因此,当上述确定出的补光灯对应的PWM信号的脉冲幅度不同于用户调节的灯光亮度下补光灯对应的PWM信号的脉冲幅度时,则可以调整补光灯对应的PWM信号的占空比,以使得调整前后补光灯对应的PWM信号的脉冲时间积分的值相等,进而使得用户感知不到智能镜上补光灯的灯光亮度发生变化。示例性的,如图3a和3b所示,其中,图3b为调整前的PWM信号的参数,图3a为调整后的PWM信号的参数,当图3a中阴影部分的面积与图3b中阴影部分的面积相等时,用户即可以感知不到智能镜上补光灯的灯光亮度发生变化。
经实验测得,人眼感知到的灯光的亮度时间积分(即光通量)的值与补光灯对应的PWM信号的脉冲时间积分的值之间的关系可以为:
Figure PCTCN2021136367-appb-000001
其中,L eye为人眼感知到的灯光的亮度时间积分的值,[D*I max+(1-D)*I min]为补光灯对应的PWM信号的脉冲时间积分的值,V(λ)为补光灯在不同波长下的相对视敏度。
由上述人眼感知到的灯光的亮度时间积分(即光通量)的值与补光灯对应的PWM信号的脉冲时间积分的值之间的关系可知,当补光灯的发出的灯光的波长发生变化时,人眼感知到的灯光的亮度时间积分(即光通量)的值也将发生变化。因此,为了确保用户感知不到智能镜上补光灯的灯光亮度发生变化,则需要将补光灯发出的灯光的波长作为参考因素。
本方案中,可以通过实验计算出每种环境光下补光灯的每种亮度等级下每种波长对应的PWM信号的占空比。
在得到补光灯对应的PWM信号的脉冲幅度和占空比后,即可以构建出PWM信号参数对应表。示例性的,如表一所示,补光灯的亮度等级为1级,补光灯发出的灯光的波长为a 1,环境光的光照强度为b 1时,PWM信号的占空比为d 1,脉冲幅度为I 1;补光灯的亮度等级为2级,补光灯发出的灯光的波长为a 3,环境光的光照强度为b 1时,PWM信号的占空比为d 3,脉冲幅度为I 3
表一
Figure PCTCN2021136367-appb-000002
在一个例子中,在得到PWM信号参数对应表中的各个参数后,还可以使用高斯过程模型、 神经网络模型、支持向量机等,对确定出的各个参数进行训练,以得到相应的计算模型。这样,在后续将当前环境下的参数输入至该计算模型,即可以确定出相应的PWM信号的占空比和脉冲幅度。
(2)启动肌肤检测功能
本方案中,当智能镜检测到其与用户之间的距离小于预设距离阈值时,智能镜则可以启动其上的相机拍摄用户图像。接着,智能镜可以对相机拍摄到的用户图像进行分析,确定出该用户图像中包含用户的人脸,以及用户的人脸上无遮挡物时,即可以启动肌肤检测功能。
(3)确定智能镜中相机拍摄图像所需的最佳光照强度
在智能镜启动肌肤检测功能后,智能镜可以基于用户的灯光调节操作,确定出用户设定的智能镜上补光灯的亮度等级,以及该亮度等级下补光灯发出的灯光的波长。例如,智能镜上可以具有5档亮度调节档位,当用户将亮度调节档位设定为2档时,智能镜则可以基于预先设定的亮度调节档位与亮度等级之间的关系,确定出2档所对应的亮度等级。
对于补光灯发出的灯光的波长,智能镜可以基于补光灯发出的灯光的色温确定。示例性的,若补光灯上不具有色温调节功能,则可以基于预先设定的亮度等级与色温之间的对应关系,确定出相应的亮度等级对应的色温;然后,再基于预先设定的色温与波长之间的关系,确定出相应的色温对应的波长。若补光灯上具有色温调节功能,则可以基于用户的色温调节操作,确定出用户设定的色温;然后,再基于预先设定的色温与波长之间的关系,确定出相应的色温对应的波长。此外,智能镜也可以基于其上的色温传感器感知到当前的补光灯发出的灯光的色温;然后,再基于预先设定的色温与波长之间的关系,确定出相应的色温对应的波长。
对于环境光的光照强度,智能镜可以基于其上的环境光传感器感知到其所处环境的环境光的光照强度。
进一步地,在确定出用户设定的智能镜上补光灯的亮度等级,该亮度等级下补光灯发出的灯光的波长,以及智能镜所处环境的环境光的光照强度后,可以查询上述预先构建的PWM信号参数对应表,确定出当前所需的PWM信号的占空比和脉冲幅度。其中,当前所需的PWM信号的占空比和脉冲幅度即为使智能镜在肌肤检测过程中其上的相机拍摄图像达到最适宜的测肤图像时的PWM信号的占空比和脉冲幅度,在该PWM信号的占空比和脉冲幅度下的补光灯的光照强度为智能镜中相机拍摄图像所需的最佳光照强度。
在一个例子中,也可以将确定出的用户设定的智能镜上补光灯的亮度等级,该亮度等级下补光灯发出的灯光的波长,以及智能镜所处环境的环境光的光照强度,输入至预先构建出的计算模型,以得到当前所需的PWM信号的占空比和脉冲幅度。
(4)灯光调节
在确定出当前所需的PWM信号的占空比和脉冲幅度后,可以对PWM信号当前对应的占空比和脉冲幅度进行调整,以将PWM信号当前对应的占空比和脉冲幅度调整至上述确定出的当前所需的PWM信号的占空比和脉冲幅度。至此即完成一次灯光调节。可以理解的是,在调整PWM信号的参数前用户感知的补光灯的亮度与调整PWM信号的参数后用户感知的补光灯的亮度相同。
接着,为了保证图像拍摄效果,可以在PWM信号为高电平信号时,控制相机拍摄图像。本方案中,高电平信号的持续时间可以大于或等于相机的曝光时间,以使得相机能够顺利完成拍摄。示例性的,如图4所示,可以控制相机41在高电平信号持续时间内完成拍摄。
本方案中,当相机拍摄完成后,可以将补光灯对应的PWM信号恢复至调整前的状态,至此即完成另外一次灯光调节。示例性的,若调整前PWM信号的占空比为D 1,脉冲幅度为I 1,调整后PWM信号的占空比为D 2,脉冲幅度为I 2,则在相机拍摄完成后,可以将PWM信号的占空比由D 2调整至D 1,脉冲幅度由I 2调整至I 1
为便于理解,接下来对整个流程进行简单描述。请参阅图5,如图5所示,在触发电子设备(如智能镜等)上的无感测肤功能后,可以获得此时用户调控的光源(即本文中的补光灯)的亮度等级,灯光波长,和环境光的光照强度。然后,基于用户调控的光源的亮度等级,灯光波长,和环境光的光照强度,查询对应的拍照时所需的补光灯的占空比D 1和脉冲幅度I 1;并将用户初始控制的补光灯的占空比D 0调整至占空比D 1,将用户初始控制的补光灯的脉冲幅度I 0调整至脉冲幅度I 1。最后,在拍照完毕后,将调整后的补光灯的占空比D 1调回至占空比D 0,将脉冲幅度I 1调回至脉冲幅度I 0。应理解,该流程中的详细内容可以参见上文中的有关描述,在此就不再一一赘述。
在一个例子中,本方案中,无感测肤功能可以是指在用户感知不到的情况下对用户的肌肤进行检测,并输出测肤报告的功能。示例性的,以电子设备为智能镜为例,在智能镜的补光灯点亮的前提下,智能镜上的摄像头检测到存在人脸、且人脸的位置距离智能镜在合适范围内,智能镜则可以后台调用无感测肤算法,异步输出测肤报告。
以上即是对本方案中灯光调节过程的介绍。接下来,基于上文所描述的灯光调节过程,对本申请实施例提供的一种灯光调节方法进行介绍。可以理解的是,该方法是上文所描述的灯光调节过程的另一种表达方式,两者是相结合的。该方法是基于上文所描述的灯光调节过程提出,该方法中的部分或全部内容可以参见上文对灯光调节过程的描述。
可以理解,该方法可以通过任何具有计算、处理能力的装置、设备、平台、设备集群来执行。其中,该方法由单独的设备执行时,该设备上可以具有相机和补光灯;该方法由设备集群执行时,该设备集群中可以有部分设备具有相机,有部分设备具有补光灯,也可以同一设备上具有相机和补光灯。本方案中补光灯可以通过脉冲宽度调制PWM信号控制。
请参阅图6,图6是本申请实施例提供的一种灯光调节方法的流程示意图。如图6所示,该灯光调节方法包括:
步骤S101、确定用户设定的补光灯的第一亮度等级,及在第一亮度等级下补光灯发出的灯光的第一波长。
步骤S102、确定电子设备所处环境的环境光的第一光照强度。
步骤S103、根据第一亮度等级,第一波长和第一光照强度,确定PWM信号的目标参数。
本方案中,目标参数可以包括目标占空比和目标脉冲幅度。其中,补光灯在目标参数下提供的灯光亮度与相机在当前条件下拍摄图像所需的补光灯的灯光亮度相匹配,且在目标参数下用户感知的补光灯的亮度与在当前条件下用户感知的补光灯的亮度相同,当前条件为补光灯的亮度为第一亮度等级,补光灯发出的灯光波长为第一波长,且环境光的光强为第一光照强度。
作为一种可能的实现方式,可以根据第一亮度等级,第一波长和第一光照强度,查询预先构建的PWM信号参数对应表,得到目标参数,其中,PWM信号对应表中包括第一亮度等级,第一波长,第一光照强度和目标参数之间的映射关系。示例性的,预先构建的PWM信号参数对应表可以为上文所描述的表一。
作为另一种可能的实现方式,可以将第一亮度等级,第一波长和第一光照强度输入至信号参数确定模型,得到目标参数。示例性的,信号参数确定模型可以为上文所描述的预先构建出的计算模型。
在一个例子中,目标参数对应的脉冲时间积分的目标计算值与第一参数对应的脉冲时间积分的第一计算值之间的偏差值处于预设范围内。示例性的,目标计算值可以图3a中阴影部分的面积,第一计算值可以为图3b中阴影部分的面积。
在确定出目标参数后,即可以执行步骤S104。
步骤S104、将PWM信号在当前条件下的第一参数调整至目标参数。
本方案中,第一参数可以包括第一占空比和第一脉冲幅度。当确定出目标参数后,即可以对PWM信号进行调节,进而将PWM信号在当前条件下的第一参数调整至目标参数。
进一步地,如图4所示,在调节PWM信号后,可以在确定出PWM信号为高电平信号时,控制相机拍摄图像。本方案中,高电平信号的持续时间可以大于或等于相机的曝光时间,以使得相机可以有充足的时间完成拍摄。
进一步地,在控制相机拍摄图像之后,可以将目标参数调整至第一参数,将补光灯对应的PWM信号恢复至调整前的状态。
由此,在电子设备运行过程中,基于补光灯发出的灯光的参数(即亮度等级和波长)和环境光的参数(即光照强度),确定出当前条件下适宜拍摄图像且用户感知不到灯光亮度发生变化的补光灯的控制信号的控制参数,并基于该控制参数对补光灯进行控制,使得可以在用户感知不到灯光亮度发生变化的情况下完成拍摄工作,且拍摄到的图像最佳。
在一个例子中,电子设备可以具有肌肤检测功能,其中,肌肤检测功能是用于基于相机拍摄的图像对用户的肌肤进行检测。此时,在确定目标参数之前,还可以确定是否启动电子设备上的肌肤检测功能。示例性的,本方案中,可以先确定用户与电子设备之间的距离小于预设距离阈值,例如基于电子设备中的距离传感器检测距离等。然后,再启动相机拍摄第一图像。最后,对第一图像进行分析,当确定第一图像中包含人脸,且人脸上无遮挡物时,即可以启动电子设备上的肌肤检测功能。
在一个例子中,电子设备可以为智能镜,该智能镜可以具有镜面。
应理解的是,本方案中提供的灯光调节方法,还可以应用到道路监控拍照系统,或者其他需要进行拍照的领域,在此不做限定。
基于上述实施例中的方法,本申请实施例还提供了一种灯光调节装置。该灯光调节装置可以为上文图2所示的电子设备。在一个例子中,该灯光调节装置可以包括:至少一个用于存储程序存储器,以及至少一个用于执行存储器存储的程序处理器。其中,当存储器存储的程序被执行时,处理器实现本方案中所提供的方法。示例性的,该灯光调节装置中的存储器可以为图2中的存储器202,处理器可以为图2中的处理器201。
关于灯光调节装置在上述各种可能的设计中执行的操作的详细描述可以参照上文本方案提供各个实施例中的描述,在此就不再一一赘述。
基于上述实施例中的方法,本申请实施例还提供了一种灯光调节装置,该装置可以运行计算机程序指令,以执行上述所描述的方法。示例性的,该装置可以为芯片,或处理器。在一个例子中,该装置可以包括处理器,该处理器可以与存储器耦合,读取存储器中的指令并根据该指令执行上述所描述的方法。其中,该存储器可以集成在芯片或处理器中,也可以独立于芯片或处理器之外。示例性的,该灯光调节装置中的存储器可以为图2中的存储器202,处理器可以为图2中的处理器201。
基于上述实施例中的方法,本申请实施例还提供了一种芯片。请参阅图7,图7为本申请实施例提供的一种芯片的结构示意图。如图7所示,芯片700包括一个或多个处理器701以及接口电路702。可选的,芯片700还可以包含总线703。其中:
处理器701可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器701中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器701可以是通用处理器、神经网络处理器(Neural Network Processing Unit,NPU)、数字通信器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。示例性的,该芯片700可以应用于图2所示的电子设备中,此时处理器701可以执行上述各个实施例中的部分或全部步骤。
接口电路702可以用于数据、指令或者信息的发送或者接收,处理器701可以利用接口电路702接收的数据、指令或者其它信息,进行加工,可以将加工完成信息通过接口电路702发送出去。示例性的,该芯片700应用于图2所示的电子设备中时,接口电路702可以用于输出测肤结果。
可选的,芯片700还包括存储器,存储器可以包括只读存储器和随机存取存储器,并向处理器提供操作指令和数据。存储器的一部分还可以包括非易失性随机存取存储器(NVRAM)。其中,该存储器可以与处理器701耦合。示例性的,存储器中可以存储有预先构建的PWM信号参数对应表。
可选的,存储器存储了可执行软件模块或者数据结构,处理器701可以通过调用存储器存储的操作指令(该操作指令可存储在操作系统中),执行相应的操作。
可选的,接口电路702可用于输出处理器701的执行结果。
需要说明的,处理器701、接口电路702各自对应的功能既可以通过硬件设计实现,也可以通过软件设计来实现,还可以通过软硬件结合的方式来实现,这里不作限制。
应理解,上述方法实施例的各步骤可以通过处理器中的硬件形式的逻辑电路或者软件形式的指令完成。
可以理解的是,在本申请实施例的描述中,“示例性的”、“例如”或者“举例来说”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”、“例如”或者“举例来说”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”、“例如”或者“举例来说”等词旨在以具体方式呈现相关概念。
在本申请实施例的描述中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示 可以存在三种关系,例如,A和/或B,可以表示:单独存在A,单独存在B,同时存在A和B这三种情况。另外,除非另有说明,术语“多个”的含义是指两个或两个以上。例如,多个系统是指两个或两个以上的系统,多个终端是指两个或两个以上的终端,多路视频流是指两路或两路以上的视频流。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
可以理解的是,本申请的实施例中的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件,硬件部件或者其任意组合。通用处理器可以是微处理器,也可以是任何常规的处理器。
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmablerom,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。

Claims (14)

  1. 一种灯光调节方法,其特征在于,应用于包含相机和补光灯的电子设备,所述补光灯通过脉冲宽度调制PWM信号控制,所述方法包括:
    确定用户设定的所述补光灯的第一亮度等级,及在所述第一亮度等级下所述补光灯发出的灯光的第一波长;
    确定所述电子设备所处环境的环境光的第一光照强度;
    根据所述第一亮度等级,所述第一波长和所述第一光照强度,确定所述PWM信号的目标参数,所述目标参数包括目标占空比和目标脉冲幅度,其中,所述补光灯在所述目标参数下提供的灯光亮度与所述相机在当前条件下拍摄图像所需的所述补光灯的灯光亮度相匹配,且在所述目标参数下所述用户感知的所述补光灯的亮度与在当前条件下所述用户感知的所述补光灯的亮度相同,所述当前条件为所述补光灯的亮度为所述第一亮度等级,所述补光灯发出的灯光波长为所述第一波长,且所述环境光的光强为所述第一光照强度;
    将所述PWM信号在所述当前条件下的第一参数调整至所述目标参数,所述第一参数包括第一占空比和第一脉冲幅度。
  2. 根据权利要求1所述的方法,其特征在于,所述将所述PWM信号在所述当前条件下的第一参数调整至所述目标参数之后,还包括:
    确定所述PWM信号为高电平信号,控制所述相机拍摄图像。
  3. 根据权利要求2所述的方法,其特征在于,所述高电平信号的持续时间大于或等于所述相机的曝光时间。
  4. 根据权利要求2或3所述的方法,其特征在于,所述控制所述相机拍摄图像之后,还包括:
    将所述目标参数调整至所述第一参数。
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述目标参数对应的脉冲时间积分的目标计算值与所述第一参数对应的脉冲时间积分的第一计算值之间的偏差值处于预设范围内。
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述根据所述第一亮度等级,所述第一波长和所述第一光照强度,确定所述PWM信号的目标参数,具体包括:
    根据所述第一亮度等级,所述第一波长和所述第一光照强度,查询预先构建的PWM信号参数对应表,得到所述目标参数,其中,所述PWM信号对应表中包括所述第一亮度等级,所述第一波长,所述第一光照强度和所述目标参数之间的映射关系;
  7. 根据权利要求1-5任一所述的方法,其特征在于,所述根据所述第一亮度等级,所述第一波长和所述第一光照强度,确定所述PWM信号的目标参数,具体包括:
    将所述所述第一亮度等级,所述第一波长和所述第一光照强度输入至信号参数确定模型,得到所述目标参数。
  8. 根据权利要求1-7任一所述的方法,其特征在于,所述电子设备具有肌肤检测功能,所述肌肤检测功能用于基于所述相机拍摄的图像对用户的肌肤进行检测,所述方法还包括:
    确定所述用户与所述电子设备之间的距离小于预设距离阈值;
    启动所述相机拍摄第一图像;
    确定所述第一图像中包含人脸,且所述人脸上无遮挡物,启动所述电子设备上的肌肤检 测功能。
  9. 根据权利要求1-8任一所述的方法,其特征在于,所述电子设备为智能镜,所述智能镜具有镜面。
  10. 一种灯光调节装置,其特征在于,包括:
    至少一个存储器,用于存储程序;
    至少一个处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行如权利要求1-9任一所述的方法。
  11. 一种灯光调节装置,其特征在于,所述装置运行计算机程序指令,以执行如权利要求1-9任一所述的方法。
  12. 一种计算机存储介质,所述计算机存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行如权利要求1-9任一所述的方法。
  13. 一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使得所述计算机执行如权利要求1-9任一所述的方法。
  14. 一种芯片,其特征在于,包括至少一个处理器和接口;
    所述接口,用于为所述至少一个处理器提供程序指令或者数据;
    所述至少一个处理器用于执行所述程序行指令,以实现如权利要求1-9任一所述的方法。
PCT/CN2021/136367 2021-02-22 2021-12-08 灯光调节方法及装置 WO2022174653A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110196645.7A CN114979499B (zh) 2021-02-22 2021-02-22 灯光调节方法及装置
CN202110196645.7 2021-02-22

Publications (1)

Publication Number Publication Date
WO2022174653A1 true WO2022174653A1 (zh) 2022-08-25

Family

ID=82932219

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136367 WO2022174653A1 (zh) 2021-02-22 2021-12-08 灯光调节方法及装置

Country Status (2)

Country Link
CN (1) CN114979499B (zh)
WO (1) WO2022174653A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116567882A (zh) * 2023-05-17 2023-08-08 广东千沣农业发展有限公司 一种同时实现灯光强调整与光通信的编码方法及系统
CN116709614A (zh) * 2023-08-02 2023-09-05 深圳爱图仕创新科技股份有限公司 灯光控制方法、装置、计算机设备及计算机可读存储介质
CN116567882B (zh) * 2023-05-17 2024-06-11 广东千沣农业发展有限公司 一种同时实现灯光强调整与光通信的编码方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100073520A1 (en) * 2008-09-19 2010-03-25 Altek Corporation Image brightness compensation method and digital camera device with image brightness compensation function
CN101750848A (zh) * 2008-12-11 2010-06-23 鸿富锦精密工业(深圳)有限公司 摄像装置及其补光方法
CN110351490A (zh) * 2018-04-04 2019-10-18 杭州海康威视数字技术股份有限公司 曝光方法、装置及摄像设备
WO2020224619A1 (zh) * 2019-05-08 2020-11-12 杭州海康威视数字技术股份有限公司 摄像机

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100073520A1 (en) * 2008-09-19 2010-03-25 Altek Corporation Image brightness compensation method and digital camera device with image brightness compensation function
CN101750848A (zh) * 2008-12-11 2010-06-23 鸿富锦精密工业(深圳)有限公司 摄像装置及其补光方法
CN110351490A (zh) * 2018-04-04 2019-10-18 杭州海康威视数字技术股份有限公司 曝光方法、装置及摄像设备
WO2020224619A1 (zh) * 2019-05-08 2020-11-12 杭州海康威视数字技术股份有限公司 摄像机

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116567882A (zh) * 2023-05-17 2023-08-08 广东千沣农业发展有限公司 一种同时实现灯光强调整与光通信的编码方法及系统
CN116567882B (zh) * 2023-05-17 2024-06-11 广东千沣农业发展有限公司 一种同时实现灯光强调整与光通信的编码方法及系统
CN116709614A (zh) * 2023-08-02 2023-09-05 深圳爱图仕创新科技股份有限公司 灯光控制方法、装置、计算机设备及计算机可读存储介质
CN116709614B (zh) * 2023-08-02 2023-10-20 深圳爱图仕创新科技股份有限公司 灯光控制方法、装置、计算机设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN114979499B (zh) 2023-08-22
CN114979499A (zh) 2022-08-30

Similar Documents

Publication Publication Date Title
US11093773B2 (en) Liveness detection method, apparatus and computer-readable storage medium
US9836639B2 (en) Systems and methods of light modulation in eye tracking devices
WO2020010848A1 (zh) 控制方法、微处理器、计算机可读存储介质及计算机设备
US10070047B2 (en) Image processing apparatus, image processing method, and image processing system
KR102227284B1 (ko) 디스플레이 장치 및 그 제어 방법
TWI682315B (zh) 電子裝置以及指紋感測方法
WO2022174653A1 (zh) 灯光调节方法及装置
US11687635B2 (en) Automatic exposure and gain control for face authentication
EP3621294B1 (en) Method and device for image capture, computer readable storage medium and electronic device
KR20200137918A (ko) 피부 이미지를 획득하는 전자 장치 및 그 제어 방법
WO2021046773A1 (zh) 人脸防伪检测方法、装置、芯片、电子设备和计算机可读介质
US20100046936A1 (en) Photographing control method and apparatus using strobe
US8804029B2 (en) Variable flash control for improved image detection
US9684828B2 (en) Electronic device and eye region detection method in electronic device
US20150178589A1 (en) Apparatus for processing digital image and method of controlling the same
JP2016052096A (ja) 画像処理プログラム、情報処理システム、画像処理方法
US10136047B2 (en) Focusing method and device for image shooting
CN112153300A (zh) 多目摄像头曝光方法、装置、设备及介质
CN112364724A (zh) 活体检测方法和装置、存储介质、电子设备
WO2020024603A1 (zh) 图像处理方法和装置、电子设备、计算机可读存储介质
CN116709614B (zh) 灯光控制方法、装置、计算机设备及计算机可读存储介质
US20230064329A1 (en) Identification model generation apparatus, identification apparatus, identification model generation method, identification method, and storage medium
WO2023093101A1 (zh) 终端设备的模式切换方法、设备及存储介质
US20240107177A1 (en) Techniques for Correcting Images in Flash Photography
KR20200137916A (ko) 피부 이미지를 획득하는 전자 장치 및 그 제어 방법

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21926367

Country of ref document: EP

Kind code of ref document: A1