WO2021057277A1 - Photographing method in dark light and electronic device - Google Patents

Photographing method in dark light and electronic device Download PDF

Info

Publication number
WO2021057277A1
WO2021057277A1 PCT/CN2020/107413 CN2020107413W WO2021057277A1 WO 2021057277 A1 WO2021057277 A1 WO 2021057277A1 CN 2020107413 W CN2020107413 W CN 2020107413W WO 2021057277 A1 WO2021057277 A1 WO 2021057277A1
Authority
WO
WIPO (PCT)
Prior art keywords
photo
face
electronic device
face photo
information
Prior art date
Application number
PCT/CN2020/107413
Other languages
French (fr)
Chinese (zh)
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 WO2021057277A1 publication Critical patent/WO2021057277A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Definitions

  • This application relates to the field of electronic technology, and in particular to a method and electronic equipment for taking pictures under dark light.
  • terminal devices such as smart phones have become necessities in people's daily life, and the camera function of terminal devices is widely and frequently used by users.
  • the camera In the process of taking pictures, the camera, as one of the most important key components on the smart phone, can collect the pictures or images that the user wants to take.
  • smartphones In a well-lit environment, smartphones can basically take clear portrait shots; however, in low-light environments, it is difficult to clearly present the details of human faces, which makes it impossible to take clear portrait shots.
  • the present application provides a method and an electronic device for taking pictures in dark light, which can obtain photos containing the best facial skin quality and overall harmony and beauty in a dark light environment, thereby improving the user's shooting experience.
  • a method for taking pictures in low light which is characterized in being applied to an electronic device, and the method includes: obtaining a first face photo in response to a user's photographing operation; when the electronic device is in a low light shooting environment When, according to the first face photo, determine the second face photo from at least one photo that has been saved in the electronic device, where the second face photo and the first face photo include facial feature information of the same user ,
  • the second face photo is the photo with the best face feature information in the at least one photo; when the face feature information of the first region of the second face photo is better than the corresponding first face photo
  • the face feature information of the first area of the second face photo is used to fuse the face feature information of the first area of the first face photo, or the first area of the first face photo is used.
  • the face feature information of the first region of the two face photos replaces the face feature information of the first region of the first face photo to obtain a third face photo, and the first region is a part of the user's face Or all areas; save the third face photo to the local photo album of the electronic device.
  • the first face photo may be a selfie of the user or a photo taken by him, and the photo includes facial feature information.
  • the electronic device may obtain the facial feature information included in the first facial photo, and according to the facial feature information of the first facial photo, determine multiple photos with the same facial feature information from the local album of the electronic device . Similar to the face recognition technology, the electronic device can select multiple photos that include the same facial feature information from a local album based on the collected facial feature information.
  • the electronic device can identify the second face photo including clear facial skin quality and pore detail information from multiple photos. In other words, the second face photo is the photo with the best face detail information among the multiple photos. .
  • the electronic device can first determine that the current shooting environment is a low light environment according to the brightness information of the ambient light.
  • the best photo is selected from the existing album through image recognition and processing technology, and the best face detail information is obtained; then the best face in the existing photo
  • the detail information and the current portrait photos taken in low light are fused or replaced, so that the user can clearly restore the skin texture of the face in the low light environment, and take the most beautiful low-light portrait photos.
  • the method further includes: when the face feature information of the first region of the first face photo is better than the first region corresponding to the second face photo When the face feature information of, it is determined that the first face photo is the third face photo and saved.
  • comparing the face details of the currently taken photo (the first face photo) and the best photo (the second face photo) can be performed by comparing the sharpness of the photo.
  • the image fine segmentation technology can be used to divide the face in the photo into different regions, and compare the face details of the different regions in the current photo and the best photo respectively.
  • the face in the process of dividing the face, can be divided into 9 areas equally in the form of nine square grids; or, another possible way of dividing the face is divided according to the facial features of the face, that is, according to the forehead of the face , Cheeks, chin, eyes, nose, mouth and other areas are divided, which is not limited in this application.
  • the best detail information at the corresponding position of each region of the face can be obtained by comparison, and the detail information can include each pore, each skin texture, pixel information of each hair, and so on.
  • the face division process is to divide the currently taken photo and the best photo separately through the same fine image segmentation technology.
  • the current photo and the best photo are both averaged in the form of a nine-square grid.
  • the human face can also be divided into regions according to preset shapes, such as rectangular division, circular division, etc. The present application does not limit the form of human face division and the number of divided regions.
  • the facial feature information of the first area includes contrast information, average gradient information, and entropy information of pixels in the first area. At least one.
  • the contrast value, the global average gradient value, and the global entropy value of the face photo can be combined to obtain a score for evaluating the overall sharpness of the picture.
  • the score includes The evaluation results of the three dimensions of contrast, average gradient, and entropy can comprehensively reflect the clarity of the picture and improve the accuracy of the evaluation of picture clarity. This application does not limit the method of evaluating the clarity of the photo.
  • the method before saving the third face photo to the local photo album of the electronic device, the method further includes: obtaining information about the current low-light shooting environment; Perform an image processing operation on the third face photo according to the current information of the low-light shooting environment, and the image processing operation includes at least one processing mode of color temperature processing, color processing, and white balance processing.
  • the best face detail information in the existing photos and the current portrait photos taken in low light are fused or replaced, and the texture of the face skin can be clearly restored in the low light environment, and the most beautiful dark photos can be taken.
  • the light portrait photo combined with the color temperature, color and other information of the environment in the currently taken photo, the overall color temperature, color, white balance and other aspects of the synthesized photo are processed, so that in the dark environment, it can also obtain the most comprehensive information.
  • the method further includes: determining that the electronic device is in a low-light shooting environment.
  • determining that the electronic device is in a dark-light shooting environment includes: when the brightness of the ambient light collected by the ambient light brightness sensor of the electronic device is lower than a preset When the brightness threshold is set, it is determined that the electronic device is in a dark-light shooting environment; and/or when the electronic device turns on a flash or a soft light, it is determined that the electronic device is in a dark-light shooting environment.
  • the sensor of the mobile phone can collect the ambient light brightness information of the current shooting environment.
  • the brightness of the ambient light is less than the set brightness threshold, it is judged that the current shooting environment is a dark light shooting environment.
  • the brightness of the ambient light is greater than or equal to the set brightness
  • the normal shooting environment can be understood as an environment outside the low-light shooting environment.
  • the photo taken is the final photo captured and saved in the album.
  • the mobile phone judges that the current environment is in a low-light shooting environment according to the obtained ambient light brightness value less than the preset ambient light brightness threshold, or when the flash or soft light is turned on when the mobile phone takes pictures, it can be understood as the working mode of the flash It is an automatic mode.
  • the intensity of the ambient light is not within a certain preset range, the electronic device can automatically turn on the flash.
  • the method of taking pictures under dark light provided by this application can be used to obtain the most beautiful skin texture with clear human face. Portrait photos.
  • the relationship between the ambient light brightness value and the preset ambient light brightness threshold may not be limited.
  • the user currently wants to take a picture that is clearer than the preview effect and manually turn it on
  • the above various possible scenes in which the photographing method of the present application is used to obtain the most beautiful portrait photos containing clear facial skin textures are collectively referred to as "photographing in the dark”.
  • an interface for adjusting the brightness threshold of the ambient light can be provided to the user in the camera application, and the user can set or adjust the brightness threshold of the ambient light through the interface.
  • the above-described method of taking pictures under low light can perform a series of processing after the user has finished taking the picture, and has more processing time.
  • the corresponding processing can be performed when the system is idle, without occupying system resources.
  • an electronic device including one or more processors; a memory; a plurality of application programs; and one or more programs, wherein the one or more programs are stored in the memory, when the one Or when multiple programs are executed by the processor, the electronic device is caused to perform the following steps: in response to the user's photographing operation, obtain a first face photo; when in a dark light shooting environment, according to the first face photo, A second face photo is determined from at least one saved photo, where the second face photo and the first face photo include facial feature information of the same user, and the second face photo is among the at least one photo The photo with the best facial feature information; when the facial feature information of the first region of the second face photo is better than the facial feature information of the first region corresponding to the first face photo, use the The face feature information of the first area of the second face photo is fused with the face feature information of the first area of the first face photo, or the face feature of the first area of the second face photo is used The information replaces the face feature information of the first area of
  • the electronic device when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps: When the face feature information is better than the face feature information of the first region corresponding to the second face photo, it is determined that the first face photo is a third face photo and saved.
  • the facial feature information of the first area includes contrast information, average gradient information, and entropy information of pixels in the first area. At least one.
  • the electronic device before saving the third face photo to the local album, when the one or more programs are executed by the processor, the electronic device Perform the following steps: obtain information about the current low-light shooting environment; perform image processing operations on the third face photo according to the current low-light shooting environment information, and the image processing operations include color temperature processing, color processing, and white balance At least one of the processing methods.
  • the electronic device when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps: determining that it is in a low-light shooting environment.
  • the electronic device when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps: When the brightness of the ambient light collected by the sensor is lower than the preset brightness threshold, it is determined that it is in a low-light shooting environment; and/or the electronic device is determined to be in a low-light shooting environment when the flash or soft light is turned on.
  • the present application provides a device included in an electronic device, and the device has the function of realizing the foregoing aspects and the behavior of the electronic device in the possible implementation manners of the foregoing aspects.
  • the function can be realized by hardware, or the corresponding software can be executed by hardware.
  • the hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a display module or unit, a detection module or unit, a processing module or unit, and so on.
  • the present application provides an electronic device, including: a touch display screen, wherein the touch display screen includes a touch-sensitive surface and a display; a camera; one or more processors; a memory; a plurality of application programs; and one or Multiple computer programs.
  • one or more computer programs are stored in the memory, and the one or more computer programs include instructions.
  • the electronic device is caused to execute the method of photographing under dark light in any possible implementation of any one of the foregoing aspects.
  • the present application provides an electronic device including one or more processors and one or more memories.
  • the one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes.
  • the computer program codes include computer instructions.
  • the electronic device executes Any one of the above-mentioned aspects is a possible implementation of a method for taking pictures under dark light.
  • the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to perform any one of the possible methods for taking photos under dark light in any one of the foregoing aspects.
  • the present application provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute any one of the possible methods for taking photos in the dark in any one of the above aspects.
  • FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
  • Fig. 2 is a schematic diagram of an example of the control structure of the photographing process of an electronic device.
  • FIG. 3 is a schematic diagram of an example of a graphical user interface for taking pictures in dark light according to an embodiment of the present application.
  • Fig. 4 is a schematic diagram of another example of a graphical user interface for taking pictures in dark light provided by an embodiment of the present application.
  • Fig. 5 is a schematic diagram of an example of face division provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a possible composition of an electronic device provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features.
  • the embodiment of the present application provides a method for taking pictures in dark light, which can be applied to electronic devices or a separate application program.
  • the application program can implement the method of taking pictures under dark light conditions and restoring portrait details in this application.
  • the method for taking pictures in low light provided by the present application can present users with clear facial skin texture and other details through image recognition and processing technology, and solve the problem of serious loss of facial details when users take pictures or take selfies in low light conditions. The problem.
  • the method for taking pictures in dark light provided by the embodiments of the present application can be applied to electronic devices with camera functions such as mobile phones, tablet computers, and wearable devices.
  • the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
  • FIG. 1 shows a schematic structural diagram of an electronic device 100.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a 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, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • 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 sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • firmware program is stored in the memory, which is used to enable the controller or processor to implement the dark-light photography of this application through an interface or protocol and to clearly restore the facial skin details through image recognition and processing technology.
  • the 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, and a universal asynchronous transceiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may couple the touch sensor 180K, the charger, the flash, the camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may 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 two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the 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 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may 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 that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones. This interface can also be used to connect to other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, 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 provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • BT wireless fidelity
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the electronic device 100 implements a display function through a graphics processing unit (GPU), a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which 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 use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an image signal processor (ISP), a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • ISP image signal processor
  • the camera 193 may be an optical zoom lens or the like, which is not limited in this application.
  • the ISP may be set in the camera 193, which is not limited in this application.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected 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 optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • 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. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • 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 realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • 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, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • 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. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials.
  • the electronic device 100 determines the intensity of the 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 that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example, when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake 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 shake 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 holster.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of 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 be used in applications such as horizontal and vertical screen switching, pedometers and so on.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can 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 holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • 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 to prevent accidental touch.
  • the ambient light sensor 180L can collect the brightness information of the shooting environment, so that the electronic device can judge whether it is in the dark-light shooting environment according to the current ambient light brightness, and then use the method provided in this application to obtain Include photos with clear face details.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces 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 due to low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the 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.
  • the bone conduction sensor 180M can obtain 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 pulse signal.
  • the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
  • the application processor may analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may 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 vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations that act on different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 may also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call 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.
  • FIG. 2 is a schematic diagram of an example of the control structure of the photographing process of an electronic device.
  • the control structure 200 includes an image signal processing (ISP) 201, a sensor 202, and an optical zoom lens 203.
  • the ISP 201 may correspond to the processor 110 in the electronic device 100 shown in FIG. 1, and may include a logic part and a firmware program (firmware) running on it.
  • the sensor 202 may correspond to various sensors in the electronic device 100 shown in FIG. 1, such as an ambient light sensor 180L, a proximity light sensor 180G, etc.; the optical zoom lens 203 may correspond to the electronic device 100 shown in FIG. Camera 193.
  • the ISP 201 may be used to process the data fed back by the camera 193, and complete the digital image processing process through a series of digital image processing algorithms.
  • the shutter is opened, and the light is transmitted to the photosensitive element of the camera through the optical zoom lens 203.
  • the optical zoom lens 203 can project the ambient light signal to the photosensitive area of the sensor 202, and the sensor 202 passes through the photoelectric Conversion, into an image visible to the naked eye.
  • the internal original image (Bayer format) is sent to the ISP 201, and the ISP 201 is processed by an algorithm to output an image in the RGB space domain to the back-end acquisition unit.
  • ISP 201 controls the optical zoom lens 203, sensor 202, and ISP logic through the firmware running on it, and then completes functions such as automatic iris, automatic exposure, and automatic white balance to implement the embodiments of this application. Provided to restore the texture of the face skin in the dark, and take the clear and most beautiful portrait effect.
  • ISP201 can also optimize the image noise, brightness, skin color, and optimize the exposure parameters, color temperature and other parameters of the shooting scene.
  • the existing smart phones are preset with front or rear flash or soft light.
  • the user takes a photo (or Selfie) in a dark light environment
  • by turning on the flash or soft light to fill in the light and then increase the brightness of the shooting environment, so that you can take portraits.
  • Some smart phones do not preset the front flash or soft light, but can fill in the light through the screen fill-in function.
  • the user takes a selfie in dim light, it will turn on the screen fill-in function, for example, by lighting the entire screen.
  • a third-party lighting device to fill light in a low-light environment.
  • the ambient brightness can be greatly improved, thereby achieving a better portrait shooting effect.
  • this method requires the user to carry a third-party lighting device with him, which is cumbersome to operate and is not portable enough to carry the lighting device, and the user experience is poor.
  • some smart phones have realized the super night scene function of ultra-long exposure and multi-frame synthesis, which can improve the overall brightness of photos taken in low light; or, through the combination of ultra-long exposure and flash or soft light, Improve the sharpness of photos taken in low light.
  • the overall brightness of the final film can be improved, the loss of portrait details, especially facial skin quality, is still very serious.
  • FIG. 3 is a schematic diagram of an example of a graphical user interface (GUI) for taking pictures in dark light provided by an embodiment of the present application.
  • GUI graphical user interface
  • This application will take a smartphone as an example to introduce in detail the method of taking pictures under dark light provided by this application.
  • FIG. 3 shows that in the unlock mode of the mobile phone, the screen display system of the mobile phone displays the currently output interface content 301, which is the main interface of the mobile phone.
  • the interface content 301 displays a variety of third-party applications (application, App), such as Alipay, photo album, music, settings, WeChat, card package, Weibo, camera and other applications.
  • App third-party applications
  • the interface content 301 may also include other more application programs, which is not limited in this application.
  • the main interface 302 of the camera application includes multiple controls, which are respectively used to implement various functions of the camera application, which will not be repeated here.
  • the method of taking photos or taking selfies in a dark light environment requires a mobile phone to monitor the brightness of the ambient light.
  • the method of this application is used to process the photos to Get the most beautiful portrait photo with clear skin texture.
  • the sensor of the mobile phone can collect the ambient light brightness information of the current shooting environment.
  • the current shooting environment is a dark light shooting environment.
  • the brightness of the light is greater than or equal to the set brightness threshold, it is determined that the current shooting environment is a normal shooting environment.
  • the normal shooting environment can be understood as an environment outside the low-light shooting environment.
  • an interface for adjusting the brightness threshold of the ambient light can be provided to the user in the camera application, and the user can set or adjust the brightness threshold of the ambient light through the interface.
  • the user can set the brightness threshold of the ambient light through the setting control 10.
  • the user clicks the setting control 10 and in response to the user's click operation, the mobile phone enters the setting interface 303 shown in (c).
  • the setting interface 303 includes general settings for the camera application's shooting resolution, geographic location information, automatic watermarking and other options, as well as the camera settings for the AI master photographer, reference line, shooting sound, smiley capture and other options during the shooting process , This application does not limit this.
  • the interface provided for the user to adjust the brightness threshold of the ambient light can be set in the general setting menu of the camera.
  • the user enters the setting interface 304 of ambient light brightness as shown in (d) in FIG.
  • "default mode” can be included.
  • the default mode of ambient light brightness can be the ambient light brightness threshold that has been set when the phone leaves the factory.
  • the setting interface 304 of ambient light brightness may also include a "custom mode", through which the user can modify the ambient light brightness threshold.
  • Fig. 4 is a schematic diagram of another example of a graphical user interface for taking pictures in dark light provided by an embodiment of the present application.
  • an interface 306 as shown in Figure 4 (b) will pop up, which enumerates multiple custom strategies, For example, custom strategy 1, custom strategy 2, custom strategy 3, etc.
  • this application does not limit the number of strategies enumerated in the custom mode.
  • the user can also execute the custom strategy shown in Figure 4 (b) to add the "+” option to enter (c) in Figure 4 )
  • the ambient light brightness threshold adjustment interface shown in the figure drag the progress bar of the brightness range to set the ambient light brightness threshold, or manually enter the brightness threshold, click "Save” to automatically save and select the current custom strategy4.
  • the user can delete and modify each custom strategy. For example, as shown in Figure 4 (d), the user can click "Custom Strategy 3" to delete and modify the custom strategy. , This application does not limit this.
  • the camera application defaults to the "default mode" if the user does not set it.
  • the camera uses the newly set ambient light brightness threshold to determine whether the current shooting environment is a low-light shooting environment.
  • the ambient light brightness value obtained by the mobile phone is greater than or equal to the preset ambient light brightness threshold, and the mobile phone does not turn on the flash or soft light, the photo taken is the finally obtained photo saved in the album.
  • this algorithm can also be called to optimize face photos when the ambient light brightness value is greater than or equal to the preset ambient light brightness threshold to meet the needs of special scenes. For example, although the overall ambient light brightness is greater than the threshold, the light Scenes where the angle or layout or local light does not meet the shooting requirements, or scenes with special requirements for the skin texture of a certain part of the face.
  • the user can manually operate, or input preset gestures, or trigger the execution of the optimization function through a menu or a specific button, so as to obtain a portrait photo containing a clear facial skin texture.
  • the mobile phone judges that the current environment is in a low-light shooting environment according to the obtained ambient light brightness value less than the preset ambient light brightness threshold, or when the flash or soft light is turned on when the mobile phone takes pictures, it can be understood as the working mode of the flash It is an automatic mode.
  • the electronic device can automatically turn on the flash.
  • the method of taking pictures under dark light provided by this application can be used to obtain the most beautiful skin texture with clear human face. Portrait photos.
  • the relationship between the ambient light brightness value and the preset ambient light brightness threshold may not be limited.
  • the user currently wants to take a picture that is clearer than the preview effect and manually turn it on
  • the above various possible scenes in which the photographing method of the present application is used to obtain the most beautiful portrait photos containing clear facial skin textures are collectively referred to as "photographing in the dark”.
  • the mobile phone can use image recognition technology to select the best photo containing clear texture, pores and other facial and skin quality information from the existing photos of user A in the album.
  • image recognition technology There are no restrictions on the method of selecting the best photo among the photos.
  • the current photos of user A in the mobile phone album can be compared with the details of the face respectively, so as to obtain the best photos containing clear texture, pores and other facial skin quality information.
  • the face details of the existing photos of the user A in the album are compared, and the best photo is determined, the face details of the currently taken photo and the best photo are compared.
  • comparing the face details of the currently taken photo and the best photo can be done by comparing the sharpness of the photo.
  • Fig. 5 is a schematic diagram of an example of face division provided by an embodiment of the present application. Specifically, the face in the photo can be divided into different regions through the image fine segmentation technology, and the face details of the different regions in the currently taken photo and the best photo can be compared respectively.
  • the face in the process of dividing the face, as shown in (a) in FIG. 5, the face may be divided into 9 regions evenly in the form of a nine-square grid, for example, regions 41-49 in (a). Then compare separately to obtain the best detail information at the corresponding position of each region of the face.
  • the detail information may include each pore, each skin texture, each hair pixel, and so on.
  • the face can be divided into 6 areas based on the user’s facial features, such as the eye area 49, nose area 50, left cheek area 51, and right cheek area 52 in (b). , The mouth area 53 and the chin area 54. Then compare the best detail information at the corresponding position of each region of the face.
  • the detail information can include each pore, each skin texture, and pixel information of each hair.
  • the face division process is to divide the currently taken photo and the best photo separately through the same fine image segmentation technology.
  • both the currently taken photo and the best photo are divided equally into faces in the form of nine square grids. 9 regions, compare the details of each region separately; or divide the face into 6 regions in the form of facial features for the currently taken photo and the best photo, and compare the details of each region separately.
  • the face in processing the face division method introduced in FIG. 5, the face can also be divided into regions according to preset shapes, such as rectangular division, circular division, etc. The form of face division and the number of divided regions are different in this application. Make a limit.
  • the sharpness parameter of the corresponding position of the human face in the photo is calculated, and then the picture with the best sharpness of the position is obtained by comparison, and the detailed information of the best photo position is obtained and stored.
  • the contrast value of the photo, the global average gradient value and the global entropy value can be combined to obtain a score for evaluating the overall sharpness of the picture, and the score includes the contrast.
  • the evaluation results of the three dimensions of, average gradient and entropy can comprehensively reflect the clarity of the picture and improve the accuracy of the evaluation of picture clarity. This application does not limit the method of evaluating the clarity of the photo.
  • contrast information is used as parameters for evaluating clarity.
  • the five sense organs are divided by (b) in Figure 4 as an example, calculate the contrast, average gradient, and entropy of the corresponding position of the face in the photo to determine the best detail information of the best photo.
  • the best photo listed above and the contrast information and average gradient information of the 6 regions of the currently taken photo from the best photo and the currently taken photo, select the best part of the face detail for each different region, and select The optimal part of the fusion process is performed with the corresponding area of the current photo.
  • the contrast of the nose area 50 of the best photo is better than the contrast of the nose area 50 of the current photo. That is, the mobile phone judges that the details of the best photo are better than the current photo. Therefore, the best photo is The nose area 50 and the nose area 50 of the currently taken photo are fused.
  • contrast information, average gradient information, and entropy information listed above can be the average contrast information, average gradient information, and entropy information of all pixels in a certain area, or the average of partially sampled pixels. Contrast information, average gradient information, and entropy information are not limited in this application.
  • the best part of the best photo is fused or replaced with the corresponding area of the currently taken photo, which can be based on the currently taken photo, using the best detail in the corresponding area of the face Information is replaced and supplemented, combined with super-resolution technology, and the corresponding high-resolution images are reconstructed from low-resolution images, thereby synthesizing photos that can present the best facial skin quality and other details in the dark.
  • the fusion processing may be a corresponding fusion of a certain area of the human face, or a full-face area. Fusion of face details; the user can specify one or more regions to which the fusion process is applicable; the replacement process can only replace the face details of a certain area, or replace the face details of multiple areas, or all areas of the entire face All are replaced, and this application does not limit it.
  • the nose region 50 of the currently captured face photo when it is determined that the detail information of the nose region 50 of the currently captured face photo is worse than the detail information of this region of the best photo, and the detail information of other regions are similar, only the nose region 50 can be replaced. Or, when it is determined that the detail information of all areas of the entire face of the currently captured face photo is worse than the detail information of the corresponding area of the best photo, all areas of the entire face may be replaced.
  • the environmental information can include information such as the color temperature and color of the environment in the currently taken photo.
  • the mobile phone can process the overall color temperature, color, white balance and other aspects of the synthesized photo by obtaining the environmental information, so as to obtain the It presents the best facial skin quality under light, and the overall harmonious and beautiful photos.
  • ISP 201 can complete the effect processing of digital images through a series of digital image processing algorithms, which can mainly include 3A algorithm processing, dead pixel correction processing, denoising processing, Strong light suppression processing, backlight compensation processing, color enhancement processing, lens shading correction processing, etc.
  • ISP 201 includes the implementation of the above-described digital image effect processing through the firmware running on it, and then completes the functions of automatic iris, automatic exposure, automatic white balance, etc., which will not be repeated here.
  • the electronic device can determine that the current shooting environment is a low light environment according to the brightness information of the ambient light.
  • the best photo is selected from the existing album through image recognition and processing technology, and the best face detail information is obtained; then the best face in the existing photo
  • the detail information and the current portrait photos taken in low light are fused or replaced, so that the user can clearly restore the texture of the face and skin in the dark environment, and take the most beautiful low-light portrait photos; at the same time, combine the current shots
  • the color temperature, color, and other information of the environment in the photos, and the overall color temperature, color, white balance and other aspects of the synthesized photos are processed, so that in the dark environment, the best facial skin quality can be obtained, and the overall harmony and beauty Photos to improve the user experience.
  • FIG. 6 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application. As shown in FIG. 6, the method may include the following steps:
  • the electronic device enters a photo preview state.
  • the photo preview state here may be a preview state of the user taking a photo or taking a self-portrait.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the ambient light sensor 180L can collect the brightness information of the shooting environment, so that the electronic device can determine whether it is in a dark-light shooting environment according to the current ambient light brightness, and thus use the method provided in this application to obtain the best human face. Photos of skin texture.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the electronic device can automatically adjust the white balance according to the perceived brightness of the ambient light, so as to process the overall color temperature, color, white balance and other aspects of the synthesized photo, so that it can also obtain the best facial skin quality in the dark environment. , And overall harmonious and beautiful photos,
  • the user takes a photo.
  • the user presses the camera control of the electronic device to complete a photo or self-portrait action.
  • the electronic device determines whether the recorded brightness value of the ambient light is greater than a preset brightness threshold, and the flash or soft light is not currently turned on.
  • the image recognition technology is used to identify Compare other photos of the current user and select the best photo with clear facial skin texture.
  • the electronic device can obtain the face detail information of the best photo, such as each pore, each skin texture, the contrast information of each hair, average Gradient information and entropy information, etc., so as to replace and supplement the corresponding area of the face with face detail information.
  • the electronic device can perform color temperature processing, color processing, and white balance processing on the synthesized photo as a whole by acquiring environmental information, so as to obtain a photo that can present the best facial skin quality under dark light and is harmonious and beautiful overall.
  • the photo taken by the user is the final photo obtained and saved in the album. There is no need to perform image processing on the captured photos, which is not limited in this application.
  • the above-described method of taking photos under low light can perform a series of processing after the user has completed the shooting, and has more processing time. For example, corresponding processing can be performed when the system is idle, and system resources may not be occupied.
  • the electronic device can first determine that the current shooting environment is a low light environment according to the brightness information of the ambient light.
  • the best photo is selected from the existing album through image recognition and processing technology, and the best face detail information is obtained; then the best face in the existing photo
  • the detail information and the current portrait photos taken in low light are fused or replaced, so that the user can clearly restore the texture of the face and skin in the dark environment, and take the most beautiful low-light portrait photos; at the same time, combine the current shots
  • the color temperature, color, and other information of the environment in the photos, and the overall color temperature, color, white balance and other aspects of the synthesized photos are processed, so that in the dark environment, the best facial skin quality can be obtained, and the overall harmony and beauty Photos to improve the user experience.
  • FIG. 7 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application. As shown in FIG. 7, the method may include the following steps:
  • the electronic device When the electronic device is in a low-light shooting environment, determine a second face photo from at least one photo that has been saved in the electronic device according to the first face photo, wherein the second face photo
  • the photo and the first face photo include facial feature information of the same user, and the second face photo is a photo with the best facial feature information among the at least one photo.
  • the first face photo may be a selfie of the user or a photo taken by him, and the photo includes facial feature information.
  • the electronic device may obtain the facial feature information included in the first facial photo, and according to the facial feature information of the first facial photo, determine multiple photos with the same facial feature information from the local album of the electronic device . Similar to the face recognition technology, the electronic device can select multiple photos that include the same facial feature information from a local album based on the collected facial feature information.
  • the electronic device can identify the second face photo including clear facial skin quality and pore detail information from multiple photos.
  • the second face photo is the photo with the best face detail information among the multiple photos. .
  • the face feature information of the first region of the second face photo is better than the face feature information of the first region corresponding to the first face photo, use the second face photo
  • the face feature information of the first region is fused with the face feature information of the first region of the first face photo, or the face feature information of the first region of the second face photo is used
  • the information replaces the face feature information of the first region of the first face photo to obtain a third face photo, and the first region is a part or all of the user's face.
  • the electronic device determines the currently acquired first face photo and the second face photo saved in the local album, it can compare the currently taken photo with the face detail information of the best photo through image processing technology. It is done by comparing the sharpness of the photos.
  • the image fine segmentation technology can be used to divide the face in the photo into different regions, and compare the face details of the different regions in the current photo and the best photo respectively.
  • the face in the process of dividing the face, can be divided into 9 areas equally in the form of nine square grids; or, another possible way of dividing the face is divided according to the facial features of the face, that is, according to the forehead of the face , Cheeks, chin, eyes, nose, mouth and other areas are divided, which is not limited in this application.
  • the best detail information at the corresponding position of each region of the face can be obtained by comparison, and the detail information can include each pore, each skin texture, pixel information of each hair, and so on.
  • the face division process is to divide the currently taken photo and the best photo separately through the same fine image segmentation technology.
  • the current photo and the best photo are both averaged in the form of a nine-square grid.
  • the human face can also be divided into regions according to preset shapes, such as rectangular division, circular division, etc. The present application does not limit the form of human face division and the number of divided regions.
  • the sharpness parameter of the corresponding position of the human face in the photo is calculated, and then the picture with the best sharpness of the position is obtained by comparison, and the detailed information of the best photo position is obtained and stored.
  • the contrast value of the photo, the global average gradient value and the global entropy value can be combined to obtain a score for evaluating the overall sharpness of the picture, and the score includes the contrast.
  • the evaluation results of the three dimensions of, average gradient and entropy can comprehensively reflect the clarity of the picture and improve the accuracy of the evaluation of picture clarity. This application does not limit the method of evaluating the clarity of the photo.
  • the electronic device can merge the optimal part of the best photo (the second face photo) with the corresponding area of the currently taken photo (the first face photo), which can be based on the currently taken photo, corresponding to the face
  • the region is replaced and supplemented with the best detail information, combined with super-resolution technology, and the corresponding high-resolution image is reconstructed from the low-resolution image, so as to synthesize photos that can show the best facial skin quality and other details in the dark.
  • the fusion processing may be a corresponding fusion of a certain area of the human face, or a full-face area.
  • the fusion of human face details; the replacement process can only replace the face details of a certain area, or replace the face details of multiple areas, or replace all areas of the entire face, which is not limited in this application.
  • the processed photo is finally obtained, that is, the third face photo, which is saved in the local photo album.
  • the above-described method of taking photos under low light can perform a series of processing after the user has completed the shooting, and has more processing time. For example, corresponding processing can be performed when the system is idle, and system resources may not be occupied.
  • an electronic device in order to implement the above-mentioned functions, includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Those skilled in the art can use different methods for each specific application in combination with the embodiments to implement the described functions, but such implementation should not be considered as going beyond the scope of the present application.
  • the electronic device may be divided into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 8 shows a schematic diagram of a possible composition of the electronic device 800 involved in the foregoing embodiment.
  • the electronic device 800 may include: an acquiring unit 801, a processing unit 802, and a display unit 803.
  • the acquiring unit 801 may be used to support the electronic device 800 to perform the above-mentioned step 601, etc., and/or used in other processes of the technology described herein.
  • the processing unit 802 may be used to support the electronic device 800 to perform the foregoing steps 602, 603, etc., and/or other processes used in the technology described herein.
  • the display unit 803 may be used to support the electronic device 800 to display final photos, etc., and/or other processes used in the technology described herein.
  • the electronic device provided in this embodiment is used to perform the above-mentioned method for taking pictures under dark light, and therefore can achieve the same effect as the above-mentioned implementation method.
  • the electronic device may include a processing module, a storage module, and a communication module.
  • the processing module can be used to control and manage the actions of the electronic device. For example, it can be used to support the electronic device to execute the steps performed by the acquisition unit 801, the processing unit 802, and the display unit 803.
  • the storage module can be used to support the electronic device to execute the storage program code and data.
  • the communication module can be used to support the communication between electronic devices and other devices.
  • the processing module may be a processor or a controller. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of this application.
  • the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on.
  • the storage module may be a memory.
  • the communication module may specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, and other devices that interact with other electronic devices.
  • the electronic device involved in this embodiment may be a device having the structure shown in FIG. 1.
  • This embodiment also provides a computer storage medium in which computer instructions are stored.
  • the computer instructions are executed on an electronic device, the electronic device is caused to execute the above-mentioned related method steps to realize the dark-light shooting in the above-mentioned embodiment. Methods.
  • This embodiment also provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above-mentioned related steps, so as to realize the method of photographing under dark light in the above-mentioned embodiment.
  • the embodiments of the present application also provide a device.
  • the device may specifically be a chip, component or module.
  • the device may include a processor and a memory connected to each other.
  • the memory is used to store computer execution instructions.
  • the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the method of photographing under dark light in the foregoing method embodiments.
  • the electronic device, computer storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding method provided above. The beneficial effects of the method will not be repeated here.
  • the disclosed device and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or It can be integrated into another device, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, which are stored in a storage medium. It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in the embodiments of the present application.
  • the foregoing storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Abstract

Provided in the present application are a photographing method in dark light and an electronic device. According to the method, the current photography environment can be determined as a dark light environment according to brightness information of ambient light; when a user takes a portrait photograph in the dark light environment, the optimal photograph is selected from the existing photograph album by means of image recognition and processing technology, and the optimal facial detail information is acquired; fusion processing or replacement processing is performed on the optimal facial detail information in the existing photograph and the portrait photograph taken in the current dark light environment, such that the user can also clearly restore facial skin texture in the dark light environment, and take the most beautiful dark light portrait photograph; and combining with information such as the color temperature and color of the environment in the photograph currently taken, the synthesized photograph is integrally processed regarding the color temperature, color, white balance, etc., such that a photograph, which contains the optimal facial skin and is integrally harmonious and attractive, can also be acquired in the dark light environment, thereby improving the photography experience of the user.

Description

一种暗光下拍照的方法及电子设备Method and electronic equipment for taking pictures under dark light
本申请要求于2019年09月23日提交中国专利局、申请号为201910899296.8、申请名称为“一种暗光下拍照的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 23, 2019, the application number is 201910899296.8, and the application name is "a method and electronic equipment for taking pictures under dark light", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及电子技术领域,尤其涉及一种暗光下拍照的方法及电子设备。This application relates to the field of electronic technology, and in particular to a method and electronic equipment for taking pictures under dark light.
背景技术Background technique
目前,智能手机等终端设备已经成为人们日常生活中的必需品,终端设备的拍照功能受到用户广泛而频繁的使用。在拍照过程中,摄像头作为智能手机上最重要的关键器件之一,可以采集用户想要拍摄的画面或者图像。在光线充足的环境下,智能手机基本都能够拍出清晰的人像拍摄效果;但是在光线较暗的环境下,人脸细节很难清晰呈现,导致无法拍出清晰的人像拍摄效果。At present, terminal devices such as smart phones have become necessities in people's daily life, and the camera function of terminal devices is widely and frequently used by users. In the process of taking pictures, the camera, as one of the most important key components on the smart phone, can collect the pictures or images that the user wants to take. In a well-lit environment, smartphones can basically take clear portrait shots; however, in low-light environments, it is difficult to clearly present the details of human faces, which makes it impossible to take clear portrait shots.
发明内容Summary of the invention
本申请提供一种暗光下拍照的方法及电子设备,能够在暗光环境下,获取包含最佳人脸肤质、且整体和谐美观的照片,提高了用户的拍摄体验。The present application provides a method and an electronic device for taking pictures in dark light, which can obtain photos containing the best facial skin quality and overall harmony and beauty in a dark light environment, thereby improving the user's shooting experience.
第一方面,提供了一种暗光下拍照的方法,其特征在于,应用于电子设备,该方法包括:响应于用户的拍照操作,获取第一人脸照片;当电子设备处于暗光拍摄环境时,根据第一人脸照片,从该电子设备已经保存的至少一个照片中确定第二人脸照片,其中,该第二人脸照片和该第一人脸照片包括同一用户的人脸特征信息,该第二人脸照片是该至少一个照片中具有最佳的人脸特征信息的照片;当该第二人脸照片的第一区域的人脸特征信息优于该第一人脸照片对应的该第一区域的人脸特征信息时,用该第二人脸照片的该第一区域的人脸特征信息融合该第一人脸照片的该第一区域的人脸特征信息,或者用该第二人脸照片的该第一区域的人脸特征信息替换该第一人脸照片的该第一区域的人脸特征信息,得到第三人脸照片,该第一区域是该用户人脸的部分或者全部区域;保存该第三人脸照片至该电子设备的本地相册。In a first aspect, a method for taking pictures in low light is provided, which is characterized in being applied to an electronic device, and the method includes: obtaining a first face photo in response to a user's photographing operation; when the electronic device is in a low light shooting environment When, according to the first face photo, determine the second face photo from at least one photo that has been saved in the electronic device, where the second face photo and the first face photo include facial feature information of the same user , The second face photo is the photo with the best face feature information in the at least one photo; when the face feature information of the first region of the second face photo is better than the corresponding first face photo When the face feature information of the first area is used, the face feature information of the first area of the second face photo is used to fuse the face feature information of the first area of the first face photo, or the first area of the first face photo is used. The face feature information of the first region of the two face photos replaces the face feature information of the first region of the first face photo to obtain a third face photo, and the first region is a part of the user's face Or all areas; save the third face photo to the local photo album of the electronic device.
应理解,第一人脸照片可以是用户的自拍照或者他拍照,该照片中包括人脸特征信息。电子设备可以获取该第一人脸照片所包括的人脸特征信息,并根据该第一人脸照片的人脸特征信息,从电子设备的本地相册中确定具有相同人脸特征信息的多个照片。类似于人脸识别技术,电子设备可以根据采集的人脸特征信息从本地相册中选择出包括相同的人脸特征信息的多个照片。此外,电子设备可以从多个照片中识别出包括清晰的人脸肤质、毛孔细节信息的第二人脸照片,换言之,第二人脸照片是多个照片中人脸细节信息最优的照片。It should be understood that the first face photo may be a selfie of the user or a photo taken by him, and the photo includes facial feature information. The electronic device may obtain the facial feature information included in the first facial photo, and according to the facial feature information of the first facial photo, determine multiple photos with the same facial feature information from the local album of the electronic device . Similar to the face recognition technology, the electronic device can select multiple photos that include the same facial feature information from a local album based on the collected facial feature information. In addition, the electronic device can identify the second face photo including clear facial skin quality and pore detail information from multiple photos. In other words, the second face photo is the photo with the best face detail information among the multiple photos. .
通过上述介绍的在暗光下拍照的方法,电子设备可以先根据环境光的亮度信息确定当 前的拍摄环境为暗光环境。当用户在暗光环境中拍摄人像照片时,通过图像识别和处理技术,从现有相册中选取最佳照片,并获取最佳的人脸细节信息;再将现有照片中最佳的人脸细节信息和当前暗光拍摄的人像照片进行融合处理或者替换处理,以实现用户在暗光环境下也能清晰还原人脸皮肤质感,拍摄出最美的暗光人像照片。Through the above-mentioned method of taking pictures under low light, the electronic device can first determine that the current shooting environment is a low light environment according to the brightness information of the ambient light. When the user takes a portrait photo in a dark light environment, the best photo is selected from the existing album through image recognition and processing technology, and the best face detail information is obtained; then the best face in the existing photo The detail information and the current portrait photos taken in low light are fused or replaced, so that the user can clearly restore the skin texture of the face in the low light environment, and take the most beautiful low-light portrait photos.
结合第一方面,在第一方面的某些实现方式中,该方法还包括:当第一人脸照片的第一区域的人脸特征信息优于该第二人脸照片对应的该第一区域的人脸特征信息时,确定该第一人脸照片为第三人脸照片并保存。With reference to the first aspect, in some implementations of the first aspect, the method further includes: when the face feature information of the first region of the first face photo is better than the first region corresponding to the second face photo When the face feature information of, it is determined that the first face photo is the third face photo and saved.
具体地,在一种可能的实现方式中,比较当前所拍摄的照片(第一人脸照片)和最佳照片(第二人脸照片)的人脸细节,可以通过比较照片的清晰度来进行。例如,可以通过图像精细分割技术,将照片中的人脸分成不同的区域,分别对比当前所拍摄的照片和最佳照片的不同区域的人脸细节。Specifically, in a possible implementation manner, comparing the face details of the currently taken photo (the first face photo) and the best photo (the second face photo) can be performed by comparing the sharpness of the photo. . For example, the image fine segmentation technology can be used to divide the face in the photo into different regions, and compare the face details of the different regions in the current photo and the best photo respectively.
可选地,在人脸划分过程中,可以以九宫格形式将人脸平均分成9个区域;或者,另一种可能的人脸划分方式,按人脸的五官进行划分,即按照人脸的额头、脸颊、下巴、眼睛、鼻子、嘴巴等区域进行划分,本申请对此不做限定。Optionally, in the process of dividing the face, the face can be divided into 9 areas equally in the form of nine square grids; or, another possible way of dividing the face is divided according to the facial features of the face, that is, according to the forehead of the face , Cheeks, chin, eyes, nose, mouth and other areas are divided, which is not limited in this application.
应理解,可以分别比对得出人脸的每个区域对应位置处最佳的细节信息,该细节信息可以包括每个毛孔、每条皮肤纹理、每根毛发的像素点信息等。It should be understood that the best detail information at the corresponding position of each region of the face can be obtained by comparison, and the detail information can include each pore, each skin texture, pixel information of each hair, and so on.
还应理解,人脸划分过程是通过相同的图像精细分割技术对当前所拍摄的照片和最佳照片分别进行划分,换言之,将当前所拍摄的照片和最佳照片都以九宫格形式将人脸平均分成9个区域,分别比对每个区域的细节信息;或者将当前所拍摄的照片和最佳照片都以五官划分形式将人脸分成6个区域,分别比对每个区域的细节信息。此外,还可以根据预设的形状对人脸进行区域划分,例如矩形划分、圆形划分等,本申请对人脸划分的形式和划分区域的数量不做限定。It should also be understood that the face division process is to divide the currently taken photo and the best photo separately through the same fine image segmentation technology. In other words, the current photo and the best photo are both averaged in the form of a nine-square grid. Divide into 9 regions and compare the detailed information of each region separately; or divide the face into 6 regions in the form of facial features for the currently taken photo and the best photo, and compare the detailed information of each region separately. In addition, the human face can also be divided into regions according to preset shapes, such as rectangular division, circular division, etc. The present application does not limit the form of human face division and the number of divided regions.
结合第一方面和上述实现方式,在第一方面的某些实现方式中,该第一区域的人脸特征信息包括该第一区域的像素点的对比度信息、平均梯度信息以及熵值信息中的至少一种。Combining the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, the facial feature information of the first area includes contrast information, average gradient information, and entropy information of pixels in the first area. At least one.
可选地,在评价照片清晰度的过程中,可以根据人脸照片的对比度值、全局平均梯度值以及全局熵值进行合并,获得一个用于评价图片整体清晰度的分值,该分值包含了对比度、平均梯度以及熵3个维度的评价结果,能够综合体现图片的清晰程度,提高图片清晰度评价的准确性。本申请对评价照片清晰度的方法不做限定。Optionally, in the process of evaluating the sharpness of the photo, the contrast value, the global average gradient value, and the global entropy value of the face photo can be combined to obtain a score for evaluating the overall sharpness of the picture. The score includes The evaluation results of the three dimensions of contrast, average gradient, and entropy can comprehensively reflect the clarity of the picture and improve the accuracy of the evaluation of picture clarity. This application does not limit the method of evaluating the clarity of the photo.
结合第一方面和上述实现方式,在第一方面的某些实现方式中,保存第三人脸照片至该电子设备的本地相册之前,该方法还包括:获取当前的暗光拍摄环境的信息;根据当前的该暗光拍摄环境的信息,对该第三人脸照片进行图像处理操作,该图像处理操作包括色温处理、色彩处理、白平衡处理中的至少一种处理方式。Combining the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, before saving the third face photo to the local photo album of the electronic device, the method further includes: obtaining information about the current low-light shooting environment; Perform an image processing operation on the third face photo according to the current information of the low-light shooting environment, and the image processing operation includes at least one processing mode of color temperature processing, color processing, and white balance processing.
通过上述技术方案,将现有照片中最佳的人脸细节信息和当前暗光拍摄的人像照片进行融合处理或者替换处理,在暗光环境下可以清晰还原人脸皮肤质感,拍摄出最美的暗光人像照片之后,再结合当前所拍摄的照片中环境的色温、色彩等信息,对合成的照片整体进行色温、色彩、白平衡等方面的处理,从而在暗光环境下,也能获取包含最佳人脸肤质、且整体和谐美观的照片,提高了用户体验。Through the above technical solution, the best face detail information in the existing photos and the current portrait photos taken in low light are fused or replaced, and the texture of the face skin can be clearly restored in the low light environment, and the most beautiful dark photos can be taken. After the light portrait photo, combined with the color temperature, color and other information of the environment in the currently taken photo, the overall color temperature, color, white balance and other aspects of the synthesized photo are processed, so that in the dark environment, it can also obtain the most comprehensive information. The beautiful face and skin quality, and the overall harmonious and beautiful photos, improve the user experience.
结合第一方面和上述实现方式,在第一方面的某些实现方式中,该方法还包括:确定 该电子设备处于暗光拍摄环境。With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, the method further includes: determining that the electronic device is in a low-light shooting environment.
结合第一方面和上述实现方式,在第一方面的某些实现方式中,确定该电子设备处于暗光拍摄环境,包括:当电子设备的环境光亮度传感器采集的环境光的亮度低于预设亮度阈值时,确定该电子设备处于暗光拍摄环境;和/或电子设备开启了闪光灯或者柔光灯时,确定该电子设备处于暗光拍摄环境。Combining the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, determining that the electronic device is in a dark-light shooting environment includes: when the brightness of the ambient light collected by the ambient light brightness sensor of the electronic device is lower than a preset When the brightness threshold is set, it is determined that the electronic device is in a dark-light shooting environment; and/or when the electronic device turns on a flash or a soft light, it is determined that the electronic device is in a dark-light shooting environment.
手机的传感器可以采集当前的拍摄环境的环境光亮度信息,当环境光的亮度小于设定的亮度阈值时,判断当前的拍摄环境为暗光拍摄环境,当环境光的亮度大于或等于设定的亮度阈值时,判断当前的拍摄环境为正常拍摄环境。在本申请中,正常拍摄环境可以理解为暗光拍摄环境之外的环境。The sensor of the mobile phone can collect the ambient light brightness information of the current shooting environment. When the brightness of the ambient light is less than the set brightness threshold, it is judged that the current shooting environment is a dark light shooting environment. When the brightness of the ambient light is greater than or equal to the set brightness When the brightness threshold is used, it is judged that the current shooting environment is a normal shooting environment. In this application, the normal shooting environment can be understood as an environment outside the low-light shooting environment.
当手机获取的环境光亮度值大于或等于预设的环境光亮度阈值,且手机未开启闪光灯或柔光灯时,所拍照片即为最终获取的保存在相册中的照片。当手机根据获取的环境光亮度值小于预设的环境光亮度阈值判断当前的环境处于暗光拍摄环境时,或者当手机拍照开启了闪光灯或柔光灯时,此时可以理解为闪光灯的工作模式为自动模式,当环境光的强度不在某个预设范围内是,电子设备可以自动开启闪光灯,此场景中可以利用本申请提供的暗光下拍照的方法获取包含清晰的人脸皮肤质感的最美人像照片。When the ambient light brightness value acquired by the mobile phone is greater than or equal to the preset ambient light brightness threshold, and the mobile phone does not turn on the flash or soft light, the photo taken is the final photo captured and saved in the album. When the mobile phone judges that the current environment is in a low-light shooting environment according to the obtained ambient light brightness value less than the preset ambient light brightness threshold, or when the flash or soft light is turned on when the mobile phone takes pictures, it can be understood as the working mode of the flash It is an automatic mode. When the intensity of the ambient light is not within a certain preset range, the electronic device can automatically turn on the flash. In this scene, the method of taking pictures under dark light provided by this application can be used to obtain the most beautiful skin texture with clear human face. Portrait photos.
还应理解,这里手机开启了闪光灯或柔光灯时,可以不限定环境光亮度值和预设的环境光亮度阈值的大小关系,例如用户当前希望拍摄出比预览效果更清晰的照片而手动开启了柔光灯或闪光灯等场景,此时可以利用本申请提供的暗光下拍照的方法获取包含清晰的人脸皮肤质感的最美人像照片。在本申请实施例的描述中,将以上各种可能的使用本申请拍照方法获取包含清晰的人脸皮肤质感的最美人像照片的场景统一称为“暗光中拍照”。It should also be understood that when the flash or soft light is turned on on the mobile phone, the relationship between the ambient light brightness value and the preset ambient light brightness threshold may not be limited. For example, the user currently wants to take a picture that is clearer than the preview effect and manually turn it on In addition to scenes such as soft light or flashing light, you can use the method of taking pictures under dark light provided in this application to obtain the most beautiful portrait photos with clear human face skin texture. In the description of the embodiments of the present application, the above various possible scenes in which the photographing method of the present application is used to obtain the most beautiful portrait photos containing clear facial skin textures are collectively referred to as "photographing in the dark".
在一种可能的实现方式中,可以在相机应用内为用户提供调整环境光的亮度阈值的接口,用户可以通过该接口对环境光的亮度阈值进行设定或调整。In a possible implementation manner, an interface for adjusting the brightness threshold of the ambient light can be provided to the user in the camera application, and the user can set or adjust the brightness threshold of the ambient light through the interface.
以上介绍的暗光下拍照的方法,可以在用户拍摄完成后进行一系列处理,有更多的处理时间,例如可以在系统空闲时进行相应的处理,可以不占用系统资源。The above-described method of taking pictures under low light can perform a series of processing after the user has finished taking the picture, and has more processing time. For example, the corresponding processing can be performed when the system is idle, without occupying system resources.
第二方面,提供了一种电子设备,包括一个或多个处理器;存储器;多个应用程序;以及一个或多个程序,其中该一个或多个程序被存储在该存储器中,当该一个或者多个程序被该处理器执行时,使得该电子设备执行以下步骤:响应于用户的拍照操作,获取第一人脸照片;当处于暗光拍摄环境时,根据该第一人脸照片,从已经保存的至少一个照片中确定第二人脸照片,其中,该第二人脸照片和该第一人脸照片包括同一用户的人脸特征信息,该第二人脸照片是该至少一个照片中具有最佳的人脸特征信息的照片;当该第二人脸照片的第一区域的人脸特征信息优于该第一人脸照片对应的该第一区域的人脸特征信息时,用该第二人脸照片的该第一区域的人脸特征信息融合该第一人脸照片的该第一区域的人脸特征信息,或者用该第二人脸照片的该第一区域的人脸特征信息替换该第一人脸照片的该第一区域的人脸特征信息,得到第三人脸照片,该第一区域是该用户人脸的部分或者全部区域;保存该第三人脸照片至本地相册。In a second aspect, an electronic device is provided, including one or more processors; a memory; a plurality of application programs; and one or more programs, wherein the one or more programs are stored in the memory, when the one Or when multiple programs are executed by the processor, the electronic device is caused to perform the following steps: in response to the user's photographing operation, obtain a first face photo; when in a dark light shooting environment, according to the first face photo, A second face photo is determined from at least one saved photo, where the second face photo and the first face photo include facial feature information of the same user, and the second face photo is among the at least one photo The photo with the best facial feature information; when the facial feature information of the first region of the second face photo is better than the facial feature information of the first region corresponding to the first face photo, use the The face feature information of the first area of the second face photo is fused with the face feature information of the first area of the first face photo, or the face feature of the first area of the second face photo is used The information replaces the face feature information of the first area of the first face photo to obtain a third face photo, where the first area is part or all of the user’s face; save the third face photo to the local Photo album.
结合第二方面,在第二方面的某些实现方式中,当该一个或者多个程序被该处理器执行时,使得该电子设备执行以下步骤:当该第一人脸照片的第一区域的人脸特征信息优于该第二人脸照片对应的该第一区域的人脸特征信息时,确定该第一人脸照片为第三人脸照片并保存。With reference to the second aspect, in some implementations of the second aspect, when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps: When the face feature information is better than the face feature information of the first region corresponding to the second face photo, it is determined that the first face photo is a third face photo and saved.
结合第二方面和上述实现方式,在第二方面的某些实现方式中,该第一区域的人脸特征信息包括该第一区域的像素点的对比度信息、平均梯度信息以及熵值信息中的至少一种。Combining the second aspect and the foregoing implementation manners, in some implementation manners of the second aspect, the facial feature information of the first area includes contrast information, average gradient information, and entropy information of pixels in the first area. At least one.
结合第二方面和上述实现方式,在第二方面的某些实现方式中,保存该第三人脸照片至本地相册之前,当该一个或者多个程序被该处理器执行时,使得该电子设备执行以下步骤:获取当前的暗光拍摄环境的信息;根据当前的该暗光拍摄环境的信息,对该第三人脸照片进行图像处理操作,该图像处理操作包括色温处理、色彩处理、白平衡处理中的至少一种处理方式。Combining the second aspect and the foregoing implementation manners, in some implementation manners of the second aspect, before saving the third face photo to the local album, when the one or more programs are executed by the processor, the electronic device Perform the following steps: obtain information about the current low-light shooting environment; perform image processing operations on the third face photo according to the current low-light shooting environment information, and the image processing operations include color temperature processing, color processing, and white balance At least one of the processing methods.
结合第二方面和上述实现方式,在第二方面的某些实现方式中,当该一个或者多个程序被该处理器执行时,使得该电子设备执行以下步骤:确定处于暗光拍摄环境。Combining the second aspect and the foregoing implementation manners, in some implementation manners of the second aspect, when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps: determining that it is in a low-light shooting environment.
结合第二方面和上述实现方式,在第二方面的某些实现方式中,当该一个或者多个程序被该处理器执行时,使得该电子设备执行以下步骤:当该电子设备的环境光亮度传感器采集的环境光的亮度低于预设亮度阈值时,确定处于暗光拍摄环境;和/或该电子设备开启了闪光灯或者柔光灯时,确定处于暗光拍摄环境。Combining the second aspect and the foregoing implementation manners, in some implementation manners of the second aspect, when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps: When the brightness of the ambient light collected by the sensor is lower than the preset brightness threshold, it is determined that it is in a low-light shooting environment; and/or the electronic device is determined to be in a low-light shooting environment when the flash or soft light is turned on.
第三方面,本申请提供了一种装置,该装置包含在电子设备中,该装置具有实现上述方面及上述方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,显示模块或单元、检测模块或单元、处理模块或单元等。In a third aspect, the present application provides a device included in an electronic device, and the device has the function of realizing the foregoing aspects and the behavior of the electronic device in the possible implementation manners of the foregoing aspects. The function can be realized by hardware, or the corresponding software can be executed by hardware. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a display module or unit, a detection module or unit, a processing module or unit, and so on.
第四方面,本申请提供了一种电子设备,包括:触摸显示屏,其中,触摸显示屏包括触敏表面和显示器;摄像头;一个或多个处理器;存储器;多个应用程序;以及一个或多个计算机程序。其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令。当指令被电子设备执行时,使得电子设备执行上述任一方面任一项可能的实现中的暗光下拍照的方法。In a fourth aspect, the present application provides an electronic device, including: a touch display screen, wherein the touch display screen includes a touch-sensitive surface and a display; a camera; one or more processors; a memory; a plurality of application programs; and one or Multiple computer programs. Among them, one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instruction is executed by the electronic device, the electronic device is caused to execute the method of photographing under dark light in any possible implementation of any one of the foregoing aspects.
第五方面,本申请提供了一种电子设备,包括一个或多个处理器和一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述任一方面任一项可能的实现中的暗光下拍照的方法。In a fifth aspect, the present application provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes. The computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes Any one of the above-mentioned aspects is a possible implementation of a method for taking pictures under dark light.
第六方面,本申请提供了一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的暗光下拍照的方法。In a sixth aspect, the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to perform any one of the possible methods for taking photos under dark light in any one of the foregoing aspects.
第七方面,本申请提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一方面任一项可能的暗光下拍照的方法。In a seventh aspect, the present application provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute any one of the possible methods for taking photos in the dark in any one of the above aspects.
附图说明Description of the drawings
图1是本申请实施例提供的一种电子设备的硬件结构示意图。FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
图2是一例电子设备拍照过程的控制结构示意图。Fig. 2 is a schematic diagram of an example of the control structure of the photographing process of an electronic device.
图3是本申请实施例提供的一例暗光中拍照的图形用户界面示意图。FIG. 3 is a schematic diagram of an example of a graphical user interface for taking pictures in dark light according to an embodiment of the present application.
图4是本申请实施例提供的又一例暗光中拍照的图形用户界面示意图。Fig. 4 is a schematic diagram of another example of a graphical user interface for taking pictures in dark light provided by an embodiment of the present application.
图5是本申请实施例提供的一例人脸划分示意图。Fig. 5 is a schematic diagram of an example of face division provided by an embodiment of the present application.
图6是本申请实施例提供的暗光下拍照的方法的示意性流程图。FIG. 6 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application.
图7是本申请实施例提供的暗光下拍照的方法的示意性流程图。FIG. 7 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application.
图8是本申请实施例提供的电子设备的一种可能的组成示意图。FIG. 8 is a schematic diagram of a possible composition of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this document is only a description of related objects The association relationship of indicates that there can be three kinds of relationships, for example, A and/or B, which can indicate: A alone exists, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。Hereinafter, the terms “first” and “second” are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" may explicitly or implicitly include one or more of these features.
本申请实施例提供了一种暗光下拍照的方法,可以应用于电子设备,也可是单独的应用程序,该应用程序可实现本申请中在暗光条件下拍照并还原人像细节的方法。具体地,本申请提供的暗光下拍照的方法可以通过图像识别和处理技术为用户呈现清晰的人脸肤质等细节,解决用户在暗光条件下拍照或者自拍时,导致人脸细节损失严重的问题。The embodiment of the present application provides a method for taking pictures in dark light, which can be applied to electronic devices or a separate application program. The application program can implement the method of taking pictures under dark light conditions and restoring portrait details in this application. Specifically, the method for taking pictures in low light provided by the present application can present users with clear facial skin texture and other details through image recognition and processing technology, and solve the problem of serious loss of facial details when users take pictures or take selfies in low light conditions. The problem.
本申请实施例提供的暗光下拍照的方法可以应用于手机、平板电脑、可穿戴设备等具有拍照功能的电子设备上,本申请实施例对电子设备的具体类型不作任何限制。The method for taking pictures in dark light provided by the embodiments of the present application can be applied to electronic devices with camera functions such as mobile phones, tablet computers, and wearable devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
示例性的,图1示出了电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Exemplarily, FIG. 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a 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, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. 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 sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Among them, the different processing units may be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
例如,本申请中,存储器中存储有固件程序(firmware),用于使控制器或处理器可以通过接口或协议实现本申请的暗光拍照并通过图像识别和处理技术清晰还原人脸肤质细节。For example, in this application, a firmware program (firmware) is stored in the memory, which is used to enable the controller or processor to implement the dark-light photography of this application through an interface or protocol and to clearly restore the facial skin details through image recognition and processing technology. .
在一些实施例中,处理器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)接口等。In some embodiments, the 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, and a universal asynchronous transceiver (universal asynchronous) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C buses. The processor 110 may couple the touch sensor 180K, the charger, the flash, the camera 193, etc., respectively through different I2C bus interfaces. For example, the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 100.
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may 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.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function. In some embodiments, the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on. In some embodiments, the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194, 无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may 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.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through the headphones. This interface can also be used to connect to other electronic devices, such as AR devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The charging management module 140 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, 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). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. The mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。无线通信模块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)等无线通信的解决方案。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
电子设备100通过图形处理器(graphics processing unit,GPU),显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a graphics processing unit (GPU), a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
显示屏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的正整数。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 use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
电子设备100可以通过图像信号处理器(image signal processor,ISP),摄像头193, 视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。在本申请中,摄像头193可以是光学变焦镜头等,本申请对此不做限定。The electronic device 100 may implement a shooting function through an image signal processor (ISP), a camera 193, a video codec, a GPU, a display screen 194, and an application processor. In this application, the camera 193 may be an optical zoom lens or the like, which is not limited in this application.
在一些实施例中,ISP可以设置在摄像头193中,本申请对此不做限定。In some embodiments, the ISP may be set in the camera 193, which is not limited in this application.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。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.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, for example, the transfer mode between human brain neurons, it can quickly process input information, and it can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。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 realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100. In addition, 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, a flash memory device, a universal flash storage (UFS), and the like.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。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. For example, music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接 听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone", "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be provided on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors and so on. The capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, 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. In some embodiments, touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example, when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the movement posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can 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 shake 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 shake 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.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, 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.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。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 holster. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the holster or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of 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 be used in applications such as horizontal and vertical screen switching, pedometers and so on.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F, used to measure distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。 发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can 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 holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. 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 to prevent accidental touch.
在本申请中,用户在拍照过程中,环境光传感器180L可以采集拍摄环境的光亮度信息,从而电子设备可以根据当前的环境光亮度判断是否处于暗光拍摄环境,从而使用本申请提供的方法获取包括清晰人脸细节的照片。In this application, when the user is taking a picture, the ambient light sensor 180L can collect the brightness information of the shooting environment, so that the electronic device can judge whether it is in the dark-light shooting environment according to the current ambient light brightness, and then use the method provided in this application to obtain Include photos with clear face details.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, 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 due to low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, 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.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can obtain 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 pulse signal. In some embodiments, the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone. The audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function. The application processor may analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The button 190 includes a power-on button, a volume button, and so on. The button 190 may be a mechanical button. It can also be a touch button. The electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效 果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback. For example, touch operations that act on different applications (such as photographing, audio playback, etc.) can correspond to different vibration feedback effects. Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminding, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
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分离。The SIM card interface 195 is used to connect to the SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can insert multiple cards at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, 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.
图2是一例电子设备拍照过程的控制结构示意图,该控制结构200包括图像信号处理(image signal processing,ISP)201、传感器202和光学变焦镜头203。其中,ISP 201可以对应于图1中示出的电子设备100中的处理器110,可以包括逻辑部分以及运行在其上的固件程序(firmware)。传感器202可以对应于图1中示出的电子设备100中的各类传感器,例如环境光传感器180L、接近光传感器180G等;光学变焦镜头203可以对应于图1中示出的电子设备100中的摄像头193。FIG. 2 is a schematic diagram of an example of the control structure of the photographing process of an electronic device. The control structure 200 includes an image signal processing (ISP) 201, a sensor 202, and an optical zoom lens 203. Wherein, the ISP 201 may correspond to the processor 110 in the electronic device 100 shown in FIG. 1, and may include a logic part and a firmware program (firmware) running on it. The sensor 202 may correspond to various sensors in the electronic device 100 shown in FIG. 1, such as an ambient light sensor 180L, a proximity light sensor 180G, etc.; the optical zoom lens 203 may correspond to the electronic device 100 shown in FIG. Camera 193.
具体地,在本申请实施例中,ISP 201可以用于处理摄像头193反馈的数据,通过一系列数字图像处理算法完成对数字图像的处理过程。如图2所示,拍照时,打开快门,光线通过光学变焦镜头203被传递到摄像头感光元件上,换言之,光学变焦镜头203可以将环境光信号投射到传感器202的感光区域后,传感器202经过光电转换,转化为肉眼可见的图像。再将内部原始图像(Bayer格式)传送给ISP 201,ISP 201经过算法处理,输出RGB空间域的图像给后端的采集单元。Specifically, in this embodiment of the present application, the ISP 201 may be used to process the data fed back by the camera 193, and complete the digital image processing process through a series of digital image processing algorithms. As shown in Figure 2, when taking a picture, the shutter is opened, and the light is transmitted to the photosensitive element of the camera through the optical zoom lens 203. In other words, the optical zoom lens 203 can project the ambient light signal to the photosensitive area of the sensor 202, and the sensor 202 passes through the photoelectric Conversion, into an image visible to the naked eye. Then the internal original image (Bayer format) is sent to the ISP 201, and the ISP 201 is processed by an algorithm to output an image in the RGB space domain to the back-end acquisition unit.
在这个过程中,ISP 201通过运行在其上的firmware对光学变焦镜头203、传感器202和ISP逻辑部分,进行相应控制,进而完成自动光圈、自动曝光、自动白平衡等功能,实现本申请实施例提供的在暗光下还原人脸皮肤质感,拍出清晰最美的人像效果。此外,ISP201还可以对图像的噪点、亮度、肤色进行算法优化,以及对拍摄场景的曝光参数、色温等参数进行优化。In this process, ISP 201 controls the optical zoom lens 203, sensor 202, and ISP logic through the firmware running on it, and then completes functions such as automatic iris, automatic exposure, and automatic white balance to implement the embodiments of this application. Provided to restore the texture of the face skin in the dark, and take the clear and most beautiful portrait effect. In addition, ISP201 can also optimize the image noise, brightness, skin color, and optimize the exposure parameters, color temperature and other parameters of the shooting scene.
为了便于理解,本申请以下实施例将以具有图1和图2所示结构的电子设备(智能手机)为例,结合附图和应用场景,对本申请实施例提供的暗光下拍照的方法进行具体阐述。For ease of understanding, the following embodiments of the present application will take the electronic device (smartphone) with the structure shown in FIG. 1 and FIG. 2 as an example, combined with the accompanying drawings and application scenarios, to perform the method for taking pictures under dark light provided by the embodiments of the present application. Explain in detail.
目前,当拍照环境为暗光时,为了提高暗光中的拍照效果,现有智能手机中预置了前置或后置闪光灯或柔光灯,当用户在暗光环境下拍照(或自拍)时,通过打开闪光灯或柔光灯进行补光,进而提升拍摄环境亮度,从而可以拍到人像。有的智能手机未预置前置闪光灯或柔光灯但可以通过屏幕补光功能进行补光,当用户在暗光下自拍时,会通过打开屏幕补光功能,例如通过点亮整块屏幕进行补光,或者点亮屏幕部分区域持续补光,通过屏幕亮度对用户人脸进行补光,进而当用户在暗光环境下拍照(或自拍)时,可以得到具有清晰人脸的自拍照。以上方法虽然可以使用户在预览和成片时的整体亮度提升,但用户得到的照片中人像细节的损失还是很严重,特别是人脸肤质等细节的损失。At present, when the camera environment is dark, in order to improve the photo effect in the dark light, the existing smart phones are preset with front or rear flash or soft light. When the user takes a photo (or Selfie) in a dark light environment At the same time, by turning on the flash or soft light to fill in the light, and then increase the brightness of the shooting environment, so that you can take portraits. Some smart phones do not preset the front flash or soft light, but can fill in the light through the screen fill-in function. When the user takes a selfie in dim light, it will turn on the screen fill-in function, for example, by lighting the entire screen. Fill light, or light up a part of the screen continuously, fill the user's face with the screen brightness, and then when the user takes a photo (or self-portrait) in a dark light environment, a self-portrait with a clear face can be obtained. Although the above method can improve the overall brightness of the user during preview and filming, the loss of portrait details in the photos obtained by the user is still very serious, especially the loss of details such as facial skin quality.
此外,用户可以在暗光环境下使用第三方打光装置进行补光,在采用第三方打光装置时,环境亮度可以得到非常大的提升,从而实现较好的人像拍摄效果。但是该方法需要用户随身携带第三方打光装置,操作繁琐且携带打光装置不够轻便,用户体验差。In addition, users can use a third-party lighting device to fill light in a low-light environment. When a third-party lighting device is used, the ambient brightness can be greatly improved, thereby achieving a better portrait shooting effect. However, this method requires the user to carry a third-party lighting device with him, which is cumbersome to operate and is not portable enough to carry the lighting device, and the user experience is poor.
又例如,有的智能手机实现了超长曝光、多帧合成的超级夜景功能,可以提升在暗光下拍摄的照片的整体亮度;或者,通过超长曝光与闪光灯或柔光灯结合的方式,提升暗光下所拍摄照片的清晰度。虽然可以使最终成片的整体亮度提升,但人像细节特别是人脸肤质等细节的损失还是很严重。For another example, some smart phones have realized the super night scene function of ultra-long exposure and multi-frame synthesis, which can improve the overall brightness of photos taken in low light; or, through the combination of ultra-long exposure and flash or soft light, Improve the sharpness of photos taken in low light. Although the overall brightness of the final film can be improved, the loss of portrait details, especially facial skin quality, is still very serious.
以上介绍的方法提升拍摄环境的亮度,使得拍摄的照片中人脸更明亮,但是还是会存在人脸肤质,例如纹理、毛孔等信息丢失的情况,人像细节的呈现还是不够清晰。The methods introduced above increase the brightness of the shooting environment and make the faces in the captured photos brighter, but there will still be the loss of facial skin quality, such as texture, pores, and other information, and the presentation of portrait details is still not clear enough.
图3是本申请实施例提供的一例暗光中拍照的图形用户界面(graphical user interface,GUI)的示意图,本申请将以智能手机为例,详细介绍本申请提供的在暗光下拍照的方法。其中,图3中的(a)图示出了手机的解锁模式下,手机的屏幕显示系统显示了当前输出的界面内容301,该界面内容301为手机的主界面。该界面内容301显示了多款第三方应用程序(application,App),例如支付宝、相册、音乐、设置、微信、卡包、微博、相机等应用程序。应理解,界面内容301还可以包括其他更多的应用程序,本申请对此不作限定。Fig. 3 is a schematic diagram of an example of a graphical user interface (GUI) for taking pictures in dark light provided by an embodiment of the present application. This application will take a smartphone as an example to introduce in detail the method of taking pictures under dark light provided by this application. . Wherein, (a) in FIG. 3 shows that in the unlock mode of the mobile phone, the screen display system of the mobile phone displays the currently output interface content 301, which is the main interface of the mobile phone. The interface content 301 displays a variety of third-party applications (application, App), such as Alipay, photo album, music, settings, WeChat, card package, Weibo, camera and other applications. It should be understood that the interface content 301 may also include other more application programs, which is not limited in this application.
如图3中的(a)图所示,用户点击相机应用,响应于用户的点击操作,手机进入如(b)图所示的相机应用的主界面302。在该相机应用的主界面302上,包括多个控件,分别用于实现相机应用的各种不同功能,这里不再赘述。As shown in (a) of FIG. 3, the user clicks on the camera application, and in response to the user's click operation, the mobile phone enters the main interface 302 of the camera application as shown in (b). The main interface 302 of the camera application includes multiple controls, which are respectively used to implement various functions of the camera application, which will not be repeated here.
应理解,本申请提供的在暗光环境下拍照或自拍的方法,需要手机监测环境光的亮度,当判断当前的拍摄环境为暗光拍摄环境时,启用本申请的方法对照片进行处理,以获取包含清晰的人脸皮肤质感的最美人像照片。It should be understood that the method of taking photos or taking selfies in a dark light environment provided by this application requires a mobile phone to monitor the brightness of the ambient light. When it is determined that the current shooting environment is a dark light shooting environment, the method of this application is used to process the photos to Get the most beautiful portrait photo with clear skin texture.
具体地,如下表1所示,手机的传感器可以采集当前的拍摄环境的环境光亮度信息,当环境光的亮度小于设定的亮度阈值时,判断当前的拍摄环境为暗光拍摄环境,当环境光的亮度大于或等于设定的亮度阈值时,判断当前的拍摄环境为正常拍摄环境。在本申请中,正常拍摄环境可以理解为暗光拍摄环境之外的环境。Specifically, as shown in Table 1 below, the sensor of the mobile phone can collect the ambient light brightness information of the current shooting environment. When the brightness of the ambient light is less than the set brightness threshold, it is determined that the current shooting environment is a dark light shooting environment. When the brightness of the light is greater than or equal to the set brightness threshold, it is determined that the current shooting environment is a normal shooting environment. In this application, the normal shooting environment can be understood as an environment outside the low-light shooting environment.
表1Table 1
参数parameter 暗光拍摄环境Low light shooting environment 正常拍摄环境Normal shooting environment
环境光亮度(单位:勒克斯lux)Ambient brightness (unit: lux) 0-500-50 >50>50
在一种可能的实现方式中,可以在相机应用内为用户提供调整环境光的亮度阈值的接口,用户可以通过该接口对环境光的亮度阈值进行设定或调整。In a possible implementation manner, an interface for adjusting the brightness threshold of the ambient light can be provided to the user in the camera application, and the user can set or adjust the brightness threshold of the ambient light through the interface.
例如,用户可以通过设置控件10对环境光的亮度阈值进行设定。如图3中的(b)图所示,用户点击设置控件10,响应于用户的点击操作,手机进入如(c)图所示的设置界面303。在该设置界面303上,包括对相机应用的拍摄分辨率、地理位置信息、自动添加水印等选项的通用设置,以及拍摄过程中AI摄影大师、参考线、拍摄声音、笑脸抓拍等选项的拍照设置,本申请对此不做限定。在本申请中,为用户提供的用于调整环境光的亮度阈值的接口可以设置在相机的通用设置菜单中。For example, the user can set the brightness threshold of the ambient light through the setting control 10. As shown in (b) of FIG. 3, the user clicks the setting control 10, and in response to the user's click operation, the mobile phone enters the setting interface 303 shown in (c). On the setting interface 303, it includes general settings for the camera application's shooting resolution, geographic location information, automatic watermarking and other options, as well as the camera settings for the AI master photographer, reference line, shooting sound, smiley capture and other options during the shooting process , This application does not limit this. In this application, the interface provided for the user to adjust the brightness threshold of the ambient light can be set in the general setting menu of the camera.
如图3中的(c)图所示,用户点击“环境光亮度”选项后,进入图3中的(d)图所示 环境光亮度的设置界面304。在环境光亮度的设置界面304中,可以包括“默认模式”,环境光亮度的默认模式可以是手机出厂时,已经设置好的环境光亮度阈值,该阈值可以是用户无法修改的,例如(d)图中示出的“环境光亮度阈值=50勒克斯(lux)”。As shown in (c) in FIG. 3, after the user clicks on the "ambient light brightness" option, the user enters the setting interface 304 of ambient light brightness as shown in (d) in FIG. In the setting interface 304 of ambient light brightness, "default mode" can be included. The default mode of ambient light brightness can be the ambient light brightness threshold that has been set when the phone leaves the factory. The threshold can be unmodifiable by the user, for example (d ) "Ambient light brightness threshold=50 lux" shown in the figure.
可选地,在环境光亮度的设置界面304中,还可以包括“自定义模式”,通过该自定义模式,用户可以修改的环境光亮度阈值。Optionally, the setting interface 304 of ambient light brightness may also include a "custom mode", through which the user can modify the ambient light brightness threshold.
图4是本申请实施例提供的又一例暗光中拍照的图形用户界面示意图。如图4中的(a)图所示,当用户点击“自定义模式”选项,可以弹出如图4中的(b)图所示的界面306,该界面上枚举多个自定义策略,例如自定义策略1、自定义策略2、自定义策略3等。其中,枚举的自定义策略可以是用户之前设定过的环境光亮度阈值,例如,某次用户首次设定环境光亮度阈值=40lux,手机将自动保存该设定的环境光亮度阈值=40lux为自定义策略1,本申请对自定义模式中枚举的策略数量不做限定。Fig. 4 is a schematic diagram of another example of a graphical user interface for taking pictures in dark light provided by an embodiment of the present application. As shown in Figure 4 (a), when the user clicks on the "Custom Mode" option, an interface 306 as shown in Figure 4 (b) will pop up, which enumerates multiple custom strategies, For example, custom strategy 1, custom strategy 2, custom strategy 3, etc. Among them, the enumerated custom strategy can be the ambient light brightness threshold previously set by the user. For example, if a user sets the ambient light brightness threshold for the first time = 40 lux, the mobile phone will automatically save the set ambient light brightness threshold = 40 lux For custom strategy 1, this application does not limit the number of strategies enumerated in the custom mode.
可选地,除了选择之前已经设定的自定义策略之外,用户还可以执行如图4中的(b)图所示的点击自定义策略添加“+”选项,进入图4中的(c)图所示的环境光亮度阈值调整界面,通过拖动亮度范围的进度条对环境光亮度阈值进行设置,或者手动输入亮度阈值,点击“保存”将自动保存并选择当前的自定义策略4。Optionally, in addition to selecting a custom strategy that has been set before, the user can also execute the custom strategy shown in Figure 4 (b) to add the "+" option to enter (c) in Figure 4 ) The ambient light brightness threshold adjustment interface shown in the figure, drag the progress bar of the brightness range to set the ambient light brightness threshold, or manually enter the brightness threshold, click "Save" to automatically save and select the current custom strategy4.
此外,用户可以对每一个自定义策略执行删除、修改等操作,例如图4中的(d)图所示,用户可以通过点击“自定义策略3”对该自定义策略执行删除、修改等操作,本申请对此不做限定。In addition, the user can delete and modify each custom strategy. For example, as shown in Figure 4 (d), the user can click "Custom Strategy 3" to delete and modify the custom strategy. , This application does not limit this.
应理解,在以上介绍的环境光亮度阈值的设定过程中,当用户不点击该接口对环境光亮度阈值进行设定,相机应用在用户不进行设定的情况下默认为“默认模式”,选择默认的环境光亮度阈值,例如默认为环境光亮度阈值=50lux。当用户选择自定义模式进行设定时,相机再以新设定的环境光亮度阈值为准,判断当前的拍摄环境是否为暗光拍摄环境。It should be understood that in the above-mentioned setting process of the ambient light brightness threshold, when the user does not click this interface to set the ambient light brightness threshold, the camera application defaults to the "default mode" if the user does not set it. Select the default ambient light brightness threshold, for example, the default ambient light brightness threshold=50lux. When the user selects the custom mode for setting, the camera then uses the newly set ambient light brightness threshold to determine whether the current shooting environment is a low-light shooting environment.
应理解,当手机获取的环境光亮度值大于或等于预设的环境光亮度阈值,且手机未开启闪光灯或柔光灯时,所拍照片即为最终获取的保存在相册中的照片。当然,也可以调用该算法,在环境光亮度值大于或等于预设的环境光亮度阈值时也对人脸照片进行优化,以满足特殊场景的需求,例如虽然整体环境光亮度大于阈值、但光线角度或布局或者局部光线不满足拍摄要求的场景,或者对人脸某局部区域皮肤质感有特殊要求的场景。这种场景下,可以通过用户手动操作,或者输入预设手势,或者通过菜单或特定按钮来触发执行该优化功能,以获得包含清晰的人脸皮肤质感的人像照片。当手机根据获取的环境光亮度值小于预设的环境光亮度阈值判断当前的环境处于暗光拍摄环境时,或者当手机拍照开启了闪光灯或柔光灯时,此时可以理解为闪光灯的工作模式为自动模式,当环境光的强度不在某个预设范围内是,电子设备可以自动开启闪光灯,此场景中可以利用本申请提供的暗光下拍照的方法获取包含清晰的人脸皮肤质感的最美人像照片。It should be understood that when the ambient light brightness value obtained by the mobile phone is greater than or equal to the preset ambient light brightness threshold, and the mobile phone does not turn on the flash or soft light, the photo taken is the finally obtained photo saved in the album. Of course, this algorithm can also be called to optimize face photos when the ambient light brightness value is greater than or equal to the preset ambient light brightness threshold to meet the needs of special scenes. For example, although the overall ambient light brightness is greater than the threshold, the light Scenes where the angle or layout or local light does not meet the shooting requirements, or scenes with special requirements for the skin texture of a certain part of the face. In this scenario, the user can manually operate, or input preset gestures, or trigger the execution of the optimization function through a menu or a specific button, so as to obtain a portrait photo containing a clear facial skin texture. When the mobile phone judges that the current environment is in a low-light shooting environment according to the obtained ambient light brightness value less than the preset ambient light brightness threshold, or when the flash or soft light is turned on when the mobile phone takes pictures, it can be understood as the working mode of the flash It is an automatic mode. When the intensity of the ambient light is not within a certain preset range, the electronic device can automatically turn on the flash. In this scene, the method of taking pictures under dark light provided by this application can be used to obtain the most beautiful skin texture with clear human face. Portrait photos.
还应理解,这里手机开启了闪光灯或柔光灯时,可以不限定环境光亮度值和预设的环境光亮度阈值的大小关系,例如用户当前希望拍摄出比预览效果更清晰的照片而手动开启了柔光灯或闪光灯等场景,此时可以利用本申请提供的暗光下拍照的方法获取包含清晰的人脸皮肤质感的最美人像照片。在本申请实施例的描述中,将以上各种可能的使用本申请拍照方法获取包含清晰的人脸皮肤质感的最美人像照片的场景统一称为“暗光中拍照”。It should also be understood that when the flash or soft light is turned on on the mobile phone, the relationship between the ambient light brightness value and the preset ambient light brightness threshold may not be limited. For example, the user currently wants to take a picture that is clearer than the preview effect and manually turn it on In addition to scenes such as soft light or flashing light, you can use the method of taking pictures under dark light provided in this application to obtain the most beautiful portrait photos with clear human face skin texture. In the description of the embodiments of the present application, the above various possible scenes in which the photographing method of the present application is used to obtain the most beautiful portrait photos containing clear facial skin textures are collectively referred to as "photographing in the dark".
在一种可能的实现方式中,当用户A在暗光中拍出一张照片时,通过图像识别技术, 识别手机相册内现有的用户A的其它照片,并对当前用户A所拍的照片和用户A的其它照片分别进行人脸细节的比对,选取最佳的照片。然后通过图像处理技术,将选取的最佳细节信息与当前所拍照片进行融合处理,最终合成包含清晰的人脸皮肤质感的最美人像照片。In a possible implementation, when user A takes a photo in the dark, through image recognition technology, identify other existing photos of user A in the mobile phone album, and compare the current photo taken by user A Compare the face details with other photos of user A, and select the best photo. Then, through image processing technology, the selected best detail information is fused with the current photo, and finally the most beautiful portrait photo with clear facial skin texture is synthesized.
可选地,手机可以通过图像识别技术,从相册用户A的现有照片中选取包含清晰的纹理、毛孔等人脸肤质信息的最佳照片,本申请对从手机相册中的用户A的现有照片中选择最佳照片的方法不做限定。例如,可以将手机相册中用户A的现有照片之间分别进行人脸细节的比对,以获取包含清晰的纹理、毛孔等人脸肤质信息的最佳照片。Optionally, the mobile phone can use image recognition technology to select the best photo containing clear texture, pores and other facial and skin quality information from the existing photos of user A in the album. There are no restrictions on the method of selecting the best photo among the photos. For example, the current photos of user A in the mobile phone album can be compared with the details of the face respectively, so as to obtain the best photos containing clear texture, pores and other facial skin quality information.
当经过对相册中用户A的现有照片之间分别进行人脸细节的比对,确定了最佳照片之后,再比较当前所拍摄的照片和最佳照片的人脸细节。After the face details of the existing photos of the user A in the album are compared, and the best photo is determined, the face details of the currently taken photo and the best photo are compared.
在一种可能的实现方式中,比较当前所拍摄的照片和最佳照片的人脸细节,可以通过比较照片的清晰度来进行。In a possible implementation, comparing the face details of the currently taken photo and the best photo can be done by comparing the sharpness of the photo.
图5是本申请实施例提供的一例人脸划分示意图。具体的,可以通过图像精细分割技术,将照片中的人脸分成不同的区域,分别对比当前所拍摄的照片和最佳照片的不同区域的人脸细节。Fig. 5 is a schematic diagram of an example of face division provided by an embodiment of the present application. Specifically, the face in the photo can be divided into different regions through the image fine segmentation technology, and the face details of the different regions in the currently taken photo and the best photo can be compared respectively.
可选地,在人脸划分过程中,可以如图5中的(a)图所示,可以以九宫格形式将人脸平均分成9个区域,例如(a)图中的区域41-区域49。再分别比对得出人脸的每个区域对应位置处最佳的细节信息,该细节信息可以包括每个毛孔、每条皮肤纹理、每根毛发的像素点等。Optionally, in the process of dividing the face, as shown in (a) in FIG. 5, the face may be divided into 9 regions evenly in the form of a nine-square grid, for example, regions 41-49 in (a). Then compare separately to obtain the best detail information at the corresponding position of each region of the face. The detail information may include each pore, each skin texture, each hair pixel, and so on.
或者,另一种可能的人脸划分方式,按人脸的五官进行划分,即按照人脸的额头、脸颊、下巴、眼睛、鼻子、嘴巴等区域进行划分。如图5中的(b)图所示,可以以用户的五官标志将人脸成6个区域,例如(b)图中的眼睛区域49、鼻子区域50、左脸颊区域51、右脸颊区域52、嘴巴区域53和下巴区域54。再分别比对得出人脸的每个区域对应位置处最佳的细节信息,该细节信息可以包括每个毛孔、每条皮肤纹理、每根毛发的像素点信息等。Or, another possible way of dividing the face is to divide the face according to the five senses, that is, to divide the face according to the forehead, cheeks, chin, eyes, nose, mouth and other areas. As shown in (b) in Figure 5, the face can be divided into 6 areas based on the user’s facial features, such as the eye area 49, nose area 50, left cheek area 51, and right cheek area 52 in (b). , The mouth area 53 and the chin area 54. Then compare the best detail information at the corresponding position of each region of the face. The detail information can include each pore, each skin texture, and pixel information of each hair.
应理解,人脸划分过程是通过相同的图像精细分割技术对当前所拍摄的照片和最佳照片分别进行划分,换言之,将当前所拍摄的照片和最佳照片都以九宫格形式将人脸平均分成9个区域,分别比对每个区域的细节信息;或者将当前所拍摄的照片和最佳照片都以五官划分形式将人脸分成6个区域,分别比对每个区域的细节信息。此外,处理图5中介绍的人脸划分方式,还可以根据预设的形状对人脸进行区域划分,例如矩形划分、圆形划分等,本申请对人脸划分的形式和划分区域的数量不做限定。It should be understood that the face division process is to divide the currently taken photo and the best photo separately through the same fine image segmentation technology. In other words, both the currently taken photo and the best photo are divided equally into faces in the form of nine square grids. 9 regions, compare the details of each region separately; or divide the face into 6 regions in the form of facial features for the currently taken photo and the best photo, and compare the details of each region separately. In addition, in processing the face division method introduced in FIG. 5, the face can also be divided into regions according to preset shapes, such as rectangular division, circular division, etc. The form of face division and the number of divided regions are different in this application. Make a limit.
在一种可能的实现方式中,通过计算照片中人脸对应位置的清晰度参数,然后比对得出该位置清晰度最佳的照片,获取并存储该最佳照片位置的细节信息。In a possible implementation manner, the sharpness parameter of the corresponding position of the human face in the photo is calculated, and then the picture with the best sharpness of the position is obtained by comparison, and the detailed information of the best photo position is obtained and stored.
可选地,在评价照片清晰度的过程中,可以根据照片的对比度值、全局平均梯度值以及全局熵值进行合并,获得一个用于评价图片整体清晰度的分值,该分值包含了对比度、平均梯度以及熵3个维度的评价结果,能够综合体现图片的清晰程度,提高图片清晰度评价的准确性。本申请对评价照片清晰度的方法不做限定。Optionally, in the process of evaluating the sharpness of the photo, the contrast value of the photo, the global average gradient value and the global entropy value can be combined to obtain a score for evaluating the overall sharpness of the picture, and the score includes the contrast. The evaluation results of the three dimensions of, average gradient and entropy can comprehensively reflect the clarity of the picture and improve the accuracy of the evaluation of picture clarity. This application does not limit the method of evaluating the clarity of the photo.
具体地,本申请实施例以对比度信息、平均梯度信息和熵值信息作为评价清晰度的参数,在人脸的同一个区域的细节信息对比过程中,以图4中的(b)图五官划分的区域为 例,分别计算照片中人脸对应位置的对比度、平均梯度和熵,确定该最佳照片的最佳细节信息。Specifically, in the embodiment of the present application, contrast information, average gradient information, and entropy value information are used as parameters for evaluating clarity. In the process of comparing detailed information of the same region of a human face, the five sense organs are divided by (b) in Figure 4 As an example, calculate the contrast, average gradient, and entropy of the corresponding position of the face in the photo to determine the best detail information of the best photo.
根据以上列举的最佳照片和当前拍摄照片的6个区域的对比度信息和平均梯度信息,从最佳照片和当前拍摄照片中,选取针对每个不同的区域的人脸细节最优部分,将选取的最优部分与当前所拍照片的对应区域进行融合处理。例如,对于鼻子区域50,最佳照片的鼻子区域50的对比度优于当前拍摄照片的鼻子区域50的对比度,即手机判断最佳照片的细节优于当前拍摄的照片,因此,将最佳照片的鼻子区域50和当前拍摄的照片的鼻子区域50进行融合处理。According to the best photo listed above and the contrast information and average gradient information of the 6 regions of the currently taken photo, from the best photo and the currently taken photo, select the best part of the face detail for each different region, and select The optimal part of the fusion process is performed with the corresponding area of the current photo. For example, for the nose area 50, the contrast of the nose area 50 of the best photo is better than the contrast of the nose area 50 of the current photo. That is, the mobile phone judges that the details of the best photo are better than the current photo. Therefore, the best photo is The nose area 50 and the nose area 50 of the currently taken photo are fused.
应理解,以上列举的对比度信息、平均梯度信息和熵值信息可以是针对某个区域的所有像素点的平均的对比度信息、平均梯度信息和熵值信息,也可以是部分取样的像素点的平均对比度信息、平均梯度信息和熵值信息,本申请对此不做限定。It should be understood that the contrast information, average gradient information, and entropy information listed above can be the average contrast information, average gradient information, and entropy information of all pixels in a certain area, or the average of partially sampled pixels. Contrast information, average gradient information, and entropy information are not limited in this application.
还应理解,可以在清晰度信息的对比过程中,综合考虑不同的数值信息,也可以为不同的数值信息设置优先级,例如,优先考虑最佳照片和当前拍摄照片的某区域像素点的平均对比度信息,当平均梯度信息相同或相差不大比较接近时,再根据平均梯度信息进行对比,当对比度信息和平均梯度信息都相同或相差不大比较接近时,再根据熵值信息进行对比,从而获取最佳细节信息,本申请对此不做限定。It should also be understood that in the process of comparing sharpness information, different numerical information can be comprehensively considered, or different numerical information can be set priority, for example, priority is given to the best photo and the average of pixels in a certain area of the currently taken photo. Contrast information, when the average gradient information is the same or the difference is not too close, then the average gradient information is compared, and when the contrast information and the average gradient information are the same or the difference is not too close, then the entropy information is compared, so To obtain the best detailed information, this application is not limited.
在一种可能的实现方式中,将最佳照片的最优部分与当前所拍照片的对应区域进行融合处理或替换处理,可以是基于当前所拍摄的照片,在人脸对应区域用最佳细节信息进行替换和补充,结合超分辨率技术,从低分辨率图像重建出相应的高分辨率图像,从而合成在暗光下可以呈现最佳人脸肤质等细节的照片。In a possible implementation, the best part of the best photo is fused or replaced with the corresponding area of the currently taken photo, which can be based on the currently taken photo, using the best detail in the corresponding area of the face Information is replaced and supplemented, combined with super-resolution technology, and the corresponding high-resolution images are reconstructed from low-resolution images, thereby synthesizing photos that can present the best facial skin quality and other details in the dark.
应理解,在本申请中将最佳照片的最优部分与当前所拍照片的对应区域进行融合处理或替换处理的过程中,融合处理可以是人脸某一个区域的对应融合,或者全脸区域的人脸细节的融合;用户可以指定融合处理适用的一个或多个区域;替换处理可以仅替换某一个区域的人脸细节,或者替换多个区域的人脸细节,或者整张脸的所有区域都进行替换,本申请对此不做限定。It should be understood that in the process of fusing or replacing the optimal part of the best photo with the corresponding area of the currently taken photo in this application, the fusion processing may be a corresponding fusion of a certain area of the human face, or a full-face area. Fusion of face details; the user can specify one or more regions to which the fusion process is applicable; the replacement process can only replace the face details of a certain area, or replace the face details of multiple areas, or all areas of the entire face All are replaced, and this application does not limit it.
例如,当判断当前拍摄的人脸照片的鼻子区域50的细节信息比最佳照片的该区域的细节信息差,而其他区域的细节信息相近时,可以仅替换该鼻子区域50。或者,当判断当前拍摄的人脸照片的整张脸的所有区域的细节信息都比最佳照片的对应区域的细节信息差,可以对该整张脸的所有区域进行替换。For example, when it is determined that the detail information of the nose region 50 of the currently captured face photo is worse than the detail information of this region of the best photo, and the detail information of other regions are similar, only the nose region 50 can be replaced. Or, when it is determined that the detail information of all areas of the entire face of the currently captured face photo is worse than the detail information of the corresponding area of the best photo, all areas of the entire face may be replaced.
在另一种可能的实现方式中,在融合处理过程中,还可以根据当前所拍摄的照片中环境信息,对替换后的照片整体再进行统一的图像处理,得到整体和谐美观的照片。In another possible implementation manner, in the process of fusion processing, it is also possible to perform unified image processing on the entire replaced photo according to the environmental information in the currently taken photo, so as to obtain an overall harmonious and beautiful photo.
应理解,环境信息可以包括当前所拍摄的照片中环境的色温、色彩等信息,手机可以通过获取环境信息,对合成的照片整体进行色温、色彩、白平衡等方面的处理,从而获取能在暗光下呈现最佳人脸肤质、且整体和谐美观的照片。It should be understood that the environmental information can include information such as the color temperature and color of the environment in the currently taken photo. The mobile phone can process the overall color temperature, color, white balance and other aspects of the synthesized photo by obtaining the environmental information, so as to obtain the It presents the best facial skin quality under light, and the overall harmonious and beautiful photos.
具体地,结合图1和图2示出的系统架构图,ISP 201可以通过一系列数字图像处理算法完成对数字图像的效果处理,主要可以包括3A算法处理、坏点校正处理、去噪处理、强光抑制处理、背光补偿处理、色彩增强处理、镜头阴影校正处理等。如图2中的相关描述,ISP 201包括通过运行在其上的firmware实现以上介绍的对数字图像的效果处理,进而完成自动光圈、自动曝光、自动白平衡等功能,此处不再赘述。Specifically, in combination with the system architecture diagrams shown in Figures 1 and 2, ISP 201 can complete the effect processing of digital images through a series of digital image processing algorithms, which can mainly include 3A algorithm processing, dead pixel correction processing, denoising processing, Strong light suppression processing, backlight compensation processing, color enhancement processing, lens shading correction processing, etc. As shown in the related description in Figure 2, ISP 201 includes the implementation of the above-described digital image effect processing through the firmware running on it, and then completes the functions of automatic iris, automatic exposure, automatic white balance, etc., which will not be repeated here.
通过上述介绍的在暗光下拍照的方法,电子设备可以根据环境光的亮度信息确定当前的拍摄环境为暗光环境。当用户在暗光环境中拍摄人像照片时,通过图像识别和处理技术,从现有相册中选取最佳照片,并获取最佳的人脸细节信息;再将现有照片中最佳的人脸细节信息和当前暗光拍摄的人像照片进行融合处理或者替换处理,以实现用户在暗光环境下也能清晰还原人脸皮肤质感,拍摄出最美的暗光人像照片;同时,再结合当前所拍摄的照片中环境的色温、色彩等信息,对合成的照片整体进行色温、色彩、白平衡等方面的处理,从而在暗光环境下,也能获取包含最佳人脸肤质、且整体和谐美观的照片,提高了用户体验。Through the above-mentioned method of taking pictures under low light, the electronic device can determine that the current shooting environment is a low light environment according to the brightness information of the ambient light. When the user takes a portrait photo in a dark light environment, the best photo is selected from the existing album through image recognition and processing technology, and the best face detail information is obtained; then the best face in the existing photo The detail information and the current portrait photos taken in low light are fused or replaced, so that the user can clearly restore the texture of the face and skin in the dark environment, and take the most beautiful low-light portrait photos; at the same time, combine the current shots The color temperature, color, and other information of the environment in the photos, and the overall color temperature, color, white balance and other aspects of the synthesized photos are processed, so that in the dark environment, the best facial skin quality can be obtained, and the overall harmony and beauty Photos to improve the user experience.
结合上述实施例及相关附图,本申请实施例提供了一种暗光下拍照的方法,该方法可以在如图1、图2所示的具有摄像头的电子设备(例如手机、平板电脑等)中实现。图6是本申请实施例提供的暗光下拍照的方法的示意性流程图,如图6所示,该方法可以包括以下步骤:In combination with the above-mentioned embodiments and related drawings, the embodiments of the present application provide a method for taking pictures under dark light. This method can be used in electronic devices with cameras (such as mobile phones, tablet computers, etc.) as shown in Figures 1 and 2 In the realization. FIG. 6 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application. As shown in FIG. 6, the method may include the following steps:
601,电子设备进入拍照预览状态。601: The electronic device enters a photo preview state.
应理解,这里拍照预览状态可以是用户在拍照或自拍的预览状态。It should be understood that the photo preview state here may be a preview state of the user taking a photo or taking a self-portrait.
602,通过电子设备的环境光传感器识别周围环境亮度,并记录环境光的亮度值。602. Identify the brightness of the surrounding environment through the ambient light sensor of the electronic device, and record the brightness value of the ambient light.
环境光传感器180L用于感知环境光亮度。用户在拍照过程中,环境光传感器180L可以采集拍摄环境的光亮度信息,从而电子设备可以根据当前的环境光亮度判断是否处于暗光拍摄环境,从而使用本申请提供的方法获取包括最佳人脸肤质的照片。The ambient light sensor 180L is used to sense the brightness of the ambient light. When the user is taking a photo, the ambient light sensor 180L can collect the brightness information of the shooting environment, so that the electronic device can determine whether it is in a dark-light shooting environment according to the current ambient light brightness, and thus use the method provided in this application to obtain the best human face. Photos of skin texture.
此外,环境光传感器180L也可用于拍照时自动调节白平衡。电子设备可以根据感知的环境光的亮度自动调节白平衡,从而对合成的照片整体进行色温、色彩、白平衡等方面的处理,从而在暗光环境下,也能获取包含最佳人脸肤质、且整体和谐美观的照片,In addition, the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The electronic device can automatically adjust the white balance according to the perceived brightness of the ambient light, so as to process the overall color temperature, color, white balance and other aspects of the synthesized photo, so that it can also obtain the best facial skin quality in the dark environment. , And overall harmonious and beautiful photos,
603,用户拍摄照片。603. The user takes a photo.
例如用户按下电子设备的拍照控件,完成拍照或自拍动作。For example, the user presses the camera control of the electronic device to complete a photo or self-portrait action.
604,电子设备判断记录的环境光的亮度值是否大于预设亮度阈值,且当前未开启闪光灯或柔光灯。604. The electronic device determines whether the recorded brightness value of the ambient light is greater than a preset brightness threshold, and the flash or soft light is not currently turned on.
605,当电子设备根据获取的环境光亮度值小于预设的环境光亮度阈值判断当前的环境处于暗光拍摄环境时,或者当手机拍照开启了闪光灯或柔光灯时,通过图像识别技术,识别当前用户的其它照片,比对选取包含清晰的人脸皮肤质感的最佳照片。605: When the electronic device judges that the current environment is in a low-light shooting environment according to the obtained ambient light brightness value being less than the preset ambient light brightness threshold, or when the flash or soft light is turned on when the mobile phone takes pictures, the image recognition technology is used to identify Compare other photos of the current user and select the best photo with clear facial skin texture.
606,确定了最佳照片之后,通过图像处理技术,将最佳照片的最优部分与当前所拍照片的对应区域进行融合处理。606. After determining the best photo, use image processing technology to merge the best part of the best photo with the corresponding area of the currently taken photo.
应理解,确定了最佳照片之后,电子设备就可以获取最佳照片的人脸细节信息,例如图5中人脸不同区域的每个毛孔、每条皮肤纹理、每根毛发的对比度信息、平均梯度信息和熵值信息等,从而对人脸对应区域用人脸细节信息进行替换和补充。It should be understood that after the best photo is determined, the electronic device can obtain the face detail information of the best photo, such as each pore, each skin texture, the contrast information of each hair, average Gradient information and entropy information, etc., so as to replace and supplement the corresponding area of the face with face detail information.
607,获取经过图像处理之后的最终照片,保存至本地相册中。607: Acquire a final photo after image processing, and save it in a local photo album.
可选地,在606的融合处理过程中,还可以根据当前所拍摄的照片中环境信息,对替换后的照片整体再进行统一的图像处理,得到整体和谐美观的照片。例如电子设备可以通过获取环境信息,对合成的照片整体进行色温处理、色彩处理、白平衡处理等,从而获取能在暗光下呈现最佳人脸肤质、且整体和谐美观的照片。Optionally, in the fusion process of 606, it is also possible to perform unified image processing on the entire replaced photo according to the environmental information in the currently taken photo, so as to obtain an overall harmonious and beautiful photo. For example, the electronic device can perform color temperature processing, color processing, and white balance processing on the synthesized photo as a whole by acquiring environmental information, so as to obtain a photo that can present the best facial skin quality under dark light and is harmonious and beautiful overall.
可选地,当手机获取的环境光亮度值大于或等于预设的环境光亮度阈值,且手机未开 启闪光灯或柔光灯时,用户所拍照片即为最终获取的保存在相册中的照片,不需要对拍摄照片做图像处理,本申请对此不做限定。Optionally, when the ambient light brightness value obtained by the mobile phone is greater than or equal to the preset ambient light brightness threshold, and the mobile phone does not turn on the flash or soft light, the photo taken by the user is the final photo obtained and saved in the album. There is no need to perform image processing on the captured photos, which is not limited in this application.
应理解,以上介绍的暗光下拍照的方法,可以在用户拍摄完成后进行一系列处理,有更多的处理时间,例如可以在系统空闲时进行相应的处理,可以不占用系统资源。It should be understood that the above-described method of taking photos under low light can perform a series of processing after the user has completed the shooting, and has more processing time. For example, corresponding processing can be performed when the system is idle, and system resources may not be occupied.
通过上述介绍的在暗光下拍照的方法流程,电子设备可以先根据环境光的亮度信息确定当前的拍摄环境为暗光环境。当用户在暗光环境中拍摄人像照片时,通过图像识别和处理技术,从现有相册中选取最佳照片,并获取最佳的人脸细节信息;再将现有照片中最佳的人脸细节信息和当前暗光拍摄的人像照片进行融合处理或者替换处理,以实现用户在暗光环境下也能清晰还原人脸皮肤质感,拍摄出最美的暗光人像照片;同时,再结合当前所拍摄的照片中环境的色温、色彩等信息,对合成的照片整体进行色温、色彩、白平衡等方面的处理,从而在暗光环境下,也能获取包含最佳人脸肤质、且整体和谐美观的照片,提高了用户体验。Through the above-mentioned method flow of taking pictures under low light, the electronic device can first determine that the current shooting environment is a low light environment according to the brightness information of the ambient light. When the user takes a portrait photo in a dark light environment, the best photo is selected from the existing album through image recognition and processing technology, and the best face detail information is obtained; then the best face in the existing photo The detail information and the current portrait photos taken in low light are fused or replaced, so that the user can clearly restore the texture of the face and skin in the dark environment, and take the most beautiful low-light portrait photos; at the same time, combine the current shots The color temperature, color, and other information of the environment in the photos, and the overall color temperature, color, white balance and other aspects of the synthesized photos are processed, so that in the dark environment, the best facial skin quality can be obtained, and the overall harmony and beauty Photos to improve the user experience.
结合上述实施例及相关附图,本申请实施例提供了一种视频播放的方法,该方法可以在如图1所示的具有触摸屏和摄像头的电子设备(例如手机、平板电脑等)中实现。图7是本申请实施例提供的暗光下拍照的方法的示意性流程图,如图7所示,该方法可以包括以下步骤:In combination with the above-mentioned embodiments and related drawings, the embodiments of the present application provide a video playback method, which can be implemented in an electronic device (such as a mobile phone, a tablet computer, etc.) having a touch screen and a camera as shown in FIG. 1. FIG. 7 is a schematic flowchart of a method for taking pictures under dark light provided by an embodiment of the present application. As shown in FIG. 7, the method may include the following steps:
701,响应于用户的拍照操作,获取第一人脸照片。701. Acquire a first face photo in response to a user's photographing operation.
702,当所述电子设备处于暗光拍摄环境时,根据所述第一人脸照片,从所述电子设备已经保存的至少一个照片中确定第二人脸照片,其中,所述第二人脸照片和所述第一人脸照片包括同一用户的人脸特征信息,所述第二人脸照片是所述至少一个照片中具有最佳的人脸特征信息的照片。702. When the electronic device is in a low-light shooting environment, determine a second face photo from at least one photo that has been saved in the electronic device according to the first face photo, wherein the second face photo The photo and the first face photo include facial feature information of the same user, and the second face photo is a photo with the best facial feature information among the at least one photo.
应理解,第一人脸照片可以是用户的自拍照或者他拍照,该照片中包括人脸特征信息。电子设备可以获取该第一人脸照片所包括的人脸特征信息,并根据该第一人脸照片的人脸特征信息,从电子设备的本地相册中确定具有相同人脸特征信息的多个照片。类似于人脸识别技术,电子设备可以根据采集的人脸特征信息从本地相册中选择出包括相同的人脸特征信息的多个照片。It should be understood that the first face photo may be a selfie of the user or a photo taken by him, and the photo includes facial feature information. The electronic device may obtain the facial feature information included in the first facial photo, and according to the facial feature information of the first facial photo, determine multiple photos with the same facial feature information from the local album of the electronic device . Similar to the face recognition technology, the electronic device can select multiple photos that include the same facial feature information from a local album based on the collected facial feature information.
此外,电子设备可以从多个照片中识别出包括清晰的人脸肤质、毛孔细节信息的第二人脸照片,换言之,第二人脸照片是多个照片中人脸细节信息最优的照片。In addition, the electronic device can identify the second face photo including clear facial skin quality and pore detail information from multiple photos. In other words, the second face photo is the photo with the best face detail information among the multiple photos. .
703,当所述第二人脸照片的第一区域的人脸特征信息优于所述第一人脸照片对应的所述第一区域的人脸特征信息时,用所述第二人脸照片的所述第一区域的人脸特征信息融合所述第一人脸照片的所述第一区域的人脸特征信息,或者用所述第二人脸照片的所述第一区域的人脸特征信息替换所述第一人脸照片的所述第一区域的人脸特征信息,得到第三人脸照片,所述第一区域是所述用户人脸的部分或者全部区域。703. When the face feature information of the first region of the second face photo is better than the face feature information of the first region corresponding to the first face photo, use the second face photo The face feature information of the first region is fused with the face feature information of the first region of the first face photo, or the face feature information of the first region of the second face photo is used The information replaces the face feature information of the first region of the first face photo to obtain a third face photo, and the first region is a part or all of the user's face.
应理解,电子设备确定了当前获取的第一人脸照片和本地相册保存的第二人脸照片之后,可以通过图像处理技术,比较当前所拍摄的照片和最佳照片的人脸细节信息,可以通过比较照片的清晰度来进行。例如,可以通过图像精细分割技术,将照片中的人脸分成不同的区域,分别对比当前所拍摄的照片和最佳照片的不同区域的人脸细节。It should be understood that after the electronic device determines the currently acquired first face photo and the second face photo saved in the local album, it can compare the currently taken photo with the face detail information of the best photo through image processing technology. It is done by comparing the sharpness of the photos. For example, the image fine segmentation technology can be used to divide the face in the photo into different regions, and compare the face details of the different regions in the current photo and the best photo respectively.
可选地,在人脸划分过程中,可以以九宫格形式将人脸平均分成9个区域;或者,另一种可能的人脸划分方式,按人脸的五官进行划分,即按照人脸的额头、脸颊、下巴、眼 睛、鼻子、嘴巴等区域进行划分,本申请对此不做限定。Optionally, in the process of dividing the face, the face can be divided into 9 areas equally in the form of nine square grids; or, another possible way of dividing the face is divided according to the facial features of the face, that is, according to the forehead of the face , Cheeks, chin, eyes, nose, mouth and other areas are divided, which is not limited in this application.
应理解,可以分别比对得出人脸的每个区域对应位置处最佳的细节信息,该细节信息可以包括每个毛孔、每条皮肤纹理、每根毛发的像素点信息等。It should be understood that the best detail information at the corresponding position of each region of the face can be obtained by comparison, and the detail information can include each pore, each skin texture, pixel information of each hair, and so on.
还应理解,人脸划分过程是通过相同的图像精细分割技术对当前所拍摄的照片和最佳照片分别进行划分,换言之,将当前所拍摄的照片和最佳照片都以九宫格形式将人脸平均分成9个区域,分别比对每个区域的细节信息;或者将当前所拍摄的照片和最佳照片都以五官划分形式将人脸分成6个区域,分别比对每个区域的细节信息。此外,还可以根据预设的形状对人脸进行区域划分,例如矩形划分、圆形划分等,本申请对人脸划分的形式和划分区域的数量不做限定。It should also be understood that the face division process is to divide the currently taken photo and the best photo separately through the same fine image segmentation technology. In other words, the current photo and the best photo are both averaged in the form of a nine-square grid. Divide into 9 regions and compare the detailed information of each region separately; or divide the face into 6 regions in the form of facial features for the currently taken photo and the best photo, and compare the detailed information of each region separately. In addition, the human face can also be divided into regions according to preset shapes, such as rectangular division, circular division, etc. The present application does not limit the form of human face division and the number of divided regions.
具体地,通过计算照片中人脸对应位置的清晰度参数,然后比对得出该位置清晰度最佳的照片,获取并存储该最佳照片位置的细节信息。Specifically, the sharpness parameter of the corresponding position of the human face in the photo is calculated, and then the picture with the best sharpness of the position is obtained by comparison, and the detailed information of the best photo position is obtained and stored.
可选地,在评价照片清晰度的过程中,可以根据照片的对比度值、全局平均梯度值以及全局熵值进行合并,获得一个用于评价图片整体清晰度的分值,该分值包含了对比度、平均梯度以及熵3个维度的评价结果,能够综合体现图片的清晰程度,提高图片清晰度评价的准确性。本申请对评价照片清晰度的方法不做限定。Optionally, in the process of evaluating the sharpness of the photo, the contrast value of the photo, the global average gradient value and the global entropy value can be combined to obtain a score for evaluating the overall sharpness of the picture, and the score includes the contrast. The evaluation results of the three dimensions of, average gradient and entropy can comprehensively reflect the clarity of the picture and improve the accuracy of the evaluation of picture clarity. This application does not limit the method of evaluating the clarity of the photo.
电子设备可以将最佳照片(第二人脸照片)的最优部分与当前所拍照片(第一人脸照片)的对应区域进行融合处理,可以是基于当前所拍摄的照片,在人脸对应区域用最佳细节信息进行替换和补充,结合超分辨率技术,从低分辨率图像重建出相应的高分辨率图像,从而合成在暗光下可以呈现最佳人脸肤质等细节的照片。The electronic device can merge the optimal part of the best photo (the second face photo) with the corresponding area of the currently taken photo (the first face photo), which can be based on the currently taken photo, corresponding to the face The region is replaced and supplemented with the best detail information, combined with super-resolution technology, and the corresponding high-resolution image is reconstructed from the low-resolution image, so as to synthesize photos that can show the best facial skin quality and other details in the dark.
应理解,在本申请中将最佳照片的最优部分与当前所拍照片的对应区域进行融合处理或替换处理的过程中,融合处理可以是人脸某一个区域的对应融合,或者全脸区域的人脸细节的融合;替换处理可以仅替换某一个区域的人脸细节,或者替换多个区域的人脸细节,或者整张脸的所有区域都进行替换,本申请对此不做限定。It should be understood that in the process of fusing or replacing the optimal part of the best photo with the corresponding area of the currently taken photo in this application, the fusion processing may be a corresponding fusion of a certain area of the human face, or a full-face area. The fusion of human face details; the replacement process can only replace the face details of a certain area, or replace the face details of multiple areas, or replace all areas of the entire face, which is not limited in this application.
704,保存所述第三人脸照片至所述电子设备的本地相册。704. Save the third face photo to a local photo album of the electronic device.
经过上述处理之后,最终得到处理后的照片,即第三人脸照片,保存在本地相册中。After the above processing, the processed photo is finally obtained, that is, the third face photo, which is saved in the local photo album.
应理解,以上介绍的暗光下拍照的方法,可以在用户拍摄完成后进行一系列处理,有更多的处理时间,例如可以在系统空闲时进行相应的处理,可以不占用系统资源。It should be understood that the above-described method of taking photos under low light can perform a series of processing after the user has completed the shooting, and has more processing time. For example, corresponding processing can be performed when the system is idle, and system resources may not be occupied.
可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to implement the above-mentioned functions, an electronic device includes hardware and/or software modules corresponding to each function. In combination with the algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Those skilled in the art can use different methods for each specific application in combination with the embodiments to implement the described functions, but such implementation should not be considered as going beyond the scope of the present application.
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, the electronic device may be divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,图8示出了上述实施例中涉及的电子设备800的一种可能的组成示意图,如图8所示,该电子设备800可以包括:获取单元 801、处理单元802和显示单元803。In the case of dividing each functional module corresponding to each function, FIG. 8 shows a schematic diagram of a possible composition of the electronic device 800 involved in the foregoing embodiment. As shown in FIG. 8, the electronic device 800 may include: an acquiring unit 801, a processing unit 802, and a display unit 803.
其中,获取单元801可以用于支持电子设备800执行上述步骤601等,和/或用于本文所描述的技术的其他过程。Wherein, the acquiring unit 801 may be used to support the electronic device 800 to perform the above-mentioned step 601, etc., and/or used in other processes of the technology described herein.
处理单元802可以用于支持电子设备800执行上述步骤602、603等,和/或用于本文所描述的技术的其他过程。The processing unit 802 may be used to support the electronic device 800 to perform the foregoing steps 602, 603, etc., and/or other processes used in the technology described herein.
显示单元803可以用于支持电子设备800显示最终的照片等,和/或用于本文所描述的技术的其他过程。The display unit 803 may be used to support the electronic device 800 to display final photos, etc., and/or other processes used in the technology described herein.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that all relevant content of the steps involved in the foregoing method embodiments can be cited in the functional description of the corresponding functional module, and will not be repeated here.
本实施例提供的电子设备,用于执行上述暗光下拍照的方法,因此可以达到与上述实现方法相同的效果。The electronic device provided in this embodiment is used to perform the above-mentioned method for taking pictures under dark light, and therefore can achieve the same effect as the above-mentioned implementation method.
在采用集成的单元的情况下,电子设备可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理,例如,可以用于支持电子设备执行上述获取单元801、处理单元802和显示单元803执行的步骤。存储模块可以用于支持电子设备执行存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。In the case of an integrated unit, the electronic device may include a processing module, a storage module, and a communication module. The processing module can be used to control and manage the actions of the electronic device. For example, it can be used to support the electronic device to execute the steps performed by the acquisition unit 801, the processing unit 802, and the display unit 803. The storage module can be used to support the electronic device to execute the storage program code and data. The communication module can be used to support the communication between electronic devices and other devices.
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。Among them, the processing module may be a processor or a controller. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, and other devices that interact with other electronic devices.
在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的电子设备可以为具有图1所示结构的设备。In an embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a device having the structure shown in FIG. 1.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的暗光下拍照的方法。This embodiment also provides a computer storage medium in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device is caused to execute the above-mentioned related method steps to realize the dark-light shooting in the above-mentioned embodiment. Methods.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的暗光下拍照的方法。This embodiment also provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above-mentioned related steps, so as to realize the method of photographing under dark light in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的暗光下拍照的方法。In addition, the embodiments of the present application also provide a device. The device may specifically be a chip, component or module. The device may include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the method of photographing under dark light in the foregoing method embodiments.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic device, computer storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding method provided above. The beneficial effects of the method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and conciseness of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function can be assigned to different functions according to needs. The function module is completed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or It can be integrated into another device, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, which are stored in a storage medium. It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in the embodiments of the present application. The foregoing storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above content is only the specific implementation of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Covered in the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (14)

  1. 一种暗光下拍照的方法,其特征在于,应用于电子设备,所述方法包括:A method for taking pictures in low light, which is characterized in that it is applied to an electronic device, and the method includes:
    响应于用户的拍照操作,获取第一人脸照片;In response to the user's photographing operation, obtain the first face photo;
    当所述电子设备处于暗光拍摄环境时,根据所述第一人脸照片,从所述电子设备已经保存的至少一个照片中确定第二人脸照片,其中,所述第二人脸照片和所述第一人脸照片包括同一用户的人脸特征信息,所述第二人脸照片是所述至少一个照片中具有最佳的人脸特征信息的照片;When the electronic device is in a low-light shooting environment, according to the first face photo, a second face photo is determined from at least one photo that has been saved by the electronic device, wherein the second face photo and The first face photo includes face feature information of the same user, and the second face photo is a photo with the best face feature information among the at least one photo;
    当所述第二人脸照片的第一区域的人脸特征信息优于所述第一人脸照片对应的所述第一区域的人脸特征信息时,用所述第二人脸照片的所述第一区域的人脸特征信息融合所述第一人脸照片的所述第一区域的人脸特征信息,或者用所述第二人脸照片的所述第一区域的人脸特征信息替换所述第一人脸照片的所述第一区域的人脸特征信息,得到第三人脸照片,所述第一区域是所述用户人脸的部分或者全部区域;When the face feature information of the first region of the second face photo is better than the face feature information of the first region corresponding to the first face photo, all the features of the second face photo are used. The face feature information of the first region is fused with the face feature information of the first region of the first face photo, or replaced with the face feature information of the first region of the second face photo Obtaining face feature information of the first region of the first face photo to obtain a third face photo, where the first region is part or all of the user's face;
    保存所述第三人脸照片至所述电子设备的本地相册。Saving the third face photo to the local photo album of the electronic device.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    当所述第一人脸照片的第一区域的人脸特征信息优于所述第二人脸照片对应的所述第一区域的人脸特征信息时,保存所述第一人脸照片。When the face feature information of the first region of the first face photo is better than the face feature information of the first region corresponding to the second face photo, the first face photo is saved.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一区域的人脸特征信息包括所述第一区域的像素点的对比度信息、平均梯度信息以及熵值信息中的至少一种。The method according to claim 1 or 2, wherein the facial feature information of the first region includes at least one of contrast information, average gradient information, and entropy information of pixels in the first region .
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述保存所述第三人脸照片至所述电子设备的本地相册之前,所述方法还包括:The method according to any one of claims 1 to 3, wherein before the saving the third face photo to the local photo album of the electronic device, the method further comprises:
    获取当前的暗光拍摄环境的信息;Obtain information about the current low-light shooting environment;
    根据当前的所述暗光拍摄环境的信息,对所述第三人脸照片进行图像处理操作,所述图像处理操作包括色温处理、色彩处理、白平衡处理中的至少一种处理方式。Perform an image processing operation on the third face photo according to the current information of the low-light shooting environment, and the image processing operation includes at least one of color temperature processing, color processing, and white balance processing.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    确定所述电子设备处于暗光拍摄环境。It is determined that the electronic device is in a dark light shooting environment.
  6. 根据权利要求5所述的方法,其特征在于,所述确定所述电子设备处于暗光拍摄环境,包括:The method according to claim 5, wherein the determining that the electronic device is in a low-light shooting environment comprises:
    当所述电子设备的环境光亮度传感器采集的环境光的亮度低于预设亮度阈值时,确定所述电子设备处于暗光拍摄环境;和/或When the brightness of the ambient light collected by the ambient light brightness sensor of the electronic device is lower than the preset brightness threshold, it is determined that the electronic device is in a dark light shooting environment; and/or
    所述电子设备开启了闪光灯或者柔光灯时,确定所述电子设备处于暗光拍摄环境。When the flash or soft light is turned on by the electronic device, it is determined that the electronic device is in a low-light shooting environment.
  7. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    一个或多个处理器;存储器;多个应用程序;以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行以下步骤:One or more processors; memory; multiple application programs; and one or more programs, wherein the one or more programs are stored in the memory, when the one or more programs are used by the processor When executed, the electronic device is caused to execute the following steps:
    响应于确定获得了第一人脸照片,其中所述第一人脸照片是响应于用户拍照操作获得的;且确定所述第一人脸照片是处于暗光拍摄环境获得,则根据所述第一人脸照片,从已经保存的至少一个照片中确定第二人脸照片,其中,所述第二人脸照片和所述第一人脸照 片包括同一用户的人脸特征信息,所述第二人脸照片是所述至少一个照片中具有最佳的人脸特征信息的照片;In response to determining that a first face photo is obtained, wherein the first face photo is obtained in response to a user's photographing operation; and it is determined that the first face photo is obtained in a low-light shooting environment, then according to the first face photo A face photo, a second face photo is determined from at least one saved photo, wherein the second face photo and the first face photo include facial feature information of the same user, and the second face photo The face photo is a photo with the best facial feature information among the at least one photo;
    当所述第二人脸照片的第一区域的人脸特征信息优于所述第一人脸照片对应的所述第一区域的人脸特征信息时,用所述第二人脸照片的所述第一区域的人脸特征信息融合所述第一人脸照片的所述第一区域的人脸特征信息,或者用所述第二人脸照片的所述第一区域的人脸特征信息替换所述第一人脸照片的所述第一区域的人脸特征信息,得到第三人脸照片,所述第一区域是所述用户人脸的部分或者全部区域;When the face feature information of the first region of the second face photo is better than the face feature information of the first region corresponding to the first face photo, all the features of the second face photo are used. The face feature information of the first region is fused with the face feature information of the first region of the first face photo, or replaced with the face feature information of the first region of the second face photo Obtaining face feature information of the first region of the first face photo to obtain a third face photo, where the first region is part or all of the user's face;
    指示保存所述第三人脸照片至本地相册。Instruct to save the third face photo to the local photo album.
  8. 根据权利要求7所述的电子设备,其特征在于,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行以下步骤:The electronic device according to claim 7, wherein when the one or more programs are executed by the processor, the electronic device is caused to perform the following steps:
    当所述第一人脸照片的第一区域的人脸特征信息优于所述第二人脸照片对应的所述第一区域的人脸特征信息时,指示保存所述第一人脸照片。When the face feature information of the first region of the first face photo is better than the face feature information of the first region corresponding to the second face photo, instruct to save the first face photo.
  9. 根据权利要求7或8所述的电子设备,其特征在于,所述第一区域的人脸特征信息包括所述第一区域的像素点的对比度信息、平均梯度信息以及熵值信息中的至少一种。The electronic device according to claim 7 or 8, wherein the facial feature information of the first area includes at least one of contrast information, average gradient information, and entropy information of pixels in the first area. Kind.
  10. 根据权利要求7至9中任一项所述的电子设备,其特征在于,所述指示保存所述第三人脸照片至本地相册之前,当所述一个或者多个程序被所述处理器执行时,使得所述电子设备执行以下步骤:The electronic device according to any one of claims 7 to 9, wherein before the instruction to save the third face photo to a local album, when the one or more programs are executed by the processor When the time, the electronic device is caused to perform the following steps:
    获取当前的暗光拍摄环境的信息;Obtain information about the current low-light shooting environment;
    根据当前的所述暗光拍摄环境的信息,对所述第三人脸照片进行图像处理操作,所述图像处理操作包括色温处理、色彩处理、白平衡处理中的至少一种处理方式。Perform an image processing operation on the third face photo according to the current information of the low-light shooting environment, and the image processing operation includes at least one of color temperature processing, color processing, and white balance processing.
  11. 根据权利要求7至10中任一项所述的电子设备,其特征在于,The electronic device according to any one of claims 7 to 10, wherein:
    所述确定处于暗光拍摄环境获得具体包括:The obtaining of determining to be in a low-light shooting environment specifically includes:
    当所述电子设备的环境光亮度传感器采集的环境光的亮度低于预设亮度阈值时,确定处于暗光拍摄环境;和/或When the brightness of the ambient light collected by the ambient light brightness sensor of the electronic device is lower than the preset brightness threshold, it is determined that it is in a dark light shooting environment; and/or
    所述电子设备开启了闪光灯或者柔光灯时,确定处于暗光拍摄环境。When the flash or soft light is turned on, the electronic device is determined to be in a low-light shooting environment.
  12. 根据权利要求7至11中任一项所述的电子设备,其特征在于,所述电子设备为芯片。The electronic device according to any one of claims 7 to 11, wherein the electronic device is a chip.
  13. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至6中任一项所述的暗光下拍照的方法。A computer storage medium, characterized by comprising computer instructions, when the computer instructions are run on an electronic device, the electronic device is caused to perform the photographing in the dark according to any one of claims 1 to 6 method.
  14. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1至6中任一项所述的暗光下拍照的方法。A computer program product, characterized in that, when the computer program product runs on a computer, the computer is caused to execute the method for photographing in dark light according to any one of claims 1 to 6.
PCT/CN2020/107413 2019-09-23 2020-08-06 Photographing method in dark light and electronic device WO2021057277A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910899296.8 2019-09-23
CN201910899296.8A CN110602403A (en) 2019-09-23 2019-09-23 Method for taking pictures under dark light and electronic equipment

Publications (1)

Publication Number Publication Date
WO2021057277A1 true WO2021057277A1 (en) 2021-04-01

Family

ID=68862522

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107413 WO2021057277A1 (en) 2019-09-23 2020-08-06 Photographing method in dark light and electronic device

Country Status (2)

Country Link
CN (1) CN110602403A (en)
WO (1) WO2021057277A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115334234A (en) * 2022-07-01 2022-11-11 北京讯通安添通讯科技有限公司 Method and device for supplementing image information by taking pictures in dark environment

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602403A (en) * 2019-09-23 2019-12-20 华为技术有限公司 Method for taking pictures under dark light and electronic equipment
US11776503B2 (en) * 2020-05-28 2023-10-03 Apple Inc. Generating display data based on modified ambient light luminance values
CN112367470B (en) * 2020-10-29 2022-03-08 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN114531578B (en) * 2020-11-23 2023-11-07 华为技术有限公司 Light source spectrum acquisition method and device
CN112686800B (en) * 2020-12-29 2023-07-07 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN115239576B (en) * 2022-06-15 2023-08-04 荣耀终端有限公司 Photo optimization method, electronic equipment and storage medium
CN115767290B (en) * 2022-09-28 2023-09-29 荣耀终端有限公司 Image processing method and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8831379B2 (en) * 2008-04-04 2014-09-09 Microsoft Corporation Cartoon personalization
CN105303161A (en) * 2015-09-21 2016-02-03 广东欧珀移动通信有限公司 Method and device for shooting multiple people
CN106204435A (en) * 2016-06-27 2016-12-07 北京小米移动软件有限公司 Image processing method and device
CN108259767A (en) * 2018-03-30 2018-07-06 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110266994A (en) * 2019-06-26 2019-09-20 广东小天才科技有限公司 A kind of video call method, video conversation apparatus and terminal
CN110602403A (en) * 2019-09-23 2019-12-20 华为技术有限公司 Method for taking pictures under dark light and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605971B (en) * 2013-12-04 2017-05-24 深圳市捷顺科技实业股份有限公司 Method and device for capturing face images
CN107846554B (en) * 2017-10-31 2020-09-01 努比亚技术有限公司 Image processing method, terminal and computer readable storage medium
CN109978754A (en) * 2017-12-28 2019-07-05 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN109493297B (en) * 2018-11-01 2020-08-18 重庆中科云从科技有限公司 Low-quality face image enhancement method, system, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8831379B2 (en) * 2008-04-04 2014-09-09 Microsoft Corporation Cartoon personalization
CN105303161A (en) * 2015-09-21 2016-02-03 广东欧珀移动通信有限公司 Method and device for shooting multiple people
CN106204435A (en) * 2016-06-27 2016-12-07 北京小米移动软件有限公司 Image processing method and device
CN108259767A (en) * 2018-03-30 2018-07-06 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110266994A (en) * 2019-06-26 2019-09-20 广东小天才科技有限公司 A kind of video call method, video conversation apparatus and terminal
CN110602403A (en) * 2019-09-23 2019-12-20 华为技术有限公司 Method for taking pictures under dark light and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115334234A (en) * 2022-07-01 2022-11-11 北京讯通安添通讯科技有限公司 Method and device for supplementing image information by taking pictures in dark environment
CN115334234B (en) * 2022-07-01 2024-03-29 北京讯通安添通讯科技有限公司 Method and device for taking photo supplementary image information in dim light environment

Also Published As

Publication number Publication date
CN110602403A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
WO2021057277A1 (en) Photographing method in dark light and electronic device
WO2021052232A1 (en) Time-lapse photography method and device
WO2020186969A1 (en) Multi-path video recording method and device
WO2022262260A1 (en) Photographing method and electronic device
WO2020168956A1 (en) Method for photographing the moon and electronic device
WO2020125410A1 (en) Image processing method and electronic device
WO2021036771A1 (en) Electronic device having foldable screen, and display method
CN113810601B (en) Terminal image processing method and device and terminal equipment
CN113810600B (en) Terminal image processing method and device and terminal equipment
WO2020134877A1 (en) Skin detection method and electronic device
WO2022100610A1 (en) Screen projection method and apparatus, and electronic device and computer-readable storage medium
CN112598594A (en) Color consistency correction method and related device
EP4231147A1 (en) Drawing command processing method and related device therefor
WO2022001258A1 (en) Multi-screen display method and apparatus, terminal device, and storage medium
WO2020118490A1 (en) Automatic screen-splitting method, graphical user interface, and electronic device
WO2023241209A9 (en) Desktop wallpaper configuration method and apparatus, electronic device and readable storage medium
CN112700377A (en) Image floodlight processing method and device and storage medium
WO2023131070A1 (en) Electronic device management method, electronic device, and readable storage medium
WO2023077939A1 (en) Camera switching method and apparatus, and electronic device and storage medium
CN113923372B (en) Exposure adjusting method and related equipment
WO2022033344A1 (en) Video stabilization method, and terminal device and computer-readable storage medium
WO2021190097A1 (en) Image processing method and device
CN111885768B (en) Method, electronic device and system for adjusting light source
CN113852755A (en) Photographing method, photographing apparatus, computer-readable storage medium, and program product
CN115706869A (en) Terminal image processing method and device and terminal equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20870341

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20870341

Country of ref document: EP

Kind code of ref document: A1