WO2023015991A1 - 拍照方法、电子设备和计算机可读存储介质 - Google Patents

拍照方法、电子设备和计算机可读存储介质 Download PDF

Info

Publication number
WO2023015991A1
WO2023015991A1 PCT/CN2022/091901 CN2022091901W WO2023015991A1 WO 2023015991 A1 WO2023015991 A1 WO 2023015991A1 CN 2022091901 W CN2022091901 W CN 2022091901W WO 2023015991 A1 WO2023015991 A1 WO 2023015991A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
electronic device
exposure value
brightness
exposure
Prior art date
Application number
PCT/CN2022/091901
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 WO2023015991A1 publication Critical patent/WO2023015991A1/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
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/72Combination of two or more compensation controls
    • 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/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio

Definitions

  • the present application relates to the field of image processing, and in particular to a photographing method, electronic equipment, and a computer-readable storage medium.
  • the camera When taking pictures in a low-light environment, in order to obtain a relatively clear image, the camera usually controls the flash to work, thereby increasing the brightness of the environment and making the obtained image clearer. For example, when the camera is in the automatic flash mode and detects that the ambient brightness meets the working requirements of the flash, if it receives a camera instruction and detects that the image of the current scene is a high dynamic range image, it will capture when the flash is in the pre-flash state and strong flash state respectively. image, composite photos based on the captured images.
  • a time gap may cause screen shake, affecting the stability of 3A (autofocus, auto white balance, and auto exposure), which is not conducive to image registration and fusion operations, and affects the quality of the captured image.
  • Embodiments of the present application provide a photographing method and electronic equipment to solve the problems in the prior art that when taking photographs, the collected images are easily segmented inaccurately, and may cause picture shaking and 3A stability, which affect the quality of the photographed images. question.
  • the embodiment of the present application provides a photographing method, the method includes: the electronic device triggers a photographing instruction, and controls the flashlight to be in the always-on state; the electronic device collects images in the always-on state, and the collected images are included in A first image collected under an exposure value, a second image collected under a second exposure value, and a third image collected under a third exposure value, the first exposure value is smaller than the second exposure value, and the second The exposure value is smaller than the third exposure value, and the first exposure value is a standard exposure value of the current scene; the electronic device generates an image to be output according to the first image, the second image and the third image.
  • the first image collected under the first exposure value is a normal exposure image.
  • the second exposure value is greater than the first exposure value, indicating that the exposure amount of the second image collected under the second exposure value is smaller than the exposure amount of the first image collected under the first exposure value.
  • the exposure of the third image is smaller than the exposure of the second image.
  • highlighted areas including solid color areas or light source areas, they can be displayed relatively clearly in the third image.
  • the normally exposed image area it can be displayed relatively clearly in the first image.
  • the second image it can be registered with the first image and the third image respectively, so that the first image and the third image can be registered based on the second image, so that the images can be effectively registered and fused, and a clear output image can be obtained .
  • the electronic device when the electronic device captures the first image, the second image and the third image, it controls the flashlight to maintain a constant brightness with a constant brightness.
  • the ambient brightness information is basically consistent. Therefore, when collecting the first image, the second image, and the third image with consistent environmental brightness information, relatively stable camera parameters can be used for image acquisition, including automatic exposure parameters, automatic white balance parameters, and automatic focus parameters, without frequent Changing the image acquisition parameters makes the image acquisition more reliable.
  • the flashlight by controlling the flashlight to be in a constant on state, combined with the adjustment of the exposure value on the software level, the first image, the second image and the third image with different exposure values are obtained.
  • the adjustment of the exposure value on the software level is more convenient and easier to implement, which can reduce the problem of camera stability caused by the adjustment of the driving current.
  • the frame is fixed, that is, the first image, the second image and the third image are fixedly generated, and the HDR image is generated according to the generated first image, the second image and the third image.
  • the existing HDR image generation method the brightness of the frame needs to be judged through the ambient brightness information, and the decision calculation is more troublesome. Therefore, the application can effectively improve the decision-making efficiency by fixing the frame output method, and can complete the photographing process more efficiently.
  • the electronic device controls the flashlight to be in the always-on state, including: the electronic device acquires the brightness of the photographing scene; and the electronic device determines the scene The brightness corresponds to the operating current; the electronic device drives the flashlight to be in a constant light state according to the operating current.
  • the working current of the flashlight is further combined with the brightness of the environment.
  • the brightness of the environment will not be too bright or too dark, so that the requirement of obtaining the first image with normal exposure can be better met.
  • the flashlight may also be controlled to work according to a fixed working current.
  • the implementation process is relatively simpler.
  • the first image, the second image and the third image are collected based on the same ambient brightness, and the stability of the images is relatively high.
  • the electronic device capturing images in the always-on state includes: the electronic device determining the first exposure value according to the brightness of the current scene; The second exposure value and the third exposure value are determined; the electronic device collects images respectively according to the determined first exposure value, second exposure value and third exposure value.
  • the preset exposure is based on the normal exposure of the first image, and the exposure of the image is gradually reduced to obtain the second image and the third image.
  • the first exposure value is EV0
  • the second exposure value may be 4 times the first exposure value, that is, the second exposure value may be EV2.
  • the third exposure value may be 64 times of the first exposure value, that is, the third exposure value may be EV6. In practice, it is not limited to this ratio.
  • the first exposure value is EV0, for example, the second exposure value can be any value in EV1-EV4, and the third exposure value can be any value in EV4-EV10. Based on the set exposure value, objects with different brightness and images with different resolutions under different exposure values can be obtained.
  • the electronic device collects images respectively according to the determined first exposure value, second exposure value, and third exposure value, including: the electronic device separately determines the first exposure value, the determined The aperture size and/or exposure time corresponding to the second exposure value and the third exposure value; the electronic device respectively performs image acquisition according to the determined aperture size and/or exposure time.
  • the electronic device generates an image to be output according to the first image, the second image, and the third image, including: the electronic device generates the first image according to the RAW format, the RAW The second image in RAW format and the third image in RAW format are optimized and fused to obtain a first output image in RAW format; the electronic device performs color space conversion on the first output image to obtain an image to be output .
  • the electronic device optimizes and fuses the collected images in RAW. Compared with the way of image optimization and fusion in the YUV domain, or the way of image fusion and optimization in the RGB domain, this application is based on image optimization and fusion in the RAW domain.
  • the fusion method in the process of optimization and fusion, can retain richer details, making the fused image clearer, which is conducive to improving the quality of the photos taken.
  • the electronic device may perform optimization and fusion processing according to the first image in RAW format, the second image in RAW format, and the third image in RAW format to obtain the first output in RAW format
  • An image comprising: subjecting the first image, the second image, and the third image to correction of dead pixels, lens shading correction, black level correction, RAW domain noise reduction, white balance gain, and image fusion processing to obtain The first output image in RAW format.
  • the RAW image can be processed based on the network model, so that the clarity, sharpness and image signal-to-noise ratio of the processed image are better.
  • the network model may be a convolutional neural network model, or may also be a U-Net network model.
  • the electronic device performs color space conversion on the first output image to obtain an image to be output, including: the electronic device performs demosaic processing on the first output image to obtain an RGB image ; Perform color correction and global color mapping processing on the RGB image, transform the processed image through color space, and process the transformed image through YUV domain to obtain an image to be output.
  • the method further includes: the upper layer of the electronic device sends the always-on state of the flashlight to the bottom layer of the electronic device the shutdown instruction; when the upper layer of the electronic device receives the response that the flash is turned off, the camera function of the electronic device is updated to an available state.
  • the method further includes: the upper layer of the electronic device When the response of turning off the flash light is not received, the HAL of the electronic device turns off the flash light.
  • the hardware abstraction layer (HAL) is used to forcibly turn off the flash light, which can avoid the problem that the bottom layer fails to turn off the flash light in time, resulting in failure to respond to the upper layer instructions in time.
  • the predetermined first duration may be 200ms to 5s.
  • the embodiment of the present application provides a photographing device, which includes: a trigger unit, configured to trigger a photographing instruction by an electronic device, and control the flashlight to be in a constant on state; An image is collected in a bright state, and the collected images include a first image collected at a first exposure value, a second image collected at a second exposure value, and a third image collected at a third exposure value, the first An exposure value is smaller than a second exposure value, the second exposure value is smaller than a third exposure value, and the first exposure value is a standard exposure value of the current scene; an image generating unit is configured to use the electronic device to , The second image and the third image generate an image to be output.
  • a trigger unit configured to trigger a photographing instruction by an electronic device, and control the flashlight to be in a constant on state
  • An image is collected in a bright state, and the collected images include a first image collected at a first exposure value, a second image collected at a second exposure value, and a third image collected at a third exposure
  • the photographing device corresponds to the above-mentioned photographing method.
  • an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor executes the computer program, the above-mentioned second or third aspect can be realized.
  • an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of the second aspect or the third aspect above is implemented.
  • the embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled with the memory, and the processor executes the computer program stored in the memory, so as to realize any one of the second aspect or the third aspect. method described in the item.
  • the chip system can be a single chip, or a chip module composed of multiple chips.
  • an embodiment of the present application provides a computer program product, which, when the computer program product is run on an electronic device, causes the electronic device to execute the method described in any one of the above-mentioned second aspect or third aspect.
  • FIG. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
  • FIG. 2 is a software structural block diagram of an electronic device provided in an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a photographing scene provided by the present application.
  • FIG. 4 is a schematic diagram of a photographing method for improving image clarity provided by the present application.
  • Fig. 5 is a schematic diagram of the implementation flow of a photographing method provided by the present application.
  • Fig. 6 is a schematic flow chart of turning on the flashlight always-on mode provided by the embodiment of the present application.
  • FIG. 7 is a schematic diagram of a constant-on state of a flashlight with different ambient brightness provided by the embodiment of the present application.
  • FIG. 8 is a schematic diagram of a photographing process provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a first image collected at a first exposure value provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a second image collected at a second exposure value provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a third image collected at a third exposure value provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of an image processing flow based on a RAW domain provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of an image signal processing flow of a night scene image provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of image signal processing of a night scene image 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, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. 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 video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • 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.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • processor 110 may include multiple sets of I2S buses.
  • the processor 110 can be coupled with the audio module 170 through an I2S bus to realize communication between the processor 110 and the audio module 170.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through the Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interface includes camera serial interface (camera serial interface, CSI), display serial interface (display serial interface, DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface to realize the shooting function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to realize the display function of the electronic device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193 , the display screen 194 , the wireless communication module 160 , the audio module 170 , the sensor module 180 and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules shown in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also provide power for electronic devices through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • 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.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC , FM, and/or IR techniques, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code division multiple access
  • TD-SCDMA time-division code division multiple access
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou satellite navigation system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • 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.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, 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 internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • 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 audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Speaker 170A also referred to as a "horn" is used to convert audio electrical signals into sound signals.
  • Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the receiver 170B can be placed close to the human ear to receive the voice.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can put his mouth close to the microphone 170C to make a sound, and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 may be provided with two microphones 170C, which may also implement a noise reduction function in addition to collecting sound signals. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions, etc.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • 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 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • the electronic device 100 determines the intensity of pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
  • 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 may be determined by the gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
  • 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 electronic device 100 when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • 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 identify the posture of electronic devices, 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.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to make a call, 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. For example, when the temperature reported by the temperature sensor 180J exceeds the threshold, the electronic device 100 may reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by the low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • the touch sensor 180K is also called “touch device”.
  • 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 bone conduction sensor 180M can also contact the human pulse and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone, combined into a bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vibrating bone mass of the vocal part acquired by the bone conduction sensor 180M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations applied to different applications may correspond to different vibration feedback effects.
  • the motor 191 may also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • the software architecture of the electronic device 100 will be introduced as an example below.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer, Android runtime (Android runtime) and system libraries, and the kernel layer from top to bottom.
  • the application layer can consist of a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include window managers, content providers, view systems, phone managers, resource managers, notification managers, and so on.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications. These data can include video, images, audio, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on.
  • the view system can be used to build applications.
  • a display interface can consist of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 .
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears on the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
  • Android Runtime includes core libraries and virtual machines. The Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application program layer and the application program framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • a system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
  • the media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least a display driver, a camera driver, an audio driver, and a sensor driver.
  • the workflow of the software and hardware of the electronic device 100 will be exemplarily described below in conjunction with a photographing scene.
  • the user's finger or stylus touches the display screen 194 of the electronic device 100, the touch sensor 180K disposed on the display screen 194 receives the touch operation, and the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes touch operations into touch events that can be read by the upper layer (for example, action down events, action move events, and action up events, etc.).
  • the action down event indicates that the finger or stylus touches the touch screen for the first time, for example, the user uses the stylus to write down a certain area on the touch screen;
  • the pen slides on the touch screen;
  • the action up event indicates that the finger or the stylus is separated from the touch screen, for example, after the stylus falls and slides for a certain distance, the user lifts the stylus so that the stylus is separated from the touch screen.
  • Touch events are stored at the kernel level.
  • the application framework layer obtains the touch event from the kernel layer, and identifies the control corresponding to the advanced touch event and the touch operation corresponding to the touch event.
  • the touch operation includes click, double-click, and slide. Take the touch operation as a touch and click operation, and the control corresponding to the click operation is the camera control of the video application as an example.
  • the video application calls the interface of the application framework layer, and then calls the corresponding callback function to realize the touch operation. corresponding application functions.
  • FIG. 3 is a schematic diagram of a photographing scene.
  • the photographing scene may include places with low ambient brightness such as indoor scenes and night scenes.
  • the brightness of the scene is usually increased by supplementary light.
  • the user enters the camera interface after opening the camera application.
  • the camera interface includes a preview area and a button area.
  • the preview area is used to display the preview image under the current shooting angle of the electronic device.
  • there is a zoom button that is, a round button on the right side of the preview area.
  • a first button area is included below the preview area, and the button area includes a camera mode selection button, a shooting button, an album button, and a lens switching button. Press the mode button to enter the corresponding shooting mode.
  • the shooting parameter buttons may include a flash mode button, a parameter setting button, and the like.
  • the function selection button may include, for example, a smart camera button, a color style button, a camera shopping button, and the like. As shown in the left figure of FIG. 3 , when the user selects the automatic flash mode, the electronic device determines whether to turn on the flash according to the brightness of the current scene.
  • the acquired ambient brightness can be compared with a preset brightness threshold. If the current ambient brightness is greater than or equal to the preset brightness threshold, as shown in the lower figure on the right side of Figure 3, the flash will not be triggered to work when taking pictures. If the current ambient brightness is lower than the preset brightness threshold, as shown in the upper figure on the right side of FIG. 3 , the flashlight is triggered to work when taking pictures. When it is determined to take pictures, the flash will be triggered to work. If the electronic device receives the user's photo instruction, it will control the flash to emit a strong flash line. brightness of the image.
  • Figure 4 shows an implementation process of improving image clarity based on images in strong flash state and pre-flash state.
  • the electronic device is in a scene with low brightness, and the working mode of the flash light of the electronic device is an automatic flash mode.
  • the electronic device compares the collected ambient brightness with a preset brightness threshold, determines that the collected ambient brightness is less than the preset brightness threshold, and can trigger a flash when taking pictures.
  • the image acquisition process can be divided into a pre-flash state and a strong flash state.
  • the pre-flash state is a period of time before the flashlight emits a flash after the electronic device receives the photographing instruction.
  • the strong flash state is the time period when the flash emits flashes.
  • the electronic device can capture one or more images.
  • the strong flash state the electronic device can collect one or more images. If the electronic device collects multiple images in the pre-flash state or the strong flash state, the multiple images in the pre-flash state can be fused into one image, or the multiple images in the strong flash state can be fused into one image.
  • the electronic device does not increase the brightness of the scene in the pre-flash state, the brightness of the captured image is relatively low.
  • the electronic device increases the brightness of the scene through the flash light, and the brightness of the collected image is higher than that of the image collected in the pre-flash state. Because images with different brightness reflect different detailed information, for example, a low brightness image can more clearly display a higher brightness object, and a higher brightness image can more clearly display a lower brightness object.
  • the image generated in the pre-flash state and the image generated in the strong flash state can be fused to obtain a higher-definition image.
  • the acquisition and fusion of the strong flash state and the pre-flash state can effectively improve the image quality.
  • the brightness and clarity of the images collected in these two states will have a large difference, which is not conducive to Accurate segmentation of objects in the image, including objects such as people or objects.
  • an embodiment of the present application proposes a photographing method.
  • the photographing method adjusts the control mode of the flashlight.
  • the pre-flash state and the strong flash state of the flashlight are adjusted to a constant light state, so that the electronic device can collect images with the same brightness of the scene, which is beneficial to the scene. people or objects for segmentation.
  • the exposure values of the captured images the first image is captured based on the standard exposure value (i.e., the first exposure value), the second image is captured based on the second exposure value, and the third image is captured based on the third exposure value, and the first exposure The value is greater than the second exposure value, which is greater than the third exposure value.
  • the time interval for image acquisition by adjusting the exposure value is shorter than the time interval for image acquisition in the pre-flash state and strong flash state, it can more effectively reduce image shake and improve auto focus, auto white balance and auto exposure
  • the stability of the image is conducive to the registration and fusion of the image, and the quality of the image is improved.
  • FIG. 5 is a schematic diagram of an implementation flow of a photographing method provided in an embodiment of the present application, and is described in detail as follows:
  • the electronic device triggers a photographing instruction, and controls the flashlight to be in a constant on state.
  • the electronic device in the embodiment of the present application includes a smart phone, a tablet computer, a notebook computer or other electronic devices with a camera.
  • the photographing instruction triggered by the electronic device may be a button instruction, a touch instruction, a voice control instruction or an instruction triggered by screen content.
  • the button instruction may include an instruction triggered according to a preset camera function key when the camera application program in the electronic device is in a running state. For example, in the running state of the camera application program, the user clicks the volume up key or the volume down key to trigger the camera application program to take pictures.
  • the button command can also be an instruction issued by the camera button of the shooting auxiliary device when the electronic device is connected to other shooting auxiliary devices. The button command is sent to the electronic device, so that the electronic device triggers the camera command.
  • the key command can also be used to quickly start the camera and trigger the camera command through the shortcut key when the camera application is not running, so as to meet the needs of quickly capturing scenes.
  • the touch instruction may be an instruction generated when the camera button is triggered on the touch screen of the electronic device.
  • the photographing interface of the electronic device shown in the left figure of FIG. 3 there are three touch buttons located below the preview area.
  • the photographing command is triggered.
  • the voice control command can detect the voice content of the user through the voice detection system during the running of the camera application program of the electronic device. If the detected voice content includes a preset keyword of the photographing instruction, the photographing instruction is triggered. Alternatively, the voice content of the user can also be detected in real time by the voice detection system. If the detected content matches the preset keywords of the camera instruction, the camera application program is started and the camera instruction is triggered.
  • the feature content that needs to trigger the photographing instruction can be selected as required. For example, it can be set that when the preview image includes a smiley face feature, the camera command will be automatically triggered. It is not limited thereto, and may also include other characteristic content, including, for example, a specific human face, a vehicle, and the like.
  • the electronic device After the electronic device triggers the photographing instruction, it controls the flashlight to be in a constant light state.
  • the flashlight is in a state of constant lighting, which means that the flashlight is in a state of constant lighting during the image acquisition process.
  • the flash can be turned off.
  • the brightness of the flashlight in the always-on state may be a fixed brightness, or the brightness in the always-on state may be determined according to the brightness of the environment.
  • FIG. 6 is a schematic diagram of an implementation flow of an electronic device triggering a photographing instruction and controlling a flashlight to be in a constant-on state according to an embodiment of the present application.
  • the electronic device triggers a camera command
  • the implementation process of controlling the flashlight to be in a constant on state includes:
  • the electronic device determines, according to a preset flash mode, that a flash light is required to take pictures.
  • the preset flash mode may be an automatic flash mode or a flash mode.
  • the flash mode is an automatic flash mode, and each time the electronic device takes a picture, it will collect the brightness in the environment through the underlying hardware, that is, the brightness in the shooting scene of the electronic device, and compare the collected brightness with the preset brightness threshold . If the collected brightness is lower than the preset brightness threshold, the comparison result is reported to the upper layer. According to the reported conclusion, the upper layer determines to trigger the flashlight to work when shooting. If the collected brightness is lower than the preset brightness threshold, the flash will not be triggered to work when shooting.
  • the electronic device When the flash mode is the flash mode, the electronic device does not need to compare the ambient brightness with the preset brightness threshold every time the electronic device takes a picture, and the upper layer decides to always trigger the flash to work when shooting.
  • the electronic device triggers a photographing instruction.
  • the camera application program of the electronic device may be in a running state or in a non-running state. If the camera application program in the electronic device is in a non-running state, the camera application program can be started through the photographing instruction.
  • the photographing instruction can be triggered according to preset button operation, touch operation, sound or screen content.
  • the electronic device determines the working current of the flashlight according to the ambient brightness.
  • 603, 602, and 601 may not be executed strictly in accordance with the sequence of serial numbers. For example, it is possible to first trigger the photographing command, and then determine that the photographing requires the flashlight to work, and determine the working current of the flashlight, or, first determine that the photographing requires the flashlight to work and the working current of the flashlight, and then trigger the photographing command.
  • the electronic device determines the operating current of the flashlight according to the ambient brightness
  • the corresponding relationship between the brightness and the operating current can be preset.
  • the ambient brightness is detected
  • the operating current corresponding to the ambient brightness is found according to the preset correspondence relationship.
  • the working current determined by the ambient brightness can meet the brightness adjustment requirements of different brightness, and make the adjusted ambient brightness in a relatively stable range.
  • the flashlight when the flashlight is driven by a fixed working current for supplementary light, it will increase the fixed brightness on the basis of the ambient brightness, so that there may be a large deviation in the adjusted brightness.
  • the flashlight is turned on according to the operating current, and kept in a constant light state for a predetermined time.
  • the determined operating current When the brightness of the environment is low, the determined operating current is larger, and when the brightness of the environment is high, the determined operating current is low.
  • the ambient brightness in the left image is higher than that in the middle and right images, and the determined operating current is relatively small.
  • the brightness of the flash is low.
  • the ambient brightness in the right picture is lower than that in the middle and left pictures, and the determined working current is larger, and the brightness of the flash driven by the working current is higher.
  • the flashlight After the flashlight is turned on according to the determined working current, the flashlight keeps the brightness corresponding to the working current unchanged within a predetermined period of time, that is, the flashlight maintains a constant lighting state. In the always-on state, it can enter S502 to collect images in the scene to obtain multiple images with the same brightness of the scene.
  • the upper layer of the electronic device sends a shutdown instruction of the flashlight to the bottom layer of the electronic device, so that the bottom layer turns off the flashlight according to the shutdown instruction, and feeds back a response message of shutdown. If the upper layer receives the response information of the shutdown command fed back by the bottom layer, for example, it can be determined that the flashlight is currently turned off by the status bit information of the register, then the camera application's camera function can be updated from an unavailable state to an available state. Wherein, the unavailable state of the photographing function is a period from when the electronic device triggers the photographing instruction to when the upper layer of the electronic device receives a response to the instruction to turn off the flashlight.
  • the upper layer of the electronic device fails to receive the response instruction from the bottom layer of the electronic device within a predetermined time period (which can be set to any value within 300 milliseconds to 5 seconds), it can be closed through HAL (abstract hardware layer)
  • HAL abtract hardware layer
  • the flashlight is used to make the flashlight exit the always-on state.
  • the flash is turned off by HAL, the photo taking function of the camera application is updated from unavailable to available.
  • the unavailable state of the photographing function of the camera application program is a time period from when the electronic device triggers a photographing instruction to when the HAL of the electronic device turns off the flashlight.
  • the trigger command does not respond, or may generate an unresponsive prompt message. Including such as prompt window and so on.
  • the electronic device collects images in the always-on state, and the collected images include the first image collected under the first exposure value, the second image collected under the second exposure value, and the image collected under the third exposure value The third image acquired below.
  • the exposure value in the embodiment of the present application includes a first exposure value, a second exposure value and a third exposure value.
  • Exposure values are a base-2 logarithmic scale system. Its calculation formula can be expressed as: Among them, N represents the aperture (f value), EV represents the exposure value, and t represents the exposure time (in seconds). Since the exposure value is calculated from the exposure time and aperture, for the same exposure value, it can be calculated by selecting different combinations of aperture and exposure time.
  • the first exposure value is a standard exposure value of the current scene.
  • the standard exposure value is an exposure value set for normal exposure of the image. Therefore, for environments with different brightness, the set standard exposure values are also different.
  • the brightness in the environment is kept within a certain range by adjusting different operating currents. Therefore, when the flashlight is turned on by the working current so that the brightness of the scene remains consistent, the standard exposure value in the embodiment of the present application may be the same exposure value.
  • a table of correspondences between standard exposure values and ambient brightness or ambient illuminance, or a table of correspondences between brightness of the area where the captured image is located and standard exposure values may be established in advance.
  • the standard exposure value is determined according to the ambient brightness and ambient illuminance detected by the electronic device, or the brightness of the area where the captured image is located.
  • the present application On the basis of determining the standard exposure value, that is, the first exposure value, the present application also sets a second exposure value and a third exposure value.
  • the second exposure value is greater than the first exposure value
  • the third exposure value is greater than the second exposure value.
  • the definition of the exposure value it can be seen that the larger the exposure value is, the smaller the brightness of the image is.
  • the brightness of the second image 82 acquired by the second exposure value is smaller than the brightness of the first image 81 acquired by the first exposure value.
  • the brightness of the third image 83 captured by the third exposure value is smaller than the brightness of the second image 82 captured by the second exposure value.
  • the first exposure value can be expressed as EV0
  • the second exposure value can be any value within the range of EV1 to EV4
  • the third exposure value can be any value from EV4 to EV8, and the second exposure value is less than The third exposure compensation value.
  • the first exposure value is EV0
  • the second exposure value is EV3.
  • the exposure parameter value of the second exposure value is the exposure parameter value of the first exposure value 2 3 times of , that is, the exposure amount of the first exposure value is 8 times of the exposure amount of the second exposure value.
  • the second exposure value is EV0 and the third exposure value is EV6.
  • the exposure parameter value of the third exposure value is the first exposure value Exposure parameter 2 6 times. That is, the exposure amount of the first exposure value is 64 times of the exposure amount of the third exposure value.
  • N 1 , N 2 , and N 3 represent the aperture size of the first exposure value, the aperture size of the second exposure value, and the aperture size of the third exposure value, respectively, and t 1 , t 2 , and t 3 represent the first exposure value
  • the electronic device controls the flashlight to maintain a constant light state with a fixed brightness when the first image, the second image and the third image are collected.
  • the ambient brightness information is basically consistent. Therefore, when collecting the first image, the second image, and the third image with consistent environmental brightness information, relatively stable camera parameters can be used for image acquisition, including automatic exposure parameters, automatic white balance parameters, and automatic focus parameters, without frequent Changing the image acquisition parameters makes the image acquisition more reliable.
  • the flashlight by controlling the flashlight to be in a constant on state, combined with the adjustment of the exposure value on the software level, the first image, the second image and the third image with different exposure values are obtained.
  • the adjustment of the exposure value on the software level is more convenient and easier to implement, which can reduce the problem of camera stability caused by the adjustment of the driving current.
  • the frame is fixed, that is, the first image, the second image, and the third image are fixedly generated, and an HDR image is generated according to the frame image.
  • the existing HDR image generation method the brightness of the frame needs to be judged through the ambient brightness information, and the decision calculation is more troublesome. Therefore, the application can effectively improve the decision-making efficiency by fixing the frame output method, and can complete the photographing process more efficiently.
  • the first image in the embodiment of the present application is a normal exposure image, therefore, the first image includes more image detail information.
  • multiple images may be included in the first image. By performing denoising and image quality optimization processing on multiple images included in the first image, a clearer fusion image is facilitated.
  • the electronic device generates an image to be output according to the first image, the second image, and the third image.
  • a first image 81 can be acquired through an exposure value. Since the first exposure value is the standard exposure value, most objects or portraits in the first image 81 are clearer than those in the second image 82 and the third image 83 . As shown in the first image of the first exposure value shown in FIG. 9 , in the first image captured by the first exposure value, the portrait information is relatively clear, but the solid color area above the portrait is blurred due to overexposure.
  • the first image may include multiple images, for example, may include 5-8 frames of images.
  • a plurality of images collected by the first exposure value can be denoised and fused into a standard exposure image with higher definition.
  • a second image 82 is captured with a second exposure value. Since the second exposure value is greater than the first exposure value, in the second image of the second exposure value shown in FIG. 10 , the definition of the portrait is reduced, but the definition of the solid color area above the portrait is improved.
  • the exposure amount of the third exposure value is much smaller than the exposure amount of the first exposure value. Therefore, in the third image 83 collected under the third exposure value, the third image collected based on the third exposure value as shown in FIG. 11 In , the solid color area can capture a clearer image, but the portrait content is very blurry.
  • the sharp areas in the first image are very blurry in the third image, and the clear areas in the third image are very blurry in the first image. Therefore, image registration cannot be accurately completed between the first image and the third image.
  • the portrait area in the second image is clearer than the portrait area in the third image
  • the solid color area in the second image is clearer than the first image. Therefore, the first image can be registered with the second image according to the portrait region, and the second image can be registered with the third image according to the solid color region. According to the registration result of the first image and the second image, and the registration result of the second image and the third image, the registration result of the first image and the third image can be obtained.
  • An output image 84 with better definition can be generated according to the registered first image and the third image.
  • the portrait area and the solid-color area are only examples, and the areas used for image registration are not limited to the portrait area and the solid-color area.
  • the portrait area may be other normally exposed image areas.
  • the solid color area may be replaced with a high brightness area in the first image, for example, may be replaced with a light source area and the like.
  • an HDR image with higher definition can be synthesized.
  • it can reduce the decision calculation of the photos required for the synthesis of the HDR image.
  • the present application can directly collect the required first image, second image, and third image, and can obtain clear HDR images while effectively reducing decision-making calculations and improving image generation efficiency.
  • FIG. 13 is a schematic diagram of a process flow for capturing images and processing them in the RAW domain provided by the embodiment of the present application. As shown in Figure 13, the shooting process includes:
  • the camera application program can be made to respond to the camera function or the video shooting function, and the flashlight can be kept in a constant light state during the realization of the camera function or the video shooting function.
  • the photographing method in the embodiment of the present application can be mainly used for capturing night scene images, indoor image capturing or other low-brightness scenes. Therefore, when the user selects the night scene shooting mode, or when the electronic device detects that the brightness of the current scene is low, and the electronic device automatically switches to the night scene mode, the flash always-on mode can be triggered.
  • the electronic device determines the operating current of the flashlight according to the brightness of the environment, so that the operating current is associated with the brightness of the scene.
  • the operating current is small, and if the brightness of the scene is low, the operating current is large.
  • the flash When the flash is always on, the brightness of the environment remains stable.
  • Performing image acquisition under a stable environment brightness can make the parameters of the acquired image, including automatic exposure parameters, automatic white balance parameters and automatic focus parameters, more stable, so that images with better quality can be obtained.
  • the exposure value is adjusted to obtain images with different exposures. It only needs to modify the exposure parameters at the software level, avoiding the adjustment of the driving current, which can improve the convenience of operation and reduce the stability problems caused by current adjustment.
  • an HDR image is generated according to the outputting frame images.
  • the brightness of the frame needs to be judged through the ambient brightness information, and the decision calculation is more troublesome. Therefore, the application can effectively improve the decision-making efficiency by fixing the frame output method, and can complete the photographing process more efficiently.
  • the first image is a normal exposure image, therefore, the details of the first image are more.
  • Two or more frames of images can be collected as the first image, and through denoising and fusion processing, it is easier to obtain a clearer photo.
  • the highlighted areas in the scene are relatively blurred in the first image.
  • the third image is the image with the highest exposure value, that is, the third image has the lowest exposure value.
  • the high-brightness areas in the scene can be displayed relatively clearly, but the low-brightness areas in the scene are blurred.
  • the overexposed areas in the scene are clearer in the second image relative to the first image.
  • the low brightness area in the scene is clearer in the second image.
  • the registration result of the first image and the second image, and the registration result of the second image and the third image the registration of the first image and the third image is realized. Therefore, the clear image of the low-brightness area in the scene can effectively cooperate with the clear image of the high-brightness area in the scene.
  • Lens Shading Correction (English full name Lens Shading Correction, English abbreviation LSC) is to solve the lens to correct the shadows around the lens caused by uneven optical refraction.
  • Lens shading correction methods can include concentric circle method and grid method, etc.
  • the black level is the lowest level value of the black data, and usually refers to the level value of the sensor signal corresponding to the photosensitive image data being 0.
  • the current black level correction (English full name Black Level Correction, English abbreviation BLC) scheme includes subtracting a fixed value for black level correction, and using the black level drift curve with temperature and gain for black level correction .
  • the network model may be a convolutional neural network model, or may also be a U-Net network model or the like.
  • the image used for training can be input into the network model in advance, and the changes in parameters such as the definition, signal-to-noise ratio, and sharpness of the image output by the network model and the input image can be judged.
  • the output image has higher definition, higher signal-to-noise ratio, and higher sharpness than the input image.
  • the first image, the second image, and the third image can be optimized through the trained network model, so as to obtain higher definition, higher signal-to-noise ratio, and sharper image. good output image.
  • Automatic capture balance methods usually include gray world method, white block method, light source parameter voting method and color scale correction method, etc.
  • the optimized images are directly fused in the RAW domain to obtain a fused image. Since a large number of details of the image are preserved in RAW, compared with the image optimized and fused by YUV, the image optimized and fused in the RAW domain has more detailed content, which is convenient for obtaining a higher quality image.
  • non-linear superposition processing may also be performed on the fused image. It may mean that the HDR image is included in the image, and the LDR image is generated through nonlinear mapping and superposition, so that the LDR screen can effectively display the generated image.
  • ghosting in the fused image due to frame registration issues, or when objects move in the image.
  • a ghost image is a double image of the same object present in an image, or it can also be called an artifact.
  • the ghost image area included in the fused image can be determined through ghost image detection, and the ghost image image can be corrected by selecting a corresponding area of one of the images before fusion to replace the ghost image area of the fused image.
  • ghost correction processing may also be implemented by improving registration accuracy and the like.
  • the image processing process of the present application can realize image optimization and fusion processing in the RAW domain with richer details, and obtain a RAW output image with clearer and richer details.
  • Fig. 14 is a schematic diagram of image signal processing of a night scene image provided by the embodiment of the present application. As shown in Fig. 14, the process includes:
  • the sensor collects multiple frames of RAW images.
  • the sensor when the sensor collects multiple frames of RAW images, based on S502 in FIG. 5 , when the flashlight is always on, multiple frames of images can be collected, including the first image, the second image and the third image.
  • it may be controlled based on parameters at the software level, so that the exposure values of the first image, the second image, and the third image are different.
  • the exposure value of the first image is a standard exposure value, which is a standard exposure image of the first image.
  • the second exposure value for capturing the second image is greater than the first exposure value for capturing the first image
  • the third exposure value for capturing the third image is greater than the second exposure value for capturing the second image.
  • the dead point removal method may include mean value method, linkage method or debugging method, etc.
  • Lens Shading Correction (English full name Lens Shading Correction, English abbreviation LSC) is to solve the lens to correct the shadows around the lens caused by uneven optical refraction.
  • Lens shading correction methods can include concentric circle method and grid method, etc.
  • the method for processing night scenes in the RAW domain may include steps 1303, 1304, 1305, 1306, 1307, 1308 and the like shown in FIG. 13 .
  • Demosaicing is used to convert a Bayer array, or RAW image, to an RGB image.
  • Demosaicing is digital image processing for reconstructing a full-color image from incomplete color samples output by an image sensor covered with a color filter array (CFA). Also known as CFA interpolation or color reconstruction.
  • CFA color filter array
  • the reconstructed image is usually accurate in uniformly colored areas, but suffers loss of resolution (detail and sharpness) and has edge artifacts.
  • Tone mapping may include global tone mapping and local tone mapping.
  • the RGB image can be converted to an image in YUV format, or an image in RGB format can be output directly.
  • the image can be further optimized such as noise reduction to further improve the image quality.
  • the photographing scheme of this application chooses to perform image optimization and fusion in the RAW domain, so that the image can retain more image details, which is conducive to improving the clarity of the output image and improving the output image. image quality. It is worth noting that the above method applied to image processing can be used to generate higher-definition and more stable-quality photos in photo-taking scenes, and can also be used to shoot video scenes to generate higher-definition and more stable-quality photos. video.
  • the electronic device may include a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor executes the computer program, the method in any one of the above method embodiments is implemented.
  • the embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be realized.
  • An embodiment of the present application provides a computer program product.
  • the computer program product runs on an electronic device, the electronic device can implement the steps in the foregoing method embodiments when executed.
  • the embodiment of the present application also provides a chip system, the chip system includes a processor, the processor is coupled with the memory, and the processor executes the computer program stored in the memory, so as to realize the above-mentioned method embodiments. method.
  • the chip system may be a single chip, or a chip module composed of multiple chips.
  • references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

本申请属于图像处理领域,提出了一种拍照方法、电子设备和计算机可读存储介质。该方法包括:电子设备触发拍照指令,控制闪光灯处于常亮状态;电子设备在所述常亮状态下采集图像,所采集的图像包括在第一曝光值下采集的第一图像、第二曝光值下采集的第二图像,以及在第三曝光值下采集的第三图像,第一曝光值小于第二曝光值,第二曝光值小于第三曝光值,第一曝光值为当前场景的标准曝光值;电子设备根据第一图像、第二图像和第三图像生成需要输出的图像。通过控制闪光灯处于常亮状态,从而可以基于相同亮度的环境进行图像采集,减小图像采集的时间间隙,降低图像采集的抖动几率,提高图像采集参数的稳定性,便于融合生成更为清晰的图像。

Description

拍照方法、电子设备和计算机可读存储介质
本申请要求于2021年08月12日在中国专利局提交的、申请号为202110927005.9、申请名称为“拍照方法、电子设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理领域,尤其涉及一种拍照方法、电子设备和计算机可读存储介质。
背景技术
在光线较暗的环境下拍照时,为了得到相对清晰的图像,相机通常会控制闪光灯工作,从而提升环境的亮度,使得到的图像更加清晰。比如,相机在自动闪光模式下,检测到环境亮度符合闪光灯工作要求,如果接收到拍照指令并检测到当前场景的图像为高动态范围图像时,分别在闪光灯处于预闪状态和强闪状态时采集图像,根据所采集的图像合成照片。
由于预闪状态和强闪状态下所采集的图像的亮度和清晰度差异较大,容易导致所采集的图像中的人物或物体分割不准确,并且,在预闪状态和强闪状态之间有一个时间间隙,可能会产生画面抖动,影响3A(自动对焦、自动白平衡和自动曝光)稳定性,不利于对图像进行配准和融合操作,影响所拍摄图像的质量。
发明内容
本申请实施例提供一种拍照方法和电子设备,以解决现有技术中在拍照时,容易导致所采集的图像分割不准确,并且可能产生画面抖动和3A稳定性,影响所拍摄图像的质量的问题。
第一方面,本申请实施例提供一种拍照方法,该方法包括:电子设备触发拍照指令,控制闪光灯处于常亮状态;电子设备在所述常亮状态下采集图像,所采集的图像包括在第一曝光值下采集的第一图像、第二曝光值下采集的第二图像,以及在第三曝光值下采集的第三图像,所述第一曝光值小于第二曝光值,所述第二曝光值小于第三曝光值,所述第一曝光值为当前场景的标准曝光值;电子设备根据所述第一图像、所述第二图像和所述第三图像生成需要输出的图像。
其中,第一曝光值下所采集的第一图像,为正常曝光的图像。第二曝光值大于第一曝光值,说明第二曝光值下所采集的第二图像的曝光量,小于第一曝光值下所采集的第一图像的曝光量。同样的道理,第三图像的曝光量,小于第二图像的曝光量。对于高亮区域,包括如纯色区域,或光源区域,可以在第三图像中较为清晰的显示。对于正常曝光的图像区域,在第一图像中可以较为清晰的显示。通过第二图像,可以分别与第一图像和第三图像配准,从而使得第一图像与第三图像能够基于第二图像进行配准,使得图像能够有效的配准融合,得到清晰的输出图像。
可以看出,电子设备在所采集的第一图像、第二图像和第三图像时,控制闪光灯保持固定亮度的常亮状态。电子设备在图像采集过程中,环境亮度信息基本一致。因 此,在采集环境亮度信息一致的第一图像、第二图像和第三图像时,可以采用较为稳定的相机参数,包括自动曝光参数、自动白平衡参数和自动对焦参数进行图像采集,不需要频繁变动图像采集参数,使得图像采集的可靠性更高。
并且,通过控制闪光灯处于恒定的常亮状态,并结合软件层面上的曝光值的调整,得到不同曝光值的第一图像、第二图像和第三图像。相对于驱动电流的调整,通过软件层面上的曝光值调整更加方便,实现更为容易,可以减少由驱动电流调整所带来的拍照稳定性问题。
本申请实施例通过固定出帧的方式,即固定生成第一图像、第二图像和第三图像,根据所出的第一图像、第二图像和第三图像生成HDR图像。而现有的HDR图像生成方法,需要通过环境亮度信息判断出帧的亮度,决策计算较为麻烦,因此,本申请通过固定出帧方式,可以有效的提高决策效率,可以更高效的完成拍照流程。
在第一方面的一些可能的实现方式中,电子设备控制闪光灯处于常亮状态,包括:电子设备获取拍照场景的亮度;根据预先设定的亮度与工作电流的对应关系,电子设备确定所述场景的亮度对应的工作电流;电子设备根据所述工作电流驱动所述闪光灯处于常亮状态。
在确定闪光灯处于常亮状态时,进一步结合环境的亮度,计算闪光灯的工作电流。使计算的工作电流驱动闪光灯工作时,环境的亮度不会过亮或过暗,从而能够更好的满足正常曝光获取第一图像的要求。
在可能的实现方式中,也可以控制闪光灯按照固定的工作电流工作。实现过程相对更为简单。使得第一图像、第二图像和第三图像基于同样的环境亮度采集得到,图像的稳定性较高。
在第一方面的一些可能实现方式中,电子设备在所述常亮状态下采集图像,包括:电子设备根据当前场景的亮度确定第一曝光值;根据预先设定的曝光量比例关系,电子设备确定所述第二曝光值和第三曝光值;电子设备根据所确定的第一曝光值、第二曝光值和第三曝光值分别采集图像。
其中,预先设定的曝光量以第一图像的正常曝光量为基础,逐步减少图像的曝光量,采集得到第二图像和第三图像。在可能的实现方式中,可以假设第一曝光值为EV0,第二曝光值可以为第一曝光值的4倍,即第二曝光值可以为第EV2。第三曝光值可以为第一曝光值的64倍,即第三曝光值可以为EV6。在实施过程中,不局限于该比例。第一曝光值为EV0,比如,第二曝光值可以为EV1-EV4中的任意值,第三曝光值可以为EV4-EV10中的任意值。基于所设定的曝光值,可以得到不同亮度的物体,在不同曝光值下的不同清晰度的图像。
在第一方面的一些可能实现方式中,电子设备根据所确定的第一曝光值、第二曝光值和第三曝光值分别采集图像,包括:电子设备分别确定与所述第一曝光值、所述第二曝光值和所述第三曝光值对应的光圈大小和/或曝光时间;电子设备根据所确定的光圈大小和/或曝光时间,分别进行图像采集。
根据所确定的曝光值进行图像采集时,只需要通过软件层面调整曝光参数,包括光圈和曝光时间,从而能够有效的实现不同曝光值图像的采集。相对于通过电流调整实现不同闪光灯亮度来确定不同曝光值图像的方式,通过软件层面的调整参数,能够 更为有效的提升拍照过程的稳定性。
在第一方面的一些可能实现方式中,电子设备根据所述第一图像、所述第二图像和所述第三图像生成需要输出的图像,包括:电子设备根据RAW格式的第一图像、RAW格式的所述第二图像和RAW格式的所述第三图像进行优化和融合处理,得到RAW格式的第一输出图像;电子设备对所述第一输出图像进行颜色空间变换,得到需要输出的图像。
电子设备将所采集的图像在RAW中进行优化和融合,相对于YUV域进行图像优化和融合的方式,或者相对于在RGB域进行图像融合和优化的方式,本申请基于RAW域的图像优化和融合方式,在优化和融合过程中,可以保留更为丰富的细节,使得融合后的图像的清晰度更高,有利于提升所拍摄照片的质量。
在RAW域进行图像优化处理时,电子设备可以根据RAW格式的第一图像、RAW格式的所述第二图像和RAW格式的所述第三图像进行优化和融合处理,得到RAW格式的第一输出图像,包括:将所述第一图像、所述第二图像和所述第三图像经过坏点校正、镜头阴影校正、黑电平校正、RAW域降噪、白平衡增益和图像融合处理,得到RAW格式的第一输出图像。
其中,RAW域降噪处理时,可以基于网络模型对RAW图像进行处理,使得处理后的图像的清晰度、锐度和图像信噪比更佳。该网络模型可以为卷积神经网络模型,或者也可以为U-Net网络模型。
在第一方面的一些可能实现方式中,电子设备对所述第一输出图像进行颜色空间转换,得到需要输出的图像,包括:电子设备将所述第一输出图像进行去马赛克处理,得到RGB图像;将所述RGB图像进行色彩矫正和全局色彩映射处理,并将处理后的图像经过颜色空间变换,将变换后的图像经过YUV域处理,得到需要输出的图像。
由于在RAW进行图像处理时,保留了图像的更多细节,将RAW处理后的图像进行色彩空间转换,可以得到不同色彩空间的高清晰度的图像,满足用户对于不同色彩空间的高清晰图像的使用要求。
在第一方面的一些可能实现方式中,在电子设备在所述常亮状态下采集图像之后,所述方法还包括:所述电子设备的上层向所述电子设备的底层发送闪光灯的常亮状态的关闭指令;所述电子设备的上层接收到闪光灯关闭的响应时,所述电子设备的拍照功能更新为可用状态。
通过控制拍照功能的可用状态的更新,可以减少用户在不可用状态期间做无用的点击操作。当拍照完成并接收到闪光灯关闭的响应时,则可以恢复拍照功能的按键为可用状态,从而便于用户继续拍摄其它照片。
在第一方面的一些可能实现方式中,在所述电子设备的上层向所述电子设备的底层发送闪光灯关闭指令之后,所述方法还包括:所述电子设备的上层在预定的第一时长内未接收到闪光灯关闭的响应时,电子设备的HAL关闭所述闪光灯。
通过硬件抽象层(HAL)强制关闭闪光灯,可避免底层未及时关闭闪光灯,导致未能及时响应上层指令的问题。其中,预定的第一时长可以为200ms至5s。
第二方面本申请实施例提供了一种拍照装置,该装置包括:触发单元,用于由电子设备触发拍照指令,控制闪光灯处于常亮状态;图像采集单元,用于由电子设备在 所述常亮状态下采集图像,所采集的图像包括在第一曝光值下采集的第一图像、第二曝光值下采集的第二图像,以及在第三曝光值下采集的第三图像,所述第一曝光值小于第二曝光值,所述第二曝光值小于第三曝光值,所述第一曝光值为当前场景的标准曝光值;图像生成单元,用于由电子设备根据所述第一图像、所述第二图像和所述第三图像生成需要输出的图像。
该拍照装置与上述的拍照方法对应。
第三方面,本申请实施例提供一种电子设备,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上述第二方面或第三方面任一项的方法。
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现如上述第二方面或第三方面任一项的方法。
第五方面,本申请实施例提供一种芯片系统,该芯片系统包括处理器,处理器与存储器耦合,处理器执行存储器中存储的计算机程序,以实现如上述第二方面或第三方面任一项所述的方法。该芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
第六方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第二方面或第三方面任一项所述的方法。
可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
图1为本申请实施例提供的一种电子设备的结构示意图;
图2为本申请实施例提供的一种电子设备的软件结构框图;
图3为本申请提供的一种拍照场景示意图;
图4为本申请提供的一种提升图像清晰度的拍照方法示意图;
图5为本申请提供的一种拍照方法实现流程示意图;
图6为本申请实施例提供的一种开启闪光灯常亮模式的流程示意图;
图7为本申请实施例提供的一种不同环境亮度的闪光灯常亮状态示意图;
图8为本申请实施例提供的一种拍照过程示意图;
图9为本申请实施例提供的一种在第一曝光值采集的第一图像示意图;
图10为本申请实施例提供的一种在第二曝光值采集的第二图像示意图;
图11为本申请实施例提供的一种在第三曝光值采集的第三图像示意图;
图12为本申请实施例提供的一种基于RAW域的图像处理流程示意图;
图13为本申请实施例提供的一种夜景图像的图像信号处理流程示意图;
图14为本申请实施例提供的一种夜景图像的图像信号处理示意图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。
下面对本申请实施例可能涉及的相关内容进行示例性介绍。
(1)电子设备。电子设备100可以包括处理器110,外部存储器接口120,内部 存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块 170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system, GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备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在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子 设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消 息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关 机。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
在介绍完电子设备100的硬件架构之后,下面示例性地对电子设备100的软件架构进行介绍。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2为本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程 序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。这些数据可以包括视频,图像,音频等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime(安卓进行时)包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如,MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。内核层是硬件和软件之间的层。内核层至少包含显示驱 动,摄像头驱动,音频驱动,传感器驱动。
下面结合拍照场景,示例性说明电子设备100软件以及硬件的工作流程。
拍照场景下,用户的手指或手写笔与电子设备100的显示屏194接触,设置于显示屏194的触摸传感器180K接收触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成上层能够读取的触摸事件(例如,action down事件、action move事件和action up事件等)。其中,action down事件表示手指或手写笔与触摸屏初次接触,例如,用户使用手写笔在触摸屏上的某个区域落笔;action move事件表示手指或手写笔在触摸屏上滑动,例如,在落笔后,手写笔在触摸屏上滑动;action up事件表示手指或手写笔与触摸屏分离,例如,在手写笔落笔并滑动一段距离后,用户抬起手写笔,使得手写笔与触摸屏分离。
触摸事件被存储在内核层。应用程序框架层从内核层获取触摸事件,识别该高级触摸事件所对应的控件以及该触摸事件对应的触摸操作,例如,触摸操作包括单击、双击和滑动等。以该触摸操作是触摸单击操作,该单击操作所对应的控件为视频应用的拍照控件为例,视频应用调用应用框架层的接口,进而通过调用对应的回调函数,实现与该次触摸操作对应的应用功能。
(2)拍照场景。在示例性介绍完本申请实施例提供的电子设备100的硬件架构和软件架构之后,下面对本申请实施例涉及的投屏场景进行示例性介绍。
如图3所示为一种拍照场景示意图。该拍照场景可以包括室内场景、夜景等环境亮度较低的场所。电子设备(如图3中的手机)为了提高所拍摄的照片的清晰度,通常会通过补光来提高场景的亮度。处于亮度较低场景中的电子设备,用户打开相机应用程序后,进入拍照界面。在所述拍照界面中,包括预览区域和按键区域。其中,预览区域用于显示电子设备当前的拍摄角度下的预览图像。在该预览区域的右部,包括有缩放按键,即预览区域右侧的圆按钮。当所述圆按钮接收到上下拖动的指令时,可相应的调整拍摄的图像的放大或缩小的倍数。在预览区域下方包括第一按键区域,在该按键区域包括拍照模式选择按键、拍摄按键、相册按键、镜头切换按键。通过模式按键可以进入相应的拍摄模式。在预览区域的上方包括有拍摄参数按键和功能选择按键。比如,拍摄参数按键可以包括闪光模式按键、参数设置按键等。功能选择按键可以包括如智能拍照按键、颜色样式按键、拍照购物按键等。如图3左图所示,当用户选择自动闪光模式时,电子设备会根据当前场景的亮度,确定是否需要开启闪光灯。
在自动闪光模式下,确定是否需要开启闪光灯时,可以将获取的环境亮度与预先设定的亮度阈值进行比较。如果当前的环境亮度大于或等于预先设定的亮度阈值,如图3右侧的下图所示,则在拍照时,不会触发闪光灯工作。如果当前的环境亮度小于预先设定的亮度阈值,如图3右侧的上图所示,则在拍照时,触发闪光灯工作。在确定拍照时会触发闪光灯在工作时,如果电子设备接收到用户的拍照指令,则会控制闪光灯发出强闪光线,电子设备在该强闪光线发出时,可以采集到通过强闪光线提升了环境亮度的图像。
图4给出了目前基于强闪状态和预闪状态的图像来提升图像清晰度的一种实现过程。如图4所示,电子设备处于亮度较低的场景中,并且电子设备的闪光灯工作模式为自动闪光模式。电子设备将采集的环境亮度与预设的亮度阈值进行比较,确定所采 集的环境的亮度小于预设的亮度阈值,在拍照时可以触发闪光。
在进行拍照时,可以将图像采集过程分为预闪状态和强闪状态。其中,预闪状态为电子设备接收到拍照指令后,在闪光灯发出闪光之前的时间段。强闪状态为闪光灯发出闪光的时间段。在预闪状态下,电子设备可以采集一张或多张图像。在强闪状态下,电子设备可采集一张或多张图像。如果电子设备在预闪状态或强闪状态下采集多张图像时,可以将预闪状态下的多张图像融合为一张图像,或者将强闪状态下的多张图像融合为一张图像。由于预闪状态下,电子设备并没有提高场景的亮度,所采集的图像的亮度较低。在强闪状态下,电子设备通过闪光灯提升了场景亮度,所采集的图像的亮度比预闪状态下采集的图像的亮度更高。由于不同亮度的图像,所反映的细节信息也不同,比如低亮度图像能够更清楚的显示较高亮度的对象,较高亮度的图像,能够更清晰的显示较低亮度的对象。如图4中的第三行图像所示,将预闪状态生成的图像与强闪状态生成的图像融合,可以得到清晰度更高的图像。
虽然通过强闪状态和预闪状态采集和融合的方式,可以有效的提升图像质量。但是,在强闪状态和预闪状态采集图像时,由于场景中的亮度会有较大的差异,会使得在这两种状态下所采集的图像的亮度和清晰度的差异较大,不利于对图像中的对象,包括人物或物体等对象进行准确的分割。并且在预闪状态采集图像的时间点,与在强闪状态采集图像的时间点之间存在较大的时间间隙,在此间隙内可能会产生画面抖动,会影响图像自动对焦、自动白平衡和自动曝光的稳定性,不利于准确高效的对图像进行配准和融合操作,从而会影响图像的拍摄质量。
基于此,本申请实施例提出了一种拍照方法。该拍照方法对闪光灯的控制方式进行了调整,在拍照期间,将闪光灯的预闪状态和强闪状态调整为常亮状态,从而使得电子设备可以采集到场景亮度一致的图像,有利于对场景中的人物或物体进行分割。通过调整所采集的图像的曝光值,基于标准曝光值(即第一曝光值)采集第一图像、基于第二曝光值采集第二图像和基于第三曝光值采集第三图像,并且第一曝光值大于第二曝光值,第二曝光值大于第三曝光值。由于通过调整曝光值进行图像采集的时间间隙,相对于预闪状态和强闪状态进行图像采集的时间间隙更短,因而能够更为有效的减少图像抖动,提高自动对焦、自动白平衡和自动曝光的稳定性,有利于对图像进行配准和融合操作,提高图像拍照质量。
图5为本申请实施例提供的一种拍照方法的实现流程示意图,详述如下:
在S501中,电子设备触发拍照指令,控制闪光灯处于常亮状态。
本申请实施例中的电子设备,包括智能手机、平板电脑、笔记本电脑或者其它具有摄像头的电子设备。
电子设备所触发的拍照指令,可以为按键指令、触摸指令、声控指令或画面内容触发的指令。其中,按键指令可以包括电子设备中的相机应用程序处于运行状态时,根据预先设定的拍照功能键触发的指令。比如,在相机应用程序运行状态下,用户点击音量增加键或音量减少键,触发相机应用程序的拍照指令。或者,按键指令也可以为电子设备与其它拍摄辅助设备相连时,由拍摄辅助设备的拍照按键所发出的指令,比如辅助设备包括如自拍杆,可以通过有线或无线连接的方式,将自拍杆的按键指令传送至电子设备,使得电子设备触发拍照指令。或者,按键指令也可以在相机应用程 序未运行状态下,通过快捷按键快速的启动相机并触发拍照指令,以用于快速抓拍场景的拍照需求。
触摸指令可以为电子设备的触摸屏中拍照按键被触发时所生成的指令。比如图3左图所示的电子设备的拍照界面中,位于预览区域下方包括三个触摸按钮,当接到用户的位于该按键范围内的触摸指令时,则触发拍照指令。
声控指令可以为电子设备的相机应用程序运行过程中,通过语音检测系统检测用户的语音内容。如果所检测的语音内容中包括预先设定的拍照指令关键词,则触发拍照指令。或者,也可以通过语音检测系统实时检测用户的语音内容。如果所检测的内容与预先设定的拍照指令关键词匹配,则启动相机应用程序,并触发拍照指令。
根据画面内容触发拍照指令时,可以根据需要选择需要触发拍照指令的特征内容。比如,可以设定预览画面中包括笑脸特征时,则自动触发拍照指令。不局限于此,还可以包括其它特征内容,包括如特定人脸、车辆等。
电子设备在触发拍照指令后,则控制闪光灯处于常亮状态。
其中,闪光灯处于常亮状态,是指闪光灯在图像采集过程中处于常亮状态。当图像采集完成时,则可以关闭闪光灯。处于常亮状态的闪光灯的亮度,可以为固定亮度,也可以根据环境的亮度,确定常亮状态的亮度。
图6为本申请实施例提供的一种电子设备触发拍照指令,控制闪光灯处于常亮状态的实现流程示意图。如图6所示,电子设备触发拍照指令,控制闪光灯处于常亮状态的实现流程包括:
在601中,电子设备根据预先设定的闪光模式,确定拍照需要闪光灯工作。
其中,预先设定的闪光模式,可以为自动闪光模式,或者闪光模式。
其中,闪光模式为自动闪光模式,电子设备在每次拍照时,会通过下层硬件采集环境中的亮度,即电子设备的拍摄场景中的亮度,并将采集的亮度与预设的亮度阈值进行比较。如果采集的亮度低于预设的亮度阈值,则将比较结果报上给上层。上层根据上报结论,确定在拍摄时触发闪光灯工作。如果采集的亮度低于预设的亮度阈值,则在拍摄时不触发闪光灯工作。
当闪光模式为闪光模式时,电子设备在每次拍照时,不需要将环境亮度与预先设定的亮度阈值比较,上层决定在拍摄时始终触发闪光灯工作。
在602中,电子设备触发拍照指令。
电子设备触发拍照指令时,电子设备的相机应用程序可以处于运行状态,也可以处于非运行状态。如果电子设备中的相机应用程序处于非运行状态,则可以通过该拍照指令,启动相机应用程序。
该拍照指令可以根据预先设定的按键操作、触摸操作、声音或画面内容触发的指令。
在603中,电子设备根据环境亮度确定闪光灯的工作电流。
其中,603、602和601可以不必严格按照序号的先后顺序执行。比如,可以先触发拍照指令,然后确定拍照需要闪光灯工作,以及确定闪光灯的工作电流,或者,先确定拍照需要闪光灯工作以及闪光灯的工作电流,然现再触发拍照指令。
电子设备根据环境亮度确定闪光灯的工作电流时,可以预先设定亮度与工作电流 的对应关系。当检测到环境亮度时,根据预先设定的对应关系,查找到环境亮度对应的工作电流。
和固定的工作电流的方式相比,通过环境亮度所确定的工作电流,可以适应不同亮度的亮度调整需求,并且使得调整后的环境亮度处于较为稳定的范围。而固定的工作电流驱动闪光灯进行补光时,则会在环境亮度的基础上,增加固定的亮度,使得调整后的亮度可能存在较大偏差。
在604中,根据所述工作电流点亮所述闪光灯,并保持预定时长的常亮状态。
当环境的亮度较低时,所确定的工作电流较大,当环境的亮度较高时,所确定的工作电流较低。比如,图7所示的不同环境亮度下的闪光灯亮度示意图中,左图中的环境亮度相对于中图和右图的亮度较高,所确定的工作电流较小,由该工作电流所驱动的闪光灯的亮度较低。右图中的环境亮度相对于中图和左图的亮度较低,所确定的工作电流较大,由该工作电流所驱动的闪光灯的亮度较高。
当闪光灯根据所确定的工作电流点亮后,闪光灯在预定时长内,保持该工作电流对应的亮度不变,即闪光灯维持常亮状态。在该常亮状态下,即可进入S502,对场景中的图像进行采集,得到场景亮度一致的多个图像。
如果图像采集完成后,电子设备的上层向电子设备的底层发送闪光灯的常亮状态的关闭指令,使底层根据该关闭指令,关闭闪光灯,并反馈关闭的响应信息。如果上层接收到底层所反馈的关闭指令的响应信息,比如可以为寄存器的状态位信息,确定当前已关闭闪光灯,则可将相机应用程序的拍照功能,由不可用状态更新为可用状态。其中,拍照功能不可用状态,为电子设备触发拍照指令至电子设备上层接收到闪光灯关闭指令的响应的时段。
或者,当电子设备的上层在预定时长(可以设定为300毫秒至5秒内的任意值)内,未能接收到电子设备的底层的响应指令时,则可通过HAL(抽象硬件层)关闭所述闪光灯,使闪光灯退出常亮状态。通过HAL关闭闪光灯时,相机应用程序的拍照功能,由不可用状态更新为可用状态。在这种情况下,相机应用程序的拍照功能的不可用状态,为电子设备触发拍照指令至电子设备的HAL关闭闪光灯的时间段。
当电子设备处于拍照功能不可用状态时,触发指令无响应,或者可以生成无响应的提示信息。包括如提示窗口等。
在S502中,电子设备在所述常亮状态下采集图像,所采集的图像包括在第一曝光值下采集的第一图像、第二曝光值下采集的第二图像,以及在第三曝光值下采集的第三图像。
其中,本申请实施例中的曝光值包括第一曝光值、第二曝光值和第三曝光值。曝光值是一个以2为底的对数刻度系统。其计算公式可以表示为:
Figure PCTCN2022091901-appb-000001
其中,N表示光圈(f值),EV表示曝光值,t表示曝光时间(单位为秒)。由于曝光值与曝光时间和光圈计算得到,因此,对于同一曝光值,可以选择不同的光圈和曝光时间的组合计算得到。
其中,第一曝光值,为当前场景的标准曝光值。所述标准曝光值,是为使得图像正常曝光所设定的曝光值。因此,对于不同亮度的环境,所设定的标准曝光值也不相同。在本申请实施例中,通过调整不同的工作电流,使得环境中的亮度保持在一定范 围。因此,通过工作电流点亮闪光灯,使得场景的亮度保持一致时,本申请实施例中的标准曝光值可以为相同的曝光值。
在可能的实现方式中,可以预先建立标准曝光值与环境亮度或环境照度的对应关系表,或者所拍摄的图像所在区域的亮度与标准曝光值的对应关系表。根据电子设备所检测到的环境亮度、环境照度,或所拍摄的图像所在区域的亮度,确定所述标准曝光值。
在确定了标准曝光值,即第一曝光值的基础上,本申请还设置有第二曝光值和第三曝光值。其中,第二曝光值大于第一曝光值,第三曝光值大于第二曝光值。根据曝光值的定义可知,曝光值越大,图像的亮度越小。如图8所示的图像采集及合成示意图,通过第二曝光值所采集的第二图像82的亮度,小于第一曝光值所采集的第一图像81的亮度。通过第三曝光值所采集的第三图像83的亮度,小于第二曝光值所采集的第二图像82的亮度。
在本申请实施例中,第一曝光值可以表示为EV0,第二曝光值可以选择EV1至EV4范围内的任意值,第三曝光值可以选择EV4至EV8的任意值,且第二曝光值小于第三曝光补偿值。比如,第一曝光值为EV0,第二曝光值为EV3。根据曝光值的定义,第二曝光值的曝光参数值
Figure PCTCN2022091901-appb-000002
是第一曝光值的曝光参数值
Figure PCTCN2022091901-appb-000003
的2 3倍,即第一曝光值的曝光量为第二曝光值的曝光量的8倍。当第二曝光值为EV0,第三曝光值为EV6时。根据曝光值的定义,第三曝光值的曝光参数值
Figure PCTCN2022091901-appb-000004
是第一曝光值
Figure PCTCN2022091901-appb-000005
的曝光参数的2 6倍。即第一曝光值的曝光量为第三曝光值的曝光量的64倍。其中,N 1、N 2、N 3分别表示第一曝光值的光圈大小、第二曝光值的光圈大小和第三曝光值的光圈大小,t 1、t 2、t 3分别表示第一曝光值的曝光时间、第二曝光值的曝光时间和第三曝光值的曝光时间。
由于电子设备在所采集的第一图像、第二图像和第三图像时,控制闪光灯保持固定亮度的常亮状态。电子设备在图像采集过程中,环境亮度信息基本一致。因此,在采集环境亮度信息一致的第一图像、第二图像和第三图像时,可以采用较为稳定的相机参数,包括自动曝光参数、自动白平衡参数和自动对焦参数进行图像采集,不需要频繁变动图像采集参数,使得图像采集的可靠性更高。
并且,通过控制闪光灯处于恒定的常亮状态,并结合软件层面上的曝光值的调整,得到不同曝光值的第一图像、第二图像和第三图像。相对于驱动电流的调整,通过软件层面上的曝光值调整更加方便,实现更为容易,可以减少由驱动电流调整所带来的拍照稳定性问题。
本申请实施例通过固定出帧的方式,即固定生成第一图像、第二图像和第三图像,根据所出帧图像生成HDR图像。而现有的HDR图像生成方法,需要通过环境亮度信息判断出帧的亮度,决策计算较为麻烦,因此,本申请通过固定出帧方式,可以有效的提高决策效率,可以更高效的完成拍照流程。
本申请实施例中的第一图像为正常曝光的图像,因此,第一图像中包括更多的图像细节信息。为了提升所拍摄的照片质量,可以使第一图像中包括多个图像。通过将第一图像中包括的多个图像进行去噪和图像画质优化处理,从而便于得到更为清晰的融合图像。
在S503中,电子设备根据所述第一图像、所述第二图像和所述第三图像生成需要输出的图像。
如图8所示,本申请实施例通过一曝光值,可以采集得到第一图像81。由于第一曝光值为标准曝光值,第一图像81中的大部分物品或人像的清晰度比第二图像82和第三图像83的清晰高。如图9所示的第一曝光值的第一图像,通过第一曝光值所采集的第一图像中,人像信息较为清晰,但是位于人像上方的纯色区域由于过曝导致图像较为模糊。
在可能的实现方式中,第一图像可以包括多个,比如可以包括5-8帧图像。通过第一曝光值采集多个图像,可以采用去噪处理,融合为清晰度更高的标准曝光图像。
通过第二曝光值采集第二图像82。由于第二曝光值大于第一曝光值,如图10所示的第二曝光值的第二图像中,人像的清晰度有所下降,但是人像上方的纯色区域的清晰度有所提高。
第三曝光值的曝光量远小于第一曝光值的曝光量,因此,第三曝光值下所采集的第三图像83中,如图11所示的基于第三曝光值所采集的第三图像中,纯色区域可采集较为清晰的图像,但是,人像内容则非常模糊。
由于第一图像中的清晰区域,在第三图像中非常模糊,而第三图像中的清晰区域在第一图像中非常模糊。因此,第一图像与第三图像无法准确的完成图像配准。第二图像中的人像区域相对于第三图像的人像区域更为清晰,第二图像中的纯色区域相对于第一图像更为清晰。因此,可以根据人像区域,将第一图像与第二图像配准,根据纯色区域,将第二图像与第三图像配准。根据第一图像与第二图像的配准结果,以及第二图像与第三图像的配准结果,即可得到第一图像与第三图像的配准结果。根据配准后的第一图像、第三图像可生成清晰度更佳的需要输出的图像84。
在本申请实施例中,人像区域和纯色区域仅为举例说明,用于图像配准的区域不限于人像区域和纯色区域。在可能的实现方式中,人像区域可以为其它正常曝光的图像区域。纯色区域可以替换为第一图像中高亮度的区域,比如可以替换为光源区域等。
另外,在本申请实施例中,基于第一图像、第二图像和第三图像,可以合成清晰度更高的HDR图像。与目前的HDR图像合成方式相比,可以减少对合成HDR图像所需要的照片的决策计算。比如,目前在合成HDR图像时,先根据场景亮度信息确定是否需要采集过曝图像和欠曝图像。根据计算结果再确定所需要采集的图像。而本申请则可以直接采集所需要的第一图像、第二图像和第三图像,能够获取清晰的HDR图像的同时,能够有效的减少决策计算,提高图像生成效率。
图13为本申请实施例提供的一种采集图像并在RAW域处理流程示意图。如图13所示,该拍摄流程包括:
1301,触发闪光灯常亮模式。
可以根据预先设定的触发指令,使相机应用程序响应拍照功能或视频拍摄功能,在拍照功能或视频拍摄功能的实现过程中,使闪光灯保持常亮状态。
由于本申请实施例中的拍照方法,主要可用于夜景图像拍摄、室内图像拍摄或其它低亮度场景。因此,可以在用户选择夜景拍摄模式时,或者电子设备检测到当前场景的亮度较低,电子设备自动切换为夜景模式时,触发闪光灯常亮模式。
在该常亮模式下,电子设备根据环境的亮度,确定闪光灯的工作电流,使得工作电流与场景的亮度关联。当场景的亮度较高,则工作电流较小,如果场景的亮度较低,则工作电流较大。通过采用与环境或场景亮度匹配的工作电流,使得闪光灯常亮状态下的环境亮度保持稳定。
1302,采集多帧不同EV的RAW图像。
在闪光灯处于常亮状态时,环境的亮度保持稳定。在环境亮度保持稳定状态下进行图像采集,可以使得采集图像的参数,包括如自动曝光参数、自动白平衡参数和自动对焦参数更为稳定,从而能够得到画质更优的图像。
并且,基于相同驱动电流下,调整曝光值来得到不同曝光度的图像。只需要在软件层面上修改曝光参数,避免对驱动电流进行调整,可提高操作便利性,减少由于电流调整所带来的稳定性问题。
通过固定出帧的方式,即固定生成第一图像、第二图像和第三图像,根据所出帧图像生成HDR图像。而现有的HDR图像生成方法,需要通过环境亮度信息判断出帧的亮度,决策计算较为麻烦,因此,本申请通过固定出帧方式,可以有效的提高决策效率,可以更高效的完成拍照流程。
1303,图像配准。
本申请实施例所采集的第一图像、第二图像和第三图像中,第一图像为正常曝光的图像,因此,第一图像的细节内容更多。可以采集两帧或两帧以上的图像作为第一图像,通过去噪和融合处理,从而便于得到更为清晰的照片。
第一图像中保留较多的细节内容的同时,场景中的高亮区域在第一图像中较为模糊。
第三图像为曝光值最高的图像,即第三图像的曝光量最低。在第三图像中,场景中的高亮区域可以较为清晰的显示,但场景中的低亮度区域则较为模糊。
相对于第一图像,场景中的过曝区域在第二图像中较为清晰。相对于第三图像,场景中的低亮度区域在第二图像中较为清晰。因此,可以将第一图像与第三图像配准,将第二图像与第三图像配准。根据第一图像与第二图像的配准结果,以及第二图像与第三图像的配准结果,实现第一图像与第三图像的配准。从而使得场景中的低亮度区域的清晰图像与场景中的高亮度区域的清晰图像能够有效的配合。
1304,镜头阴影校正/黑电平校正。
其中,镜头阴影校正(英文全称为Lens Shading Correction,英文简称为LSC)是为了解决镜头对光学折射不均匀导致的镜头周围出现阴影的情况所做的校正。镜头阴影校正方法可以包括同心圆法和网格法等。
黑电平即黑色数据的最低电平值,通常指感光图像数据为0时所对应的传感器信号的电平值。目前的黑电平校正(英文全称为Black Level Correction,英文简称为BLC)方案包括减去固定数值的方式进行黑电平校正,以及利用黑电平随温度和增益的漂移曲线进行黑电平校正。
1305,网络模型处理。
在本申请实施例中,所述网络模型可以卷积神经网络模型,或者也可以为U-Net网络模型等。在使用网络模型进行优化前,可以预先将用于训练的图像输入到网络模 型,判断网络模型输出的图像与输入图像的清晰度、信噪比和锐度等参数的变化。通过不断调整模型中的参数,使得输出图像相对于输入图像的清晰度更高、信噪比更高,锐度更高。完成网络模型的参数优化的训练后,可以通过训练后的网络模型,对第一图像、第二图像和第三图像进行优化处理,从而得到清晰度更高、信噪比更高、锐度更佳的输出图像。
1306,自动白平衡。
为了能够将不同光照下物体颜色调整为人眼认同的颜色,需要对图像进行白平衡处理。自动抓拍平衡方法通常包括灰色世界法、白块法、光源参数投票法和色阶纠正法等。
1307,图像融合。
将所采集的第一图像、第二图像和第三图像经过去噪等优化处理后,在RAW域直接将优化的图像进行融合处理,得到融合后的图像。由于RAW中保留了图像的大量细节,与YUV进行优化和融合的图像相比,在RAW域进行优化和融合的图像的细节内容更为丰富,便于得到更高画质的图像。
1308,非线性叠加&鬼影矫正。
在本申请实施例中,还可以对融合后的图像进行非线性叠加处理。可以指将图像中包括HDR图像,通过非线性映射和叠加的方式,生成LDR图像,使得LDR屏幕能够有效的显示所生成的图像。
由于画面配准问题,或者图像中出现物体移动时,融合后的图像可能会存在鬼形。鬼影即为图像中存在的同一物体的重影,或者也可称为伪影。可以通过鬼影检测,确定融合后的图像中包括的鬼影区域,并通过可以选择融合前的其中一张图像的相应区域替换融合图像的鬼影区域,对鬼影图像进行矫正。不局限于此,还可以通过提高配准精度等方式,实现鬼影矫正处理。
1309,RAW图像输出。
通过上述处理后,与YUV域的图像优化融合方式相比,本申请的图像处理过程可以在细节内容较为丰富的RAW域实现图像优化和融合处理,得到细节内容更为清晰丰富的RAW输出图像。
图14为本申请实施例提供的一种夜景图像的图像信号处理示意图,如图14所示,该流程包括:
1401,传感器采集多帧RAW图像。
其中,传感器采集多帧RAW图像时,可以基于图5中的S502,在闪光灯处于常亮状态下,采集多帧图像,包括第一图像、第二图像和第三图像。其中,可以基于软件层面的参数控制,使得第一图像、第二图像和第三图像的曝光值不同。并且,第一图像的曝光值为标准曝光值,第一图像的标准曝光图像。采集第二图像的第二曝光值大于采集第一图像的第一曝光值,采集第三图像的第三曝光值大于采集第二图像的第二曝光值。
1402,坏点及PD点去除。
受限于CMOS工艺以及低廉的成本,传感器出厂时一般都是存在坏点(举例某款sensor是200个左右且坏点不相邻),这些坏点需要在ISP处理中去除。
坏点去除方法可以包括均值法、联动方法或调试方法等。
1403,镜头阴影校正。
其中,镜头阴影校正(英文全称为Lens Shading Correction,英文简称为LSC)是为了解决镜头对光学折射不均匀导致的镜头周围出现阴影的情况所做的校正。镜头阴影校正方法可以包括同心圆法和网格法等。
1404,RAW域夜景处理。
该RAW域夜景处理方法,可以包括图13中所示的1303、1304、1305、1306、1307、1308等步骤。
1405,去马赛克处理/RAW2GRG。
去马赛克处理用于将拜耳阵列,或RAW格式的图像转换为RGB图像。去马赛克处理是用于从覆盖有颜色滤波器阵列(CFA)的图像传感器输出的不完整颜色样本重建全色图像的数字图像处理。也称为CFA插值或颜色重建。重建图像通常在均匀着色的区域中是精确的,但是具有分辨率(细节和清晰度)的损失并且具有边缘伪影。
1406,色彩矫正。
由于相机的颜色匹配特性通常不满足卢瑟条件,即传感器的RGB响应通常不是线性无关的,相机的颜色匹配特性与CIE(国际发光照明委员会)标准观察者之间并不存在线性关系。因此,我们需要校正相机的特性,即通过色彩校正,使其接近标准观察者。通常使用颜色校正矩阵完成对图像的色彩矫正。
1407,色调影射。
由于所合成的图像的亮度范围较大,为了使得所生成的图像在普通的LDR显示器中能够正常显示,需要将高动态范围的图像通过色调映射为低动态范围的图像。色调映射可以包括全局色调映射和局部色调映射。
1408,RGB2YUV。
完成色调映射后,可以将RGB图像转换为YUV格式的图像,或者也可以直接输出RGB格式的图像。
1409,YUV处理。
在YUV域,还可以进一步对图像进行降噪等优化处理,进一步提升图像质量。
在整个夜景图像的图像信号处理过程中,本申请的拍照方案选择在RAW域进行图像优化和融合,使得图像能够保留更多的图像细节,有利于提升所输出的图像的清晰度,提升输出图像的画质。值得注意的是,上述应用于图像处理的方法,可以用于拍照场景下生成清晰度更高、质量更为稳定的照片,也可以用于拍摄视频场景,生成清晰度更高、质量更为稳定的视频。
本申请实施例提供的电子设备,可以包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上述方法实施例中任一项的方法。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例还提供一种芯片系统,所述芯片系统包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如上述各个方法实施例所述的方法。所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。此外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (12)

  1. 一种拍照方法,其特征在于,所述方法包括:
    电子设备触发拍照指令,控制闪光灯处于常亮状态;
    电子设备在所述常亮状态下采集图像,所采集的图像包括在第一曝光值下采集的第一图像、在第二曝光值下采集的第二图像,以及在第三曝光值下采集的第三图像,所述第一曝光值小于所述第二曝光值,所述第二曝光值小于所述第三曝光值,所述第一曝光值为当前场景的标准曝光值;
    电子设备根据所述第一图像、所述第二图像和所述第三图像生成需要输出的图像。
  2. 根据权利要求1所述的方法,其特征在于,电子设备控制闪光灯处于常亮状态,包括:
    电子设备获取拍照场景的亮度;
    根据预先设定的亮度与工作电流的对应关系,电子设备确定所述场景的亮度对应的工作电流;
    电子设备根据所述工作电流驱动所述闪光灯处于常亮状态。
  3. 根据权利要求1所述的方法,其特征在于,电子设备在所述常亮状态下采集图像,包括:
    电子设备根据当前场景的亮度确定第一曝光值;
    根据预先设定的曝光量比例关系,电子设备确定所述第二曝光值和第三曝光值;
    电子设备根据所确定的第一曝光值、第二曝光值和第三曝光值分别采集图像。
  4. 根据权利要求3所述的方法,其特征在于,电子设备根据所确定的第一曝光值、第二曝光值和第三曝光值分别采集图像,包括:
    电子设备分别确定与所述第一曝光值、所述第二曝光值和所述第三曝光值对应的光圈大小和/或曝光时间;
    电子设备根据所确定的光圈大小和/或曝光时间,分别进行图像采集。
  5. 根据权利要求1所述的方法,其特征在于,电子设备根据所述第一图像、所述第二图像和所述第三图像生成需要输出的图像,包括:
    电子设备根据RAW格式的第一图像、RAW格式的所述第二图像和RAW格式的所述第三图像进行优化和融合处理,得到RAW格式的第一输出图像;
    电子设备对所述第一输出图像进行颜色空间变换,得到需要输出的图像。
  6. 根据权利要求5所述的方法,其特征在于,电子设备根据RAW格式的第一图像、RAW格式的所述第二图像和RAW格式的所述第三图像进行优化和融合处理,得到RAW格式的第一输出图像,包括:
    将所述第一图像、所述第二图像和所述第三图像经过坏点校正、镜头阴影校正、黑电平校正、RAW域降噪、白平衡增益和图像融合处理,得到RAW格式的第一输出图像。
  7. 根据权利要求6所述的方法,其特征在于,将所述第一图像、所述第二图像和所述第三图像经过RAW域降噪处理时,通过网络模型对所述第一图像、所述第二图像和所述第三图像进行降噪处理。
  8. 根据权利要求5所述的方法,其特征在于,电子设备对所述第一输出图像进行 颜色空间转换,得到需要输出的图像,包括:
    电子设备将所述第一输出图像进行去马赛克处理,得到RGB图像;
    将所述RGB图像进行色彩矫正和全局色彩映射处理,并将处理后的图像经过颜色空间变换,将变换后的图像经过YUV域处理,得到需要输出的图像。
  9. 根据权利要求1所述的方法,其特征在于,在电子设备在所述常亮状态下采集图像之后,所述方法还包括:
    所述电子设备的上层向所述电子设备的底层发送闪光灯的常亮状态的关闭指令;
    所述电子设备的上层接收到闪光灯关闭的响应时,所述电子设备的拍照功能更新为可用状态。
  10. 根据权利要求9所述的方法,其特征在于,在所述电子设备的上层向所述电子设备的底层发送闪光灯关闭指令之后,所述方法还包括:
    所述电子设备的上层在预定的第一时长内未接收到闪光灯关闭的响应时,电子设备的HAL关闭所述闪光灯。
  11. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至10任一项所述的方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-10任一项所述的方法。
PCT/CN2022/091901 2021-08-12 2022-05-10 拍照方法、电子设备和计算机可读存储介质 WO2023015991A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110927005.9 2021-08-12
CN202110927005.9A CN114095666B (zh) 2021-08-12 2021-08-12 拍照方法、电子设备和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2023015991A1 true WO2023015991A1 (zh) 2023-02-16

Family

ID=80296148

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091901 WO2023015991A1 (zh) 2021-08-12 2022-05-10 拍照方法、电子设备和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN114095666B (zh)
WO (1) WO2023015991A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499789A (zh) * 2023-12-25 2024-02-02 荣耀终端有限公司 一种拍摄方法及相关装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095666B (zh) * 2021-08-12 2023-09-22 荣耀终端有限公司 拍照方法、电子设备和计算机可读存储介质
CN116074634B (zh) * 2022-05-27 2023-11-14 荣耀终端有限公司 一种曝光参数确定方法和装置
CN117408927A (zh) * 2023-12-12 2024-01-16 荣耀终端有限公司 图像处理方法、设备及存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001189890A (ja) * 1999-12-28 2001-07-10 Fuji Photo Film Co Ltd ディジタルカメラ
JP2006197243A (ja) * 2005-01-13 2006-07-27 Canon Inc 撮像装置及び撮像方法及びプログラム及び記憶媒体
CN103957363A (zh) * 2014-05-16 2014-07-30 深圳市中兴移动通信有限公司 闪光拍摄方法和拍摄装置
WO2019082539A1 (ja) * 2017-10-24 2019-05-02 ソニー株式会社 制御装置と制御方法およびプログラム
CN109729279A (zh) * 2018-12-20 2019-05-07 华为技术有限公司 一种图像拍摄方法和终端设备
CN109788207A (zh) * 2019-01-30 2019-05-21 Oppo广东移动通信有限公司 图像合成方法、装置、电子设备及可读存储介质
CN109862282A (zh) * 2019-02-18 2019-06-07 Oppo广东移动通信有限公司 人物图像处理方法和装置
CN110198417A (zh) * 2019-06-28 2019-09-03 Oppo广东移动通信有限公司 图像处理方法、装置、存储介质及电子设备
CN114095666A (zh) * 2021-08-12 2022-02-25 荣耀终端有限公司 拍照方法、电子设备和计算机可读存储介质

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4554094B2 (ja) * 2001-01-26 2010-09-29 オリンパス株式会社 撮像装置
US8174611B2 (en) * 2009-03-26 2012-05-08 Texas Instruments Incorporated Digital image segmentation using flash
US9706130B2 (en) * 2015-05-28 2017-07-11 Blackberry Limited Camera having HDR during pre-flash
CN105163047B (zh) * 2015-09-15 2018-11-06 厦门美图之家科技有限公司 一种基于色彩空间转换的hdr图像生成方法、系统及拍摄终端
CN107888842B (zh) * 2017-12-28 2021-04-20 上海传英信息技术有限公司 一种基于智能终端的闪光灯控制方法及控制系统
CN111418201B (zh) * 2018-03-27 2021-10-15 华为技术有限公司 一种拍摄方法及设备
CN108717691B (zh) * 2018-06-06 2022-04-15 成都西纬科技有限公司 一种图像融合方法、装置、电子设备及介质
CN109194873B (zh) * 2018-10-29 2021-02-02 浙江大华技术股份有限公司 一种图像处理方法及装置
CN110198419A (zh) * 2019-06-28 2019-09-03 Oppo广东移动通信有限公司 图像处理方法、装置、存储介质及电子设备
KR20210018121A (ko) * 2019-08-06 2021-02-17 삼성전자주식회사 글로벌 정규화 및 모션 배제를 포함하는 로컬 히스토그램 매칭을 수행하는 전자 장치 및 방법
CN110611750B (zh) * 2019-10-31 2022-03-22 北京迈格威科技有限公司 一种夜景高动态范围图像生成方法、装置和电子设备
US10911691B1 (en) * 2019-11-19 2021-02-02 Samsung Electronics Co., Ltd. System and method for dynamic selection of reference image frame
CN111064898B (zh) * 2019-12-02 2021-07-16 联想(北京)有限公司 图像拍摄方法及装置、设备、存储介质
CN113038027B (zh) * 2021-03-05 2022-08-19 上海商汤临港智能科技有限公司 曝光控制方法、装置、设备以及存储介质

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001189890A (ja) * 1999-12-28 2001-07-10 Fuji Photo Film Co Ltd ディジタルカメラ
JP2006197243A (ja) * 2005-01-13 2006-07-27 Canon Inc 撮像装置及び撮像方法及びプログラム及び記憶媒体
CN103957363A (zh) * 2014-05-16 2014-07-30 深圳市中兴移动通信有限公司 闪光拍摄方法和拍摄装置
WO2019082539A1 (ja) * 2017-10-24 2019-05-02 ソニー株式会社 制御装置と制御方法およびプログラム
CN109729279A (zh) * 2018-12-20 2019-05-07 华为技术有限公司 一种图像拍摄方法和终端设备
CN109788207A (zh) * 2019-01-30 2019-05-21 Oppo广东移动通信有限公司 图像合成方法、装置、电子设备及可读存储介质
CN109862282A (zh) * 2019-02-18 2019-06-07 Oppo广东移动通信有限公司 人物图像处理方法和装置
CN110198417A (zh) * 2019-06-28 2019-09-03 Oppo广东移动通信有限公司 图像处理方法、装置、存储介质及电子设备
CN114095666A (zh) * 2021-08-12 2022-02-25 荣耀终端有限公司 拍照方法、电子设备和计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499789A (zh) * 2023-12-25 2024-02-02 荣耀终端有限公司 一种拍摄方法及相关装置
CN117499789B (zh) * 2023-12-25 2024-05-17 荣耀终端有限公司 一种拍摄方法及相关装置

Also Published As

Publication number Publication date
CN114095666A (zh) 2022-02-25
CN114095666B (zh) 2023-09-22

Similar Documents

Publication Publication Date Title
CN112532857B (zh) 一种延时摄影的拍摄方法及设备
CN113132620B (zh) 一种图像拍摄方法及相关装置
CN109951633B (zh) 一种拍摄月亮的方法和电子设备
WO2020125410A1 (zh) 一种图像处理的方法及电子设备
WO2023015991A1 (zh) 拍照方法、电子设备和计算机可读存储介质
CN114679537A (zh) 一种拍摄方法及终端
CN113411528B (zh) 一种录像帧率的控制方法、终端及存储介质
CN112532892B (zh) 图像处理方法及电子装置
WO2023015990A1 (zh) 点光源图像检测方法和电子设备
CN112887583A (zh) 一种拍摄方法及电子设备
CN113891009B (zh) 曝光调整方法及相关设备
CN113542580B (zh) 去除眼镜光斑的方法、装置及电子设备
WO2023273323A9 (zh) 一种对焦方法和电子设备
WO2023056795A1 (zh) 快速拍照方法、电子设备及计算机可读存储介质
CN113452898A (zh) 一种拍照方法及装置
CN113572948B (zh) 视频处理方法和视频处理装置
CN115567630A (zh) 一种电子设备的管理方法、电子设备及可读存储介质
WO2022267608A1 (zh) 一种曝光强度调节方法及相关装置
CN113923372B (zh) 曝光调整方法及相关设备
CN113891008B (zh) 一种曝光强度调节方法及相关设备
WO2021204103A1 (zh) 照片预览方法、电子设备和存储介质
CN114070916A (zh) 一种拍摄的补光方法及相关装置
WO2024078275A1 (zh) 一种图像处理的方法、装置、电子设备及存储介质
CN115460343B (zh) 图像处理方法、设备及存储介质
CN115705663B (zh) 图像处理方法与电子设备

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE