WO2020015149A1 - 一种皱纹检测方法及电子设备 - Google Patents

一种皱纹检测方法及电子设备 Download PDF

Info

Publication number
WO2020015149A1
WO2020015149A1 PCT/CN2018/106242 CN2018106242W WO2020015149A1 WO 2020015149 A1 WO2020015149 A1 WO 2020015149A1 CN 2018106242 W CN2018106242 W CN 2018106242W WO 2020015149 A1 WO2020015149 A1 WO 2020015149A1
Authority
WO
WIPO (PCT)
Prior art keywords
wrinkle
detected
image
electronic device
line
Prior art date
Application number
PCT/CN2018/106242
Other languages
English (en)
French (fr)
Inventor
胡宏伟
董辰
丁欣
郜文美
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP18926958.2A priority Critical patent/EP3809361B1/en
Priority to CN201880085477.0A priority patent/CN111566693B/zh
Priority to US17/260,015 priority patent/US11941804B2/en
Publication of WO2020015149A1 publication Critical patent/WO2020015149A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30088Skin; Dermal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30242Counting objects in image

Definitions

  • the present application relates to the field of communications, and in particular, to a wrinkle detection method and an electronic device.
  • the severity of facial wrinkles can directly reflect people's skin age and skin health. Wrinkles, as one of the hallmark features of skin aging, have attracted the attention of beauty lovers.
  • the embodiments of the present application provide a wrinkle detection method and an electronic device, which are used to solve the technical problem of low detection accuracy of the existing wrinkle detection method.
  • an embodiment of the present application provides a wrinkle detection method.
  • a plurality of images to be detected are obtained by rotating a region in a face image where wrinkles need to be detected, and each of the images to be detected at different angles is respectively based on the gray level of a pixel.
  • the value determines the wrinkle point from all the pixels, and then determines at least one wrinkle line from a plurality of images to be detected according to the determined wrinkle point.
  • a wrinkle line is displayed in a face image in which a wrinkle is to be detected, where each wrinkle line indicates A wrinkle in the image to be detected, which can indicate a wrinkle in an area of the face image where wrinkles need to be detected.
  • wrinkles can be detected in images to be detected at different angles, which helps improve detection accuracy when detecting wrinkles in different directions.
  • a plurality of images to be detected may be obtained by rotating a region of a face image in which a wrinkle needs to be detected in any of the following ways:
  • Method 1 The areas in the face image that need to be detected for wrinkles can be rotated according to some or all of the preset angles in the preset angle set to obtain multiple images to be detected, where the preset angle set includes multiple preset angles. The value of each preset angle is different.
  • Method 2 The areas in the face image that need to be detected for wrinkles can be rotated according to some or all of the preset angles in the set of preset angles to obtain multiple candidate images, and then multiple candidate images are respectively set according to the preset Some or all of the preset ratios in the scale set are reduced to obtain multiple images to be detected.
  • the preset scale set includes multiple preset scales, and each preset scale has a different value.
  • a rectangular window when determining the wrinkle point from all the pixels of the image to be detected, a rectangular window may be set, and then according to the set sliding step, the rectangular window is controlled to traverse the image to be detected, and For each window position, determine the central pixel point located at the center of the rectangular window, and determine the confidence value of the central pixel point based on the gray values of all the pixel points in the rectangular window, to obtain multiple confidence values. After that, it will not be less than the threshold value.
  • the center pixel point corresponding to the confidence value is used as a wrinkle point, and the confidence value can be used to indicate the possibility that the center pixel point is a wrinkle point. Therefore, by reducing the candidate image, the detection accuracy for wrinkles of different thicknesses can be improved.
  • the confidence value of the central pixel located at the center of the rectangular window can be determined according to the following formula:
  • M represents the confidence value of the central pixel at the center of the rectangular window
  • P ij represents the element located in the i-th row and the j-th column in the first matrix
  • Q ij represents the i-th row and the j-th column in the second matrix Element
  • the first matrix is a preset N * N matrix
  • the elements of each row in the first matrix are the same
  • the elements of the i-th row and the j-th column in the second matrix are the i-th and j-th rows in the rectangular window
  • the gray value of the pixels of the column is 1 ⁇ i ⁇ N, 1 ⁇ j ⁇ N
  • N is an odd number
  • N is 3 or more.
  • the expression of the first matrix is:
  • P is the first matrix and n 0 > n 1 ;
  • P is the first matrix and n 0 < n 1 ; or
  • P is the first matrix
  • u is an integer and 1 ⁇ u ⁇ x, N is greater than 3;
  • P is the first matrix, n u < n u-1 , u is an integer and 1 ⁇ u ⁇ x, N is greater than 3.
  • the threshold value is an average value of the plurality of confidence values, so that a central pixel point having a confidence value that is not less than the threshold value is used as a wrinkle point to improve the detection accuracy of the wrinkle point.
  • the contour lines of at least two consecutive wrinkle points in the wrinkle points may be determined, and then a straight line segment in the contour lines is determined, and a part of Or all straight segments are used as wrinkle lines.
  • the determined wrinkle line meets one or more of the following conditions: the size of the wrinkle line is not less than a preset pixel size; or the line between the two pixels with the furthest distance on the wrinkle line The included angle with the horizontal direction is not greater than the preset included angle.
  • all the wrinkle lines determined according to all the images to be detected may be displayed in the area where wrinkle detection is required.
  • a wrinkle score may be determined according to a feature set of at least one wrinkle line displayed, and a wrinkle score may be output, where the feature set of the wrinkle line may include the length of one or more of the following features , The width of the wrinkle line, the contrast value of the pixels on the wrinkle line, and the area ratio of the wrinkle line, where the contrast value is used to characterize the contrast of the pixel points on the wrinkle line, and the area ratio of the wrinkle line is used to characterize the wrinkle line. The proportion of the number of pixels in the total number of pixels in the image to be detected.
  • the wrinkle score can be determined according to the following formula:
  • H A ⁇ ⁇ 1 + B ⁇ ⁇ 2 + C ⁇ ⁇ 3 + D ⁇ ⁇ 4 + ⁇ 5;
  • H is the wrinkle score
  • A is the length of the wrinkle line
  • B is the width of the wrinkle line
  • C is the contrast value of the pixels on the wrinkle line
  • D is the area ratio of the wrinkle line
  • ⁇ 1, ⁇ 2, ⁇ 3, and ⁇ 4 are less than Zero preset parameter
  • ⁇ 5 is the preset parameter.
  • an embodiment of the present application provides an electronic device for implementing the above-mentioned first aspect or any one of the methods in the first aspect, including corresponding function modules, which are respectively used to implement the steps in the above method.
  • the functions can be realized by hardware, and can also be implemented by hardware executing corresponding software, or by a combination of software and hardware.
  • the hardware or software may include one or more modules corresponding to the functions described above.
  • An electronic device provided in an embodiment of the present application includes a processor, a memory, and a display screen; wherein the processor is coupled to the memory and the display screen; wherein the memory is used to store program instructions; and the processor is used to read the program stored in the memory Instructions, combined with a display screen, to implement the method of the first aspect of the embodiment of the present application and any of its possible designs.
  • a computer storage medium provided in an embodiment of the present application stores the program instructions, and when the program instructions are run on the electronic device, the electronic device executes the first aspect of the embodiments of the application and any of the first aspects Possible design methods.
  • a computer program product provided in an embodiment of the present application, when the computer program product is run on an electronic device, causes the electronic device to implement the first aspect of the embodiment of the present application and any of its possible design methods.
  • a chip provided in an embodiment of the present application, the chip is coupled to a memory in an electronic device, and controls the electronic device to execute the first aspect of the embodiment of the application and a method of any possible design thereof.
  • Coupled in the embodiments of the present application means that two components are directly or indirectly combined with each other.
  • FIG. 1 is a schematic structural diagram of an electronic device applicable to an embodiment of the present application
  • FIG. 2A is a schematic diagram of a user interface applicable to an embodiment of the present application.
  • FIG. 2B is a schematic diagram of another user interface according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a wrinkle detection method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a position of a region in a face image in which a wrinkle needs to be detected according to an embodiment of the present application
  • FIG. 5 is a schematic diagram of a region where wrinkles need to be detected according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an effect of rotating a region where wrinkles need to be detected according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of an effect of reducing a region where wrinkles need to be detected according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an effect of detecting a wrinkle line in a reduced area where wrinkles need to be detected according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a rectangular window according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of determining a wrinkle line according to an outline of a wrinkle point according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a wrinkle line provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of wrinkle line fusion provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of another wrinkle line fusion provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of a wrinkle in a region under the eye and a corresponding wrinkle score according to an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a forehead region wrinkle and a corresponding wrinkle score according to an embodiment of the present application.
  • 16 is a schematic flowchart of another wrinkle detection method according to an embodiment of the present application.
  • FIG. 17 is a schematic diagram of a wrinkle detection result report page according to an embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
  • At least one means one or more, and “multiple” means two or more.
  • “And / or” describes the association relationship of related objects, and indicates that there can be three kinds of relationships. For example, A and / or B can indicate: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character “/” generally indicates that the related objects are an "or” relationship. "At least one (item) below” or similar expressions refers to any combination of these items, including any combination of single or plural items.
  • At least one (a), a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, c It can be single or multiple.
  • the electronic device may be a portable electronic device including functions such as a personal digital assistant and / or a music player, such as a mobile phone, a tablet computer, a wearable device (such as a smart watch) with a wireless communication function, Vehicle equipment, etc.
  • portable electronic devices include, but are not limited to, carrying Or portable electronic devices with other operating systems.
  • the above-mentioned portable electronic device may also be a laptop computer or the like having a touch-sensitive surface (for example, a touch panel). It should also be understood that, in other embodiments of the present application, the above electronic device may also be a desktop computer having a touch-sensitive surface (such as a touch panel).
  • FIG. 1 is 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 charge management module 140, a power management module 141, a battery 142, an antenna 2, and wireless communication
  • the sensor module 180 includes an ambient light sensor 180L.
  • the sensor module 180 may further include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, Bone conduction sensor 180M and so on.
  • the electronic device 100 in this embodiment of the present application may further include an antenna 1, a mobile communication module 150, and a subscriber identification module (SIM) card interface 195.
  • SIM subscriber identification module
  • 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), an image signal processor (ISP), a controller, and a memory.
  • AP application processor
  • GPU graphics processing unit
  • ISP image signal processor
  • controller controller
  • memory e.g., RAM
  • Video codec e.g., RAM
  • DSP digital signal processor
  • NPU neural-network processing unit
  • different processing units may be independent devices or integrated in one or more processors.
  • the processor 110 may further include a memory for storing instructions and data.
  • the memory in the processor 110 may be a cache memory.
  • the memory may 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 and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • the processor 110 may further include one or more interfaces.
  • the interface may be a universal serial bus (USB) interface 130.
  • the interface can also be an integrated circuit (I2C) interface, an integrated circuit (I2S) interface, a pulse code modulation (PCM) interface, or a universal asynchronous transmission / reception transmission.
  • I2C integrated circuit
  • I2S integrated circuit
  • PCM pulse code modulation
  • UART Universal asynchronous receiver / transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input / output
  • SIM subscriber identity module
  • the USB interface 130 is an interface that complies with the USB standard specification.
  • the USB interface 130 may include a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones and play audio through headphones. This interface can also be used to connect other electronic devices, such as AR devices.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. While the charge management module 140 is charging the battery 142, the power management module 141 can also provide power to the electronic device.
  • the power management module 141 is used to connect the battery 142, the charge management module 140 and the processor 110.
  • the power management module 141 receives inputs 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 battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be disposed in the processor 110.
  • the power management module 141 and the charge management module 140 may be provided in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
  • the antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals.
  • Each antenna in the electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization.
  • antenna 1 can be multiplexed into a diversity antenna for a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G / 3G / 4G / 5G and the like applied on the electronic device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 may receive the electromagnetic wave by the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic wave, and transmit it to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic wave radiation through the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is configured to modulate a low-frequency baseband signal to be transmitted into a high-frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be a separate device.
  • the modem processor may be independent of the processor 110 and disposed in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 may provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (Bluetooth, BT), and global navigation satellites applied to the electronic device 100. Wireless communication solutions such as global navigation system, GNSS, frequency modulation (FM), near field communication (NFC), and infrared (IR).
  • the wireless communication module 160 may be one or more devices that integrate at least one communication processing module.
  • the wireless communication module 160 receives the electromagnetic wave signal via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and sends the processed signal to the processor 110.
  • the wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and convert it into electromagnetic wave radiation through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include a global system for mobile communications (GSM), a general packet radio service (GPRS), code division multiple access (CDMA), and broadband. Wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and / or IR technology.
  • the GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation navigation system (BDS), and a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and / or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Bertdou navigation navigation system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing and is connected to the display 194 and an application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light-emitting diode).
  • LED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLEDs flexible light-emitting diodes
  • Miniled MicroLed, Micro-oLed, quantum dot light emitting diodes (QLEDs), etc.
  • the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP processes the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and the light is transmitted to the light receiving element of the camera through the lens. The light signal is converted into an electrical signal, and the light receiving element of the camera passes the electrical signal to the ISP for processing and converts the image to the naked eye. ISP can also optimize the image's noise, brightness, and skin tone. ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, an ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • An object generates an optical image through a lens and projects it onto a 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 passes the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs digital image signals to the DSP for processing.
  • DSP converts digital image signals into image signals in standard RGB, YUV and other formats.
  • the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals. In addition to digital image signals, it 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 a Fourier transform on the frequency point energy and the like.
  • 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 expert groups (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture expert groups
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • the NPU can quickly process input information and continuously learn by itself.
  • the NPU can realize applications such as intelligent cognition of the electronic device 100, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 may be used to connect an external memory card (for example, a Micro SD card) to achieve the expansion of the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, save files such as music and videos on 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 executing 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 may store an operating system, at least one application required by a function (such as a sound playback function, an image playback function, etc.) and the like.
  • the storage data area may store data (such as audio data, phonebook, 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 memory (UFS), or the like.
  • UFS universal flash memory
  • the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, and an application processor. For example, music playback, recording, etc.
  • the audio module 170 is configured to convert digital audio information into an analog audio signal and output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
  • the speaker 170A also called a "horn", is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
  • the receiver 170B also referred to as the "handset" is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or a voice message, it can answer the voice by holding 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 through the mouth near the microphone 170C, and input a sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C.
  • the electronic device 100 may be provided with two microphones 170C, in addition to collecting sound signals, it may also implement a noise reduction function.
  • the electronic device 100 may further be provided with three, four, or more microphones 170C to implement sound signal collection, noise reduction, and also identify the source of the sound, to implement a directional recording function, and the like.
  • the headset interface 170D is used to connect a wired headset.
  • the headphone interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic platform (OMTP) standard interface, a cellular telecommunications industry association (of the USA, CTIA) standard interface, etc. .
  • OMTP open mobile electronic platform
  • CTIA cellular telecommunications industry association
  • the pressure sensor 180A is used to sense a pressure signal, and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be disposed on the display screen 194.
  • the capacitive pressure sensor may be at least two parallel plates having a conductive material. 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.
  • 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 based on the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but different touch operation intensities may correspond to different operation instructions. For example, when a touch operation with a touch operation intensity lower than the first pressure threshold is applied to the short message application icon, an instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction for creating a short message is executed.
  • the gyro sensor 180B may be used to determine a movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, the x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the angle of the electronic device 100 shake, and calculates the distance that the lens module needs to compensate according to the angle, so that the lens cancels the shake of the electronic device 100 through the backward movement to achieve image stabilization.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the barometric pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C, and assists in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 can detect the opening and closing of the flip leather case by using the magnetic sensor 180D.
  • the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the opened and closed state of the holster or the opened and closed state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to recognize the posture of electronic devices, and is used in applications such as switching between horizontal and vertical screens, and pedometers.
  • 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 through a light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from a nearby object. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficiently reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100.
  • the electronic device 100 may use the proximity light sensor 180G to detect that the user is holding 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 holster mode, and the pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • Ambient light sensor 180L can also be used to automatically adjust 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 a pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 may use the collected fingerprint characteristics to realize fingerprint unlocking, access application lock, fingerprint photographing, fingerprint answering an incoming call, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the electronic device 100 executes a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds the threshold, the electronic device 100 performs a performance reduction of a 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 the abnormal shutdown of the electronic device 100 caused by the low temperature.
  • the electronic device 100 when the temperature is lower than another threshold, performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • the touch sensor 180K is 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 referred to as a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation 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.
  • a visual output related to the touch operation may 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 acquire a vibration signal of a human voice oscillating bone mass.
  • Bone conduction sensor 180M can also contact the human pulse and receive blood pressure beating signals.
  • the bone conduction sensor 180M may also be disposed in the earphone and combined into a bone conduction earphone.
  • the audio module 170 may analyze a voice signal based on the vibration signal of the oscillating bone mass of the vocal part obtained by the bone conduction sensor 180M to implement a voice function.
  • the application processor may analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M to implement a heart rate detection function.
  • the keys 190 may include a start key, a volume key, and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive a key input, and generate a key signal input related to user settings and function control of the electronic device 100.
  • the motor 191 may generate a vibration alert.
  • the motor 191 can be used for vibration alert for incoming calls, or for touch vibration feedback.
  • the touch operation applied to 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 (such as time reminders, receiving information, alarm clocks, games, etc.) can also correspond to different vibration feedback effects.
  • Touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate a charging state, a power change, and may also be used to indicate a message, missed call, notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 100 by inserting or removing the SIM card interface 195.
  • the electronic device 100 may support one or N SIM card interfaces, and N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple SIM cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different.
  • the SIM card interface 195 may also be compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through a SIM card to implement functions such as calling and data communication.
  • the electronic device 100 uses an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the 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 parts than shown, or some parts may be combined, or some parts may be split, or different parts may be arranged.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the electronic device 100 is taken as an example to describe the embodiment of the present application in detail.
  • the applications supported by the electronic device in the embodiments of the present application may include applications such as a camera, such as a camera.
  • the applications supported by the electronic device may also include various other applications, such as: graphics, games, phones, video players, music players, photo management, browsers, calendars, clocks, and so on.
  • the applications supported by the electronic device in the embodiments of the present application may further include applications for skin detection.
  • the application for skin detection is to detect the characteristics of the user's facial skin (such as facial skin wrinkles, pores, blackheads, stains, red areas, etc.) through the captured face images, and can provide users with a detection result report .
  • the detection result report may include, but is not limited to, scoring for each feature on the facial skin, comprehensive analysis of the facial skin, etc., and may further display the user's face picture, and based on the detection result of each feature on the face image Corresponding problems are marked, such as blackheads in the nose area, wrinkles in the forehead area, and stains in the cheek area.
  • the detection result report can be presented to the user through the user interface.
  • the detection result report can be shown in the user interface 200 shown in FIG. 2A, including the comprehensive score, skin age, and pores, blackheads, fine lines, stains, and Red zone score.
  • the user interface 200 may further include a virtual button 201, a virtual button 202, a virtual button 203, a virtual button 204, and a virtual button 205.
  • the virtual button 201 the electronic device 100 responds to the virtual button.
  • the specific care suggestions for the pores are displayed on the display screen 194.
  • the virtual button 202, the virtual button 203, the virtual button 204, and the virtual button 205 refer to the functions of the virtual button 201, and details are not described herein again.
  • the user skin detection solution in the embodiment of the present application may integrate a shooting condition detection module, an image quality detection module, and a region of interest in the processor 110. , ROI) detection module, skin feature detection module, result analysis module, etc.
  • a shooting condition detection module, an image quality detection module, a region of interest (ROI) detection module, a skin feature detection module, a result analysis module, and the like may be integrated on an application processor in the processor 110. Wait.
  • an artificial intelligence (AI) chip is integrated in the processor 110, and a shooting condition detection module, an image quality detection module, and a region of interest (ROI) detection module are integrated on the AI chip.
  • Skin feature detection module, result analysis module, etc. to achieve user skin detection.
  • the shooting condition detection module can detect the current shooting conditions to guide users to shoot under the required shooting conditions to ensure that the captured images meet the requirements, thereby ensuring the accuracy of skin detection based on the images.
  • the required shooting conditions include: sufficient ambient lighting, a suitable distance between the face and the electronic device (for example, about 25cm), straight faces, eyes closed, no glasses, no bangs on the forehead, accurate focus, no Obvious jitter, etc.
  • the processor 110 When the shooting condition detection module successfully detects, the processor 110 will start the intelligent fill light. For example, when the shooting condition detection module meets the requirements of the current shooting condition, it determines that the detection is successful. Specifically, in the embodiment of the present application, the electronic device may use different fill light modes (such as a flash mode and a flashlight mode) to fill the user's face to meet the requirements for detecting different facial skin features. After the user's face is filled with light, the processor 110 can control the camera 193 to photograph the user's face to obtain a face image of the user's face.
  • different fill light modes such as a flash mode and a flashlight mode
  • the image quality detection module can detect the quality of the face image to ensure that the captured image meets the requirements of different facial skin feature detection.
  • the ROI detection module can determine the ROI to be detected from the face image after the image quality detection module detects that the quality of the image meets the requirements. For example, a blackhead ROI is a small area on the nose.
  • the skin feature detection module can detect facial skin features in the determined ROI, for example, detecting wrinkles, pores, blackheads, stains, red areas, and oil output in the skin.
  • the result analysis module can analyze the detection results of the facial skin features detected by the skin feature detection module, and give a score and a ranking of each detection item for each skin feature.
  • the processor 110 may further integrate an image pre-processing module.
  • the image pre-processing module can compress and crop the captured face image, so that the ROI detection module and skin feature detection module can perform subsequent processing.
  • the processor 110 may also report the detected detection report (including the area of the detection result of each feature on the face image, such as a blackhead in the nose area). , Wrinkles are marked in the forehead area, stains are marked in the cheek area, etc., the scores of each detection item are displayed on the display screen 194 for users to check and improve the user experience.
  • an embodiment of the present application provides a method for detecting wrinkles.
  • the method can be used by the electronic device 100 to rotate a region of a face image in which a wrinkle needs to be detected to obtain multiple images to be detected. After that, wrinkles in different images to be detected are detected separately. Because different rotation angles of different images to be detected are different, performing wrinkle detection on multiple images to be detected separately can improve the detection accuracy of wrinkles in different directions.
  • the above-mentioned wrinkle detection method provided in the embodiment of the present application may be applied to an application program for skin detection supported by the electronic device 100.
  • the display screen 194 of the electronic device 100 displays an icon 206 of the skin-detection application.
  • the electronic device 100 detects an operation on the icon 206 (for example, the electronic device detects that the user clicks the icon 206), and in response to the operation on the icon 206, the user interface 208 of the skin measurement application is displayed on the display screen 194.
  • the user interface 710 of the skin test application includes a virtual button 209 (in practice, the virtual button may be named "test" or "photograph", etc.).
  • the electronic device 100 detects an operation on the virtual button 209 (for example, the electronic device detects that the user clicks the virtual button 209), and in response to the operation on the virtual button 209, according to the wrinkle detection method provided in the embodiment of the present application, the face image is In areas where wrinkles need to be detected for wrinkle detection.
  • the face image can be obtained by the electronic device 100 in response to the operation of the virtual button 209 by shooting the user's face using the electronic device 100 through the camera 193.
  • the camera 193 here can be a front camera of the electronic device 100, or, for To improve the quality of photography, when the pixels of the front camera are lower than the pixels of the rear camera, the camera 193 may also be the rear camera of the electronic device 100.
  • the face image may also be an image read by the electronic device 100 from the internal memory 121 or the external memory through the external memory interface 120 in response to the operation of the virtual button 209. At this time, the face image may be captured and stored in advance The face image in the internal memory 121 or the external memory.
  • the face image may be an image obtained by an electronic device taking a user's face through a camera 193 (the camera 193 may be a front camera or a rear camera).
  • the electronic device 100 stores the obtained face image in the inside In the memory 121, after the electronic device 100 detects an operation on the virtual button 209, the electronic device 100 can read the face image from the internal memory 121.
  • the face image stored in the internal memory 121 may also be an image received by the electronic device 100 through the mobile communication module 150 and / or the wireless communication module 1160.
  • the user can also select whether the electronic device 100 captures a face image through the camera 193 or whether the electronic device 100 reads the image from the internal memory 121 or the external memory. Face image.
  • the display screen 194 displays a photo selection area 212, where the photo selection area 212 may include prompt information such as "how to select a photo” and "where to obtain a photo” for Remind the user to select the source of the face image.
  • the photo selection area 212 may further include a plurality of virtual keys for performing operations corresponding to the virtual keys to obtain a face image in different ways, for example, a virtual key.
  • the first button 213 indicating that a face image is obtained by shooting (the name of the first button 213 may be "shoot”, “photograph”, etc.), or the virtual button may indicate that it is read from the memory
  • the second button 214 for obtaining a face image in a manner the name of the second button 214 may be "storage”, "album”, etc.).
  • the electronic device 100 After the electronic device 100 detects the user's operation on the first button 213, the electronic device 100 can capture the user's face image through the camera 193 as the face image in response to the user's operation on the first button 213; the electronic device 100 detects the user's operation on the first button 213; After the operation of the two keys 214, the user may continue to be prompted to select a storage path of the face image, and read the image selected by the user as the face image from the storage path selected by the user.
  • the storage path may be a default storage path of the “photo album” of the electronic device 100; the storage path may include a storage path of the internal memory 121, or a storage path of an external storage.
  • the display of the above photo selection area 212 can also be triggered by the electronic device 100 in a manner other than the operation of the virtual button 209 detected.
  • a new function virtual button can be set in the user interface 208 for the electronic device 100 After the operation of the new function virtual key is detected, the photo selection area 212 is displayed.
  • the display screen 194 may display the face image preview interface 210 and display the face image in the preview area 211 of the face image preview interface 210.
  • the electronic device 100 may display the face image in the preview area 211.
  • the face image determines the ROI for wrinkle detection, and uses it as a region in the face image where wrinkles need to be detected, and is used to detect wrinkles by using the wrinkle detection method provided in the embodiment of the present application.
  • FIG. 3 may include the following steps:
  • the processor 110 rotates the area of the face image to be detected, to obtain multiple images to be detected;
  • the processor 110 determines a wrinkle point from all the pixels of each image to be detected according to the gray value of the pixels in each image to be detected;
  • the processor 110 determines at least one wrinkle line from a plurality of images to be detected according to the wrinkle point, and each wrinkle line is used to represent a wrinkle in the image to be detected;
  • the processor 110 displays the detected face image on the display screen 194, and displays at least one wrinkle line in a corresponding area of the face image, as shown in FIG. 17 below, which will be described in detail when referring to FIG. 17 below.
  • the area where wrinkles need to be detected may be areas where wrinkles are common on the face.
  • the wrinkle detection Areas: forehead area 401, under-eye area 402, corner area 403, nose area extending downward 404 or eyebrow area 405, and so on.
  • the ROI of the wrinkles in the face image can be determined according to the region of interest detection function, and the ROI of the wrinkles is used as the region where wrinkles need to be detected.
  • a wrinkled ROI can be extracted from at least one of a forehead region 401, an under-eye region 402, a corner region 403, a nose extension region 404, or a brow region 405 in a face image. Areas where wrinkles need to be detected.
  • the ROI of the wrinkles shown as number (a) in FIG. 5 can be extracted according to the area 402 shown in FIG. 4 as the area where wrinkles need to be detected.
  • the forehead area 401 shown in FIG. 4 can also be extracted as shown in FIG. 4.
  • the ROI of the wrinkles indicated by (b) in 5 is an area where wrinkles need to be detected.
  • the image to be detected involved in the step shown in step S101 may be a normal color image obtained by rotating a normal color face image.
  • the processor 110 may perform color processing on the detected image to Determine the gray value of the pixels in the image to be detected; the image to be detected can also be a gray image obtained by rotating and performing color processing on a face image of normal color, and each pixel in the gray image can be determined by the gray value Indicates, in step S102, the processor 110 may directly determine the gray value of each pixel according to the gray image.
  • the processor 110 may rotate a region of a face image in which a wrinkle needs to be detected to obtain multiple images to be detected, and the following are examples of several feasible ways to explain:
  • Method 1 Rotate the area where wrinkles need to be detected according to some or all of the preset angles in the preset angle set to obtain multiple images to be detected.
  • the areas in the face image that need to be detected for wrinkles can be rotated according to some or all of the preset angles in the preset angle set, and the multiple images obtained by the rotation are used as the images to be detected.
  • the angle set may include multiple preset angles, and the values of any two preset angles may be different.
  • the preset angle may represent an angle indicating the actual rotation of the area where wrinkles need to be detected, wherein the value of the preset angle may be between [-180, 180] ° (degrees), for example, the preset angle may be 90 °; The value of the preset angle may not be between [-180, 180] °.
  • the preset angle is 270 °, which indicates that the area where wrinkles need to be detected is actually rotated 270 °.
  • the sign of the value of the preset angle in the set of preset angles can also be used to indicate the direction of rotation when rotating the area where wrinkles need to be detected.
  • the following can be used to indicate when rotating the area where wrinkles need to be detected
  • Direction of rotation If the value of the preset angle is positive, it means that the area where wrinkles need to be detected is rotated clockwise, and if the value of the preset angle is negative, it means that the area where wrinkles are to be detected is rotated clockwise; or, The embodiment of the present application does not exclude the following description of the direction of rotation when rotating the area where wrinkles need to be detected.
  • the value of the preset angle in the preset angle set is negative, it can mean that the area where wrinkles need to be detected is rotated clockwise. If the preset angle value is positive, it means that the area where wrinkles need to be detected is rotated clockwise.
  • the area to be detected for wrinkle extraction is the area shown by number (a) in FIG. 5.
  • the preset angle set includes three preset angles: 30 °, 60 °, and 90 °, so in S101.
  • the area shown by number (a) in FIG. 5 can be rotated by 30 ° to obtain the image shown by number (a) in FIG. 6, and the image shown by number (a) in FIG. 5 can be obtained.
  • the area shown is rotated by 60 ° to obtain the image shown by number (b) in FIG. 6, and the area shown by number (a) in FIG. 5 is rotated by 90 ° to obtain the number shown in FIG. 6 ( c), so that the images shown in numbers (a), (b), and (c) in FIG. 6 are images to be detected.
  • the preset angle can be set to 0 °.
  • the preset angles in the preset angle set when detecting wrinkles in the forehead area shown in (5) in 5 may include 0 ° and 90 °, that is, the image to be detected includes the image to be detected (it can be regarded as the area where wrinkles need to be detected according to Image after 0 ° rotation) and image after rotating the area where wrinkles need to be detected by 90 ° (90 ° clockwise or 90 ° counterclockwise).
  • Method 2 Rotate the area where wrinkles need to be detected according to some or all of the preset angles in the preset angle set, and reduce them according to some or all of the preset proportions in the preset proportion set to obtain multiple images to be detected.
  • the area in the face image where wrinkles need to be detected can be rotated according to some or all of the preset angles in the preset angle set to obtain multiple candidate images.
  • the preset angle set and the preset angle settings The method can refer to the implementation of the first method above; thereafter, a plurality of candidate images can be reduced according to some or all of the preset ratios in the preset ratio set to obtain multiple images to be detected.
  • the images to be detected Can include candidate images.
  • the preset ratio set includes multiple preset ratios, each of which has a different value.
  • the preset ratio can represent the size of the candidate image before reduction and the size of the image to be detected after reduction.
  • the preset ratio may be a value less than or equal to 1. It should be understood that the reduction referred to herein may refer to reducing the image in the same ratio without changing the aspect ratio of the image.
  • each candidate image obtained by rotating the area where wrinkles need to be detected can be reduced according to some or all of the preset proportions in a preset proportion set to obtain multiple images to be detected.
  • one of the obtained candidate images is the image shown in number (a) in FIG. 7.
  • the image shown in number (a) can be reduced according to the preset ratio of 0.5 to obtain the image shown in number (b) in FIG. 7 and the image shown in number (a) according to The preset ratio of 0.3 is reduced to obtain the image shown by number (c) in FIG. 7, so that the images shown by numbers (b) and (c) in FIG. 7 can be used as the images to be detected.
  • the candidate image shown by number (a) in FIG. 7 may be used as the image to be detected.
  • the candidate images may be numbered (a) and numbered (b) in FIG. 6 )
  • the image shown in number (c) can be rotated according to the preset ratios of 0.5 and 0.3 to obtain two images.
  • the image shown is rotated to obtain two images, and the image shown by number (c) in FIG. 6 is rotated to obtain two images.
  • the numbers (a), (b), and (c) in FIG. 6 are obtained. Display images, and multiple images obtained by rotating the images indicated by numbers (a), (b), and (c) as the images to be detected.
  • the gray area in the gray image has a lower gray value than the non-wrinkle area (that is, the color of the wrinkle area is darker), but after zooming in at a preset ratio greater than 1, the contrast between the light and dark areas in the gray image is not enlarged.
  • the gray value of the pixels in the area where the wrinkles are located is not much different, so it is more difficult to accurately detect wrinkle points in the enlarged grayscale image. Therefore, in order to improve the accuracy of wrinkle detection, you can Detect wrinkles in a grayscale image reduced by a ratio of less than 1, for example, the grayscale image shown in number (a) in FIG. 8 is obtained by enlarging a part of the grayscale image shown in number (b).
  • the wrinkles in the area where wrinkles need to be detected can be detected according to the to-be-detected image obtained by reducing the candidate image. Since the to-be-detected image reduces the candidate image by a ratio of less than 1, the The contrast between the light and dark areas is more obvious, so the wrinkle points in the image to be detected can be determined more accurately, so that different thickness wrinkles can be detected more accurately.
  • the processor 110 may determine the wrinkle point according to the following method: setting a rectangular window, and controlling the rectangular window to traverse the image to be detected according to a set sliding step, wherein each of the window positions where the rectangular window is located, Determine the central pixel located at the center of the rectangular window, and determine the confidence value of the central pixel based on the gray values of all pixels in the rectangular window, so as to obtain multiple confidence values, corresponding to the confidence value that is not less than the threshold
  • the center pixel point is used as a wrinkle point, wherein the confidence value can be used to indicate the possibility that the center pixel point is a wrinkle point.
  • the sliding step size can be set to one pixel, that is, each time a rectangular window is controlled to move one pixel point horizontally or vertically to traverse the image to be detected and determine the confidence level corresponding to all pixels in the image to be detected value.
  • the rectangular window may be set as a square composed of N * N pixels, where N is an odd number greater than 1, for example, N is 3 or N is 5, so that the number of rows and columns of the rectangular window is N.
  • the set rectangular window 901 can be used to traverse the to-be-detected image 900 and determine the confidence value of the central pixel of the rectangular window 901 at each window position where the rectangular window 901 is located.
  • the threshold involved in step S102 may be a preset value, such as 0 or 400. It should be understood that the smaller the threshold is, the more the number of wrinkle points determined according to the above method is, that is, the smaller the threshold is, the higher the sensitivity of wrinkle detection is. However, if the threshold is too small, the identified wrinkle point may be located in the black area 902 in the image 900 to be detected as shown in FIG. 9 (the gray value of the pixel point in the black area is generally 0). At this time, the wrinkle point cannot be used.
  • the average value of the confidence values of the center pixel points of the multiple window positions determined after traversing the image to be detected may be used as a threshold value, or the determined center pixel points of the multiple window positions are non-zero
  • the average value of the confidence value of the sigma as a threshold to improve the accuracy of wrinkle detection. It can be understood that increasing the value of the threshold can improve the difference in gray values between the selected wrinkle point and the surrounding pixels, thereby improving the accuracy of wrinkle point detection.
  • the electronic device 100 may determine the confidence value of the center pixel according to the following formula (1):
  • M represents the confidence value of the central pixel at the center of the rectangular window
  • P ij represents the element located in the i-th row and the j-th column in the first matrix
  • Q ij represents the i-th row and the j-th column in the second matrix Element
  • the first matrix is a preset N * N matrix
  • the elements of each row in the first matrix are the same
  • the elements of the i-th row and the j-th column in the second matrix are the i-th and j-th rows in the rectangular window
  • the gray value of the pixels of the column is 1 ⁇ i ⁇ N, 1 ⁇ j ⁇ N
  • N is an odd number
  • N is 3 or more.
  • the elements in the second matrix may be composed of gray values of all pixels in the rectangular window.
  • the second matrix may be an N * N matrix.
  • the value of each pixel position in the second matrix may be the gray value of the corresponding position in the second matrix.
  • the value of Q 11 in the second matrix may be the pixel of the first row and the first column in the rectangular window. The gray value of the point.
  • the number of rows N and the number of columns N of the first matrix may be the same as the number of rows N and the number of columns N of the rectangular window.
  • the size of the rectangular window is 3 * 3 pixels
  • the size of the first matrix is 3 * 3. matrix.
  • the first matrix P may have the following expression:
  • the first matrix P may also have an expression as shown in formula (3):
  • n u > n u-1 , u is an integer and 1 ⁇ u ⁇ x, The N is greater than 3; or, n u ⁇ n u-1 , u is an integer and 1 ⁇ u ⁇ x, The N is greater than 3.
  • the first matrix P may have the following expression:
  • the following describes an example of a method for determining a confidence value of a central pixel of a rectangular window in an embodiment of the present application. If the size of the rectangular window 901 is 5 * 5 pixels, when sliding to a certain window position, the gray value of each pixel in the rectangular window 901 is shown in Table 1. It can be seen that when the rectangular window 901 is at the window position, the center pixel is The gray value of the points (pixels with the number of rows and columns of 3) is 110.
  • the expression of the second matrix Q can be set as:
  • the value of the pixel (i, j) in the second matrix is the gray value of the pixel point located in the i-th row and the j-th column in the rectangular window 901 shown in Table 1.
  • the processor 110 may determine the confidence value of the center pixel point of the rectangular window 901 according to the expressions of the first matrix P shown in the formula (4) and the second matrix Q shown in the formula (5). .
  • the position of the wrinkle point in the image to be detected determined by the processor 110 as shown in number (a) in FIG. 10 may be a white bright point in the image as shown in (b) in FIG. 10 As shown.
  • the processor 110 may determine the contour lines of at least two consecutive wrinkle points in the image to be detected, and then determine the straight line segments included in the contour lines, and use some or all of the straight line segments as the wrinkle lines. .
  • a contour extraction technique can be used to extract contour lines in the image to be detected.
  • the processor 110 may determine the wrinkle point shown by the white bright point in the number (b) image in FIG. 10 according to the steps shown in S102. Thereafter, the electronic device 100 may determine at least one contour line according to the wrinkle point. Based on the contour lines, all straight line segments included in the contour lines can be used as wrinkle lines to obtain the wrinkle lines shown by the bright white lines in the image of number (c).
  • the wrinkle line determined by the processor 110 satisfies one or more of the following preset conditions:
  • the size of the wrinkle line is not less than a preset pixel size.
  • the size of the wrinkle line can be represented by the length of the wrinkle line, where the length of the wrinkle line can be the length of the straight line segments that make up the wrinkle line (where the length of the straight line unit is the number of pixels), or The size can be represented by the number of pixels of the straight line segments that make up the wrinkle line.
  • the processor 110 may select a straight line segment having a size not smaller than a preset pixel size as a wrinkle line according to the first condition. As shown in FIG.
  • the preset pixel size is 50 pixels (each pixel is a pixel size)
  • the number of pixels in the straight line segment 1101 between the A and B pixel points on the contour line 1100 is greater than or equal to 50, and the straight line segment 1101 can be used as a wrinkle line. It should be understood that, in this application, the size of the wrinkle line may be larger than a preset pixel size as a preset condition.
  • the included angle between the line between the two furthest pixels on the wrinkle line and the horizontal direction is not greater than the preset included angle.
  • the processor 110 may use a straight line segment satisfying the second condition as a wrinkle line. As shown in FIG. 11, if the preset angle is 15 °, the included angle ⁇ between the straight line segment 1101 between the two pixel points A and B and the horizontal direction If it is not greater than 15 °, the straight line segment 1101 can be used as a wrinkle line. It should be understood that in this application, the angle between the line between the two pixels with the furthest distance on the wrinkle line and the horizontal direction may be smaller than the preset angle as the preset condition.
  • the processor 110 may also use the above condition one or condition two as the preset condition, or may use the above condition one and condition two as the preset condition.
  • the processor 110 can also determine and save the information of the straight line segment 1101. Since the wrinkle score is subsequently determined, for example, the length, width, area, and length of the straight line segment 1101 can be determined and saved. The contrast value of the pixels.
  • the processor 110 may call the program code in the internal memory 121 to implement it. Thereafter, the processor 110 may store the determined straight line segment 1101 in the internal memory 121 or through an external memory interface. 120. Store the information in an external memory.
  • the width of the straight line segment 1101 can be expressed by the number of pixels, which can be used to represent the average pixel width of the straight line segment 1101. As shown in FIG. 10, the straight line segment 1101 can be a straight line segment with an uneven width, and the average pixel of the straight line segment 1101 can be calculated.
  • the width is the width of the straight line segment 1101.
  • the straight line segment 1101 has a length of 60 pixels.
  • the straight line segment 1101 with a width of 1 (pixels) has a length of 30 pixels
  • the straight line segment 1101 with a width of 2 has a length of 20 pixels.
  • the length of the straight line segment 1101 of 3 is 10 pixels. It can be known that the average pixel width of the straight line segment 1101 is 2 pixels ((1 * 30 + 2 * 20 + 3 * 10) / 60), so that 2 can be used as the straight line segment 1101. width.
  • the area of the straight line segment 1101 can be represented by the number of pixels of the straight line segment constituting the wrinkle line, and the unit is the number of pixels.
  • the contrast value of the pixels on the straight line segment 1101 can be used to represent the contrast of the pixels on the straight segment 1101 (contrast ratio).
  • the average value of the contrast of the pixels on the straight line segment 1101 can be used as the contrast value of the pixels on the straight segment 1101.
  • the processor 110 may display the determined at least one wrinkle line in an area where wrinkles need to be detected, so as to indicate a location of the wrinkles in an area where wrinkles need to be detected.
  • the wrinkle lines determined in all the images to be detected may be fused into a region where wrinkles need to be detected for display. It should be understood that “fusion” here refers to merging the wrinkle lines in multiple images into the same image, or to merge the wrinkle lines in an image into another image, where the wrinkle lines are in the image before and after the fusion. The position in the center remains unchanged.
  • a wrinkle line corresponding to the image to be detected (that is, a wrinkle line determined according to the image to be detected) needs to be performed. Rotate in the opposite direction. For example, if you want to detect the image after rotating the area where wrinkles need to be detected clockwise by 30 °, then in the process of fusing the wrinkle lines, you need to rotate the wrinkle lines determined based on the image to be detected counterclockwise by 30. °, and then the wrinkle lines and the wrinkle lines corresponding to other images to be detected (if other images to be detected are rotated, other images to be detected need to be rotated in the opposite direction) to be fused.
  • the image to be detected may also be mapped before the wrinkle line is fused.
  • the wrinkle line is enlarged, and the enlargement ratio when enlarging is one of the preset ratios when reducing the candidate image (for example, if the preset ratio when reducing is n, the ratio is 1 / n. Zoom in).
  • the wrinkle line corresponding to the image to be detected may be doubled by 1 / 0.5, and then the wrinkles will be enlarged. Lines and wrinkle lines corresponding to other images to be detected (if other images to be detected have been reduced, other images to be detected need to be proportionally enlarged) for fusion.
  • the image to be detected determined in the step shown in S101 is an image shown by numbers (a), (b), and (c) in FIG. 7, where, as shown by number (a) in FIG.
  • the displayed image can be regarded as being obtained by reducing the candidate image (the candidate image is the image shown by number (a) in FIG. 7) by a preset ratio of 1.
  • the image shown by number (b) in FIG. 7 is based on the candidate
  • the image is reduced by a preset ratio of 0.5
  • the image shown by number (c) in FIG. 7 is obtained by reducing the candidate image by a preset ratio of 0.3. It is determined by the image shown by number (a) in FIG.
  • the wrinkle line after the wrinkle line is magnified at 1 ⁇ is shown by the white bright line in the image numbered (a) in FIG. 12.
  • After the wrinkle line determined by the image shown at the numbered (b) in FIG. 7 is enlarged by 1 / 0.5 times.
  • the image is shown as the bright white line in the numbered (b) image in FIG. 12, and the image enlarged by 1 / 0.3 times according to the wrinkle line determined by the image shown in the numbered (c) in FIG. 7 is numbered as shown in FIG. 12 ( c)
  • the white numbers in the numbered (a) image, the numbered (b) image, and the numbered (c) image in FIG. 12 may be combined.
  • the color bright lines are fused to obtain the image shown in number (d) in FIG. 12, where the white light lines are used to represent the wrinkle lines corresponding to the candidate images shown in number (a) in FIG. 7 (the wrinkles corresponding to the alternative images) Lines, that is, wrinkle lines determined from all the to-be-detected images determined from the candidate images, and fused to the same image as the wrinkle lines).
  • the candidate image shown in the numbered (a) image in FIG. 7 is obtained by rotating the area where the wrinkle needs to be detected shown in the numbered (a) image in FIG. 5 clockwise by 90 °
  • the wrinkle lines shown by the white bright lines in the numbered (d) image in FIG. 12 can be rotated counterclockwise by 90 °, and then the wrinkle lines corresponding to other candidate images are fused to obtain the numbered (a) in FIG. 5 Wrinkle lines corresponding to areas where wrinkles need to be detected (wrinkle lines corresponding to areas where wrinkles need to be detected) line).
  • the white bright line in the number (a) image in FIG. 13 and the number (b) image in FIG. 13 can be obtained.
  • the medium white bright line can represent the wrinkle line corresponding to the candidate image shown by number (b) in FIG. 6 after rotating counterclockwise by 60 °
  • the white bright line in the number (c) image in FIG. 13 can be Represents the wrinkle line corresponding to the candidate image shown by number (c) in FIG. 6 after rotating counterclockwise by 30 °.
  • the white in the image of number (a) in FIG. 13 can be brightened.
  • Lines, white bright lines in the numbered (b) image, and white bright lines in the numbered (c) image are merged to obtain the white bright lines in the numbered (d) image as shown in FIG. 13, and thereafter, the numbered (d) image is
  • the bright white lines are displayed in the area where wrinkles need to be detected as shown in the image (a) in FIG. 5, and the image shown in (e) in FIG. 13 and the image in (e) in FIG. 13 are obtained.
  • the white bright line is the wrinkle line corresponding to the area where wrinkles need to be detected, and is used to indicate the wrinkles in the area where wrinkles need to be detected.
  • the implementation of the present invention can also detect wrinkles in the area of wrinkles according to the need to determine the wrinkle score in the user's face image, and the wrinkle score is used to indicate the severity of the user's facial wrinkles.
  • the wrinkle score can be determined according to the feature set of the wrinkle line displayed, wherein the feature set of the wrinkle line includes one or more of the following characteristics: the length of the wrinkle line, the width of the wrinkle line, and the pixel points on the wrinkle line Contrast value, area ratio of wrinkles.
  • the length of the wrinkle line may refer to the length of the straight line segments that make up the wrinkle line; the width of the wrinkle line may refer to the width of the straight line segments that make up the wrinkle line; the contrast value of the pixel points on the wrinkle line is used to characterize the wrinkle line
  • the contrast of a pixel can be represented by the contrast value of the pixels on the straight line segments that make up the wrinkle line.
  • the area ratio of the wrinkle line is used to indicate that the number of pixels in the pixel area surrounded by the wrinkle line accounts for the total number of pixels in the image to be detected. Specific gravity, in which the area ratio of the wrinkle line can be represented by the area of the straight line segments that make up the wrinkle line.
  • the above process of determining the wrinkle score information can be implemented by the processor 110 by calling program code in the internal memory 121.
  • the processor 110 may display the wrinkle score through the display screen 194, for example, may display the wrinkle score in the user interface 200 shown in FIG. 2A (as shown by “fine lines 78 points” in FIG. 2A) ; Or the processor 110 may play the audio corresponding to the wrinkle score through the speaker 170A or the headphone interface 170D.
  • the determination of the wrinkle score can meet the following formula requirements:
  • H is the wrinkle score
  • A is the length of the wrinkle line
  • B is the width of the wrinkle line
  • C is the contrast value of the pixels on the wrinkle line
  • D is the area ratio of the wrinkle line
  • ⁇ 1, ⁇ 2, ⁇ 3, and ⁇ 4 are less than
  • ⁇ 5 is the preset parameter.
  • ⁇ 5 may be a preset positive integer.
  • the value of ⁇ 5 may be related to the full score of the wrinkle score. If the full score of the wrinkle score is 100 points, the value of ⁇ 5 may be 100.
  • the rounded H in formula (6) can also be used as the user's wrinkle score.
  • the lengths of all the wrinkle lines in the area where wrinkles need to be detected can be sorted, the first N (N ⁇ 2) long wrinkle lines are determined as the target wrinkle lines, and the average of the N target wrinkle lines is determined.
  • the length is the length of the wrinkle line in the feature set
  • the average width of the N target wrinkle lines is the width of the wrinkle line in the feature set
  • the average of the contrast values of the pixel points on the N target wrinkle lines is the wrinkle in the feature set.
  • the contrast value of the pixels on the line and the average value of the area proportions of the N target wrinkle lines are taken as the area proportions of the wrinkle lines in the feature set.
  • the result of scoring the wrinkles of the area under the user can refer to FIG. 14, wherein the wrinkle line determined according to the area under the eyes (a1) in FIG. 14 is as bright as white in the image (a2) As shown by the line, the wrinkle score corresponding to the area under the eye (a1) determined by the above method is 61 points; the line of wrinkles determined according to the area under the eye (b1) is as shown by the bright white line in the image (b2) It shows that the wrinkle score corresponding to the area under the eye number (b1) determined by the above method is 75 points; the line of wrinkles determined according to the area under the eye number (c1) is shown by the bright white line in the image (c2), The wrinkle score corresponding to the area under the eye (c1) determined by the above method is 86 points; the line of wrinkles determined based on the area under the eye (d1) is shown by the bright white line in the image (d2). The wrinkle score corresponding to the area under the eye (d1) determined by the method was 91 points.
  • the result of scoring the user's forehead area can be referred to FIG. 15, wherein the wrinkle line determined according to the forehead area numbered (e1) in FIG. 15 is shown by the bright white line in the image (e2),
  • the wrinkle score corresponding to the forehead area numbered (e1) determined by the above method is 61 points;
  • the wrinkle line determined according to the forehead area numbered (f1) in FIG. 15 is shown by the bright white line in the image (f2) ,
  • the wrinkle score corresponding to the forehead area numbered (f1) determined by the above method is 82 points;
  • the wrinkle line determined according to the forehead area numbered (g1) in FIG. 15 is as indicated by the white bright line in the image numbered (g2) It shows that the wrinkle score corresponding to the forehead area numbered (g1) determined by the above method is 94 points.
  • the average value of the wrinkle scores of all areas where wrinkles need to be detected can be rounded (such as rounding up), and the rounded value can be used as the total score of the user's wrinkle score.
  • the score is 94 points
  • the user's immediate area score is 91 points
  • 93 points can be used as the total score of the user's wrinkle score.
  • the specific implementation process of the wrinkle score is described in detail, and may specifically include the following steps:
  • Step 1601 The processor 110 extracts an area in the face image that needs to be detected based on the face image;
  • Step 1602 The processor 110 rotates the area obtained in step 1601 according to multiple preset angles in the preset angle set to obtain multiple candidate images;
  • Step 1603 The processor 110 rotates according to multiple preset ratios in a preset ratio set for each candidate image to obtain multiple images to be detected;
  • Step 1604 the processor 110 determines, for each image to be detected, a wrinkle point according to a gray value of a pixel point in the image to be detected;
  • Step 1605 the processor 110 determines, for each image to be detected, at least one wrinkle line according to the determined wrinkle point;
  • Step 1606 The processor 110 enlarges all the obtained wrinkle lines according to a preset ratio for multiple to-be-detected images obtained from the same candidate image, and fuses the enlarged wrinkle lines into the candidate image to obtain a backup image. Select the fused wrinkles corresponding to the image;
  • Step 1607 The processor 110 reversely rotates the fused wrinkle line corresponding to each candidate image according to a preset angle on which the candidate image is obtained, and fuses the rotated wrinkle line to the wrinkle that needs to be detected.
  • the wrinkle line corresponding to the area where wrinkles need to be detected is obtained; further, the wrinkle line corresponding to the area where wrinkles need to be detected can be displayed on the display screen 194;
  • Step 1608 The processor 110 determines the wrinkle score according to the wrinkle line corresponding to the area where wrinkles need to be detected, and displays the wrinkle score corresponding to the area where wrinkles need to be detected on the display screen 194.
  • the processor 110 may display the wrinkle score in the user interface as shown in FIG. 2A through the display screen 194, as shown by “fine lines 78 points” in the figure.
  • the processor 110 may also display a wrinkle detection result report through the display screen 194, where the wrinkle detection result report may include, but is not limited to, including a wrinkle score, skin care advice, a result map, and the like.
  • the display screen 194 may display a wrinkle detection result report page 1700. It can be seen that the wrinkle detection result report page 1700 may include a wrinkle score, skin care advice, and a wrinkle area marked with a wrinkle line, that is, the result of wrinkle detection. Illustration.
  • the wrinkle detection result report page 1700 may be displayed by the processor 110 after determining the wrinkle score, or may be displayed after the processor 110 detects an operation on the virtual button 203 shown in FIG. 2A.
  • the detected wrinkle line may be marked in the area where wrinkle detection is required, and the wrinkle line labeled need to be detected may be marked.
  • the wrinkled area is displayed on the display screen 194 of the electronic device 100.
  • an area marked with a wrinkle line that needs to be detected for wrinkles can be displayed in the user interface 200 as shown in FIG. 2, so that the location of the wrinkle can be intuitively indicated.
  • the electronic device may include a hardware structure and / or a software module, and implement the foregoing functions in the form of a hardware structure, a software module, or a hardware structure and a software module. Whether one of the above functions is executed by a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application of the technical solution and design constraints.
  • FIG. 18 illustrates an electronic device 1800 provided by the present application.
  • the electronic device 1800 includes at least one processor 1801, a memory 1802, and a display screen 1803.
  • the processor 1801 is coupled to the memory 1802 and the display 1803.
  • the coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units, or modules, and may be electrical, mechanical, or other forms for the device. , Information exchange between units, or modules.
  • the memory 1802 may be used to store program instructions
  • the display screen 1803 may be used to implement a display function of the electronic device 1800.
  • the processor 1801 can be used to call the programs and instructions stored in the memory 1802, and in combination with the display 1803, to cause the electronic device 1800 to execute the steps performed by the electronic device in the wrinkle detection method shown in FIG. 3 and / or FIG. 16, thereby improving Quality of taking pictures.
  • the memory 1802 may have functions of the internal memory 121 of the electronic device 100 in the foregoing method embodiment, such as storing program codes and instructions, and storing information of the straight line segment 1101 determined by the electronic device 100.
  • the processor 1801 may have the functions of the processor 110 of the electronic device 100 in the foregoing method embodiment.
  • the processor 1801 may call a program stored in the memory 1802 and execute the steps shown in S101, S102, and S103 in the method shown in FIG. 3 Or, perform the steps shown in steps 1601 to 1608 in the method shown in FIG. 16.
  • the display screen 1803 may have the function of the display screen 194 of the electronic device 100 in the foregoing method embodiment.
  • the display screen 1803 may be used to perform the steps shown in step S104 in the method shown in FIG. 3 to display the display needs determined in step 1607.
  • the wrinkle line corresponding to the area where wrinkles are detected, and can be used to display the wrinkle score.
  • the electronic device 1800 may further include a speaker / external player interface 1804.
  • the speaker / external player interface 1804 may have the functions of the speaker 170A / headphone interface 170D of the electronic device 100.
  • the electronic device 1800 may be used to output the wrinkle score of the electronic device 1800. .
  • Computer-readable media includes computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage media may be any available media that can be accessed by a computer.
  • computer-readable media may include RAM, ROM, electrically erasable programmable read-only memory (EEPROM), read-only memory (EEPROM), compact disc-read-only memory (CD-ROM) ROM) or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer. Also. Any connection is properly a computer-readable medium.
  • disks and discs include compact discs (CDs), laser discs, optical discs, digital video discs (DVDs), floppy discs, and Blu-ray discs, among which Discs usually reproduce data magnetically, while discs use lasers to reproduce data optically.
  • CDs compact discs
  • DVDs digital video discs
  • floppy discs floppy discs
  • Blu-ray discs among which Discs usually reproduce data magnetically, while discs use lasers to reproduce data optically. The above combination should also be included in the protection scope of the computer-readable medium.

Abstract

一种皱纹检测方法及电子设备,该方法旋转人脸图像中需要检测皱纹的区域得到多个待检测图像,通过在每个不同角度的待检测图像中分别根据像素点的灰度值从全部像素点中确定皱纹点,并根据皱纹点确定至少一条皱纹线,此后,电子设备可在需要检测皱纹的区域显示皱纹线,其中,每条皱纹线指示待检测图像中的一条皱纹。采用以上方法,电子设备可分别在具有不同旋转角度的待检测图像中检测皱纹,有助于提高对于不同走向的皱纹进行检测时的检测精度。

Description

一种皱纹检测方法及电子设备
本申请要求于2018年7月16日提交中国专利局、申请号为201810776285.6、申请名称为“一种检测皱纹的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,尤其涉及一种皱纹检测方法及电子设备。
背景技术
面部皱纹的严重程度可以直接反映人们肌肤年龄、皮肤健康状况,皱纹作为皮肤老化的标志性特征之一,颇受爱美人士的关注。
目前,一些应用程序可检测用户面部图像中存在的皱纹。然而,由于用户面部图像中皱纹的走向具有不规则性,现有方法在进行皱纹检测时难以准确检测不同走向的皱纹,因此检测精确度不高。
发明内容
本申请实施例提供一种皱纹检测方法及电子设备,用于解决现有的皱纹检测方法的检测精度不高的技术问题。
第一方面,本申请实施例提供一种皱纹检测方法,通过旋转人脸图像中需要检测皱纹的区域得到多个待检测图像,在每个不同角度的待检测图像中分别根据像素点的灰度值从全部像素点中确定皱纹点,此后根据确定的皱纹点从多个待检测图像中确定至少一条皱纹线,在人脸图像中需要检测皱纹的区域显示皱纹线,其中,每条皱纹线指示待检测图像中的一条皱纹,从而可以指示人脸图像的需要检测皱纹的区域中的皱纹。
采用以上方法,可在不同角度的待检测图像中检测皱纹,有助于提高对于不同走向的皱纹进行检测时的检测精度。
一种可能的设计中,可通过以下方式中的任意一种,旋转人脸图像中需要检测皱纹的区域得到多个待检测图像:
方式一、可以将人脸图像中需要检测皱纹的区域,分别按照预设角度集合中的部分或全部预设角度旋转,得到多个待检测图像,其中,预设角度集合包括多个预设角度,每个预设角度的数值不同。
方式二、可以将人脸图像中需要检测皱纹的区域,分别按照预设角度集合中的部分或全部预设角度旋转,得到多个备选图像,之后将多个备选图像,分别按照预设比例集合中的部分或全部预设比例进行缩小,得到多个待检测图像,其中,预设比例集合包括多个预设比例,每个预设比例的数值不同。
一种可能的设计中,在从待检测图像的全部像素点中确定皱纹点时,可设置矩形窗口,之后按设定的滑动步长,控制矩形窗口遍历待检测图像,并在矩形窗口所在的每个窗口位 置,确定位于矩形窗口中心位置的中心像素点,根据矩形窗口中全部像素点的灰度值确定中心像素点的置信度值,得到多个置信度值,此后,将不小于阈值的置信度值所对应的中心像素点,作为皱纹点,其中,置信度值可用于表示中心像素点为皱纹点的可能性。从而可以通过对备选图像进行缩小,提高对于不同粗细的皱纹的检测精度。
一种可能的设计中,若矩形窗口的长、宽均为N个像素,可根据以下公式,确定位于矩形窗口中心位置的中心像素点的置信度值:
Figure PCTCN2018106242-appb-000001
其中,M表示矩形窗口中心位置的中心像素点的置信度值,P ij表示第一矩阵中位于第i行、第j列的元素,Q ij表示第二矩阵中位于第i行、第j列的元素,第一矩阵为预设的N*N的矩阵,第一矩阵中每一行的元素相同,第二矩阵中第i行、第j列的元素,为矩形窗口中第i行、第j列的像素点的灰度值,1≤i≤N,1≤j≤N,N为奇数,且N大于等于3。
一种可能的设计中,第一矩阵的表达式为:
Figure PCTCN2018106242-appb-000002
其中,P为第一矩阵,n 0>n 1;或者
Figure PCTCN2018106242-appb-000003
其中,P为第一矩阵,n 0<n 1;或者
Figure PCTCN2018106242-appb-000004
其中,P为第一矩阵,n u>n u-1,u为整数且1≤u≤x,
Figure PCTCN2018106242-appb-000005
N大于3;或者
Figure PCTCN2018106242-appb-000006
其中,P为第一矩阵,n u<n u-1,u为整数且1≤u≤x,
Figure PCTCN2018106242-appb-000007
N大于3。
一种可能的设计中,阈值为所述多个置信度值的均值,从而将具有不小于阈值的置信度值的中心像素点作为皱纹点,提高皱纹点的检测准确度。
一种可能的设计中,在从多个待检测图像中确定至少一条皱纹线时,可以确定皱纹点中至少两个连续的皱纹点的轮廓线,之后确定轮廓线中的直线段,并将部分或全部直线段作为皱纹线。
一种可能的设计中,确定的皱纹线满足以下条件中的一个或多个:皱纹线的尺寸不小于预设像素尺寸;或者,皱纹线上距离最远的两个像素点之间的连线与水平方向的夹角不大于预设夹角。
一种可能的设计中,在区域中显示至少一条皱纹线时,可以在需要检测皱纹的区域中,显示根据全部待检测图像确定的全部皱纹线。
一种可能的设计中,还可以根据显示的至少一条皱纹线的特征集,确定皱纹评分,并输出皱纹评分,其中,皱纹线的特征集可包括以下特征中的一个或多个皱纹线的长度、皱纹线的宽度、皱纹线上像素点的对比度值、皱纹线的面积占比,其中,对比度值用于表征皱纹线上像素点的对比度,皱纹线的面积占比用于表征皱纹线上的像素数量占待检测图像中全部像素数量的比重。
一种可能的设计中,可根据以下公式确定皱纹评分:
H=A×ω1+B×ω2+C×ω3+D×ω4+ω5;
其中,H为皱纹评分,A为皱纹线的长度,B为皱纹线的宽度,C为皱纹线上像素点的对比度值,D为皱纹线的面积占比,ω1、ω2、ω3以及ω4为小于零的预设参数,ω5为预设参数。
第二方面,本申请实施例提供一种电子设备,用于实现上述第一方面或第一方面中的任意一种方法,包括相应的功能模块,分别用于实现以上方法中的步骤。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现,或通过软件、硬件相结合的方式实现。硬件或软件可包括一个或多个与上述功能相对应的模块。
本申请实施例提供的一种电子设备,包括处理器、存储器和显示屏;其中处理器与存储器和显示屏相耦合;其中,存储器用于存储程序指令;处理器用于读取存储器中存储的程序指令,结合显示屏,以实现本申请实施例第一方面及其任一可能的设计的方法。
第三方面,本申请实施例提供的一种计算机存储介质,该计算机存储介质存储有程序指令,当程序指令在电子设备上运行时,使得电子设备执行本申请实施例第一方面及其任一可能的设计的方法。
第四方面,本申请实施例提供的一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备本申请实施例第一方面及其任一可能的设计的方法。
第五方面,本申请实施例提供的一种芯片,所述芯片与电子设备中的存储器耦合,控制电子设备执行本申请实施例第一方面及其任一可能的设计的方法。
另外,第二方面至第五方面所带来的技术效果可参见上述第一方面的描述,此处不再赘述。
需要说明的是,本申请实施例中“耦合”是指两个部件彼此直接或间接地结合。
附图说明
图1为本申请实施例适用的一种电子设备的结构示意图;
图2A为本申请实施例适用的一种用户界面的示意图;
图2B为本申请实施例提供的另一种用户界面的示意图;
图3为本申请实施例提供的一种皱纹检测方法的流程示意图;
图4为本申请实施例提供的人脸图像中需要检测皱纹的区域的位置示意图;
图5为本申请实施例提供的一种需要检测皱纹的区域的示意图;
图6为本申请实施例提供的一种旋转需要检测皱纹的区域的效果示意图;
图7为本申请实施例提供的一种缩小需要检测皱纹的区域的效果示意图;
图8为本申请实施例提供的一种检测缩小的需要检测皱纹的区域中皱纹线的效果示意图;
图9为本申请实施例提供的一种矩形窗口的示意图;
图10为本申请实施例提供的一种根据皱纹点的轮廓线确定皱纹线的示意图;
图11为本申请实施例提供的一种皱纹线的示意图;
图12为本申请实施例提供的一种皱纹线融合的示意图;
图13为本申请实施例提供的另一种皱纹线融合的示意图;
图14为本申请实施例提供的眼下区域皱纹及对应的皱纹评分的示意图;
图15为本申请实施例提供的额头区域皱纹及对应的皱纹评分的示意图;
图16为本申请实施例提供的另一种皱纹检测方法的流程示意图;
图17为本申请实施例提供的一种皱纹检测结果报告页面的示意图;
图18为本申请实施例提供的另一种电子设备的结构示意图。
具体实施方式
应理解,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a、b和c,其中a、b、c可以是单个,也可以是多个。
本申请公开的各个实施例可以应用于电子设备中。在本申请一些实施例中,电子设备可以是包含诸如个人数字助理和/或音乐播放器等功能的便携式电子设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴设备(如智能手表)、车载设备等。便携式电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2018106242-appb-000008
或者其它操作系统的便携式电子设备。上述便携式电子设备也可以是诸如具有触敏表面(例如触控面板)的膝上型计算机(Laptop)等。还应当理解的是,在本申请其他一些实施例中,上述电子设备也可以是具有触敏表面(例如触控面板)的台式计算机。
图1示出了一种电子设备100的结构示意图。
电子设备100可以包括处理器110、外部存储器接口120、内部存储器121、通用串行总线(universal serial bus,USB)接口130、充电管理模块140、电源管理模块141、电池142、天线2、无线通信模块160、音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、传感器模块180、按键190、马达191、指示器192、摄像头193、以及显示屏194等。其中传感器模块180包括环境光传感器180L。此外,传感器模块180还可以包括压力传感器180A、陀螺仪传感器180B、气压传感器180C、磁传感器180D、加速度 传感器180E、距离传感器180F、接近光传感器180G、指纹传感器180H、温度传感器180J、触摸传感器180K、骨传导传感器180M等。在另一些实施例中,本申请实施例中的电子设备100还可以包括天线1、移动通信模块150、以及用户标识模块(subscriber identification module,SIM)卡接口195等。
处理器110可以包括一个或多个处理单元。例如:处理器110可以包括应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、存储器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
在一些实施例中,处理器110中还可以设置存储器,用于存储指令和数据。示例的,处理器110中的存储器可以为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在另一些实施例中,处理器110还可以包括一个或多个接口。例如,接口可以为通用串行总线(universal serial bus,USB)接口130。又例如,接口还可以为集成电路(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)接口等。可以理解的是,本申请实施例可以通过接口连接电子设备100的不同模块,从而使得电子设备100能够实现不同的功能。例如拍照、处理等。需要说明的是,本申请实施例对电子设备100中接口的连接方式不作限定。
其中,USB接口130是符合USB标准规范的接口。例如,USB接口130可以包括Mini USB接口、Micro USB接口、USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110、内部存储器121、外部存储器、显示屏194、摄像头193和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电、阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器、开关、功率放大器、低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波、放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A、受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络)、蓝牙(bluetooth,BT)、全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波信号,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址接入(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、时分码分多址(time-division code division multiple access,TD-SCDMA)、长期演进(long term evolution,LTE)、BT、GNSS、WLAN、NFC、FM、和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS)、全球导航卫星系统(global navigation satellite system,GLONASS)、北斗卫星导航系统(beidou navigation satellite system,BDS)、准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU、显示屏194、以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像、视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、Miniled、MicroLed、Micro-oLed、量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点、亮度、肤色进行算法优化。ISP还可以对拍摄场景的曝光、色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3、MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别、人脸识别、语音识别、文本理解等。
外部存储器接口120可以用于连接外部存储卡(例如,Micro SD卡),实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐、视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据、电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170、扬声器170A、受话器170B、麦克风170C、耳 机接口170D以及应用处理器等实现音频功能。例如音乐播放、录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐、或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个、四个或更多麦克风170C,实现声音信号采集、降噪、还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口、美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口等。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190可以包括开机键、音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动 反馈。例如,作用于不同应用(例如拍照、音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒、接收信息、闹钟、游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态、电量变化,也可以用于指示消息、未接来电、通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件、软件或软件和硬件的组合实现。
下面以电子设备100为例对本申请实施例进行详细说明。
另外,应理解,本申请实施例中电子设备支持的应用程序可以包括拍照类的应用,例如相机。此外,电子设备支持的应用程序还可以包括其他多种应用,例如:绘图、游戏、电话、视频播放器、音乐播放器、照片管理、浏览器、日历、时钟等。
本申请实施例中的电子设备支持的应用又可以包括用于皮肤检测的应用。其中,用于皮肤检测的应用是通过对拍摄的人脸图像来检测用户面部皮肤的特征(例如面部皮肤的皱纹、毛孔、黑头、色斑、红区等),并可以为用户提供检测结果报告。例如,检测结果报告可以但不限于包括针对面部皮肤上各个特征的打分、对面部皮肤的综合分析等,还可以进而展示用户的人脸图片,并根据对各个特征的检测结果在人脸图像上分别标示出相应的问题,比如在鼻头区域标示有黑头,在额头区域标示有皱纹,在脸颊区域标示有色斑等等。可以理解的是,检测结果报告可以通过用户界面呈现给用户,例如,检测结果报告可以如图2A所示的用户界面200,包括综合得分、肤龄、以及毛孔、黑头、细纹、色斑以及红区的得分。在另一些实施例中,用户界面200上还可以包括虚拟按钮201、虚拟按钮202、虚拟按钮203、虚拟按钮204和虚拟按钮205,其中以虚拟按钮201为例,电子设备100响应于对虚拟按钮201的操作,在显示屏194上显示针对毛孔的具体护理建议。虚拟按钮202、虚拟按钮203、虚拟按钮204和虚拟按钮205的功能可参见虚拟按钮201的功能,在此不再赘述。
为了使得电子设备对用户面部皮肤的检测更加准确,示例的,本申请实施例的用户皮肤检测方案,可以在处理器110中集成拍摄条件检测模块、图像质量检测模块、感兴趣区域(region of interest,ROI)检测模块、皮肤特征检测模块、结果分析模块等。在一些实施例中,可以在处理器110中的应用处理器上集成拍摄条件检测模块、图像质量检测模块、感兴趣区域(region of interest,ROI)检测模块、皮肤特征检测模块、结果分析模块等等。在另一些实施例中,在处理器110中集成人工智能(artificial intelligence,AI)芯片,在AI 芯片上集成拍摄条件检测模块、图像质量检测模块、感兴趣区域(region of interest,ROI)检测模块、皮肤特征检测模块、结果分析模块等,来实现用户皮肤检测。
其中,拍摄条件检测模块可以实现对当前拍摄条件进行检测,以指导用户在要求的拍摄条件下进行拍摄,确保拍摄图像满足要求,从而保证基于图像对皮肤检测的准确性。例如,要求的拍摄条件包括:环境光照充足、人脸与电子设备之间的距离合适(例如25cm左右)、面部端正、睁眼闭眼、不佩戴眼镜、前额尽量无刘海遮挡、对焦准确、无明显抖动等。
当拍摄条件检测模块检测成功后,处理器110会启动智能补光。例如,当拍摄条件检测模块在当前拍摄条件满足要求时,确定检测成功。具体的,本申请实施例中电子设备可以采用不同的补光模式(例如闪光灯模式,手电筒模式)对用户的面部进行补光,以满足不同面部皮肤特征检测的要求。在对用户的面部补光后,处理器110就可以控制摄像头193对用户面部进行拍摄得到用户面部的人脸图像。
图像质量检测模块可以对人脸图像的质量进行检测,以确保拍摄的图像满足不同面部皮肤特征检测的要求。
ROI检测模块可以在图像质量检测模块检测到图像的质量满足要求后,从人脸图像中确定待检测的ROI,例如黑头的ROI是鼻头上的一小块区域。
皮肤特征检测模块可以分别对已经确定出的ROI中的面部皮肤特征进行检测,例如检测皮肤中的皱纹、毛孔、黑头、色斑、红区、出油程度等。
结果分析模块可以对皮肤特征检测模块检测得到的面部皮肤特征的检测结果进行分析,并针对各个皮肤特征给出各个检测项的打分、打分排序等。
另外,在一些实施例中,处理器110中还可以集成图像预处理模块。其中,图像预处理模块可以对拍摄到的人脸图像进行压缩、剪裁等,以便ROI检测模块、皮肤特征检测模块等进行后续处理。
为了输出人脸图像分析结果,或输出各个检测项的打分等,处理器110还可以将检测得到的检测报告(包含各个特征的检测结果在人脸图像上的区域,比如在鼻头区域标示有黑头,在额头区域标示有皱纹,在脸颊区域标示有色斑等等,各个检测项的打分等)显示在显示屏194上,供用户进行查看,提高用户体验。
综上,为了提高皱纹检测中的准确度,本申请实施例提供一种检测皱纹的方法,该方法可以由电子设备100对人脸图像中需要检测皱纹的区域进行旋转,得到多个待检测图像,之后分别检测不同待检测图像中的皱纹,由于不同的待检测图像的旋转角度不同,从而对多个待检测图像分别进行皱纹检测,可提高不同走向皱纹的检测准确度。
上述本申请实施例提供的皱纹检测方法可应用于电子设备100所支持的用于皮肤检测的应用程序。例如,如图2B所示,电子设备100的显示屏194显示测肤应用的图标206。电子设备100检测到对图标206的操作(如,电子设备检测到用户点击图标206),则响应于对图标206的操作,在显示屏194显示测肤应用的用户界面208。其中测肤应用的用户界面710包括虚拟按钮209(在实施中,虚拟按钮可命名为“测试”或“拍照”等等)。电子设备100检测到对虚拟按钮209的操作(如,电子设备检测到用户点击虚拟按钮209),则响应于对虚拟按钮209的操作,根据本申请实施例提供的皱纹检测方法,对人脸图像中需要检测皱纹的区域进行皱纹检测。
其中,人脸图像,可由电子设备100响应于对虚拟按钮209的操作,通过摄像头193 拍摄使用电子设备100的用户面部得到,这里的摄像头193,可以是电子设备100的前置摄像头,或者,为了提高拍照的质量,在前置摄像头的像素低于后置摄像头的像素的情况下,摄像头193也可以是电子设备100的后置摄像头。或者,人脸图像也可以是电子设备100响应于对虚拟按钮209的操作,从内部存储器121或通过外部存储器接口120从外部存储器中读取的图像,此时人脸图像可以是事先拍摄并存储于内部存储器121或外部存储器中的人脸图像。
例如,人脸图像可以是电子设备通过摄像头193(这里的摄像头193可以是前置摄像头或者后置摄像头)拍摄用户面部得到的图像,在拍照后,电子设备100将得到的人脸图像存储于内部存储器121中,在电子设备100检测到对虚拟按钮209的操作后,电子设备100可从内部存储器121中读取该人脸图像。另外在实施中,内部存储器121存储的人脸图像,也可以是电子设备100通过移动通信模块150和/或无线通信模块1160接收的图像。
进一步的,电子设备100检测到对虚拟按钮209的操作后,还可以由用户选择电子设备100通过摄像头193进行拍摄以获取人脸图像,还是由电子设备100从内部存储器121或外部存储器中读取人脸图像。例如,电子设备100检测到对虚拟按钮209的操作后,显示屏194显示照片选择区域212,其中,照片选择区域212可包括“如何选择照片”、“从哪里获取照片”等提示信息,用于提醒用户选择人脸图像的来源,照片选择区域212还可包括多个虚拟按键,用于通过用户对虚拟按键的操作,执行虚拟按键对应的操作以通过不同途径获取人脸图像,例如,虚拟按键可以是表示通过拍摄的方式获取人脸图像的第一按键213(第一按键213的名称可以是“拍摄”、“拍照”等等),或者,虚拟按键可以是表示通过从存储器中读取的方式获取人脸图像的第二按键214(第二按键214的名称可以是“存储”、“相册”等等)。电子设备100在检测到用户对第一按键213的操作后,可响应于用户对第一按键213的操作,通过摄像头193拍摄用户面部图像,作为人脸图像;电子设备100在检测到用户对第二按键214的操作后,可继续提示用户选择人脸图像的存储路径,并从用户选择的存储路径读取用户选择的图像作为人脸图像。其中,存储路径可以是电子设备100的“相册”的默认存储路径;存储路径可以包括内部存储器121的存储路径,也可以外部存储的存储路径。另外应理解,以上照片选择区域212的显示,也可通过电子设备100检测到对于虚拟按钮209的操作以外的方式触发,例如,可以在用户界面208设置新的功能虚拟按键,用于电子设备100检测到对于新的功能虚拟按键的操作后,显示照片选择区域212。
采用以上方法获取用户的人脸图像后,显示屏194可显示人脸图像预览界面210,并在人脸图像预览界面210的预览区域211显示人脸图像,电子设备100可以根据预览区域211中的人脸图像确定皱纹检测的ROI,并将其作为人脸图像中需要检测皱纹的区域,用于通过本申请实施例提供的皱纹检测方法,进行皱纹的检测。
接下来详细描述基于上述不同方式获取的图像,电子设备100中的处理器110如何具体实现对人脸图像进行皱纹检测,具体请参见图3所示,可包括以下步骤:
S101:处理器110旋转上述获取的人脸图像中需要检测皱纹的区域,得到多个待检测图像;
S102:处理器110根据每个待检测图像中像素点的灰度值,从每个待检测图像的全部像素点中确定皱纹点;
S103:处理器110根据皱纹点,从多个待检测图像中确定至少一条皱纹线,每条皱纹 线用于表示待检测图像中的一条皱纹;
S104:处理器110在显示屏194显示检测的人脸图像,并在人脸图像的相应区域中显示至少一条皱纹线,具体如下述图17所示,下述描述到图17时将详细阐述。
应理解,以上S101、S102以及S103所示步骤,可以由电子设备100的处理器110执行内部存储器121中的程序代码予以实现。
应理解,本申请实施例所涉及的需要检测皱纹的区域,可以是面部常见皱纹的区域,举例来说,可以将如图4所示人脸图像中以下区域中的至少一个区域作为需要检测皱纹的区域:额头区域401、眼下区域402、眼角区域403、鼻翼向下延伸的区域404或者眉心区域405等等。
一种实现方式中,可以根据感兴趣区域检测功能确定人脸图像中皱纹的ROI,并将皱纹的ROI作为需要检测皱纹的区域。具体来说,可通过图像压缩和剪裁,从人脸图像中额头区域401、眼下区域402、眼角区域403、鼻翼向下延伸的区域404或者眉心区域405中的至少一个区域,提取皱纹的ROI作为需要检测皱纹的区域。示例性的,可根据图4所示眼下区域402,提取如图5中编号(a)所示的皱纹的ROI作为需要检测皱纹的区域;也可以根据图4所示额头区域401,提取如图5中编号(b)所示的皱纹的ROI作为需要检测皱纹的区域。
S101所示步骤中涉及的待检测图像,可以是指正常色彩的人脸图像进行旋转后得到的正常色彩的图像,则在S102所示步骤中,处理器110可以对待检测图像进行色彩处理,以确定待检测图像中的像素点的灰度值;待检测图像也可以是正常色彩的人脸图像进行旋转并进行色彩处理后得到的灰度图像,灰度图像中每个像素点可由灰度值表示,则在S102所示步骤中,处理器110可直接根据灰度图像确定各像素点的灰度值。
在S101所示步骤的实施中,处理器110旋转人脸图像中需要检测皱纹的区域得到多个待检测图像的方式可以有多种,下面举例几种可行的方式予以说明:
方式一、按照预设角度集合中的部分或全部预设角度旋转需要检测皱纹的区域,得到多个待检测图像。
具体来说,可将所述人脸图像中需要检测皱纹的区域,分别按照预设角度集合中的部分或全部预设角度进行旋转,将旋转得到的多个图像作为待检测图像,其中,预设角度集合可以包括多个预设角度,任意两个预设角度的数值可以不同。应理解,预设角度,可表示表示需要检测皱纹的区域实际旋转的角度,其中,预设角度的取值可以在[-180,180]°(度)之间,例如,预设角度可以是90°;预设角度的取值,也可以不在[-180,180]°之间,例如,预设角度为270°,表示需要检测皱纹的区域实际旋转了270°。
在实施中,还可通过预设角度集合中预设角度的数值的符号的正、负,表示旋转需要检测皱纹的区域时的旋转方向,例如,可通过如下方式表示旋转需要检测皱纹的区域时的旋转方向:若预设角度的数值符号为正,可表示将需要检测皱纹的区域进行顺时针旋转,若预设角度数值为负,可表示将需要检测皱纹的区域进行顺时针旋转;或者,本申请实施例中也不排除采用如下方式表示旋转需要检测皱纹的区域时的旋转方向,若预设角度集合中预设角度的数值为负,可表示将需要检测皱纹的区域进行顺时针旋转,若预设角度数值为正,可表示将需要检测皱纹的区域进行顺时针旋转。
示例性的,提取的需要检测皱纹的区域为如图5中编号(a)所示的区域,若预设角度集合包括三个预设角度:30°、60°以及90°,从而在S101所示步骤的实施中,可以对 如图5中编号(a)所示的区域按照30°进行旋转,得到如图6中编号(a)所示的图像,对如图5中编号(a)所示的区域按照60°进行旋转,得到如图6中编号(b)所示的图像,以及对如图5中编号(a)所示的区域按照90°进行旋转,得到如图6中编号(c)所示的图像,从而图6中编号(a)、编号(b)以及编号(c)所示图像为待检测图像。另外在实施中,还可将预设角度设为0°。
另外,还可根据需要检测皱纹的区域在人脸图像中的位置,设定预设角度集合中的预设角度,例如,由于额头区域皱纹分布方向多为水平方向和竖直方向,针对如图5中编号(b)所示额头区域检测皱纹时的预设角度集合中的预设角度可包括0°以及90°,即待检测图像包括待检测图像(可视为将需要检测皱纹的区域按照0°旋转后的图像)以及将需要检测皱纹的区域旋转90°(顺时针旋转90°或者逆时针旋转90°)后的图像。
方式二、按照预设角度集合中的部分或全部预设角度旋转需要检测皱纹的区域,并分别按照预设比例集合中的部分或全部预设比例进行缩小,得到多个待检测图像。
具体来说,可将人脸图像中需要检测皱纹的区域,分别按照预设角度集合中的部分或全部预设角度旋转,得到多个备选图像,这里预设角度集合以及预设角度的设置方式,可以参照以上方式一的实施;此后,可将多个备选图像,分别按照预设比例集合中的部分或全部预设比例进行缩小,得到多个待检测图像,其中,待检测图像,可以包括备选图像,预设比例集合包括多个预设比例,每个预设比例的数值不同,预设比例可表示缩小前备选图像的尺寸与缩小后得到的待检测图像的尺寸之间的比例关系,例如,预设比例可以是小于等于1的值。应理解,这里所指缩小,可以是指在不改变图像的长宽比例的情况下对图像进行等比缩小。
示例性的,可将旋转需要检测皱纹的区域后得到的每个备选图像,分别按照预设比例集合中的部分或全部预设比例进行缩小,得到多个待检测图像。举例来说,若根据预设角度集合中的预设角度旋转需要检测皱纹的区域后,得到的备选图像之一为图7中编号(a)所示图像,假设预设比例集合中的预设比例为0.5和0.3,此时,可对编号(a)所示图像按照预设比例0.5进行缩小,得到如图7中编号(b)所示图像,以及对编号(a)所示图像按照预设比例0.3进行缩小,得到如图7中编号(c)所示图像,从而可将如图7中编号(b)、编号(c)所示图像作为待检测图像;另外在实施中,还可将图7中编号(a)所示备选图像,作为待检测图像。
在实施中,根据设角度集合中的预设角度旋转需要检测皱纹的区域后,得到的备选图像可以为多个,例如,备选图像可以为如图6中编号(a)、编号(b)以及编号(c)所示图像,则可根据预设比例0.5和0.3,对如图6中编号(a)所示图像进行旋转,得到两个图像,对如图6中编号(b)所示图像进行旋转,得到两个图像,以及对如图6中编号(c)所示图像进行旋转,得到两个图像,将图6中编号(a)、编号(b)以及编号(c)所示图像,以及旋转编号(a)、编号(b)以及编号(c)所示图像得到的多个图像作为待检测图像。
由于灰度图像中皱纹所在区域相比非皱纹区域的灰度值更低(即皱纹区域色彩更暗),但在按照大于1的预设比例放大后,灰度图像中明暗区域的对比没有放大前明显,尤其是对于较粗的皱纹,皱纹所在区域内像素点的灰度值差别不大,从而放大后的灰度图像中更难准确检测皱纹点,因此为了提高皱纹检测的准确性,可在按照小于1的比例进行缩小后的灰度图像中检测皱纹,例如在如图8中编号(a)所示的灰度图像,为编号(b)所示灰 度图像的部分区域放大后得到的灰度图像,可见在编号(a)所示灰度图像中,明暗区域的对比不明显,很难根据该灰度图像确定皱纹点所在位置,而编号(b)所示灰度图像中的明暗区域的对比更加明显,因此根据编号(b)所示图像(相当于编号(a)所示灰度图像按照小于1的预设比例进行缩小后得到的灰度图像)更容易确定皱纹点所在位置,其中,在图7中编号(c)所示图像中的深色线条表示编号(b)所示图像中皱纹所在位置。
采用以上方式二,可根据缩小备选图像所得到的待检测图像,对需要检测皱纹的区域中的皱纹进行检测,由于待检测图像将备选图像按照小于1的比例进行缩小,可使得图像中明暗区域对比更加明显,因此可以更加准确地确定待检测图像中的皱纹点,从而能够更为准确的检测不同粗细的皱纹。
一种实现方式中,处理器110可根据以下方法确定皱纹点:设置矩形窗口,并按照设定的滑动步长控制矩形窗口遍历待检测图像,其中,可在矩形窗口所在的每一个窗口位置,确定位于矩形窗口中心位置的中心像素点,以及根据矩形窗口中全部像素点的灰度值确定中心像素点的置信度值,从而得到多个置信度值,将不小于阈值的置信度值所对应的中心像素点,作为皱纹点,其中,置信度值可用于表示中心像素点为皱纹点的可能性。在实施中,滑动步长可设置为一个像素,即,每次控制矩形窗口沿水平方向或竖直方向移动一个像素点,以遍历待检测图像并确定待检测图像中全部像素点对应的置信度值。
具体的,矩形窗口可以设置为由N*N个像素组成的正方形,其中,N为大于1的奇数,例如N取3,或者N取5,从而矩形窗口的行数、列数均为N。如图9所示,可将设置的矩形窗口901遍历待检测图像900,并确定矩形窗口901所在的每一个窗口位置时矩形窗口901的中心像素点的置信度值。
步骤S102所涉及的阈值,可以是预设值,如0或者400。应理解,所述阈值越小,根据以上方法确定出的皱纹点数量越多,即阈值越小,皱纹检测的灵敏度越高。但如果阈值过小,确定出的皱纹点可能会位于如图9所示待检测图像900中的黑色区域902(黑色区域中像素点的灰度值一般为0),此时该皱纹点无法用于指示皱纹位置,因此,可将遍历待检测图像后所确定的多个窗口位置的中心像素点的置信度值的均值,作为阈值,或者将确定的多个窗口位置的中心像素点的非零的置信度值的均值,作为阈值,以提高皱纹检测准确度。可以理解,提高阈值的取值可以提高选取的皱纹点与周围的像素点之间的灰度值差异,从而提高皱纹点检测的准确度。
在一种可能的设计中,若矩形窗口的长、宽均为N个像素,电子设备100可根据以下公式(1)确定中心像素点的置信度值:
Figure PCTCN2018106242-appb-000009
其中,M表示矩形窗口中心位置的中心像素点的置信度值,P ij表示第一矩阵中位于第i行、第j列的元素,Q ij表示第二矩阵中位于第i行、第j列的元素,第一矩阵为预设的N*N的矩阵,第一矩阵中每一行的元素相同,第二矩阵中第i行、第j列的元素,为矩形窗口中第i行、第j列的像素点的灰度值,1≤i≤N,1≤j≤N,N为奇数,且N大于等于3。
具体的,第二矩阵中的元素可由矩形窗口中全部像素的灰度值构成,举例来说,若矩形窗口为由N*N个像素组成的正方形,则第二矩阵可以为N*N矩阵,其中,第二矩阵中每一个像素位置的取值可以是第二矩阵中对应位置的灰度值,如,第二矩阵中Q 11的取值,可以是矩形窗口中第1行第1列像素点的灰度值。
另外,第一矩阵的行数N、列数N,可以与矩形窗口的像素行数N、列数N相同,例如,矩形窗口的尺寸为3*3个像素,第一矩阵为3*3的矩阵。
示例性的,若N=3,则第一矩阵P可以具有如下表达式:
Figure PCTCN2018106242-appb-000010
式(2)中,n 0>n 1;或者,n 0<n 1
若N=5,第一矩阵P还可以具有如式(3)所示的表达式:
Figure PCTCN2018106242-appb-000011
式(3)中,n u>n u-1,u为整数且1≤u≤x,
Figure PCTCN2018106242-appb-000012
所述N大于3;或者,n u<n u-1,u为整数且1≤u≤x,
Figure PCTCN2018106242-appb-000013
所述N大于3。
一种可行的方式中,第一矩阵P可以具有如下表达式:
Figure PCTCN2018106242-appb-000014
下面举例说明本申请实施例中确定矩形窗口中心像素点的置信度值的方式。若矩形窗口901的尺寸为5*5像素,当滑动到某一窗口位置时,矩形窗口901内各像素点的灰度值如表1所示,可见,矩形窗口901在该窗口位置时中心像素点(行数、列数均为3的像素点)的灰度值为110。
Figure PCTCN2018106242-appb-000015
表1-矩形窗口901内各像素点的灰度值统计表
根据表1,可将第二矩阵Q的表达式设置为:
Figure PCTCN2018106242-appb-000016
式(5)中,第二矩阵中的像素(i,j)的取值,为表1所示矩形窗口901内位于第i行第j列的像素点的灰度值。
此后,处理器110可根据式(4)所示的第一矩阵P以及式(5)所示的第二矩阵Q的表达式,通过公式(1)确定矩形窗口901中心像素点的置信度值。
示例性的,采用以上皱纹点检测方法,处理器110确定的如图10中编号(a)所示待检测图像中的皱纹点的位置,可以如图10中编号(b)图像中的白色亮点所示。
进行上述处理后,处理器110可以确定待检测图像中至少两个连续的皱纹点的轮廓线,之后确定轮廓线所包括的直线段,将全部直线段中的部分或全部直线段,作为皱纹线。在实施中,可采用轮廓提取技术提取待检测图像中的轮廓线。
仍以图10为例,处理器110根据S102所示步骤可确定如图10中编号(b)图像中的白色亮点所示的皱纹点,此后,电子设备100可根据皱纹点确定至少一条轮廓线,在轮廓线的基础上,可将轮廓线所包括的全部直线段,作为皱纹线,得到如编号(c)图像中的白色亮线所示的皱纹线。
处理器110确定的皱纹线满足以下预设条件中的一个或多个:
条件一、皱纹线的尺寸不小于预设像素尺寸。这里皱纹线的尺寸,可以由皱纹线的长度表示,其中皱纹线的长度可以是组成该皱纹线的直线段的长度(其中,直线段的长度单位为像素点的数量),或者,皱纹线的尺寸可以由组成该皱纹线的直线段的像素点的数量表示。处理器110可根据条件一,选择尺寸不小于预设像素尺寸的直线段作为皱纹线,如图11所示,若预设像素尺寸为50像素(每一像素为一个像素点的尺寸),当轮廓线1100上的A、B两像素点之间的直线段1101的像素数量大于或等于50,可以将直线段1101作为皱纹线。应理解,本申请中也可将皱纹线的尺寸大于预设像素尺寸,作为预设条件。
条件二、皱纹线上距离最远的两个像素点之间的连线与水平方向的夹角不大于预设夹角。处理器110可以将满足条件二的直线段作为皱纹线,如图11所示,若预设角度为15°,A、B两像素点之间的直线段1101与水平方向之间的夹角θ不大于15°,则可将直线段1101作为皱纹线。应理解,本申请中也可将皱纹线上距离最远的两个像素点之间的连线与水平方向的夹角小于预设夹角,作为预设条件。
本申请在实施中,处理器110也既可以将以上条件一或条件二作为预设条件,也可以将以上条件一和条件二作为预设条件。
处理器110在确定直线段1101作为皱纹线后,还可以确定并保存直线段1101的信息,由于后续确定皱纹评分,例如,可以确定并保存直线段1101的长度、宽度、面积以及直线段1101上的像素点的对比度值。以上确定直线段1101的信息的过程,处理器110可以调用内部存储器121中的程序代码予以实现,此后,处理器110可以将确定的直线段1101的信息存储于内部存储器121,或通过外部存储器接口120,将信息存储于外部存储器。
其中,直线段1101的宽度可以用像素数量表示,可用于表示直线段1101的平均像素宽度,如图10所示,直线段1101可以是宽度不均匀的直线段,可以将直线段1101的平均 像素宽度作为直线段1101的宽度,例如,直线段1101长度为60像素,其中,宽度为1(像素)的直线段1101的长度为30像素,宽度为2的直线段1101的长度为20像素,宽度为3的直线段1101的长度为10像素,可知直线段1101的平均像素宽度为2像素((1*30+2*20+3*10)/60),从而可以将2作为直线段1101的宽度。
直线段1101的面积,可以由组成该皱纹线的直线段的像素点的数量表示,单位为像素数量。
直线段1101上的像素点的对比度值,可用于表示直线段1101上像素点的对比度(contrast ratio)。在实施中,可将直线段1101上像素点的对比度的平均值作为直线段1101上的像素点的对比度值。
处理器110可将确定的至少一条皱纹线,在需要检测皱纹的区域中进行显示,以在需要检测皱纹的区域中指示出皱纹所在位置。示例性的,若待检测图像数量为两个或两个以上,可以将全部待检测图像中确定出的皱纹线,融合到需要检测皱纹的区域中进行显示。应理解,这里的“融合”,是指将多个图像中的皱纹线,合并到同一图像中,或者是指将图像中的皱纹线融合到另一图像中,其中融合前后,皱纹线在图像中所处的位置不变。
一种可行的实施方式中,若待检测图像为旋转需要检测皱纹的区域后得到的,在融合皱纹线前,还需要对待检测图像对应的皱纹线(即根据待检测图像确定的皱纹线)进行反方向的旋转,例如,将需要检测皱纹的区域进行顺时针30°旋转后得到待检测图像,则在融合皱纹线的过程中,需要将根据该待检测图像确定的皱纹线,逆时针旋转30°,之后将皱纹线和其他待检测图像对应的皱纹线(若其他待检测图像经过旋转,需要对其他待检测图像进行反方向旋转)进行融合。
另外一种可行的实施方式中,若对需要检测皱纹的区域进行旋转后得到备选图像,在对备选图像进行缩小后得到待检测图像,则在融合皱纹线前,还可以对待检测图像对应的皱纹线进行放大,其中进行放大时的放大比例为对备选图像进行缩小时依据的预设比例分之一(如,进行缩小时依据的预设比例为n,则按照1/n的比例进行放大)。例如,将备选图像按照0.5的预设比例进行缩小后得到待检测图像,则在融合皱纹线前,可按照1/0.5的比例将待检测图像对应的皱纹线进行2倍放大,之后将皱纹线和其他待检测图像对应的皱纹线(若其他待检测图像进行过缩小,需要对其他待检测图像进行等比例放大)进行融合。
举例来说,若在S101所示步骤中确定的待检测图像为如图7中编号(a)、编号(b)以及编号(c)所示图像,其中,如图7中编号(a)所示图像可视为根据备选图像(备选图像即如图7中编号(a)所示图像)按照预设比例1进行缩小得到的,图7中编号(b)所示图像为根据备选图像按照预设比例0.5进行缩小得到的,图7中编号(c)所示图像为根据备选图像按照预设比例0.3进行缩小得到的,根据如图7中编号(a)所示图像确定的皱纹线进行1倍放大后的皱纹线如图12中编号(a)图像中的白色亮线所示,根据如图7中编号(b)所示图像确定的皱纹线进行1/0.5倍放大后的图像如图12中编号(b)图像中的白色亮线所示,根据如图7中编号(c)所示图像确定的皱纹线进行1/0.3倍放大后的图像如图12中编号(c)图像中的白色亮线所示,在融合皱纹线时,可以将如图12中编号(a)图像、编号(b)图像以及编号(c)图像中的白色亮线,融合得到如图12中编号(d)所示的图像,其中白色亮线用于表示如图7中编号(a)所示备选图像对应的皱纹线(备选图像对应的皱纹线,即根据备选图像确定的全部待检测图像确定的皱纹线,融合至同一图像得到的皱纹线)。
在上例中,若如图7中编号(a)图像所示的备选图像,是将如图5中编号(a)图像所示的需要检测皱纹的区域顺时针旋转90°后的到的,可以对如图12中编号(d)图像中白色亮线所示的皱纹线逆时针旋转90°,此后与其他的备选图像对应的皱纹线进行融合,得到如图5中编号(a)图像所示的需要检测皱纹的区域对应的皱纹线(需要检测皱纹的区域对应的皱纹线,即根据需要检测皱纹的区域确定的全部待检测图像对应的全部皱纹线,融合至同一图像得到的皱纹线)。例如,对如图12中编号(d)图像所示的白色亮线逆时针旋转90°后,可得到如图13中编号(a)图像中的白色亮线,图13中编号(b)图像中白色亮线,可表示逆时针旋转60°后的根据如图6中编号(b)所示的备选图像对应的皱纹线,以及,图13中编号(c)图像中白色亮线,可表示逆时针旋转30°后的根据如图6中编号(c)所示的备选图像对应的皱纹线,在S104所示步骤中,可以对如图13中编号(a)图像中的白色亮线、编号(b)图像中的白色亮线以及编号(c)图像中白色亮线进行融合,得到如图13中编号(d)图像中的白色亮线,此后,将编号(d)图像中的白色亮线显示在如图5中编号(a)图像所示的需要检测皱纹的区域中,可得到如图13中编号(e)所示图像,图13中编号(e)所示图像中的白色亮线为需要检测皱纹的区域对应的皱纹线,用于表示需要检测皱纹的区域中的皱纹。
本发明实施还可以根据需要检测皱纹的区域中的皱纹,确定用户人脸图像中的皱纹评分,皱纹评分用于表示用户面部皱纹的严重程度。具体来说,可根据显示的皱纹线的特征集,确定皱纹评分,其中,皱纹线的特征集包括以下特征中的一个或多个:皱纹线的长度、皱纹线的宽度、皱纹线上像素点的对比度值、皱纹线的面积占比。其中,皱纹线的长度可以是指组成皱纹线的直线段的长度;皱纹线的宽度,可以是指组成皱纹线的直线段的宽度;皱纹线上像素点的对比度值,用于表征皱纹线上像素点的对比度,可以由组成皱纹线的直线段上像素点的对比度值表示;皱纹线的面积占比,用于表示皱纹线所围像素区域内的像素数量占待检测图像中全部像素数量的比重,其中,皱纹线的面积占比可以由组成皱纹线的直线段的面积表示。以上确定皱纹评分的信息的过程,处理器110可通过调用内部存储器121中的程序代码予以实现。在输出皱纹评分时,处理器110可以通过显示屏194中显示皱纹评分,例如,可在如图2A所示的用户界面200中显示皱纹评分(如图2A中“细纹78分”所示);或者处理器110可以通过扬声器170A或耳机接口170D播放皱纹评分对应的音频。
示例性的,确定皱纹评分可以符合下述公式要求:
H=A×ω1+B×ω2+C×ω3+D×ω4+ω5;(6)
其中,H为皱纹评分,A为皱纹线的长度,B为皱纹线的宽度,C为皱纹线上像素点的对比度值,D为皱纹线的面积占比,ω1、ω2、ω3以及ω4为小于零的预设参数,ω5为预设参数。在实施中,ω5可以是预设的正整数,例如,ω5的取值可以与皱纹评分的满分相关,如皱纹评分的满分为100分,则ω5取值可以为100。在实施中,还可以将式(6)中取整后的H,作为用户的皱纹评分。
一种可行的方式中,可以对需要检测皱纹的区域中的全部皱纹线的长度进行排序,确定前N(N≥2)长的皱纹线作为目标皱纹线,并将N个目标皱纹线的平均长度,作为上述特征集中的皱纹线的长度,将N个目标皱纹线的平均宽度作为上述特征集中的皱纹线的宽度,将N个目标皱纹线上像素点的对比度值的均值作为特征集中的皱纹线上像素点的对比度值,以及将N个目标皱纹线的面积占比的平均值作为特征集中的皱纹线的面积占比。
示例性的,采用以上方法,对用户眼下区域进行皱纹评分的结果可以参照图14,其中,根据图14中编号为(a1)的眼下区域确定的皱纹线如编号(a2)图像中的白色亮线所示,采用以上方法确定的编号为(a1)的眼下区域对应的皱纹评分为61分;根据编号为(b1)的眼下区域确定的皱纹线如编号(b2)图像中的白色亮线所示,采用以上方法确定的编号为(b1)的眼下区域对应的皱纹评分为75分;根据编号为(c1)的眼下区域确定的皱纹线如编号(c2)图像中的白色亮线所示,采用以上方法确定的编号为(c1)的眼下区域对应的皱纹评分为86分;根据编号为(d1)的眼下区域确定的皱纹线如编号(d2)图像中的白色亮线所示,采用以上方法确定的编号为(d1)的眼下区域对应的皱纹评分为91分。
采用以上方法,对用户额头区域进行皱纹评分的结果可以参照图15,其中,根据图15中编号为(e1)的额头区域确定的皱纹线如编号(e2)图像中的白色亮线所示,采用以上方法确定的编号为(e1)的额头区域对应的皱纹评分为61分;根据图15中编号为(f1)的额头区域确定的皱纹线如编号(f2)图像中的白色亮线所示,采用以上方法确定的编号为(f1)的额头区域对应的皱纹评分为82分;根据图15中编号为(g1)的额头区域确定的皱纹线如编号(g2)图像中的白色亮线所示,采用以上方法确定的编号为(g1)的额头区域对应的皱纹评分为94分。
一种可能的实现方式中,可以将全部需要检测皱纹的区域的皱纹评分的均值进行取整(如向上取整),将取整后的数值作为用户皱纹评分的总得分,例如,用户额头区域评分为94分,用户的眼下区域评分为91分,可以将93分作为用户皱纹评分的总分。
结合图16所示,具体详述皱纹评分的具体实现过程,具体可包括以下步骤:
步骤1601:处理器110根据人脸图像,提取人脸图像中需要检测皱纹的区域;
步骤1602:处理器110分别根据预设角度集合中的多个预设角度,旋转步骤1601中得到的区域,得到多个备选图像;
步骤1603:处理器110针对每一个备选图像,根据预设比例集合中的多个预设比例进行旋转,得到多个待检测图像;
步骤1604:处理器110针对每一个待检测图像,根据待检测图像中像素点的灰度值确定皱纹点;
步骤1605:处理器110针对每一个待检测图像,根据确定的皱纹点确定至少一条皱纹线;
步骤1606:处理器110针对根据同一个备选图像得到的多个待检测图像,将得到的全部皱纹线按照预设比例进行放大,并将放大后的皱纹线融合到备选图像中,得到备选图像所对应的融合后的皱纹线;
步骤1607:处理器110针对每一个备选图像所对应的融合后的皱纹线,根据得到该备选图像所依据的预设角度进行逆向旋转,并将旋转后的皱纹线融合到需要检测皱纹的区域中,得到需要检测皱纹的区域所对应的皱纹线;进而还可在显示屏194中显示需要检测皱纹的区域所对应的皱纹线;
步骤1608:处理器110根据需要检测皱纹的区域所对应的皱纹线,确定皱纹评分,并在显示屏194中显示需要检测皱纹的区域所对应的皱纹评分。
在以上步骤1608的实施中,处理器110可通过显示屏194在如图2A所示的用户界面中显示皱纹评分,如图中“细纹78分”所示。处理器110也可以通过显示屏194显示皱纹检测结果报告,其中,皱纹检测结果报告可以包括但不限于包括皱纹评分、护肤建议、 结果图等等。如图17所示,显示屏194可显示皱纹检测结果报告页面1700,可见,皱纹检测结果报告页面1700可包括皱纹评分、护肤建议、标示有皱纹线的需要检测皱纹的区域,即皱纹检测的结果图。示例性的,该皱纹检测结果报告页面1700,可以是处理器110在确定皱纹评分后显示的,也可以是处理器110在检测到对图2A所示的虚拟按钮203的操作后显示的。
在采用本申请实施例提供的皱纹检测方法,对需要检测皱纹的区域进行皱纹检测后,可以将检测到的皱纹线标示于需要检测皱纹的区域中,以及,可以将标示有皱纹线的需要检测皱纹的区域显示于电子设备100的显示屏194中,例如,可以将标示有皱纹线的需要检测皱纹的区域,显示在如图2所示的用户界面200中,从而可直观地指示皱纹位置。
应理解,上述本申请提供的实施例中,从电子设备作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
基于相同的构思,图18所示为本申请提供的一种电子设备1800。示例的,电子设备1800包括至少一个处理器1801、存储器1802和显示屏1803。其中,处理器1801与存储器1802、显示屏1803耦合,本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。
在实施中,存储器1802可用于存储程序指令,显示屏1803可用于实现电子设备1800的显示功能。处理器1801可用于调用存储器1802中存储的程序、指令时,结合显示屏1803,使得电子设备1800执行图3和/或图16所示的皱纹检测方法中由电子设备所执行的步骤,从而提高拍照的质量。
具体的,存储器1802可具有上述方法实施例中电子设备100的内部存储器121的功能,如存储程序代码、指令,以及存储电子设备100确定的直线段1101的信息。处理器1801可具有上述方法实施例中电子设备100的处理器110的功能,如,处理器1801可调用存储器1802中存储的程序,执行如图3所示方法中S101、S102以及S103所示步骤,或者,执行如图16所示方法中如步骤1601至1608所示步骤。显示屏1803可具有上述方法实施例中电子设备100的显示屏194的功能,如,显示屏1803可用于执行如图3所示方法中S104所示步骤,用于显示步骤1607中确定的显示需要检测皱纹的区域所对应的皱纹线,以及可用于显示皱纹评分。
示例性的,电子设备1800还可以包括扬声器/外部播放器接口1804,扬声器/外部播放器接口1804可具有电子设备100的扬声器170A/耳机接口170D的功能,如,可用于电子设备1800输出皱纹评分。
所属领域的技术人员可以清楚地了解到本申请实施例可以用硬件实现,或固件实现,或它们的组合方式来实现。当使用软件实现时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括RAM、ROM、电可擦可编程只读存储器(electrically erasable programmable read only memory,EEPROM)、只读光盘(compact disc read-Only memory, CD-ROM)或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。此外。任何连接可以适当的成为计算机可读介质。例如,如果软件是使用同轴电缆、光纤光缆、双绞线、数字用户线(digital subscriber line,DSL)或者诸如红外线、无线电和微波之类的无线技术从网站、服务器或者其他远程源传输的,那么同轴电缆、光纤光缆、双绞线、DSL或者诸如红外线、无线和微波之类的无线技术包括在所属介质的定影中。如本申请实施例所使用的,盘(disk)和碟(disc)包括压缩光碟(compact disc,CD)、激光碟、光碟、数字通用光碟(digital video disc,DVD)、软盘和蓝光光碟,其中盘通常磁性的复制数据,而碟则用激光来光学的复制数据。上面的组合也应当包括在计算机可读介质的保护范围之内。
总之,以上所述仅为本申请的实施例而已,并非用于限定本申请的保护范围。凡根据本申请的揭露,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (16)

  1. 一种皱纹检测方法,其特征在于,包括:
    旋转人脸图像中需要检测皱纹的区域,得到多个待检测图像;
    根据每个所述待检测图像中像素点的灰度值,从每个所述待检测图像的全部像素点中确定皱纹点;
    根据所述皱纹点,从所述多个待检测图像中确定至少一条皱纹线,每条所述皱纹线用于表示所述待检测图像中的一条皱纹;
    在所述区域中显示至少一条所述皱纹线。
  2. 如权利要求1所述的方法,其特征在于,所述旋转人脸图像中需要检测皱纹的区域,得到多个待检测图像,包括:
    将所述人脸图像中需要检测皱纹的区域,分别按照预设角度集合中的部分或全部预设角度旋转,得到所述多个待检测图像,所述预设角度集合包括多个预设角度,每个所述预设角度的数值不同。
  3. 如权利要求1所述的方法,其特征在于,所述旋转人脸图像中需要检测皱纹的区域,得到多个待检测图像,包括:
    将所述人脸图像中需要检测皱纹的区域,分别按照预设角度集合中的部分或全部预设角度旋转,得到多个备选图像;将所述多个备选图像,分别按照预设比例集合中的部分或全部预设比例进行缩小,得到所述多个待检测图像,所述预设比例集合包括多个预设比例,每个所述预设比例的数值不同。
  4. 如权利要求1-3任一所述的方法,其特征在于,根据待检测图像中像素点的灰度值,从所述待检测图像的全部像素点中确定皱纹点,包括:
    设置矩形窗口;
    按设定的滑动步长,控制所述矩形窗口遍历所述待检测图像;
    在所述矩形窗口所在的每个窗口位置,确定位于矩形窗口中心位置的中心像素点,并根据所述矩形窗口中全部像素点的灰度值确定所述中心像素点的置信度值,得到多个置信度值,所述置信度值用于表示所述中心像素点为皱纹点的可能性;
    将不小于阈值的置信度值所对应的中心像素点,作为所述皱纹点。
  5. 如权利要求4所述的方法,其特征在于,所述矩形窗口的长、宽均为N个像素;
    所述确定位于矩形窗口中心位置的中心像素点,并根据所述矩形窗口中全部像素点的灰度值确定所述中心像素点的置信度值,包括:
    根据以下公式确定所述位于矩形窗口中心位置的中心像素点的置信度值:
    Figure PCTCN2018106242-appb-100001
    其中,M表示所述矩形窗口中心位置的中心像素点的置信度值,P ij表示第一矩阵中位于第i行、第j列的元素,Q ij表示第二矩阵中位于第i行、第j列的元素,所述第一矩阵为预设的N*N的矩阵,所述第一矩阵中每一行的元素相同,所述第二矩阵中第i行、第j列的元素,为所述矩形窗口中第i行、第j列的像素点的灰度值,1≤i≤N,1≤j≤N,N为奇数,且N大于等于3。
  6. 如权利要求5所述的方法,其特征在于,所述第一矩阵的表达式为:
    Figure PCTCN2018106242-appb-100002
    其中,P为所述第一矩阵,n 0>n 1;或者
    Figure PCTCN2018106242-appb-100003
    其中,P为所述第一矩阵,n 0<n 1;或者
    Figure PCTCN2018106242-appb-100004
    其中,P为所述第一矩阵,n u>n u-1,u为整数且1≤u≤x,
    Figure PCTCN2018106242-appb-100005
    所述N大于3;或者
    Figure PCTCN2018106242-appb-100006
    其中,P为所述第一矩阵,n u<n u-1,u为整数且1≤u≤x,
    Figure PCTCN2018106242-appb-100007
    所述N大于3。
  7. 如权利要求4-6任一所述的方法,其特征在于,所述阈值为所述多个置信度值的均值。
  8. 如权利要求1-7任一所述的方法,其特征在于,所述根据所述皱纹点,从所述多个待检测图像中确定至少一条皱纹线,包括:
    确定所述皱纹点中至少两个连续的皱纹点的轮廓线;
    确定所述轮廓线中的直线段;
    将部分或全部所述直线段作为所述皱纹线。
  9. 如权利要求1-8任一所述的方法,其特征在于,所述皱纹线满足以下条件中的一个或多个:
    所述皱纹线的尺寸不小于预设像素尺寸;
    所述皱纹线上距离最远的两个像素点之间的连线与水平方向的夹角不大于预设夹角。
  10. 如权利要求1-9任一所述的方法,其特征在于,在所述区域中显示至少一条所述皱纹线,包括:
    在所述区域中,显示根据全部所述待检测图像确定的全部皱纹线。
  11. 如权利要求1-10任一所述的方法,其特征在于,该方法还包括:
    根据显示的所述至少一条所述皱纹线的特征集,确定皱纹评分,所述特征集包括以下特征中的一个或多个:所述皱纹线的长度、所述皱纹线的宽度、所述皱纹线上像素点的对比度值、所述皱纹线的面积占比,其中,所述对比度值用于表征所述皱纹线上像素点的对比度,所述皱纹线的面积占比用于表征所述皱纹线上的像素数量占所述待检测图像中全部像素数量的比重;
    输出所述皱纹评分。
  12. 如权利要求11所述的方法,其特征在于,通过如下公式确定所述皱纹评分:
    H=A×ω1+B×ω2+C×ω3+D×ω4+ω5;
    其中,所述H为所述皱纹评分,所述A为所述皱纹线的长度,所述B为所述皱纹线的宽度,所述C为所述皱纹线上像素点的对比度值,所述D为所述皱纹线的面积占比,所述ω1、所述ω2、所述ω3以及所述ω4为小于零的预设参数,所述ω5为预设参数。
  13. 一种电子设备,其特征在于,包括处理器、存储器和显示屏;
    其中所述处理器与所述存储器和所述显示屏相耦合;
    所述存储器,用于存储程序指令;
    所述处理器,用于读取所述存储器中存储的所述程序指令,结合所述显示屏,以实现如权利要求1至12任一所述的方法。
  14. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有程序指令,当所述程序指令在电子设备上运行时,使得所述电子设备执行如权利要求1至12任一所述的方法。
  15. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1至12任一所述的方法。
  16. 一种芯片,其特征在于,所述芯片与电子设备中的存储器耦合,控制所述电子设备执行如权利要求1至12任一所述的方法。
PCT/CN2018/106242 2018-07-16 2018-09-18 一种皱纹检测方法及电子设备 WO2020015149A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP18926958.2A EP3809361B1 (en) 2018-07-16 2018-09-18 Wrinkle detection method and electronic device
CN201880085477.0A CN111566693B (zh) 2018-07-16 2018-09-18 一种皱纹检测方法及电子设备
US17/260,015 US11941804B2 (en) 2018-07-16 2018-09-18 Wrinkle detection method and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810776285.6 2018-07-16
CN201810776285 2018-07-16

Publications (1)

Publication Number Publication Date
WO2020015149A1 true WO2020015149A1 (zh) 2020-01-23

Family

ID=69164982

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106242 WO2020015149A1 (zh) 2018-07-16 2018-09-18 一种皱纹检测方法及电子设备

Country Status (4)

Country Link
US (1) US11941804B2 (zh)
EP (1) EP3809361B1 (zh)
CN (1) CN111566693B (zh)
WO (1) WO2020015149A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353490A (zh) * 2020-02-28 2020-06-30 创新奇智(重庆)科技有限公司 发动机编号牌的质量分析方法、装置、电子设备及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199171B (zh) * 2018-11-19 2022-09-23 荣耀终端有限公司 一种皱纹检测方法和终端设备
CN111767846A (zh) * 2020-06-29 2020-10-13 北京百度网讯科技有限公司 图像识别方法、装置、设备和计算机存储介质
CN113592796A (zh) * 2021-07-19 2021-11-02 深圳数联天下智能科技有限公司 嘴角下垂的检测方法、装置、设备和介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010119431A (ja) * 2008-11-17 2010-06-03 Shiseido Co Ltd シワ評価方法、シワ評価装置、シワ評価プログラム、及び該プログラムが記録された記録媒体
CN101916370A (zh) * 2010-08-31 2010-12-15 上海交通大学 人脸检测中非特征区域图像处理的方法
CN103827916A (zh) * 2011-09-22 2014-05-28 富士胶片株式会社 皱纹检测方法、皱纹检测装置和皱纹检测程序以及皱纹评估方法、皱纹评估装置和皱纹评估程序
CN105310652A (zh) * 2014-06-09 2016-02-10 松下知识产权经营株式会社 皱纹检测装置和皱纹检测方法
CN107158570A (zh) * 2017-05-11 2017-09-15 柳华荣 一种软组织修复系统
CN107330370A (zh) * 2017-06-02 2017-11-07 广州视源电子科技股份有限公司 一种额头皱纹动作检测方法和装置及活体识别方法和系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015232746A (ja) * 2014-06-09 2015-12-24 パナソニックIpマネジメント株式会社 皺検出装置および皺検出方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010119431A (ja) * 2008-11-17 2010-06-03 Shiseido Co Ltd シワ評価方法、シワ評価装置、シワ評価プログラム、及び該プログラムが記録された記録媒体
CN101916370A (zh) * 2010-08-31 2010-12-15 上海交通大学 人脸检测中非特征区域图像处理的方法
CN103827916A (zh) * 2011-09-22 2014-05-28 富士胶片株式会社 皱纹检测方法、皱纹检测装置和皱纹检测程序以及皱纹评估方法、皱纹评估装置和皱纹评估程序
CN105310652A (zh) * 2014-06-09 2016-02-10 松下知识产权经营株式会社 皱纹检测装置和皱纹检测方法
CN107158570A (zh) * 2017-05-11 2017-09-15 柳华荣 一种软组织修复系统
CN107330370A (zh) * 2017-06-02 2017-11-07 广州视源电子科技股份有限公司 一种额头皱纹动作检测方法和装置及活体识别方法和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3809361A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353490A (zh) * 2020-02-28 2020-06-30 创新奇智(重庆)科技有限公司 发动机编号牌的质量分析方法、装置、电子设备及存储介质
CN111353490B (zh) * 2020-02-28 2023-10-31 创新奇智(重庆)科技有限公司 发动机编号牌质量分析方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
US20210327058A1 (en) 2021-10-21
CN111566693B (zh) 2022-05-20
EP3809361A4 (en) 2021-08-11
EP3809361B1 (en) 2023-01-25
EP3809361A1 (en) 2021-04-21
US11941804B2 (en) 2024-03-26
CN111566693A (zh) 2020-08-21

Similar Documents

Publication Publication Date Title
US11798162B2 (en) Skin detection method and electronic device
US11759143B2 (en) Skin detection method and electronic device
KR102548317B1 (ko) 색소 검출 방법 및 전자 장치
CN113810601B (zh) 终端的图像处理方法、装置和终端设备
US11272116B2 (en) Photographing method and electronic device
WO2020015149A1 (zh) 一种皱纹检测方法及电子设备
CN111103922B (zh) 摄像头、电子设备和身份验证方法
CN113542580B (zh) 去除眼镜光斑的方法、装置及电子设备
WO2020015148A1 (zh) 一种色斑检测方法及电子设备
CN111557007B (zh) 一种检测眼睛睁闭状态的方法及电子设备
CN115150543B (zh) 拍摄方法、装置、电子设备及可读存储介质
WO2023071497A1 (zh) 拍摄参数调节方法、电子设备及存储介质

Legal Events

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

Ref document number: 18926958

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018926958

Country of ref document: EP

Effective date: 20210114