WO2024174626A1 - 一种图像抓拍方法及电子设备 - Google Patents

一种图像抓拍方法及电子设备 Download PDF

Info

Publication number
WO2024174626A1
WO2024174626A1 PCT/CN2023/133794 CN2023133794W WO2024174626A1 WO 2024174626 A1 WO2024174626 A1 WO 2024174626A1 CN 2023133794 W CN2023133794 W CN 2023133794W WO 2024174626 A1 WO2024174626 A1 WO 2024174626A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
images
frames
composition
person
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2023/133794
Other languages
English (en)
French (fr)
Inventor
李子怡
杜远超
王文博
朱世宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to US18/870,093 priority Critical patent/US20250338010A1/en
Priority to EP23923789.4A priority patent/EP4510603A4/en
Publication of WO2024174626A1 publication Critical patent/WO2024174626A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/30168Image quality inspection

Definitions

  • the embodiments of the present application relate to the field of image technology, and in particular to an image capture method and electronic equipment.
  • the face or body of the person in the picture can be detected to obtain the face position or body position; when the face position or body position meets the pre-defined photo template, the photo operation is triggered.
  • this method does not take into account the distribution of the person's weight in the picture; at the same time, when there are multiple people in the picture, it does not take into account the positional relationship between the multiple people, which can easily lead to an unbalanced picture.
  • the embodiments of the present application provide an image capture method and an electronic device for screening multiple frames of images to obtain images with higher composition quality.
  • the present application provides an image capture method, which is applied to an electronic device, the electronic device including a camera, and the method including: displaying multiple frames of images captured by the camera in real time; determining the composition index of the corresponding image based on the character information of each frame of the image; wherein the character information includes the number of target persons and one or more of multiple character parameters, the multiple character parameters include the center of mass position of the target person, the area ratio of the target person and the face position of the target person, the composition index includes one or more of the multiple composition parameters, the multiple composition parameters include a distance parameter, an intimacy parameter and a compactness parameter, the distance parameter is used to indicate the degree of match between the image and a preset composition rule, the intimacy parameter is used to indicate the intimacy between at least two target persons in the image, and the compactness parameter is used to indicate the discrete degree of position arrangement between at least three target persons in the image; saving one or more frames of images with the highest composition quality in the multiple frames of images; wherein, the smaller the distance parameter, the smaller the
  • the present application evaluates the composition quality of the image through three quantitative parameters (i.e., distance parameter, intimacy parameter, and compactness parameter) by quantifying the degree of match between the image and the preset composition rules, the intimacy between at least two target persons in the image, and the discreteness of the position arrangement between at least three target persons in the image, and saves one or more frames with the highest composition quality, which can avoid the rigidity of the photo template and give users free space to play. It can not only save time but also help users get high-quality images.
  • three quantitative parameters i.e., distance parameter, intimacy parameter, and compactness parameter
  • the composition index includes a distance parameter, and when the number of people N ⁇ 2, the character information includes the center of mass position of N target characters and the area ratio of the N target characters; the composition index of the corresponding image is determined according to the character information of each frame of the image, including: for each of the N target characters, according to the distance from the center of mass position of the target character to the preset reference position, the corresponding basic distance parameter is obtained; the basic distance parameters corresponding to all target characters are weighted averaged with the area ratio of each target character as the weight to obtain the distance parameter. It can be understood that when there are multiple target characters, weighted averaging with the area ratio of different target characters as the weight can effectively evaluate whether the multiple target characters are close to the reference position. The closer the target character is to the reference position, the higher the composition quality of the image.
  • the preset reference position includes multiple reference positions; according to the distance from the center of mass position of the target person to the preset reference position, a corresponding basic distance parameter is obtained, including: taking the minimum value of the distance from the center of mass position of the target person to the multiple reference positions as the corresponding basic distance parameter; or, the preset reference position includes one reference position; according to the distance from the center of mass position of the target person to the preset reference position, a corresponding basic distance parameter is obtained, including: taking the distance from the center of mass position of the target person to a reference position as the corresponding basic distance parameter.
  • the preset reference position includes: four interest points of the image, two diagonal lines of the image, four trisection lines of the image, or the center point of the image.
  • the preset reference positions of the first composition rule are the four interest points of the image
  • the preset reference positions of the second composition rule are the four trisection lines of the image
  • the preset reference positions of the third composition rule are the two diagonal lines of the image
  • the preset reference positions of the fourth composition rule central composition rule
  • the composition index when the number of people N ⁇ 2, the composition index includes an intimacy parameter, the character information includes the face positions of N target characters, and the composition index of the corresponding image is determined according to the character information of each frame of the image, including: constructing a second-order tree structure with N face positions as nodes and the line connecting any two face positions as edges; wherein the weight of each edge is the distance between the two face positions corresponding to the edge; constructing a minimum spanning tree of the second-order tree structure, the minimum spanning tree includes N-1 edges; and determining the average value of the weights of the N-1 edges as the intimacy parameter.
  • the composition index when the number of people N ⁇ 3, the composition index also includes a compactness parameter, the character information also includes the center of mass positions of N target characters, and the composition index of the corresponding image is determined based on the character information of each frame of the image, and also includes: respectively determining the standard deviation of the N center of mass positions in the first direction and the standard deviation in the second direction; and determining the smaller value of the standard deviation in the first direction and the standard deviation in the second direction as the compactness parameter.
  • the method also includes: comparing composition indicators of any two frames of images in the multiple frames, and eliminating the frame with low composition quality in the any two frames of images; continuing to compare the composition indicators of any two frames of images in the multiple frames after eliminating the frame with low composition quality, until all the multiple frames of images are compared.
  • the composition index includes a distance parameter
  • the distance parameter includes a first distance parameter, a second distance parameter, a third distance parameter and a fourth distance parameter
  • the first distance parameter is used to reflect the degree of matching between the image and the first composition rule
  • the second distance parameter is used to reflect the degree of matching between the image and the second composition rule
  • the third distance parameter is used to reflect the degree of matching between the image and the third composition rule
  • the fourth distance parameter is used to reflect the degree of matching between the image and the fourth composition rule
  • the first composition rule, the second composition rule, the third composition rule and the fourth composition rule include different reference positions
  • comparing the composition index of any two frames of images in the plurality of frames of images includes: when the difference between the first distance parameters of any two frames of images is greater than or equal to a first threshold, comparing the first distance parameters of any two frames of images, wherein the image with a smaller first distance parameter has a higher composition quality; when the difference between the first distance parameters
  • the composition index also includes an intimacy parameter
  • comparing the composition indicators of any two frames of images in multiple frames of images also includes: when the difference between the fourth distance parameters of any two frames of images is less than the fourth threshold, judging whether the difference between the intimacy parameters of any two frames of images is greater than or equal to the fifth threshold; when the difference between the intimacy parameters of any two frames of images is greater than or equal to the fifth threshold, comparing the intimacy parameters of any two frames of images, wherein the image with a smaller intimacy parameter has a higher composition quality.
  • the composition index also includes a compactness parameter
  • comparing the composition indicators of any two frames of images in a plurality of frames of images includes: when the difference in the compactness parameters of any two frames of images is greater than or equal to a sixth threshold, comparing the compactness parameters of any two frames of images, wherein the image with a smaller compactness parameter has a higher composition quality.
  • the target person is each person in the image, or the target person is a person in the image whose area ratio is greater than a preset threshold and whose center of mass position is within a preset area.
  • the method also includes: performing human body detection, face detection and key point detection on multiple frames of images to obtain human body detection results, face detection results and key point detection results respectively; determining the shooting state of each character in the multiple frames of images according to the human body detection results, face detection results and key point detection results; wherein the shooting state includes the motion state of the character and one or more of the following multiple states, and the multiple states include: the center of mass position of the character, the portrait type and the area ratio of the character; saving one or more frames of images with the highest composition quality in the multiple frames of images, including: saving one or more frames of legal images with the highest composition quality in the multiple frames of images; wherein the legal image is an image in which the shooting states of all characters are valid.
  • the key point detection result only includes the key points of the top of the head and the neck key point
  • the portrait type is a close-up of the face
  • the center of mass of the character is the average coordinate point of the top of the head key point and the neck key point.
  • the key point detection results only include the top of the head key point, the neck key point, the shoulder key point and one or more of the following multiple first key points
  • the portrait type is a bust portrait
  • the center of mass position of the character is the average coordinate point of the neck key point and the shoulder key point
  • the multiple first key points include the arm key point and the wrist key point.
  • the portrait type is a seven/ninth-point portrait
  • the center of mass position of the character is the average coordinate point of the top of the head key point, the neck key point, the shoulder key point, the hip joint key point, and the arm key point
  • the multiple second key points include the wrist key point and the knee key point.
  • the key point detection results only include the top of the head key point, the ankle key point and one or more of the following multiple third key points
  • the portrait type is a full-body portrait
  • the center of mass position of the character is the center point position of the character's body frame
  • the multiple third key points include shoulder key points, hip joint key points, arm key points, wrist key points, and knee key points.
  • the portrait type is a partial close-up
  • the center of mass position of the person is the average coordinate point of all key points detected.
  • the human body detection result includes a human body frame of the person, and the area ratio of the person is the ratio of the area of the human body frame to the image area.
  • the face detection result includes a face frame, and the face position is the center point position of the face frame, or the center of mass position of the person's head.
  • the portrait type of the person is not a full-length portrait or a half-length portrait and does not include at least one of the key points of the top of the head, the key points of the neck, the key points of the ankles, and the key points of the wrists, the shooting status of the person is invalid.
  • the portrait type is a bust portrait and the area ratio is greater than the seventh threshold or does not include the top of the head key points and the neck key points, the shooting status of the person is invalid.
  • the present application provides an electronic device, comprising: a memory and a processor; the processor is coupled to the memory; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes a method as in any one of the embodiments of the first aspect.
  • the present application provides a computer-readable storage medium, comprising computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes a method as in any one of the embodiments of the first aspect.
  • the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the method of the first aspect and any possible design thereof.
  • the present application provides a chip system, which includes one or more interface circuits and one or more processors.
  • the interface circuit and the processor are interconnected by a line.
  • the above chip system can be applied to a terminal device including a communication module and a memory.
  • the interface circuit is used to receive a signal from the memory of the terminal device and send a signal to the memory of the terminal device.
  • the processor sends the received signal, which includes the computer instructions stored in the memory.
  • the terminal device can execute the method of the first aspect and any possible design thereof.
  • the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here.
  • FIG1 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG2 is another schematic diagram of an interface provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a group of interfaces provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a group of interfaces provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of a group of interfaces provided in an embodiment of the present application.
  • FIG7A is a flowchart of an image capturing method provided in an embodiment of the present application.
  • FIG7B is a schematic diagram of another interface provided in an embodiment of the present application.
  • FIG8 is a second flow chart of an image capture method provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of a portrait provided in an embodiment of the present application.
  • FIG10 is another schematic diagram of a portrait provided in an embodiment of the present application.
  • FIG11 is a schematic diagram of another portrait provided in an embodiment of the present application.
  • FIG12 is a schematic diagram of another portrait provided in an embodiment of the present application.
  • FIG13A is a third flow chart of an image capture method provided in an embodiment of the present application.
  • FIG13B shows reference positions of the golden triangle composition rule, the rule of thirds composition rule, the diagonal rule, and the center composition rule;
  • FIG14 is a fourth flow chart of an image capture method provided in an embodiment of the present application.
  • FIG15 is a schematic diagram of generating a second-order tree structure provided in an embodiment of the present application.
  • FIG16 is a schematic diagram of a minimum spanning tree provided in an embodiment of the present application.
  • FIG17 is a schematic diagram of another method for generating a second-order tree structure provided in an embodiment of the present application.
  • FIG18 is a flowchart diagram 5 of an image capture method provided in an embodiment of the present application.
  • FIG19 is a sixth flow chart of an image capture method provided in an embodiment of the present application.
  • FIG20 is a schematic diagram of the structure of a chip system provided in an embodiment of the present application.
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
  • the character "/” generally indicates that the associated objects before and after are in a kind of "or" relationship.
  • references to "one embodiment” or “some embodiments” in this specification mean that one embodiment of the present application
  • the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments.
  • the statements “in one embodiment”, “in some embodiments”, “in some other embodiments”, “in some other embodiments”, etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
  • the terms “include”, “comprising”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized in other ways.
  • connection includes direct connection and indirect connection, unless otherwise specified. "First” and “second” are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • the words “exemplarily” or “for example” are used to indicate examples, illustrations or explanations. Any embodiment or design described as “exemplarily” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as “exemplarily” or “for example” is intended to present related concepts in a specific way.
  • the related art provides a solution that uses a basic composition solution to guide users to take pictures.
  • the electronic device can detect the face or body of the person in the picture, obtain the face position or body position, and trigger the photo operation when the face position or body position meets the pre-defined photo template.
  • this solution includes at least the following two problems:
  • the distribution of the person's weight in the picture is not taken into account, resulting in an imbalance in the captured image.
  • the electronic device detects the person in the picture and performs a shooting operation when it determines that the position of the person meets the predefined shooting template.
  • the picture does not include the person's head, that is, there is an imbalance in the picture, and the image quality is not high.
  • the electronic device performs face detection on two people (person a and person b) in the picture, and when it detects that one of the people (for example, person a) meets the pre-defined photo template, the shooting operation is performed.
  • person a and person b since the positional relationship between person b and person a is not taken into account, only half of person b's face is included in the picture, and the image quality is not high.
  • the embodiment of the present application provides an image capture method, which can determine the shooting status of each character in the multiple frames of images after acquiring multiple frames of images, and finally retain the legal images in the multiple frames of images.
  • the legal images are images in which the shooting status of all characters is valid.
  • the shooting status refers to the status of the character in the picture, including but not limited to the character's state of movement, the character's portrait type, the key points of the character, the character's area ratio in the picture, the character's position in the picture, and whether the character has his eyes open or is smiling.
  • the motion state of the character includes but is not limited to walking, running, jumping, playing badminton, swimming, standing still, etc.
  • the types of character portraits include facial close-up, bust, 70%/90% portrait, full-body portrait, and partial close-up, etc., which are used to roughly represent the approximate truncation state of the character's body parts in the picture.
  • the electronic device can pre-set multiple invalid states. If the shooting state of the person is not any of the multiple invalid states, the shooting state of the person can be considered reasonable.
  • multiple invalid states include: the person is running or playing badminton, but part of the person's limbs (such as head, hands, feet) are missing (i.e., not appearing in the picture); the person is in a static state, but the person does not open his eyes and/or smile; the person in the picture is in a static state, but the person is located in the corner of the picture (such as four sides, four corners, etc.), etc.
  • the electronic device may also evaluate the composition quality of multiple frames of images, and retain one or more frames of images with higher composition quality among the multiple frames of images.
  • the composition quality of the image can be evaluated from at least three aspects: basic composition, social relationships in multi-person scenes, and character position arrangement in multi-person scenes.
  • the basic composition can be used to reflect whether the position of the character matches the common photography composition rules. If the position of the character matches the common photography composition method, it can be considered that the basic composition of the image conforms to conventional aesthetics and has a high composition quality.
  • Social relationships in multi-person scenes can be used to measure whether the relationship between multiple characters is close when there are multiple characters in the image. If the relationship between multiple characters is close, it can be considered that the image may have more abundant emotions, can affect the viewer emotionally, and has a higher composition quality.
  • the position arrangement of characters in a multi-person scene can be used to measure whether the arrangement of multiple characters is dispersed when there are three or more characters in the image. If the arrangement of multiple characters is not dispersed, it can be considered that the position arrangement of multiple characters in the image is reasonable and the composition quality is high.
  • the present application does not need to set the photo template in advance. Instead, after capturing multiple frames of images, the image composition quality is evaluated from multiple dimensions, and the images with good basic composition, close relationships between characters, and reasonable personnel arrangement are retained.
  • the images obtained in this way can avoid the rigidity of the photo template, give users room for free play, and help users obtain high-quality images.
  • the image capture method provided in the embodiment of the present application can be applied to a scenario in which a camera application is used in an electronic device, and in this scenario, image frames with high composition quality can be captured.
  • multiple frames of images can be actively acquired during the image preview process before the electronic device takes photos/records, and one or more frames of images with high composition quality can be saved.
  • one or more frames of images with high composition quality can be saved among multiple frames of images included in a video stream during the process of recording a video by an electronic device.
  • the image capture method provided in the embodiment of the present application is mainly explained by taking the image preview process before taking pictures/recording as an example.
  • the electronic device may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and/or a smart city device, etc., which have a camera.
  • PDA personal digital assistant
  • AR augmented reality
  • VR virtual reality
  • AI artificial intelligence
  • wearable device a vehicle-mounted device
  • smart home device a smart home device and/or a smart city device, etc.
  • FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
  • sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
  • the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc.
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • controller a memory
  • video codec a digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated in one or more processors.
  • the controller can be the nerve center and command center of the electronic device.
  • the controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
  • I2C inter-integrated circuit
  • I2S inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device.
  • the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from a charger.
  • the charger can be a wireless charger or a wired charger. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging 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 and the charging management module 140 can also be set in the same device.
  • the wireless communication function of the electronic device can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
  • the line 1 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.
  • antenna 1 can be reused as a diversity antenna for a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to electronic devices.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1.
  • at least some functional modules of the mobile communication module 150 can be set in the processor 110.
  • at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
  • the wireless communication module 160 can provide wireless communication solutions for application in electronic devices, including WLAN (such as (wireless fidelity, Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), etc.
  • WLAN such as (wireless fidelity, Wi-Fi) network
  • Bluetooth bluetooth, BT
  • global navigation satellite system global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication
  • NFC near field communication
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 2.
  • the electronic device implements the display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, etc.
  • the display screen 194 includes a display panel.
  • the electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
  • ISP is used to process the data fed back by camera 193.
  • Camera 193 is used to capture static images or videos.
  • the electronic device may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be saved in the external memory card.
  • the internal memory 121 may be used to store computer executable program codes, which include instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121.
  • the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
  • the program storage area can store an operating system, an application required for at least one function (such as a sound player,
  • the storage data area can store data created during the use of the electronic device (such as audio data, phone book, etc.).
  • 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 disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • the electronic device can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the button 190 includes a power button, a volume button, etc.
  • the button 190 can be a mechanical button. It can also be a touch button.
  • the motor 191 can generate a vibration prompt.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect the SIM card.
  • the SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device.
  • the electronic device can support 1 or N SIM card interfaces, N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc.
  • the electronic device After the electronic device opens the camera application, the electronic device can actively capture multiple frames of images and retain one or more frames of images with higher quality.
  • the camera application has an automatic capture function (also referred to as wonderful capture, smart capture, etc.).
  • the automatic capture function means that when the electronic device intelligently recognizes a specific picture, such as a person smiling, jumping, running, or a pet, it can actively capture the wonderful picture and retain the legal images with high composition quality.
  • a specific picture such as a person smiling, jumping, running, or a pet
  • the automatic capture function when the automatic capture function is turned on, the electronic device can actively capture multiple frames of images and retain the legal images with high composition quality among the multiple frames.
  • the electronic device may be a mobile phone, and the process of enabling the automatic snapshot function may be as shown in FIG. 4-FIG . 5 .
  • the mobile phone can display an interface 401 (also referred to as a main interface, desktop, Home interface, etc.).
  • the interface 401 includes icons of multiple applications, such as an icon 401a of a camera application, an icon of a setting application, etc. If the user wants to open the camera application, the user can click the icon 401a of the camera application.
  • the mobile phone can receive an operation of the user clicking the icon 401a of the camera application.
  • the mobile phone opens the camera application and displays an interface 402 as shown in (b) of FIG. 4 .
  • the interface 402 is a shooting preview interface for displaying images collected by the camera in real time. As shown in (b) of FIG.
  • the interface 402 includes a setting button 402a, a photo button, etc.
  • the mobile phone can receive an operation of the user clicking the setting button 402a.
  • the mobile phone can display an interface 403 as shown in (a) of FIG. 5 .
  • the interface 403 includes multiple setting options, such as photo ratio, smart photo 403a, filter recommendation, etc.
  • the mobile phone can display an interface 404 as shown in (b) of FIG. 5 .
  • the interface 404 includes options such as voice-controlled photography, gesture photography, smile capture, and automatic capture 404a.
  • the option of automatic capture 404a includes a switch button 404b and a prompt message 404c.
  • the user can turn on or off the automatic capture function by clicking the switch button 404b.
  • the prompt message 404c is used to specifically describe the automatic capture function, for example, "When automatic capture is turned on, it automatically takes pictures when it intelligently recognizes wonderful moments such as people smiling, jumping, running, and cats and dogs.”
  • the electronic device may also store legal images with high composition quality into a gallery, so that the user can view the captured images from the gallery.
  • an electronic device may display an interface 601.
  • Interface 601 is a shooting preview interface, which is used to display the image captured by the camera in real time.
  • the interface 601 also includes a thumbnail 601a and an icon 601b.
  • the thumbnail 601a is a thumbnail of the latest frame of the image stored in the mobile phone.
  • the icon 601b is used to indicate that the automatic capture function has been turned on.
  • the mobile phone can receive the user's operation on the icon 601b.
  • the mobile phone can display the interface 404 shown in (b) of Figure 5 to set the automatic capture function.
  • the mobile phone captures a legal image with high composition quality during the period when the mobile phone displays the interface 601
  • the image can be stored in the gallery and a thumbnail 601c can be displayed.
  • the thumbnail 601c is a thumbnail of the image just captured by the mobile phone and stored in the gallery.
  • the thumbnail 601c can be clicked.
  • the mobile phone may receive a user's operation on the thumbnail 601c, and in response to the operation, the mobile phone may display an image corresponding to the thumbnail 601c.
  • the electronic device can evaluate the image quality from at least two aspects: one is the shooting status of all characters in the image, and the other is the composition quality of the image, and retain one or more frames of images in which the shooting status of all characters in the multiple frames is valid (i.e., legal) and the composition quality is high.
  • the image can be any frame of the preview stream image data obtained by the camera in real time, and no specific limitation is made here.
  • the shooting state refers to the state of the person in the picture, including but not limited to the person's motion state, the person's truncation state in the picture, the person's center of mass position, the person's area ratio in the picture, and whether the person has his eyes open or is smiling, etc.
  • FIG7A shows a flow chart of an image capture method provided in an embodiment of the present application. It specifically illustrates the process of an electronic device determining the truncation state of an image character in a picture.
  • the image capture method includes:
  • the camera can obtain preview stream image data in real time, and the preview stream image data includes multiple frames of images.
  • the image in S710 can be any one frame of the multiple frames of images.
  • the electronic device may input the image into a human body detection model, a face detection model, and a key point detection model respectively to obtain a human body detection result, a face detection result, and a key point detection result.
  • the human body detection model, face detection model and key point detection model are all models trained to convergence.
  • the human body detection model is used to identify the human body in the image and determine the position of the human body frame.
  • the face detection model is used to identify the face in the image, and further identify whether the face is open-eyed, smiling, etc.
  • the face detection results may include the position of the face frame, whether the face is open-eyed, and whether the face is smiling, etc.
  • the key point detection model can be used to identify the key points of the human body of each character in the image, and the key points of the human body include but are not limited to the top of the head, neck, left shoulder, right shoulder, left hip, right hip, left knee, right knee, left ankle, right ankle, left elbow (also called left arm), right elbow (also called right arm), left wrist, right wrist, etc.
  • the electronic device may perform a matching operation on all face frames and all human body frames.
  • the purpose of matching the human frame and the face frame is to determine whether the face frame and the human frame belong to the same person. It can be understood that if the face frame matches the human frame, it can be determined that the face frame and the human frame belong to the same person; if the face frame and the human frame do not match, it can be determined that the face frame and the human frame do not belong to the same person.
  • the electronic device may extract the feature points of each human body frame and the feature points of the face frame, and perform similarity matching based on the feature points to determine the matching face frame and human body frame.
  • the electronic device may input the face frame and the human body frame into a matching model to obtain the confidence level of the matching between the human body frame and the face frame. When the confidence level of the matching between the human body frame and the face frame is higher than a preset threshold, the human body frame matches the face frame.
  • the number of people N in the image is the sum of the number of human body frames with matching face frames (or the number of face frames with matching human body frames), the number of face frames without matching human body frames, and the number of human body frames without matching face frames.
  • FIG7B shows an image.
  • the image includes face frame a, face frame b, human body frame c, human body frame d, and human body frame e, wherein face frame a matches human body frame c, face frame b matches human body frame d, and human body frame e does not have a matching face frame.
  • the number of human body frames with matching face frames in the image is 2
  • the number of face frames without matching human body frames is 0,
  • the number of human body frames without matching face frames is 1, so it can be determined that the image includes 3 characters, that is, the total number of people is 3.
  • S750 Determine the portrait type and centroid position according to the key point detection result.
  • the electronic device can determine the type of the portrait and the position of the person in the picture according to the key point detection result.
  • the position of the person in the picture is characterized by the center of mass position of the person. That is, the electronic device can determine the type of the portrait and the center of mass position of the person according to the key point detection result.
  • Fig. 8 shows a flow chart of the electronic device determining the portrait type and the centroid position of the person according to the key point detection result. It should be noted that the coordinates appearing below are all coordinates in a coordinate system established with the upper left vertex of the image as the origin, the width of the image as the horizontal axis, and the height of the image as the vertical axis.
  • the electronic device can determine that the portrait type is a close-up of the face, and determine that the center of mass position of the person is the average coordinate point of the key point of the top of the head and the key point of the neck.
  • the electronic device can obtain the key point A of the top of the head and the key point B of the neck by performing key point detection on the image, wherein the coordinates of the key point A of the top of the head are (x1, y1), and the coordinates of the key point B of the neck are (x2, y2).
  • the electronic device can determine that the portrait type of the image is a close-up of the face, and the center of mass position of the person is the average coordinate point R1 of the key point A of the top of the head and the key point B of the neck, and the coordinates of the average coordinate point R1 are ((x1+x2)/2, (y1+y2)/2).
  • the electronic device can determine that the portrait type is a bust portrait, and determine the center of mass position of the person as the average coordinate point of the neck key point and the shoulder key point.
  • the user's arms and wrists may also be in the frame. Therefore, in another optional implementation, when the key point detection results include the top of the head key points, the neck key points, and the shoulder key points, The key point detection result further includes arm key points and/or wrist key points.
  • the electronic device can also determine that the portrait type is a bust portrait, and determine the center of mass position of the person as the average coordinate point of the neck key point and the shoulder key point.
  • the electronic device detects key points of the image to obtain the top key point A, the neck key point B, the left shoulder key point C1, the right shoulder key point C2, the left arm key point D1, the right arm key point D2 and the right wrist key point E1, wherein the coordinates of the top key point A are (x1, y1), the coordinates of the neck key point B are (x2, y2), the coordinates of the left shoulder key point C1 are (x3, y3), and the coordinates of the right shoulder key point C2 are (x4, y4).
  • the electronic device can determine that the portrait type of the image is a bust, and the center of mass position of the person is the average coordinate point R2 of the top key point A, the neck key point B, the left shoulder key point C1 and the right shoulder key point C2, and the coordinates of the average coordinate point R2 are:
  • N is the number of key points, which is 4.
  • the electronic device can determine the portrait type as a seven-point/nine-point portrait, and determine the center of mass of the person as the average coordinate point of the key points of the hip joint, the arm, the shoulder, the neck, and the top of the head.
  • the electronic device can also determine that the portrait type is a 70%/90% image, and determine the center of mass position of the person as the average coordinate point of the top of the head key point, the neck key point, the shoulder key point, the hip joint key point, and the arm key point.
  • the electronic device can detect key points of the image and obtain the top of the head key point A, the neck key point B, the left shoulder key point C1, the left arm key point D1, the left hip key point E1, the left wrist key point F1 and the left knee key point G1.
  • the electronic device can then determine that the portrait type is a seven-tenths/ninths portrait, and determine the center of mass position of the person as the average coordinate point R3 of the top of the head key point A, the neck key point B, the left shoulder key point C1, the left arm key point D1 and the left hip key point E1.
  • the electronic device can determine that the portrait type is a full-body portrait, and determine the center of mass position of the person as the average coordinate point of the key points on the top of the head, neck, shoulders, hip joints and arms.
  • the electronic device can also determine that the portrait type is a full-body image.
  • the electronic device can use the center point position of the human body frame of the person as the center of mass position of the person.
  • the center point of the human body frame refers to the intersection of the two diagonals of the human body frame.
  • the electronic device detects key points of the image to obtain key points A, Neck key point B, left shoulder key point C1, right shoulder key point C2, right arm key point D2, left hip key point E1, right hip key point E2, left knee key point F1, right knee key point F2, left ankle key point G1 and right ankle key point G2, so the electronic device can determine that the portrait type of the person is a full-body portrait, and the center of mass position of the person is the average coordinate point R4 of the top of the head key point A, neck key point B, left shoulder key point C1, right shoulder key point C2, right arm key point D2, left hip key point E1, and right hip key point E2.
  • the electronic device determines the portrait type as a partial close-up, and determines the centroid position of the person as the average coordinate point of all the key points detected. For example, if the key point detection result only includes the arms, the electronic device can determine the portrait type as a close-up of the arms, and the centroid position is the position coordinate of the arm.
  • the portrait type can roughly represent the approximate truncation state of the body parts of the person in the picture. For example, if the portrait type is a close-up of the face, it means that the picture only includes the head of the person, and the parts below the head of the person are truncated. If the portrait type is a bust, it means that the picture includes the upper body of the person, and the parts below the waist of the person are truncated. If the portrait type is a seven/nine-point portrait, it means that the picture includes the part above the calf/ankle of the person, and the feet of the person are truncated. If the portrait type is a full-body portrait, it means that the picture includes the entire body of the person.
  • the electronic device can specifically confirm it through the key point detection results. For example, if the key point detection results do not include the key points of the top of the head and the neck, it can be determined that the head of the person in the picture is truncated; for another example, if the key point detection results do not include the elbows and wrists, it can be determined that the hands of the person in the picture are truncated.
  • the electronic device can determine the portrait types and centroid positions of the N persons.
  • the electronic device may also input the image into a motion recognition model to determine the motion state of the person.
  • the motion recognition model is a neural network model that is pre-trained to convergence and can be used to recognize the motion state of the person in the image, including but not limited to walking, running, jumping, playing badminton, swimming, throwing, playing water fights, and being still.
  • the electronic device can also determine the area ratio of each character according to the human body detection result.
  • the area ratio of the character is specifically the ratio of the area of the character in the image, which can be the ratio of the character area to the image area.
  • the character area is the area of the human body frame corresponding to the character.
  • the electronic device After the electronic device determines the shooting status of all the people in the image, it can confirm whether the image is a legal image.
  • the image may include a main character and an effective character
  • the electronic device may perform effectiveness judgment on the main character and the effective character respectively.
  • the main character mainly refers to the main character in the image, or the protagonist.
  • the effective character is a character in the image whose importance is less than that of the main character, such as a passerby.
  • the electronic device can determine whether each person meets the valid person condition in turn, and if the person meets the valid person condition, store the person in the valid person set. If the person also meets the subject person condition, store the person in the subject person set. After determining whether all the people in the image are subject people or valid people, the electronic device can perform validity judgments on the people in the valid person set and the people in the subject person set respectively.
  • the electronic device may classify the characters into valid characters and main characters according to the area ratio of the characters and the centroid position of the characters.
  • the valid character condition may include that the area ratio of the characters is greater than a threshold value.
  • M1 the main character condition may include that the area ratio of the character is greater than the threshold M1 and the center of mass position of the character is within the preset area of the image.
  • the preset area may be the area formed by the four points of interest of the image, the area formed by the third line of the image, etc., which is not specifically limited here.
  • a character whose area ratio is greater than the threshold M1 can be called a valid character
  • a character whose area ratio is greater than the threshold M1 and the center of mass position of the character is within the preset area of the image can be called a main character.
  • the electronic device can set multiple invalid states for the valid characters and the main characters respectively.
  • the valid characters may have limb amputations, inadequate expressions, etc.
  • the main character its various invalid states may include: when the character is jumping or running, the portrait type is not full-body, or there is a limb truncation; when the character is throwing or playing badminton, the portrait type is not full-body or half-body, or there is a head truncation; when the character is splashing water or playing table tennis, there is no face in the image or the elbow is truncation; the character is in a static state, with no eyes open or smiling, or there is a face truncation; the character is in a static state, and the area occupies too large when no face is detected; the character is in a static state, the portrait type is a close-up of the face or a bust, and the center of mass of the character is outside the preset area, etc.
  • multiple invalid states may include: when the person is jumping or running, the portrait type is not full body, the head is cut off, etc. It can be understood that if the shooting state of the valid person does not match any of the above invalid states, it can be determined that the shooting state of the valid person is valid.
  • the image is determined to be legal.
  • the electronic device may not distinguish between valid characters and subject characters, and directly determine whether the shooting status of all characters is valid, and confirm that the image is legal when the shooting status of all characters is valid.
  • the principle of determining whether the shooting status of each character is valid is similar to the principle of determining whether the shooting status of the subject character/valid character is valid, and will not be repeated here.
  • the electronic device can also evaluate the composition quality of the image.
  • the composition quality of the image can be evaluated from at least three aspects: basic composition, social relationships in multi-person scenes, and position arrangement of characters in multi-person scenes. The above three aspects will be explained below.
  • Basic composition refers to the layout and structure of the picture, and specifically refers to the position of the characters on the picture.
  • Common photography composition rules include but are not limited to the golden triangle composition rule, the rule of thirds composition, the diagonal rule, and the center composition rule. Different composition rules may have different marking points or guide lines to assist in composition.
  • the reference positions of the golden triangle composition rule, the thirds composition rule, the diagonal rule, and the center composition rule are shown.
  • the image is more in line with the golden triangle composition rule.
  • the person is near any of the thirds lines, it can be considered that the image is more in line with the thirds composition rule.
  • the person is near any of the diagonals, it can be considered that the image is more in line with the center composition rule.
  • the person is near the center point, it can be considered that the image is more in line with the center composition rule.
  • the electronic device can determine the distance parameter according to the distance from the center of mass position of the target person to the reference position, and use this to measure the degree of matching between the image and the preset composition rule.
  • Different composition rules have different corresponding reference positions, and thus different corresponding distance parameters.
  • the target person can be any person in the image, or can be the main person in the image.
  • the following takes the target person as each person in the image, the image size as width*height (width x height), and the center of mass position as (Mass x , Mass y ) as an example to first explain the process of the electronic device determining the degree of matching of the image with different composition rules when there is only one person in the image.
  • the reference positions are four points of interest.
  • the electronic device can calculate the distances between the centroid position and the four points of interest, and use the minimum distance of the four distances as the first distance parameter to characterize the degree of matching between the image and the golden triangle composition rule. The smaller the first distance parameter, the higher the degree of matching between the image and the golden triangle composition rule.
  • the first distance parameter satisfies:
  • d(P ix ,P iy ) is the coordinate of the i-th interest point.
  • the reference position is the four thirds lines.
  • the electronic device can calculate the distance between the centroid position and the four thirds lines, and use the minimum distance of the four distances as the second distance parameter to characterize the degree of matching between the image and the rule of thirds. The smaller the second distance parameter, the higher the degree of matching between the image and the rule of thirds.
  • the second distance parameter satisfies the formula:
  • the distance from the centroid position (Mass x , Mass y ) to the i-th three-point line is:
  • the reference position is the two diagonals.
  • the electronic device can calculate the distance from the centroid position to the two diagonals, and use the minimum distance of the two distances as a third distance parameter to characterize the degree of matching between the image and the diagonal rule. The smaller the third distance parameter, the higher the degree of matching between the image and the diagonal rule.
  • the third distance parameter satisfies the formula:
  • the reference position is the center point of the image.
  • the electronic device can calculate the distance from the centroid position to the center point of the image, and use the distance as the fourth distance parameter to characterize the degree of matching between the image and the central composition rule. The smaller the fourth distance parameter, the higher the degree of matching between the image and the central composition rule, and the more evenly the person is distributed in the entire image.
  • the fourth distance parameter satisfies:
  • the degree to which the image matches different composition rules is related to the area ratio of each character and the distance between the center of mass position of the character and each marking point or guide line.
  • the electronic device can calculate the area ratio of N characters and the minimum distance from the center of mass of the N characters to the four points of interest, and then perform a weighted average of the N minimum distances using the area ratio of the characters as a weight, and use the obtained result as the first distance parameter to characterize the degree of matching between the image and the golden triangle composition rule.
  • the calculation formula can be as follows:
  • Sp is the degree of matching between the image and the golden triangle composition rule when the image includes N people
  • wj is the area ratio of the j-th person, j ⁇ [1,N]
  • Pj is the center of mass position of the j-th person
  • PiP is the i-th interest point, i ⁇ [1,4]
  • massDistanceAllPoint (j) is the minimum distance from the center of mass position of the j-th person to the four interest points.
  • the electronic device can calculate the area ratio of N characters and the minimum distance from the center of mass of N characters to four thirds lines, and then perform weighted average of the N minimum distances using the area ratio of the characters as weights, and use the obtained result as the second distance parameter to characterize the degree of matching between the image and the rule of thirds.
  • the calculation formula can be as follows:
  • S T is the degree of match between the image and the rule of thirds when the image includes N characters; w j is the area ratio of the j-th character, j ⁇ [1,N], P j is the center of mass position of the j-th character, P i T is the i-th third line, i ⁇ [1,4], massDistanceThirdLine (j) is the minimum distance from the center of mass position of the j-th character to the four third lines.
  • the electronic device can calculate the area ratio of the N characters and the minimum distance from the center of mass of the N characters to the two diagonals, and then perform a weighted average of the N minimum distances using the area ratio of the characters as the weight, and use the obtained result as the third distance parameter to characterize the degree of matching between the image and the diagonal rule.
  • the calculation formula can be as follows:
  • SD is the degree of matching between the image and the diagonal rule when there are N characters in the image
  • wj is the The area proportion of the jth character, j ⁇ [1,N]
  • Pj is the center of mass position of the jth character
  • P i D is the ith diagonal line, i ⁇ [1,2]
  • massDistance DiagonaLine (j) is the minimum distance from the center of mass position of the jth character to the two diagonals.
  • the electronic device can calculate the area ratio of the N characters and the distance from the center of mass of the N characters to the center position, and then perform a weighted average of the N distances using the area ratio of the characters as the weight, and use the obtained result as the fourth distance parameter to characterize the degree of matching between the image and the central composition rule.
  • the calculation formula can be as follows:
  • S C is the degree of matching between the image and the central composition rule when the image includes N characters; w j is the area ratio of the j-th character, j ⁇ [1,N], P j is the center of mass position of the j-th character, PC is the center point, and massDistance Center (j) is the distance from the center of mass position of the j-th character to the center point.
  • the electronic device can count the number of main persons in the image, and when the number of main persons is 1 or greater than 1, calculate the distance parameter using the above-mentioned different methods respectively, which will not be repeated here.
  • the electronic device may also evaluate the social relationship characteristics of the image.
  • the social relationship characteristics may implicitly express the relationship between the target persons in the image, such as whether the relationship between the persons is close, etc., which may affect the viewer's preference emotionally.
  • the electronic device may determine an intimacy parameter of the image, and use the intimacy parameter to reflect the close relationship between the characters in the image.
  • the electronic device can determine the face position of each target person in the image, and determine the intimacy parameter of the image based on multiple face positions.
  • the target person can be each person in the image or the main person in the image.
  • the face position can be the center point position of the face frame or the center of mass position of the person's head.
  • the center of mass position of the person's head refers to the average point coordinates of the key points on the top of the head and the key points on the neck.
  • FIG14 is a flowchart of an image capture method provided in an embodiment of the present application. It specifically shows the process of an electronic device determining an intimacy parameter of an image. As shown in FIG14 , the image capture method provided in an embodiment of the present application includes:
  • S1401 constructing a second-order tree structure with N face positions as nodes and the line connecting any two face positions as edges; wherein the weight of each edge is the distance between the two face positions corresponding to the edge.
  • the image shown in (a) in FIG. 15 includes five face frames, and the center points of the five face frames are A, B, C, D, and E.
  • the electronic device can use A, B, C, D, and E as nodes, connect AB, AC, AD, AE, BC, BD, BE, CD, CE, and DE, and then calculate the Euclidean distance between AB as the weight of the AB edge, calculate the Euclidean distance between AC as the weight of the AC edge, calculate the Euclidean distance between AD as the weight of the AD edge, calculate the Euclidean distance between AE as the weight of the AE edge, calculate the Euclidean distance between BC as the weight of the BC edge, calculate the Euclidean distance between BD as the weight of the BD edge, and calculate the Euclidean distance between BE as the weight of the BE edge.
  • the Euclidean distance between A, B, C, D, and E is used as the weight of the BE edge
  • the Euclidean distance between CD is used as the weight of the CD edge
  • the Euclidean distance between CE is used as the weight of the CE edge
  • the Euclidean distance between DE is used as the weight of the DE edge.
  • the second-order tree structure constructed according to A, B, C, D, and E can be shown in (b) of Figure 15.
  • the minimum spanning tree includes all nodes in the second-order tree structure and includes the minimum number of edges that keep the graph connected.
  • the electronic device can use Prim's algorithm or Kruskal's algorithm to construct a minimum spanning tree.
  • Kruskal's algorithm refers to sorting all the edges in the connected network (i.e., the second-order tree structure) in ascending order according to the weight size, and starting from the edge with the smallest weight. As long as this edge does not form a loop with the selected edges, it can be selected to form a minimum spanning tree. For a connected network with N vertices, N-1 edges that meet the conditions are selected, and the spanning tree composed of these edges is the minimum spanning tree.
  • the electronic device sorts all the edges in the second-order tree structure shown in (b) of FIG. 15 in ascending order according to the weight values, and Table 1 can be obtained:
  • the smallest weights are the weights of the B-C edge and the C-D edge, both of which are 3.
  • the B-C edge can form a minimum spanning tree; since the C-D edge will not form a loop with the selected B-C edge, it can form a minimum spanning tree; since the D-E edge will not form a loop with the selected B-C edge and C-D edge, it can form a minimum spanning tree; since the E-A edge will not form a loop with the selected B-C edge, C-D edge, and D-E edge, it can form a minimum spanning tree; since the D-A edge will form a loop with the selected edge, it cannot form a minimum spanning tree. In this way, the minimum spanning tree shown in Figure 16 can be obtained.
  • Prim's algorithm refers to finding an edge with the smallest weight from a connected network containing N vertices each time. This operation is repeated N-1 times.
  • the spanning tree composed of N-1 edges with the smallest weight is the minimum spanning tree.
  • the electronic device first determines the edge with the smallest weight from A-E, A-D, A-C, and A-B, which is A-E. Then, the electronic device determines the edge with the smallest weight from E-D, E-C, and E-B, which is E-D. Next, the electronic device determines the edge with the smallest weight from D-C and D-B, which is D-C. Finally, A-E, E-D, D-C, and C-B are connected to form a minimum spanning tree.
  • Face Closeness is the intimacy parameter
  • N is the total number of faces.
  • Face Closeness that is, the closer the faces in the picture are, and the closer the relationship between the characters is, the richer the emotions contained in the image, and therefore the higher the composition quality.
  • the electronic device can determine the compactness parameter of the image according to the centroid position of the target persons, which is used to evaluate the position arrangement of the target persons in the image. For each person in the image or the main person in the image.
  • FIG18 is a flowchart of an image capture method provided in an embodiment of the present application. It specifically shows the process of an electronic device determining an intimacy parameter of an image. As shown in FIG18 , the image capture method provided in an embodiment of the present application includes:
  • the electronic device can use the length and width of the image to normalize the center of mass position of the person.
  • the center of mass position after normalization satisfies:
  • the standard deviation in the X-axis direction (which can be called the first direction) can reflect the arrangement of the characters in the X-axis direction
  • the standard deviation in the Y-axis direction (which can be called the second direction) can reflect the arrangement of the characters in the Y-axis direction.
  • S1803 Determine the smaller value of the standard deviation in the X-axis direction and the standard deviation in the Y-axis direction as a compactness parameter.
  • the obtained compactness parameter can be used to indicate the position arrangement of at least three characters in the image, and the smaller the compactness parameter is, the more reasonable the position arrangement of at least three characters is, and the higher the composition quality of the image is.
  • the electronic device may compare the composition indices of the images to retain one or more frames of images with higher composition quality.
  • the electronic device can compare the composition indicators of any two frames of the multiple images, eliminate the frame with lower composition quality among the any two frames of the images, and then continue to compare the composition indicators of any two frames of the multiple images after eliminating the frame with lower composition quality, until the comparison of the multiple frames of images is completed, and finally determine one or more frames of images with higher composition quality.
  • the comparison process is described in detail below by taking an electronic device comparing the composition indicators of a first image and a second image as an example.
  • the composition parameters of the first image include a first distance parameter a, a second distance parameter a, a third distance parameter a, a fourth distance parameter a, a first intimacy parameter and a first compactness parameter; among them, the first distance parameter a is used to characterize the degree of matching between the first image and the golden triangle composition rule, the second distance parameter a is used to characterize the degree of matching between the first image and the rule of thirds composition, the third distance parameter a is used to characterize the degree of matching between the first image and the diagonal rule, the fourth distance parameter a is used to characterize the degree of matching between the first image and the central composition rule, the first intimacy parameter is used to characterize the closeness of the relationship between multiple characters in the first image, and the first compactness parameter is used to characterize the rationality of the position arrangement between multiple characters in the first image.
  • the first distance parameter a is used to characterize the degree of matching between the first image and the golden triangle composition rule
  • the second distance parameter a is used to characterize the degree of matching between the first
  • the composition parameters of the second image include a first distance parameter b, a second distance parameter b, a third distance parameter b, a fourth distance parameter b, a second intimacy parameter and a second compactness parameter; wherein the first distance parameter b is used to characterize the degree of matching between the second image and the golden triangle composition rule, the second distance parameter b is used to characterize the degree of matching between the second image and the rule of thirds composition, the third distance parameter b is used to characterize the degree of matching between the second image and the diagonal rule, the fourth distance parameter b is used to characterize the degree of matching between the second image and the central composition rule, the second intimacy parameter is used to characterize the closeness of the relationship between multiple characters in the second image, and the second compactness parameter is used to characterize the rationality of the position arrangement between multiple characters in the second image.
  • the electronic device may compare different composition parameters of the first image and the second image.
  • the electronic device when the total number of people in the first image and the second image is 1, the electronic device only compares the distance parameters of the two images. Specifically, the electronic device may calculate a first difference between the first distance parameter a and the first distance parameter b, and when the first difference is greater than a first threshold, if the first distance parameter a is smaller, the composition quality of the first image is higher than the composition quality of the second image; if the first distance parameter b is smaller, the composition quality of the second image is higher than the composition quality of the first image.
  • the first difference is the absolute value of the difference between the first distance parameter a and the first distance parameter b.
  • the first threshold is used to measure the similarity between the first distance parameter a and the first distance parameter b. When the first difference is less than or equal to the first threshold, it means that the first image and the second image may use the same composition rule, and thus the comparability is low; when the first difference is greater than the first threshold, it means that the first image and the second image do not use the same composition rule, and thus are compared.
  • the electronic device may calculate the second difference between the second distance parameter a and the second distance parameter b.
  • the second difference is greater than the second threshold, if the second distance parameter a is smaller, the composition quality of the first image is higher than the composition quality of the second image; if the second distance parameter b is smaller, the composition quality of the second image is higher than the composition quality of the first image.
  • the electronic device may calculate a third difference between the third distance parameter a and the third distance parameter b.
  • the third difference is greater than the third threshold, if the third distance parameter a is smaller, the composition quality of the first image is higher than the composition quality of the second image; if the third distance parameter b is smaller, the composition quality of the second image is higher than the composition quality of the first image.
  • the electronic device may calculate a fourth difference between the fourth distance parameter a and the fourth distance parameter b.
  • the fourth difference is greater than the fourth threshold, if the fourth distance parameter a is smaller, the composition quality of the first image is higher than the composition quality of the second image; and if the fourth distance parameter b is smaller, the composition quality of the second image is higher than the composition quality of the first image.
  • the electronic device When the fourth difference is less than the fourth threshold, the electronic device cannot determine which image has a higher composition quality based on the distance parameters of the two images, and can further determine the image quality based on parameters such as clarity and signal-to-noise ratio.
  • the electronic device may compare the composition qualities of the two images by using the distance parameters and the intimacy parameters of the two images.
  • the electronic device can compare the distance parameters of the two images, as described above, and will not be repeated here. If the distance parameters of the two images cannot determine which image has a higher composition quality, the electronic device can further compare the intimacy parameters of the two images.
  • the electronic device may calculate the fifth difference between the first compactness and the second compactness, and when the fifth difference is greater than or equal to the fifth threshold, if the first compactness is smaller, the composition quality of the first image is higher than the composition quality of the second image; if the second compactness is smaller, the composition quality of the second image is higher than the composition quality of the first image.
  • the electronic device may further determine the image quality according to parameters such as clarity and signal-to-noise ratio.
  • the electronic device may compare the composition qualities of the two images by using a compactness parameter.
  • the electronic device can calculate the sixth difference between the first compactness parameter and the second compactness parameter.
  • the sixth difference is greater than the sixth threshold, if the first compactness parameter is smaller, the composition quality of the first image is higher than the composition quality of the second image; if the second compactness parameter is smaller, the composition quality of the second image is higher than the composition quality of the first image.
  • the electronic device may retain the legal images therein.
  • the process of determining the legal images is as described above and will not be described in detail here.
  • the electronic device may compare the composition indicators of the multiple frames of images, and finally save one or more frames of images with higher composition quality.
  • the process of comparing the composition indicators of two frames of images is described above and will not be repeated here.
  • the electronic device may first acquire the legitimacy detection results and composition indicators of the multiple frames of images. Then, the image frames are compared in pairs. If one of the two frames of images is legal and the other is illegal, it can be determined that the composition quality of the legal image is higher. If both frames of images are legal or illegal, the image with higher composition quality is determined based on the composition indicators of the two frames of images. The process of comparing the composition indicators of the two frames of images is described above and will not be repeated here.
  • the electronic device can identify the shooting status of all objects in the image, evaluate the composition quality of the image, and determine the image that needs to be retained from multiple frames of images based on the shooting status of all objects and the composition quality of the image.
  • the electronic device may first identify the shooting status of all the objects in the image. When the shooting status of all the objects in the image is reasonable, the electronic device further evaluates the composition quality of the image. In this way, for images in which the shooting status of some or all of the objects is unreasonable, the electronic device does not need to evaluate the composition quality, so as to reduce the amount of calculation, thereby being able to more quickly determine the images that need to be retained from multiple frames of images.
  • the present application does not need to set the photo template in advance, but evaluates the image composition quality from multiple dimensions after capturing multiple frames of images, and retains the images with good basic composition, close character relationships, and reasonable personnel arrangement.
  • the images obtained in this way can avoid the rigidity of the photo template, give users room for free play, and help users obtain high-quality images.
  • the present application also provides an electronic device, which may include: a memory and one or more processors.
  • the memory and the processor are coupled.
  • the memory is used to store computer program code, and the computer program code includes computer instructions.
  • the processor executes the computer instructions, the electronic device can execute the various functions or steps executed by the mobile phone in the above method embodiment.
  • the chip system 2000 includes at least one processor 2001 and at least one interface circuit 2002.
  • the processor 2001 and the interface circuit 2002 can be interconnected by lines.
  • the interface circuit 2002 can be used to receive signals from other devices (such as the memory of an electronic device).
  • the interface circuit 2002 can be used to send signals to other devices (such as processor 2001).
  • the interface circuit 2002 can read the instructions stored in the memory and send the instructions to the processor 2001.
  • the electronic device or server can perform the various steps in the above embodiments.
  • the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
  • This embodiment also provides a computer-readable storage medium, in which a computer instruction is stored.
  • a computer instruction is stored on an electronic device, the electronic device or the server executes the above method.
  • the electronic device or the server executes the above method.
  • This embodiment also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it enables the computer to execute each function or step in the above method embodiment.
  • an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes each function or step performed by the mobile phone in the above method embodiment.
  • the electronic device, communication system, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

本申请提供一种图像抓拍方法及电子设备,涉及图像技术领域。该方法可自动抓拍构图质量高的图像。该方法包括:实时显示摄像头采集的多帧图像;根据每帧图像的人物信息确定对应图像的构图指标;其中,人物信息包括目标人物的人数以及多个人物参数中的一个或多个,多个人物参数包括目标人物的质心位置、目标人物的面积占比和目标人物的人脸位置,构图指标包括多个构图参数中的一个或多个,多个构图参数包括距离参数、亲密度参数以及紧凑度参数;保存多帧图像中构图质量最高的一帧或多帧图像;其中,距离参数越小、亲密度参数越小或者紧凑度参数越小,则图像的构图质量越高。

Description

一种图像抓拍方法及电子设备
本申请要求于2023年02月23日提交国家知识产权局、申请号为202310206533.4、发明名称为“一种图像抓拍方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及图像技术领域,尤其涉及一种图像抓拍方法及电子设备。
背景技术
随着电子技术的快速发展,手机、平板等电子设备上的摄像头像素越来越高,使得越来越多用户使用手机、平板等电子设备进行拍照。各大设备厂商为满足用户的拍照需求,对电子设备的硬件不断升级,以提高拍摄画面的画质及清晰度。但是用户对于拍照的需求并不仅限于画质及清晰度,还包括对于画面美感的要求,例如画面构图等。
考虑到大多数用户没有专业的摄影技能,可能不会合理构图,相关技术可以采用基础的构图方案指导用户进行拍摄。例如,可以对画面中的人物进行人脸或人体检测,得到人脸位置或人体位置;当人脸位置或人体位置符合预先定义的拍照模板时,触发拍照操作。但这种方式未考虑到人物重量在画面中的分布;同时,对于画面中存在多个人物的情况,其并未考虑多个人物之间的位置关系,这些都容易导致画面失衡的情况。
发明内容
本申请实施例提供一种图像抓拍方法及电子设备,用于对多帧图像进行筛选,得到构图质量较高的图像。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,本申请提供一种图像抓拍方法,应用于电子设备,电子设备包括摄像头,方法包括:实时显示摄像头采集的多帧图像;根据每帧图像的人物信息确定对应图像的构图指标;其中,人物信息包括目标人物的人数以及多个人物参数中的一个或多个,多个人物参数包括目标人物的质心位置、目标人物的面积占比和目标人物的人脸位置,构图指标包括多个构图参数中的一个或多个,多个构图参数包括距离参数、亲密度参数以及紧凑度参数,距离参数用于指示图像与预设构图法则的匹配程度,亲密度参数用于指示图像中至少两个目标人物间的亲密度,紧凑度参数用于指示图像中至少三个目标人物间位置排布的离散程度;保存多帧图像中构图质量最高的一帧或多帧图像;其中,距离参数越小、亲密度参数越小或者紧凑度参数越小,则图像的构图质量越高。
可以理解地,本申请通过量化图像与预设构图法则的匹配程度、图像中至少两个目标人物间的亲密度以及图像中至少三个目标人物间位置排布的离散程度,通过三个量化参数(即距离参数、亲密度参数以及紧凑度参数)在评估图像的构图质量,并保存其中构图质量最高的一帧或多帧,既能够避免拍照模板的死板,给用户自由发挥空 间,又能辅助用户得到高质量图像。
在第一方面提供的一种实施方式中,构图指标包括距离参数,在人数N≥2的情况下,人物信息包括N个目标人物的质心位置、N个目标人物的面积占比;根据每帧图像的人物信息确定对应图像的构图指标,包括:对于N个目标人物中的每个目标人物,根据目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数;以每个目标人物的面积占比为权重对所有目标人物对应的基础距离参数加权平均,得到距离参数。可以理解地,在存在多个目标人物时通过不同目标人物的面积占比为权重进行加权平均,能够有效评估多个目标人物是否接近参考位置。其中目标人物越接近参考位置,则该图像的构图质量越高。
在第一方面提供的一种实施方式中,在人数N=1的情况下,人物信息包括每个目标人物的质心位置,根据每帧图像的人物信息确定对应图像的构图指标,包括:根据目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数;将基础距离参数确定为距离参数。
在第一方面提供的一种实施方式中,预设参考位置包括多个参考位置;根据目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数,包括:将目标人物的质心位置到多个参考位置的距离中的最小值作为对应的基础距离参数;或者,预设参考位置包括一个参考位置;根据目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数,包括:将目标人物的质心位置到一个参考位置的距离作为对应的基础距离参数。
在第一方面提供的一种实施方式中,预设参考位置包括:图像的四个兴趣点、图像的两条对角线、图像的四条三等分线或者图像的中心点。具体的,第一构图法则(黄金构图法则)的预设参考位置为图像的四个兴趣点,第二构图法则(三分构图法则)的预设参考位置为图像的四条三等分线、第三构图法则(对角线法则)的预设参考位置为图像的两条对角线、第四构图法则(中心构图法则)的预设参考位置为图像的中心点。
在第一方面提供的一种实施方式中,在人数N≥2的情况下,构图指标包括亲密度参数,人物信息包括N个目标人物的人脸位置,根据每帧图像的人物信息确定对应图像的构图指标,包括:以N个人脸位置为节点,以任意两个人脸位置的连线为边构建二阶树结构;其中,每条边的权值为边对应的两个人脸位置间的距离;构建二阶树结构的最小生成树,最小生成树包括N-1条边;将N-1条边的权值的平均值确定为亲密度参数。
在第一方面提供的一种实施方式中,在人数N≥3的情况下,构图指标还包括紧凑度参数,人物信息还包括N个目标人物的质心位置,根据每帧图像的人物信息确定对应图像的构图指标,还包括:分别确定N个质心位置在第一方向上的标准差、在第二方向上的标准差;将第一方向上的标准差、第二方向上的标准差中的较小值确定为紧凑度参数。
在第一方面提供的一种实施方式中,方法还包括:比较多帧图像中任意两帧图像的构图指标,剔除任意两帧图像中构图质量低的一帧图像;继续比较剔除构图质量低的一帧图像后的多帧图像中的任意两帧图像的构图指标,直至多帧图像均完成比较。
在第一方面提供的一种实施方式中,在任意两帧图像的人数均为1的情况下,构图指标包括距离参数,距离参数包括第一距离参数、第二距离参数、第三距离参数以及第四距离参数,第一距离参数用于反映图像与第一构图法则的匹配程度,第二距离参数用于反映图像与第二构图法则的匹配程度,第三距离参数用于反映图像与第三构图法则的匹配程度,第四距离参数用于反映图像与第四构图法则的匹配程度,第一构图法则、第二构图法则、第三构图法则以及第四构图法则包括不同的参考位置;比较多帧图像中任意两帧图像的构图指标包括:在任意两帧图像的第一距离参数的差值大于或等于第一阈值的情况下,比较任意两帧图像的第一距离参数,其中第一距离参数较小的图像的构图质量更高;在任意两帧图像的第一距离参数的差值小于第一阈值的情况下,判断任意两帧图像的第二距离参数的差值是否大于或等于第二阈值;在任意两帧图像的第二距离参数的差值大于或等于第二阈值的情况下,比较任意两帧图像的第二距离参数,其中第二距离参数较小的图像的构图质量更高;在任意两帧图像的第二距离参数的差值小于第二阈值的情况下,判断任意两帧图像的第三距离参数的差值是否大于或等于第三阈值;在任意两帧图像的第三距离参数的差值大于或等于第三阈值的情况下,比较任意两帧图像的第三距离参数,其中第三距离参数较小的图像的构图质量更高;在任意两帧图像的第三距离参数的差值小于第三阈值的情况下,判断任意两帧图像的第四距离参数的差值是否大于或等于第四阈值;在任意两帧图像的第四距离参数的差值大于或等于第四阈值的情况下,比较任意两帧图像的第四距离参数,其中第四距离参数较小的图像的构图质量更高。
在第一方面提供的一种实施方式中,若任意两帧图像中的一帧图像的人数N=2,另一帧图像的人数N≥2,构图指标还包括亲密度参数,比较多帧图像中任意两帧图像的构图指标还包括:在任意两帧图像的第四距离参数的差值小于第四阈值的情况下,判断任意两帧图像的亲密度参数的差值是否大于或等于第五阈值;在任意两帧图像的亲密度参数的差值大于或等于第五阈值的情况下,比较任意两帧图像的亲密度参数,其中亲密度参数较小的图像的构图质量更高。
在第一方面提供的一种实施方式中,若任意两帧图像的人数均大于等于2,构图指标还包括紧凑度参数,比较多帧图像中任意两帧图像的构图指标包括:在任意两帧图像的紧凑度参数的差值大于或等于第六阈值的情况下,比较任意两帧图像的紧凑度参数,其中紧凑度参数较小的图像的构图质量更高。
在第一方面提供的一种实施方式中,目标人物为图像中的每个人物,或者,目标人物为图像中面积占比大于预设阈值且质心位置在预设区域内的人物。
在第一方面提供的一种实施方式中,方法还包括:对多帧图像进行人体检测、人脸检测以及关键点检测,分别得到人体检测结果、人脸检测结果以及关键点检测结果;根据人体检测结果、人脸检测结果以及关键点检测结果确定多帧图像中每个人物的拍摄状态;其中,拍摄状态包括人物的运动状态及以下多种状态中的一种或多种,多种状态包括:人物的质心位置、人像类型以及人物的面积占比;保存多帧图像中构图质量最高的一帧或多帧图像,包括:保存多帧图像中构图质量最高的一帧或多帧合法图像;其中,合法图像为所有人物的拍摄状态均有效的图像。
在第一方面提供的一种实施方式中,若关键点检测结果仅包括头顶关键点及脖子 关键点,则人像类型为面部特写,以及人物的质心位置为头顶关键点与脖子关键点的平均坐标点。
在第一方面提供的一种实施方式中,若关键点检测结果仅包括头顶关键点、脖子关键点、肩部关键点以及以下多个第一关键点中的一个或多个,则人像类型为胸像,以及人物的质心位置为脖子关键点与肩部关键点的平均坐标点,多个第一关键点包括胳膊关键点和手腕关键点。
在第一方面提供的一种实施方式中,若关键点检测结果仅包括头顶关键点、脖子关键点、肩部关键点、髋关节关键点、胳膊关键点以及以下多个第二关键点中的一个或多个,则人像类型为七/九分像,以及人物的质心位置为头顶关键点、脖子关键点、肩部关键点、髋关节关键点、胳膊关键点的平均坐标点,多个第二关键点包括手腕关键点以及膝盖关键点。
在第一方面提供的一种实施方式中,若关键点检测结果仅包括头顶关键点、脚踝关键点以及以下多个第三关键点中的一个或多个,则人像类型为全身像,以及人物的质心位置为人物的人体框的中心点位置,多个第三关键点包括肩部关键点、髋关节关键点、胳膊关键点、手腕关键点、膝盖关键点。
在第一方面提供的一种实施方式中,若关键点检测结果不包括头顶关键点及脖子关键点,则人像类型为局部特写,以及人物的质心位置为检测到所有关键点的平均坐标点。
在第一方面提供的一种实施方式中,人体检测结果包括人物的人体框,人物的面积占比为人体框的面积与图像面积的比值。
在第一方面提供的一种实施方式中,人脸检测结果包括人脸框,人脸位置为人脸框的中心点位置,或者为人物头部的质心位置。
在第一方面提供的一种实施方式中,若人物处于运动状态,且人物的人像类型不为全身像、半身像且不包括头顶关键点、脖子关键点、脚踝关键点及手腕关键点中的至少一个,人物的拍摄状态无效。
在第一方面提供的一种实施方式中,若人物处于静止状态,且人物未睁眼、未微笑、人像类型为胸像且面积占比大于第七阈值或者不包括头顶关键点及脖子关键点,人物的拍摄状态无效。
第二方面,本申请提供一种电子设备,电子设备包括:存储器和处理器;处理器与存储器耦合;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;当计算机指令被处理器执行时,使得电子设备执行如第一方面中任意一种实施方式的方法。
第三方面,本申请提供一种计算机可读存储介质,包括计算机指令;当计算机指令在电子设备上运行时,使得电子设备执行如第一方面中任意一种实施方式的方法。
第四方面,本申请提供一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行如第一方面及其任一种可能的设计方式的方法。
第五方面,本申请提供一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。上述芯片系统可以应用于包括通信模块和存储器的终端设备。该接口电路用于从终端设备的存储器接收信号,并向 处理器发送接收到的信号,该信号包括存储器中存储的计算机指令。当处理器执行该计算机指令时,终端设备可以执行如第一方面及其任一种可能的设计方式的方法。
其中,第二方面至第五方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种界面示意图;
图2为本申请实施例提供的另一种界面示意图;
图3为本申请实施例提供的一种电子设备的结构示意图;
图4为本申请实施例提供的一组界面示意图;
图5为本申请实施例提供的一组界面示意图;
图6为本申请实施例提供的一组界面示意图;
图7A为本申请实施例提供的一种图像抓拍方法的流程示意图一;
图7B为本申请实施例提供的又一种界面示意图;
图8为本申请实施例提供的一种图像抓拍方法的流程示意图二;
图9为本申请实施例提供的一种人像示意图;
图10为本申请实施例提供的另一种人像示意图;
图11为本申请实施例提供的又一种人像示意图;
图12为本申请实施例提供的再一种人像示意图;
图13A为本申请实施例提供的一种图像抓拍方法的流程示意图三;
图13B示出了黄金三角构图法则、三分构图法则、对角线法则以及中心构图法则的参考位置;
图14为本申请实施例提供的一种图像抓拍方法的流程示意图四;
图15为本申请实施例提供的一种生成二阶树结构的示意图;
图16为本申请实施例提供的一种最小生成树的示意图;
图17为本申请实施例提供的另一种生成二阶树结构的示意图;
图18为本申请实施例提供的一种图像抓拍方法的流程示意图五;
图19为本申请实施例提供的一种图像抓拍方法的流程示意图六;
图20为本申请实施例提供的一种芯片系统的结构示意图。
具体实施方式
下面结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个 或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
为了使用户能得到高质量的图像,相关技术提供了一种采用基础的构图方案指导用户进行拍摄的方案。具体的,电子设备可以对画面中的人物进行人脸或人体检测,得到人脸位置或人体位置,当人脸位置或人体位置符合预先定义的拍照模板时,触发拍照操作。但这种方案至少包括以下两种问题:
一是未考虑到人物重量在画面中的分布,导致拍摄得到的图像出现画面失衡等情况。示例性的,如图1所示,电子设备对画面中的人物进行人体检测,并在确定人体位置符合预先定义的拍照模板时进行拍摄操作。但是由于未考虑人物重量在画面中的分布,使得该画面中不包括人物的头部,即存在画面失衡的情况,图像质量不高。
二是未考虑到多人拍摄场景下多个人物之间的位置关系,可能导致拍摄得到的图像部分人物的位置不合理。示例性的,如图2所示,电子设备对画面中的2个人物(人物a和人物b)进行人脸检测,当检测到其中一个人物(例如人物a)符合预先定义的拍照模板时,进行拍摄操作。但由于未考虑到人物b与人物a的位置关系,使得画面中仅包括人物b的半张脸,图像质量不高。
本申请实施例提供一种图像抓拍方法,可以在获取多帧图像后,确定多帧图像中每个人物的拍摄状态,并最终保留多帧图像中的合法图像。其中,合法图像即为所有人物的拍摄状态均有效的图像。
其中,拍摄状态是指人物在画面中的状态,包括但不仅限于人物所处的运动状态、人物的人像类型,人物所包括的关键点,人物在画面中的面积占比,人物在画面中的位置,以及人物是否睁眼、微笑等。
示例性的,人物所处的运动状态包括但不仅限于走路、跑步、跳跃、打羽毛球、游泳、静止等。人物的人像类型包括面部特写、胸像、七/九分像、全身像以及局部特写等,用于大致表征人物身体部位在画面中的大致截断状态。
电子设备可以预先设置多种无效状态,若人物的拍摄状态并非多种无效状态中的任意一种,则可以认为该人物的拍摄状态是合理的。例如,多种无效状态包括:人物跑步或者打羽毛球,但该人物的部分肢体(例如头、手、脚)缺失(即未出现在画面中);人物处于静止状态,但该人物并未睁眼和/或未微笑;画面中的人物处于静止状态,但该人物位于画面的角落位置(例如四条边、四个顶角等)等。
可见,通过确定每个人物的拍摄状态可避免画面失衡的图像被保留,以及避免包 含一些明显不具备美感(例如缺胳膊少腿)的图像被保留,达到保证图像质量的效果。
进一步的,电子设备还可以评估多帧图像的构图质量,并保留多帧图像中构图质量较高的一帧或多帧图像。
在本实施例中,图像的构图质量可从以下至少三个方面进行评估,分别为:基础构图、多人场景下的社交关系以及多人场景下的人物位置排布。其中,基础构图可用于反映人物所处的位置是否与常见的摄影构图规则匹配。如果人物所处的位置与常见的摄影构图方式匹配,则可以认为该图像的基础构图符合常规审美,构图质量较高。
多人场景下的社交关系可用于在图像中具有多个人物时,衡量多个人物之间的关系是否亲近。若多个人物之间关系比较亲近,则可以认为该图像可能具有较为充沛的情感,能够在情感上影响观看者,构图质量较高。
多人场景下的人物位置排布可用于在图像中具有三个及以上人物时,衡量多个人物之间的排布是否分散。若多个人物之间的排布并不分散,可则可以认为图像中多个人物之间的位置排布比较合理,构图质量较高。
其中,相对于简单地通过识别人体位置/人脸位置与拍照模板进行匹配的方式而言,本申请无需预先设置拍照模板,而是在抓拍多帧图像后从多个维度评估图像的构图质量,并保留其中基础构图较好、人物关系比较亲近且人员排布比较合理的图像,这样得到的图像既能够避免拍照模板的死板,给用户自由发挥空间,又能辅助用户得到高质量图像。
需要说明的是,本申请实施例提供的图像抓拍方法,可应用于电子设备中使用相机应用的场景中,并在该场景中,抓拍构图质量高的图像帧。
示例性的,采用本申请实施例提供的图像抓拍方法,可以在电子设备拍照/录制前的图像预览过程中主动获取多帧图像,并保存其中构图质量高的一帧或多帧图像。
又示例性的,采用本申请实施例提供的图像抓拍方法,可以在电子设备录制视频的过程中,保存视频流所包括的多帧图像中构图质量高的一帧或多帧图像。
下文中,主要以拍照/录制前的图像预览过程为例说明本申请实施例提供的图像抓拍方法。
需要说明的是,本申请实施例提供的电子设备可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备等具有摄像头的设备,本申请实施例对该电子设备的具体类型不作特殊限制。
图3为本申请实施例提供的一种电子设备的结构示意图。如图3所示,电子设备可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module, SIM)卡接口195等。
其中,上述传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器和骨传导传感器等传感器。
可以理解的是,本实施例示意的结构并不构成对电子设备的具体限定。在另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。在另一些实施例中,电子设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。在一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。在一些实施例中,电子设备的天 线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。
天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。
移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在电子设备上的包括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转为电磁波辐射出去。
电子设备通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。该显示屏194包括显示面板。
电子设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。ISP用于处理摄像头193反馈的数据。摄像头193用于捕获静态图像或视频。在一些实施例中,电子设备可以包括1个或N个摄像头193,N为大于1的正整数。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备的各种功能应用以及数据处理。例如,在本申请实施例中,处理器110可以通过执行存储在内部存储器121中的指令,内部存储器121可以包括存储程序区和存储数据区。
其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播 放功能,图像播放功能等)等。存储数据区可存储电子设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备的接触和分离。电子设备可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。
下面将结合附图详细说明本申请提供的图像抓拍方法。
在电子设备开启相机应用后,电子设备可以主动拍摄多帧图像,并保留其中质量较高一帧或多帧的图像。
在一种可选的实施方式中,相机应用具备自动抓拍功能(也可以称为精彩抓拍、智能抓拍等)。该自动抓拍功能是指电子设备在智能识别到特定画面,例如人物微笑、跳跃、奔跑或者宠物等,能够主动抓拍该精彩画面,并保留其中合法的、且构图质量较高的图像。也就是说,在已经开启自动抓拍功能的状态下,电子设备可主动拍摄多帧图像,并保留多帧图像中合法的、且构图质量较高的图像。
示例性的,电子设备可以为手机,开启自动抓拍功能的过程可以如图4-图5所示。
如图4中的(a)所示,手机可以显示界面401(也可以称为主界面、桌面、Home界面等)。该界面401包括多个应用的图标,例如相机应用的图标401a、设置应用的图标等。若用户希望开启相机应用,可以点击该相机应用的图标401a。手机可以接收用户点击相机应用的图标401a的操作,响应于该操作,手机开启相机应用,以及显示如图4中的(b)所示的界面402。该界面402为拍摄预览界面,用于显示摄像头实时采集的图像。如图4中的(b)所示,该界面402包括设置按钮402a、拍照按钮等。手机可以接收用户点击该设置按钮402a的操作,响应于该操作,手机可以显示如图5中的(a)所示的界面403。该界面403中包括多个设置选项,例如照片比例、智能拍照403a、滤镜推荐等。响应于用户对智能拍照403a的操作,如图5中的(b)所示,手机可以显示界面404。该界面404包括声控拍照、手势拍照、笑脸抓拍、自动抓拍404a等选项。此外,该自动抓拍404a的选项包括开关按钮404b以及提示信息404c。用户通过点击该开关按钮404b可以开启或关闭自动抓拍功能。该提示信息404c用于具体描述自动抓拍功能,例如为“开启自动抓拍时,智能识别到人物微笑、跳跃、奔跑以及猫、狗等精彩瞬间时自动拍照”。
在一种可选的实施方式中,电子设备还可以将合法的、且构图质量较高的图像存入图库,以便于用户从图库中查看抓拍到的图片。
示例性的,如图6中的(a)所示,电子设备(例如手机)可显示界面601,该界 面601为拍摄预览界面,用于显示摄像头实时采集的图像。该界面601还包括缩略图601a及图标601b。该缩略图601a为手机存储的最新一帧图像的缩略图。该图标601b用于指示已开启自动抓拍功能。手机可接收用户对该图标601b的操作,响应于该操作,手机可显示图5中的(b)所示的界面404,以对自动抓拍功能进行设置。另外,如图6中的(b)所示,若在手机显示界面601期间,手机抓拍到合法的、且构图质量较高的图像,可将该图像存入图库,并显示缩略图601c,该缩略图601c即为手机刚刚抓拍到、且存入图库的图像的缩略图。其中,若用户希望查看电子设备刚刚保存的图像,可点击该缩略图601c。手机可接收用户对缩略图601c的操作,响应于该操作,手机可显示缩略图601c对应的图像。
在本实施例,电子设备可从至少两个方面来评估图像质量,一是图像中所有人物的拍摄状态,二是图像的构图质量,并保留多帧图像中所有人物的拍摄状态均有效(即合法的)、且构图质量较高的一帧或多帧图像。
为了更清楚地说明电子设备评估图像质量的过程,下文先结合附图说明电子设备确定图像中所有人物的拍摄状态的过程,以及电子设备确定图像的构图质量的过程。需要说明的是,该图像可以为摄像头实时获取的预览流图像数据中的任意一帧图像,在此不做具体限制。
前文已经说明,拍摄状态是指人物在画面中的状态,包括但不仅限于人物所处的运动状态、人物在画面中的截断状态、人物的质心位置、人物在画面中的面积占比、以及人物是否睁眼、微笑等。下文先具体说明电子设备确定人物在画面中的截断状态的过程。
图7A示出了本申请实施例提供的一种图像抓拍方法的流程示意图一。其具体说明了电子设备确定图像人物在画面中的截断状态的过程。如图7A所示,该图像抓拍方法包括:
S710,获取图像。
需要说明的是,相机可以实时获取预览流图像数据,该预览流图像数据即包括多帧图像。S710中的图像可以为多帧图像中的任意一帧图像。
S720,对图像进行人体检测、人脸检测以及关键点检测,得到人体检测结果、人脸检测结果以及关键点检测结果。
示例性的,电子设备可将图像分别输入人体检测模型、人脸检测模型以及关键点检测模型,以得到人体检测结果、人脸检测结果以及关键点检测结果。
需要说明的是,人体检测模型、人脸检测模型以及关键点检测模型均为训练至收敛的模型。其中,人体检测模型用于识别图像中的人体,以及确定人体框的位置。人脸检测模型用于识别图像中的人脸,并进一步识别该人脸是否睁眼、是否微笑等。人脸检测结果可以包括人脸框的位置、人脸是否睁眼以及人脸是否微笑的结果等。关键点检测模型可用于识别图像中每个人物的人体关键点,该人体关键点包括但不仅限于,头顶、脖子、左肩、右肩、左髋、右髋、左膝盖、右膝盖、左脚踝、右脚踝、左手肘(也可称为左胳膊)、右手肘(也可称为右胳膊)、左手腕、右手腕等。
S730,根据人体检测结果、人脸检测结果,确定图像中的总人数。
在一种可选的实施方式中,电子设备可以将所有人脸框与所有人体框进行匹配操 作。其中,对人体框和人脸框进行匹配操作的目的在于,确定人脸框与人体框是否属于同一个人。可以理解地,若人脸框与人体框匹配,则可以确定该人脸框与人体框属于同一个人;若人脸框与人体框不匹配,则可以确定该人脸框与人体框不属于同一个人。
例如,电子设备可提取每个人体框的特征点和人脸框的特征点,并基于特征点进行相似度匹配,以确定匹配的人脸框和人体框。又例如,电子设备可以将人脸框及人体框输入匹配模型,得到人体框与人脸框匹配的置信度。当人体框与人脸框匹配的置信度高于预设的阈值时,则该人体框与人脸框匹配。
其中,图像的人数N为存在匹配的人脸框的人体框的数量(或者存在匹配的人体框的人脸框的数量)、不存在匹配的人体框的人脸框的数量,以及不存在匹配的人脸框的人体框的数量的总和。
示例性的,图7B示出了一幅图像。该图像中包括人脸框a、人脸框b、人体框c、人体框d以及人体框e,其中人脸框a与人体框c匹配,人脸框b与人体框d匹配,人体框e不存在匹配的人脸框。从而,图像中存在匹配的人脸框的人体框的数量为2,不存在匹配的人体框的人脸框的数量为0,不存在匹配的人脸框的人体框的数量为1,因此可以确定该图像中包括3个人物,即总人数为3。
S740,判断当前已处理的人物个数是否小于总人数。
若当前已处理的人物个数小于或等于总人数,则执行S750;若当前已处理的人物个数大于总人数,则结束流程。
S750,根据关键点检测结果确定人像类型和质心位置。
可以理解地,电子设备可以根据关键点检测结果确定人像类型以及人物在画面中的位置。在本实施例中,考虑到人物具备一定轮廓,以人物的质心位置来表征人物在画面中的位置。也即,电子设备可以根据关键点检测结果确定人像类型以及人物的质心位置。
图8示出了电子设备根据关键点检测结果确定人物的人像类型及其质心位置的流程图。需要说明的是,下文中出现的坐标均是以图像的左上顶点为原点、以图像的宽为横轴、以图像的高为纵轴建立的坐标系下的坐标。
如图8所示,在关键点检测结果中仅包括头顶及脖子的关键点的情况下,电子设备可以确定人像类型为面部特写,并确定人物的质心位置为头顶关键点与脖子关键点的平均坐标点。示例性的,如图9所示,电子设备对图像进行关键点检测可得到头顶关键点A及脖子关键点B,其中头顶关键点A的坐标为(x1,y1),脖子关键点B的坐标为(x2,y2),则电子设备可确定该图像的人像类型为面部特写,且人物的质心位置为头顶关键点A和脖子关键点B的平均坐标点R1,平均坐标点R1的坐标为((x1+x2)/2,(y1+y2)/2)。
在一种可选的实施方式中,在关键点检测结果中仅包括头顶、脖子以及肩部(包括左肩或右肩)的关键点的情况下,电子设备可确定人像类型为胸像,并确定人物的质心位置为脖子关键点与肩部关键点的平均坐标点。
考虑到在一些胸像中,用户的胳膊、手腕也可能入镜。因此,在另一种可选的实施方式中,在关键点检测结果中包括头顶关键点、脖子关键点、肩部关键点的情况下, 该关键点检测结果中还进一步包括胳膊关键点和/或手腕关键点,电子设备同样可以确定人像类型为胸像,并确定人物的质心位置为脖子关键点与肩部关键点的平均坐标点。
示例性的,如图10所示,电子设备对图像进行关键点检测可得到头顶关键点A、脖子关键点B、左肩关键点C1、右肩关键点C2、左胳膊关键点D1、右胳膊关键点D2以及右手腕关键点E1,其中头顶关键点A的坐标为(x1,y1),脖子关键点B的坐标为(x2,y2),左肩关键点C1的坐标为(x3,y3),右肩关键点C2的坐标为(x4,y4),则电子设备可确定该图像的人像类型为胸像,且人物的质心位置为头顶关键点A、脖子关键点B、左肩关键点C1及右肩关键点C2的平均坐标点R2,且平均坐标点R2的坐标为:
其中,N为关键点的个数,即为4。
在一种可选的实施方式中,在关键点检测结果中仅包括头顶、脖子、肩部、髋关节以及胳膊的关键点的情况下,电子设备可确定人像类型为七/九分像,以及确定人物的质心位置为髋关节关键点、胳膊关键点、肩部关键点、脖子关键点以及头顶关键点的平均坐标点。其中,求取该平均坐标点的算法与上述求取平均坐标点R2的方法类似,区别在于N=5,即i∈[1,5],在此不再赘述。
考虑到在一些七/九分像中,用户手腕、膝盖也可能入镜。因此,在另一种可选的实施方式中,在关键点检测结果中包括头顶、脖子、肩部、胳膊、髋关节以及胳膊的关键点的情况下,若关键点检测结果还包括手腕和/或膝盖,电子设备同样可确定人像类型为七/九分像,并确定人物的质心位置为头顶关键点、脖子关键点、肩部关键点、髋关节关键点、胳膊关键点的平均坐标点。
示例性的,如图11所示,电子设备对图像进行关键点检测可得到头顶关键点A、脖子关键点B、左肩关键点C1、左胳膊关键点D1、左髋关键点E1、左手腕关键点F1以及左膝盖关键点G1,则电子设备可确定人像类型为七/九分像,并确定人物的质心位置为头顶关键点A、脖子关键点B、左肩关键点C1、左胳膊关键点D1以及左髋关键点E1的平均坐标点R3。
在一种可选的实施方式中,在关键点检测结果中仅包括头顶、脖子、肩部、髋关节、胳膊、膝盖及脚踝的关键点的情况下,电子设备可确定人像类型为全身像,并确定人物的质心位置为头顶关键点、脖子关键点、肩部关键点、髋关节关键点、胳膊关键点的平均坐标点。
考虑到一些全身像中,例如用户处于蹲下的姿势,或者用户穿得比较宽松检测不到肩部、髋关节、胳膊、手腕或者膝盖。从而,在关键点检测结果仅包括头顶关键点和脚踝关键点的情况下,电子设备同样可以确定人像类型为全身像。这种情况下,电子设备可以将该人物的人体框的中心点位置作为该人物的质心位置。其中人体框的中心点是指人体框两对角线的交点。
示例性的,如图12所示,电子设备对图像进行关键点检测可得到头顶关键点A、 脖子关键点B、左肩关键点C1、右肩关键点C2、右胳膊关键点D2、左髋关键点E1、右髋关键点E2、左膝盖关键点F1、右膝盖关键点F2、左脚踝关键点G1以及右脚踝关键点G2,因此电子设备可确定该人物的人像类型为全身像,且人物的质心位置为头顶关键点A、脖子关键点B、左肩关键点C1、右肩关键点C2、右胳膊关键点D2、左髋关键点E1、右髋关键点E2的平均坐标点R4。
在一种可选的实施方式中,在关键点检测结果不包括头顶以及肩部的关键点的情况下,电子设备确定人像类型为局部特写,并确定人物的质心位置为检测到的所有关键点的平均坐标点。例如,关键点检测结果中仅包括胳膊,则电子设备可确定人像类型为胳膊的特写,质心位置即为该胳膊的位置坐标。
S760,根据人体检测结果、关键点检测以及人像类型确定人物的截断状态。
可以理解地,人像类型可大致表征人物身体部位在画面中的大致截断状态。例如,若人像类型为面部特写,即表明画面中仅包括人物的头部,人物头部以下的部位被截断。若人像类型为胸像,即表明画面中包括人物的上半身,人物腰部以下的部位被截断。若人像类型为七/九分像,即表明画面中包括人物小腿/脚踝以上的部分,人物的脚被截断。若人像类型为全身像,即表明画面中包括人物的整个身体。
具体的,关于人体具体部位(例如四肢、头部)的截断状态,电子设备可具体通过关键点检测结果确认。例如,关键点检测结果中不包括头顶、脖子的关键点,则可以确定画面中人物的头被截断;又例如,关键点检测结果中不包括手肘、手腕,则可以确定画面中人物的手被截断。
S770,当前已处理的人物个数加1。
如此,可使得图像中包括N个人物时,电子设备可确定N个人物的人像类型以及质心位置。
在一种可选的实施方式中,电子设备还可以将图像输入运动识别模型,以确定人物所处的运动状态。该运动识别模型为预先训练至收敛的神经网络模型,可用于识别图像中人物所处的运动状态,包括但不仅限于走路、跑步、跳跃、打羽毛球、游泳、投掷、打水仗、静止等。
在一种可选的实施方式中,电子设备还可以根据人体检测结果确定每个人物的面积占比。人物的面积占比具体为人物的面积在图像中的占比,可以为人物面积与图像面积的比值。在一种可选的实施方式中,人物面积为该人物对应的人体框的面积。
在电子设备确定图像中所有人物的拍摄状态后,便可确认该图像是否为合法图像。
在一种可选的实施方式中,图像中可包括主体人物和有效人物,电子设备可对主体人物和有效人物分别进行有效性判断。其中,主体人物主要是指图像中的主要人物,也可以说是主角。而有效人物是图像中重要程度次于主要人物的人物,例如路人等。
如图13A所示,电子设备可依次判断每个人物是否符合有效人物条件,若人物符合有效人物条件则将其存入有效人物集合。若该人物还符合主体人物条件,则将其存入主体人物集合。在判断出图像中所有人物是否为主体人物或有效人物后,电子设备可对有效人物集合中的人物和主体人物集合中的人物分别进行有效性判断。
在一种可选的实施方式中,电子设备可根据人物的面积占比以及人物的质心位置将人物划分为有效人物和主体人物。有效人物条件可以包括人物的面积占比大于阈值 M1,主体人物条件可以包括人物的面积占比大于阈值M1且人物的质心位置在图像的预设区域内。示例性的,该预设区域可以为图像四个兴趣点所构成的区域、图像三分线所构成的区域等,在此不做具体限制。也就是说,人物的面积占比大于阈值M1的人物可以称为有效人物,人物的面积占比大于阈值M1且人物的质心位置在图像的预设区域内的人物可以称为主体人物。
在本实施例中,电子设备可分别给有效人物和主体人物设置多种无效状态。其中,有效人物相对与主体人物而言,可以存在肢体截断、表情不到位等情况。
例如,对于主体人物而言,其多种无效状态可包括:在人物正在跳跃或跑步的情况下,人像类型不为全身,或者存在肢体截断;在人物正在投掷、打羽毛球的情况下,人像类型不为全身像及半身像,或者存在头部截断;在人物正在泼水或者打乒乓球的情况下,图像中不存在人脸或者手肘截断;人物处于静止状态,且未睁眼或未微笑,或者存在脸部截断;人物处于静止状态,且在未检测到人脸的情况下面积占比过大;人物处于静止状态、人像类型为面部特写或胸像,且人物的质心位置在预设区域之外等。
可以理解地,若主体人物的拍摄状态不与上述任何一种无效状态匹配,则可确定该主体人物的拍摄状态有效。
对于有效人物而言,其多种无效状态可包括:在人物正在跳跃或跑步的情况下,人像类型不为全身、存在头部截断等。可以理解地,若有效人物的拍摄状态不与上述任何一种无效状态匹配,则可确定该有效人物的拍摄状态有效。
需要说明的是,上述多种无效状态仅为示例,实际还可以根据需求设置更多。
在一种可选的实施方式中,在所有有效人物的拍摄状态有效以及所有主体人物的拍摄状态均有效的情况下,确定该图像合法。
在一种可选的实施方式中,电子设备可以不区分有效人物和主体人物,直接判断所有人物的拍摄状态是否有效,在所有人物的拍摄状态均有效的情况下确认该图像合法。其中,判断每个人物的拍摄状态是否有效的原理与上述判断主体人物/有效人物的拍摄状态是否有效的原理类似,在此不再赘述。
电子设备还可以评估图像的构图质量。其中图像的构图质量可从以下至少三个方面进行评估,分别为:基础构图、多人场景下的社交关系以及多人场景下的人物位置排布。下面将对上述三个方面分别进行说明。
一、基础构图
基础构图是指画面上的布局、结构,具体可指人物在画面上的位置。常见的摄影构图法则包括但不仅限于黄金三角构图法则、三分构图法则、对角线法则以及中心构图法则等。其中,不同的构图法则可具有不同的标记点或引导线,以辅助构图。
如图13B所示,示出了黄金三角构图法则、三分构图法则、对角线法则以及中心构图法则的参考位置。其中,在人物在四个兴趣点中任意一个兴趣点附近的情况下,可以认为该图像比较符合黄金三角构图法则。在人物在任意一条三分线附近的情况下,可以认为该图像比较符合三分构图法则。在人物在任意一条对角线附近的情况下,可以认为该图像比较符合中心构图法。在人物在中心点附近的情况下,可以认为该图像比较符合中心构图法。
在本实施例中,电子设备可根据目标人物的质心位置到参考位置的距离确定距离参数,并以此衡量图像与预设构图法则的匹配程度。其中,不同的构图法则,其对应的参考位置不同,因此对应的距离参数也不同。需要说明的是,该目标人物可以为图像中的每个人物,也可以为图像中的主体人物。
下面以目标人物为图像中的每个人物,图像的尺寸为width*height(宽x高),质心位置为(Massx,Massy)为例,先说明在图像中仅包括一个人物时,电子设备确定图像与不同构图法则的匹配程度的过程。
对于黄金三角构图法则,参考位置为四个兴趣点。电子设备可计算质心位置与四个兴趣点之间的距离,并将四个距离中的最小距离作为第一距离参数,用于表征图像与黄金三角构图法则的匹配程度。其中,第一距离参数越小,则该图像与黄金三角构图法则的匹配程度越高。
其中,第一距离参数满足:
其中,为第一距离参数,dis(i)为质心位置到第i个兴趣点的距离,i=1,2,3,4。
其中,质心位置到任意一个兴趣点的距离满足:
其中,d(Pix,Piy)为第i个兴趣点的坐标。
对于三分构图法则,参考位置为四条三分线。电子设备可计算质心位置到四条三分线之间的距离,并将四个距离中的最小距离作为第二距离参数,用于表征图像与三分构图法则的匹配程度。其中,第二距离参数越小,则该图像与三分构图法则的匹配程度越高。
其中,第二距离参数满足算式:
其中,为第二距离参数,d(mass,Li)是指质心位置到第i条三分线的距离,i=1,2,3,4。
以第i条三分线为y=ki+bi为例,则质心位置(Massx,Massy)到该第i条三分线的距离为:
对于对角线法则,参考位置为两条对角线。电子设备可计算质心位置到两条对角线的距离,并将两个距离中的最小距离作为第三距离参数,用于表征图像与对角线法则的匹配程度。其中,第三距离参数越小,则该图像与对角线法则的匹配程度越高。
其中,第三距离参数满足算式:
其中,为第三距离参数,d(mass,Li)是指质心位置到第i 条对角线的距离,i=1,2。
对于中心构图法则,参考位置为图像中心点。电子设备可计算质心位置到图像中心点的距离,并以该距离为第四距离参数,用于表征图像与中心构图法则的匹配程度。其中,第四距离参数越小,表明图像与中心构图法则的匹配程度越高,该人物在整个图像中的分布较为均匀。
其中,第四距离参数满足:
其中,为第四距离参数,(Cx,Cy)为中心点的坐标。
在图像中包括N个人物时,图像与不同构图法则的匹配程度,与每个人物的面积占比以及该人物的质心位置与各标记点或引导线的距离有关。
具体的,对于黄金三角构图法则,电子设备可计算N个人物的面积占比,以及N个人物的质心位置到四个兴趣点的最小距离,然后以人物的面积占比为权重对N个最小距离进行加权平均,将得到的结果作为第一距离参数,用于表征该图像与黄金三角构图法则的匹配程度。具体的,计算公式可以如下所示:
其中,Sp为在图像中包括N个人物时,该图像与黄金三角构图法则的匹配程度;wj为第j个人物的面积占比,j∈[1,N],Pj为第j个人物的质心位置,Pi P为第i个兴趣点,i∈[1,4],massDistanceAllPoint(j)为第j个人物的质心位置到四个兴趣点的最小距离。
对于三分构图法则,电子设备可计算N个人物的面积占比,以及N个人物的质心位置到四条三分线的最小距离,然后以人物的面积占比为权重对N个最小距离进行加权平均,将得到的结果作为第二距离参数,用于表征该图像与三分构图法则的匹配程度。具体的,计算公式可以如下所示:
其中,ST为在图像中包括N个人物时,该图像与三分构图法则的匹配程度;wj为第j个人物的面积占比,j∈[1,N],Pj为第j个人物的质心位置,Pi T为第i条三分线,i∈[1,4],massDistanceThirdLine(j)为第j个人物的质心位置到四条三分线的最小距离。
对于对角线法则,电子设备可计算N个人物的面积占比,以及N个人物的质心位置到两条对角线的最小距离,然后以人物的面积占比为权重对N个最小距离进行加权平均,将得到的结果作为第三距离参数,用于表征该图像与对角线法则的匹配程度。具体的,计算公式可以如下所示:
其中,SD为在图像中包括N个人物时,该图像与对角线法则的匹配程度;wj为第 j个人物的面积占比,j∈[1,N],Pj为第j个人物的质心位置,Pi D为第i条对角线,i∈[1,2],massDistanceDiagonaLine(j)为第j个人物的质心位置到两条对角线的最小距离。
对于中心构图法则,电子设备可计算N个人物的面积占比,以及N个人物的质心位置到中心位置的距离,然后以人物的面积占比为权重对N个距离进行加权平均,将得到的结果作为第四距离参数,用于表征该图像与中心构图法则的匹配程度。具体的,计算公式可以如下所示:
其中,SC为在图像中包括N个人物时,该图像与中心构图法则的匹配程度;wj为第j个人物的面积占比,j∈[1,N],Pj为第j个人物的质心位置,PC为中心点,massDistanceCenter(j)为第j个人物的质心位置到中心点的距离。
可以理解地,上述的距离参数(包括第一距离参数、第二距离参数、第三距离参数及第四距离参数)越小,则表明图像与构图规则的匹配程度越高,即该图像的构图质量越高。
需要说明的是,在目标人物为主体人物的情况下,电子设备可统计图像中主体人物的数量,并在主体人物的数量为1或大于1时,分别采用上述不同的方式计算距离参数,在此不再赘述。
二、多人场景下的社交关系
在图像中包括两个目标人物以上时,电子设备还可以评估该图像的社交关系特征。社交关系特征可以隐含地表达图像中目标人物的关系,例如人物之间的关系是否亲近等,这可能会在情感上影响观看者的偏好。
在一种可选的实施方式中,电子设备可确定图像的亲密度参数,通过亲密度参数来反映画面中人物间的亲近关系。
具体的,电子设备可确定图像中每个目标人物的人脸位置,并根据多个人脸位置确定图像的亲密度参数。其中,目标人物可以为图像中的每个人或者图像中的主体人物。人脸位置可以为人脸框的中心点位置,人物头部的质心位置。人物头部的质心位置是指头顶关键点和脖子关键点的平均点坐标,具体算法见前文的描述,在此不再赘述。
图14示出了本申请实施例提供的一种图像抓拍方法的流程图。其具体示出了电子设备确定图像的亲密度参数的过程。如图14所示,本申请实施例提供的图像抓拍方法包括:
S1401,以N个人脸位置为节点,以任意两个人脸位置的连线为边构建二阶树结构;其中,每条边的权值为边对应的两个人脸位置间的距离。
示例性的,图15中的(a)所示的图像中包括5个人脸框,该5个人脸框的中心点分别为A、B、C、D、E。其中,电子设备可以A、B、C、D、E为节点,连接AB、AC、AD、AE、BC、BD、BE、CD、CE、DE,然后计算AB之间的欧式距离作为A-B边的权值、计算AC之间的欧式距离作为A-C边的权值、计算AD之间的欧式距离作为A-D边的权值、计算AE之间的欧式距离作为A-E边的权值、计算BC之间的欧式距离作为B-C边的权值、计算BD之间的欧式距离作为B-D边的权值、计算BE之间 的欧式距离作为B-E边的权值、计算CD之间的欧式距离作为C-D边的权值、计算CE之间的欧式距离作为C-E边的权值、计算DE之间的欧式距离作为D-E边的权值。其中,根据A、B、C、D、E构建的二阶树结构可以如图15中的(b)所示。
S1402,构建二阶树结构的最小生成树,最小生成树包括N-1条边。
该最小生成树包括二阶树结构中的所有节点,并且包括保持图连通的最少的边。
其中,电子设备可采用Prim(普里姆)算法或Kruskal(克鲁斯卡尔)算法构建最小生成树。Kruskal(克鲁斯卡尔)算法是指将连通网(即二阶树结构)中所有的边按照权值大小做升序排序,从权值最小的边开始选择,只要此边不和已选择的边一起构成环路,就可以选择它组成最小生成树。对于N个顶点的连通网,挑选出N-1条符合条件的边,这些边组成的生成树就是最小生成树。
示例性的,电子设备将图15中的(b)所示的二阶树结构中的所有边按照权值大小做升序排序,可得到表1:
表1
其中,最小的权值为B-C边的权值、C-D边的权值,均为3。假设电子设备从B-C开始挑选,由于尚未选择任何边组成最小生成树,且B-C自身不会构成环路,所以B-C边可以组成最小生成树;由于C-D边不会和已选的B-C边构成环路,可以组成最小生成树;由于D-E边不会和已选的B-C边、C-D边构成环路,可以组成最小生成树;由于E-A边不会和已选的B-C边、C-D边以及D-E边构成环路,可以组成最小生成树;由于D-A边会和已选的边构成环路,不能组成最小生成树。如此,便可得到图16所示的最小生成树。
Prim(普里姆)算法是指对于包含N个顶点的连通网,每次从连通网中找出一个权值最小的边,这样的操作重复N-1次,由N-1条权值最小的边组成的生成树就是最小生成树。
示例性的,如图17所示,电子设备先从A-E、A-D、A-C以及A-B中确定权值最小的边,即为A-E。然后,电子设备从E-D、E-C、E-B中确定权值最小的边,即为E-D。接着,电子设备从D-C、D-B中确定权值最小的边,即为D-C。最终,连接A-E、E-D、D-C、C-B组成最小生成树。
S1403,将N-1条边的权值的平均值确定为亲密度参数。
其中,具体计算公式为:
其中,FaceCloseness为亲密度参数,N为人脸总数。
可以理解地,FaceCloseness越小,即画面中的人脸越紧凑,进而人物间的关系越亲密,该图像包含的情感更丰厚,因此构图质量更高。
三、多人场景下的人物位置排布
在图像中包括三个目标人物以上时,电子设备可根据目标人物的质心位置确定图像的紧凑度参数,用于评估图像中目标人物的位置排布情况。同样地,目标人物可以 为图像中的每个人或者图像中的主体人物。
图18示出了本申请实施例提供的一种图像抓拍方法的流程图。其具体示出了电子设备确定图像的亲密度参数的过程。如图18所示,本申请实施例提供的图像抓拍方法包括:
S1801,对N个质心位置进行归一化处理。
在本实施例中,为消除量纲影响,电子设备可利用图像的长、宽对人物的质心位置进行归一化处理。其中,归一化处理后的质心位置满足:
S1802,确定进行归一化处理后的N个质心位置在X轴方向上的标准差、在Y轴方向上的标准差。
可以理解地,X轴方向(可以称为第一方向)的标准差可以反映人物在X轴方向上的排布情况,Y轴方向(可以称为第二方向)上的标准差可以反映人物在Y轴方向上的排布情况。
S1803,将X轴方向上的标准差、Y轴方向上的标准差中的较小值确定为紧凑度参数。
如此,得到的紧凑度参数可用于指示图像中至少三个人物间的位置排布情况,且紧凑度参数越小则至少三个人物间的位置排布越合理,图像的构图质量越高。
在确定多帧图像的构图指标后,电子设备可对图像的构图指标进行比较,以保留其中构图质量较高的一帧或多帧图像。
具体的,电子设备可比较所述多帧图像中任意两帧图像的构图指标,剔除所述任意两帧图像中构图质量较低的一帧图像,然后继续比较剔除所述构图质量较低的一帧图像后的多帧图像中的任意两帧图像的构图指标,直至所述多帧图像均完成比较,最终确定其中构图质量较高的一帧或多帧图像。
下面以电子设备以比较第一图像和第二图像的构图指标为例,具体说明比较过程。
其中,第一图像的构图参数包括第一距离参数a、第二距离参数a、第三距离参数a、第四距离参数a、第一亲密度参数以及第一紧凑度参数;其中,第一距离参数a用于表征第一图像与黄金三角构图法则的匹配程度,第二距离参数a用于表征第一图像与三分构图法则的匹配程度,第三距离参数a用于表征第一图像与对角线法则的匹配程度,第四距离参数a用于表征第一图像与中心构图法则的匹配程度,第一亲密度参数用于表征第一图像中多个人物间的关系亲近程度,第一紧凑度参数用于表征第一图像中多个人物间位置排布的合理程度。
第二图像的构图参数包括第一距离参数b、第二距离参数b、第三距离参数b、第四距离参数b、第二亲密度参数以及第二紧凑度参数;其中,第一距离参数b用于表征第二图像与黄金三角构图法则的匹配程度,第二距离参数b用于表征第二图像与三分构图法则的匹配程度,第三距离参数b用于表征第二图像与对角线法则的匹配程度,第四距离参数b用于表征第二图像与中心构图法则的匹配程度,第二亲密度参数用于表征第二图像中多个人物间的关系亲近程度,第二紧凑度参数用于表征第二图像中多个人物间位置排布的合理程度。
需要说明的是,根据第一图像中的总人数和第二图像中的总人数的不同,电子设备可比对第一图像和第二图像不同的构图参数。
其中,在第一图像和第二图像的总人数均为1的情况,电子设备仅比较两幅图像的距离参数。具体的,电子设备可计算第一距离参数a与第一距离参数b的第一差值,在该第一差值大于第一阈值的情况下,若第一距离参数a更小则第一图像的构图质量高于第二图像的构图质量;若第一距离参数b更小则第二图像的构图质量高于第一图像的构图质量。
其中,第一差值为第一距离参数a和第一距离参数b的差的绝对值。第一阈值用于衡量第一距离参数a和第一距离参数b的相近程度。在第一差值小于或等于第一阈值的情况下,说明第一图像和第二图像可能采用了相同的构图法则,因而可比性较低;在第一差值大于第一阈值的情况下,说明第一图像和第二图像并非采用相同的构图法则,因而进行比较。
在第一差值小于或等于第一阈值的情况下,电子设备可计算第二距离参数a与第二距离参数b的第二差值,在该第二差值大于第二阈值的情况下,若第二距离参数a更小则第一图像的构图质量高于第二图像的构图质量;若第二距离参数b第二图像的构图质量高于第一图像的构图质量。
在第二差值小于或等于第二阈值的情况下,电子设备可计算第三距离参数a与第三距离参数b的第三差值,在该第三差值大于第三阈值的情况下,若第三距离参数a更小则第一图像的构图质量高于第二图像的构图质量;若第三距离参数b更小则第二图像的构图质量高于第一图像的构图质量。
在第三差值小于或等于第三阈值的情况下,电子设备可计算第四距离参数a与第四距离参数b的第四差值,在该第四差值大于第四阈值的情况下,若第四距离参数a更小则第一图像的构图质量高于第二图像的构图质量,第四距离参数b更小则第二图像的构图质量高于第一图像的构图质量。
在第四差值小于第四阈值的情况下,电子设备根据两幅图像的距离参数无法确定哪副图像的构图质量更高,可以进一步根据清晰度、信噪比等参数确定图像质量。
在一幅图像的总人数为2且另一幅图像的总人数大于2的情况下,电子设备可通过两幅图像的距离参数以及亲密度参数来比较两幅图像的构图质量。
首先,电子设备可比较两幅图像的距离参数,详情参见前文,在此不再赘述。若通过两幅图像的距离参数无法确定哪副图像的构图质量更高,则电子设备可进一步比较两幅图像的亲密度参数。
具体的,在第四差值小于第四阈值的情况下,电子设备可计算第一紧凑程度与第二紧凑程度的第五差值,在该第五差值大于或等于第五阈值的情况下,若第一紧凑程度更小则第一图像的构图质量高于第二图像的构图质量;若第二紧凑程度更小则第二图像的构图质量高于第一图像的构图质量。
在第五差值小于第五阈值的情况下,电子设备可以进一步根据清晰度、信噪比等参数确定图像质量。
在两幅图像的总人数均大于2的情况下,电子设备可通过紧凑度参数比较两幅图的构图质量。
具体的,电子设备可以计算第一紧凑度参数与第二紧凑度参数的第六差值,在该第六差值大于第六阈值的情况下,若第一紧凑度参数较小则第一图像的构图质量高于第二图像的构图质量;若第二紧凑度参数较小则第二图像的构图质量高于第一图像的构图质量。
在一种可选的实施方式中,电子设备在获取多帧图像后,可保留其中的合法图像。其中,确定合法图像的过程参见前文,在此不再赘述。
在一种可选的实施方式中,电子设备在获取多帧图像后,可比较多帧图像的构图指标,最终保存其中构图质量较高的一帧或多帧图像。其中比较两帧图像的构图指标的过程参见前文,在此不再赘述。
在一种可选的实施方式中,如图19所示,电子设备在获取多帧图像后,可先获取多帧图像的合法性检测结果以及构图指标。然后对图像帧进行两两对比,若两帧图像中一帧图像合法另一帧图像不合法,则可确定其中的合法图像的构图质量更高。若两帧图像均合法或者均不合法,则根据两帧图像的构图指标确定构图质量更高的图像。其中比较两帧图像的构图指标的过程参见前文,在此不再赘述。
在一种可选的实施方式中,对于每帧图像,电子设备可识别该图像中所有拍摄对象的拍摄状态,以及评估该图像的构图质量,并基于所有拍摄对象的拍摄状态以及图像的构图质量从多帧图像中确定需要被保留的图像。
在另一种可选的实施方式中,对于每帧图像,电子设备可先识别该图像中所有拍摄对象的拍摄状态。在该图像中所有拍摄对象的拍摄状态均合理的情况下,电子设备才进一步评估该图像的构图质量。如此对于那些存在部分或全部拍摄对象的拍摄状态不合理的图像,电子设备可以无需评估其构图质量,以减少运算量,从而能够更加快速地从多帧图像中确定需要被保留的图像。
综上所述,本申请无需预先设置拍照模板,而是在抓拍多帧图像后从多个维度评估图像的构图质量,并保留其中基础构图较好、人物关系比较亲近且人员排布比较合理的图像,这样得到的图像既能够避免拍照模板的死板,给用户自由发挥空间,又能辅助用户得到高质量图像。
本申请实施例还提供了一种电子设备,该电子设备可以包括:存储器和一个或多个处理器。存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,电子设备可执行上述方法实施例中手机执行的各个功能或者步骤。
本申请实施例还提供一种芯片系统,如图20所示,该芯片系统2000包括至少一个处理器2001和至少一个接口电路2002。处理器2001和接口电路2002可通过线路互联。例如,接口电路2002可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路2002可用于向其它装置(例如处理器2001)发送信号。示例性的,接口电路2002可读取存储器中存储的指令,并将该指令发送给处理器2001。当所述指令被处理器2001执行时,可使得电子设备或者服务器执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备或者服务器执行上述方 法实施例中的各个功能或者步骤。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述方法实施例中的各个功能或者步骤。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述方法实施例中手机执行的各个功能或者步骤。
其中,本实施例提供的电子设备、通信系统、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (24)

  1. 一种图像抓拍方法,其特征在于,应用于电子设备,所述电子设备包括摄像头,所述方法包括:
    实时显示所述摄像头采集的多帧图像;
    根据每帧图像的人物信息确定对应图像的构图指标;其中,所述人物信息包括目标人物的人数以及多个人物参数中的一个或多个,所述多个人物参数包括目标人物的质心位置、目标人物的面积占比和目标人物的人脸位置,所述构图指标包括多个构图参数中的一个或多个,所述多个构图参数包括距离参数、亲密度参数以及紧凑度参数,所述距离参数用于指示所述图像与预设构图法则的匹配程度,所述亲密度参数用于指示所述图像中至少两个目标人物间的亲密度,所述紧凑度参数用于指示所述图像中至少三个目标人物间位置排布的离散程度;
    保存所述多帧图像中构图质量最高的一帧或多帧图像;其中,所述距离参数越小、所述亲密度参数越小或者所述紧凑度参数越小,则所述图像的构图质量越高。
  2. 根据权利要求1所述的方法,其特征在于,所述构图指标包括所述距离参数,在人数N≥2的情况下,所述人物信息包括N个目标人物的质心位置、N个目标人物的面积占比;所述根据每帧图像的人物信息确定对应图像的构图指标,包括:
    对于所述N个目标人物中的每个目标人物,根据所述目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数;
    以每个目标人物的面积占比为权重对所有目标人物对应的基础距离参数加权平均,得到所述距离参数。
  3. 根据权利要求1所述的方法,其特征在于,所述构图指标包括所述距离参数,在人数N=1的情况下,所述人物信息包括每个目标人物的质心位置,所述根据每帧图像的人物信息确定对应图像的构图指标,包括:
    根据所述目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数;
    将所述基础距离参数确定为所述距离参数。
  4. 根据权利要求2或3所述的方法,其特征在于,所述预设参考位置包括多个参考位置;所述根据所述目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数,包括:
    将所述目标人物的质心位置到所述多个参考位置的距离中的最小值作为对应的基础距离参数;
    或者,
    所述预设参考位置包括一个参考位置;所述根据所述目标人物的质心位置到预设参考位置的距离,得到对应的基础距离参数,包括:
    将所述目标人物的质心位置到所述一个参考位置的距离作为对应的基础距离参数。
  5. 根据权利要求2或3所述的方法,其特征在于,所述预设参考位置包括:图像的四个兴趣点、图像的两条对角线、图像的四条三等分线或者图像的中心点。
  6. 根据权利要求1-5中任意一项所述的方法,其特征在于,在人数N≥2的情况下,所述构图指标包括所述亲密度参数,所述人物信息包括N个目标人物的人脸位置,所述根据每帧图像的人物信息确定对应图像的构图指标,包括:
    以N个人脸位置为节点,以任意两个人脸位置的连线为边构建二阶树结构;其中,每条边的权值为边对应的两个人脸位置间的距离;
    构建所述二阶树结构的最小生成树,所述最小生成树包括N-1条边;
    将所述N-1条边的权值的平均值确定为所述亲密度参数。
  7. 根据权利要求6所述的方法,其特征在于,在人数N≥3的情况下,所述构图指标还包括所述紧凑度参数,所述人物信息还包括N个目标人物的质心位置,所述根据每帧图像的人物信息确定对应图像的构图指标,还包括:
    分别确定N个质心位置在第一方向上的标准差、在第二方向上的标准差;
    将所述第一方向上的标准差、所述第二方向上的标准差中的较小值确定为所述紧凑度参数。
  8. 根据权利要求1-7中任意一项所述的方法,其特征在于,所述方法还包括:
    比较所述多帧图像中任意两帧图像的构图指标,剔除所述任意两帧图像中构图质量低的一帧图像;
    继续比较剔除所述构图质量低的一帧图像后的多帧图像中的任意两帧图像的构图指标,直至所述多帧图像均完成比较。
  9. 根据权利要求8所述的方法,其特征在于,在所述任意两帧图像的人数均为1的情况下,所述构图指标包括所述距离参数,所述距离参数包括第一距离参数、第二距离参数、第三距离参数以及第四距离参数,所述第一距离参数用于反映所述图像与第一构图法则的匹配程度,所述第二距离参数用于反映所述图像与第二构图法则的匹配程度,所述第三距离参数用于反映所述图像与第三构图法则的匹配程度,所述第四距离参数用于反映所述图像与第四构图法则的匹配程度,所述第一构图法则、所述第二构图法则、所述第三构图法则以及所述第四构图法则包括不同的参考位置;
    所述比较所述多帧图像中任意两帧图像的构图指标包括:
    在所述任意两帧图像的第一距离参数的差值大于或等于第一阈值的情况下,比较所述任意两帧图像的第一距离参数,其中第一距离参数较小的图像的构图质量更高;
    在所述任意两帧图像的第一距离参数的差值小于第一阈值的情况下,判断所述任意两帧图像的第二距离参数的差值是否大于或等于第二阈值;
    在所述任意两帧图像的第二距离参数的差值大于或等于第二阈值的情况下,比较所述任意两帧图像的第二距离参数,其中第二距离参数较小的图像的构图质量更高;
    在所述任意两帧图像的第二距离参数的差值小于第二阈值的情况下,判断所述任意两帧图像的第三距离参数的差值是否大于或等于第三阈值;
    在所述任意两帧图像的第三距离参数的差值大于或等于第三阈值的情况下,比较所述任意两帧图像的第三距离参数,其中第三距离参数较小的图像的构图质量更高;
    在所述任意两帧图像的第三距离参数的差值小于第三阈值的情况下,判断所述任意两帧图像的第四距离参数的差值是否大于或等于第四阈值;
    在所述任意两帧图像的第四距离参数的差值大于或等于第四阈值的情况下,比较所述任意两帧图像的第四距离参数,其中第四距离参数较小的图像的构图质量更高。
  10. 根据权利要求9所述的方法,其特征在于,若所述任意两帧图像中的一帧图像的人数N=2,另一帧图像的人数N≥2,所述构图指标还包括亲密度参数,所述比较所 述多帧图像中任意两帧图像的构图指标还包括:
    在所述任意两帧图像的第四距离参数的差值小于第四阈值的情况下,判断所述任意两帧图像的亲密度参数的差值是否大于或等于第五阈值;
    在所述任意两帧图像的亲密度参数的差值大于或等于第五阈值的情况下,比较所述任意两帧图像的亲密度参数,其中亲密度参数较小的图像的构图质量更高。
  11. 根据权利要求8-10中任意一项所述的方法,其特征在于,若所述任意两帧图像的人数均大于等于2,所述构图指标还包括所述紧凑度参数,所述比较所述多帧图像中任意两帧图像的构图指标包括:
    在所述任意两帧图像的紧凑度参数的差值大于或等于第六阈值的情况下,比较所述任意两帧图像的紧凑度参数,其中紧凑度参数较小的图像的构图质量更高。
  12. 根据权利要求1-11中任意一项所述的方法,其特征在于,所述目标人物为图像中的每个人物,或者,所述目标人物为图像中面积占比大于预设阈值且质心位置在预设区域内的人物。
  13. 根据权利要求1-12中任意一项所述的方法,其特征在于,所述方法还包括:
    对所述多帧图像进行人体检测、人脸检测以及关键点检测,分别得到人体检测结果、人脸检测结果以及关键点检测结果;
    根据所述人体检测结果、所述人脸检测结果以及所述关键点检测结果确定所述多帧图像中每个人物的拍摄状态;其中,所述拍摄状态包括人物的运动状态及以下多种状态中的一种或多种,所述多种状态包括:人物的质心位置、人像类型以及人物的面积占比;
    所述保存所述多帧图像中构图质量最高的一帧或多帧图像,包括:
    保存所述多帧图像中构图质量最高的一帧或多帧合法图像;其中,所述合法图像为所有人物的拍摄状态均有效的图像。
  14. 根据权利要求13所述的方法,其特征在于,若所述关键点检测结果仅包括头顶关键点及脖子关键点,则所述人像类型为面部特写,以及所述人物的质心位置为所述头顶关键点与所述脖子关键点的平均坐标点。
  15. 根据权利要求13所述的方法,其特征在于,若所述关键点检测结果仅包括头顶关键点、脖子关键点、肩部关键点以及以下多个第一关键点中的一个或多个,则所述人像类型为胸像,以及所述人物的质心位置为所述脖子关键点与所述肩部关键点的平均坐标点,所述多个第一关键点包括胳膊关键点和手腕关键点。
  16. 根据权利要求13所述的方法,其特征在于,若所述关键点检测结果仅包括头顶关键点、脖子关键点、肩部关键点、髋关节关键点、胳膊关键点以及以下多个第二关键点中的一个或多个,则所述人像类型为七/九分像,以及所述人物的质心位置为所述头顶关键点、所述脖子关键点、所述肩部关键点、所述髋关节关键点、所述胳膊关键点的平均坐标点,所述多个第二关键点包括手腕关键点以及膝盖关键点。
  17. 根据权利要求13所述的方法,其特征在于,若所述关键点检测结果仅包括头顶关键点、脚踝关键点以及以下多个第三关键点中的一个或多个,则所述人像类型为全身像,以及所述人物的质心位置为所述人物的人体框的中心点位置,所述多个第三关键点包括肩部关键点、髋关节关键点、胳膊关键点、手腕关键点、膝盖关键点。
  18. 根据权利要求13所述的方法,其特征在于,若所述关键点检测结果不包括头顶关键点及脖子关键点,则所述人像类型为局部特写,以及所述人物的质心位置为检测到所有关键点的平均坐标点。
  19. 根据权利要求13-18中任意一项所述的方法,其特征在于,所述人体检测结果包括人物的人体框,所述人物的面积占比为所述人体框的面积与图像面积的比值。
  20. 根据权利要求13-18中任意一项所述的方法,其特征在于,所述人脸检测结果包括人脸框,所述人脸位置为所述人脸框的中心点位置,或者为人物头部的质心位置。
  21. 根据权利要求13-18中任意一项所述的方法,其特征在于,若人物处于运动状态,且所述人物的人像类型不为全身像、半身像且不包括头顶关键点、脖子关键点、脚踝关键点及手腕关键点中的至少一个,所述人物的拍摄状态无效。
  22. 根据权利要求13-18中任意一项所述的方法,其特征在于,若人物处于静止状态,且所述人物未睁眼、未微笑、人像类型为胸像且面积占比大于第七阈值或者不包括头顶关键点及脖子关键点,所述人物的拍摄状态无效。
  23. 一种电子设备,其特征在于,所述电子设备包括:存储器和处理器;所述处理器与所述存储器耦合;其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求1-22中任一项所述的方法。
  24. 一种计算机可读存储介质,其特征在于,包括计算机指令;当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-22中任一项所述的方法。
PCT/CN2023/133794 2023-02-23 2023-11-23 一种图像抓拍方法及电子设备 Ceased WO2024174626A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/870,093 US20250338010A1 (en) 2023-02-23 2023-11-23 Image capture method and electronic device
EP23923789.4A EP4510603A4 (en) 2023-02-23 2023-11-23 IMAGE CAPTURE METHOD AND ELECTRONIC DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310206533.4A CN117135441B (zh) 2023-02-23 2023-02-23 一种图像抓拍方法及电子设备
CN202310206533.4 2023-02-23

Publications (1)

Publication Number Publication Date
WO2024174626A1 true WO2024174626A1 (zh) 2024-08-29

Family

ID=88855243

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/133794 Ceased WO2024174626A1 (zh) 2023-02-23 2023-11-23 一种图像抓拍方法及电子设备

Country Status (4)

Country Link
US (1) US20250338010A1 (zh)
EP (1) EP4510603A4 (zh)
CN (1) CN117135441B (zh)
WO (1) WO2024174626A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120260088B (zh) * 2023-12-26 2026-04-03 荣耀终端股份有限公司 图像处理方法及电子设备
CN121037677B (zh) * 2025-10-30 2026-02-24 上海维享时空信息科技有限公司 基于多模态感知的景区游客无感抓拍与智能优选系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004247869A (ja) * 2003-02-12 2004-09-02 Nikon Corp 電子カメラ
CN107025437A (zh) * 2017-03-16 2017-08-08 南京邮电大学 基于智能构图及微表情分析的智能拍照方法及装置
CN109196852A (zh) * 2016-11-24 2019-01-11 华为技术有限公司 拍摄构图引导方法及装置
CN111160201A (zh) * 2019-12-20 2020-05-15 万翼科技有限公司 一种人脸图像上传方法、装置、电子设备及存储介质
CN111432114A (zh) * 2019-12-31 2020-07-17 武汉星巡智能科技有限公司 基于拍摄构图评分方法、装置、设备及存储介质

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6940545B1 (en) * 2000-02-28 2005-09-06 Eastman Kodak Company Face detecting camera and method
GB2372165A (en) * 2001-02-10 2002-08-14 Hewlett Packard Co A method of selectively storing images
US7627148B2 (en) * 2004-07-06 2009-12-01 Fujifilm Corporation Image data processing apparatus and method, and image data processing program
KR101477182B1 (ko) * 2007-06-01 2014-12-29 삼성전자주식회사 단말 및 그의 이미지 촬영 방법
US8508622B1 (en) * 2010-01-15 2013-08-13 Pixar Automatic real-time composition feedback for still and video cameras
KR101906827B1 (ko) * 2012-04-10 2018-12-05 삼성전자주식회사 연속 사진 촬영 장치 및 방법
KR102093647B1 (ko) * 2013-02-22 2020-03-26 삼성전자 주식회사 카메라를 구비하는 장치의 이미지 촬영장치 및 방법
CN105100625B (zh) * 2015-08-27 2018-06-12 华南理工大学 一种基于图像美学的人物图像辅助拍摄方法和系统
US10977509B2 (en) * 2017-03-27 2021-04-13 Samsung Electronics Co., Ltd. Image processing method and apparatus for object detection
US10445586B2 (en) * 2017-12-12 2019-10-15 Microsoft Technology Licensing, Llc Deep learning on image frames to generate a summary
WO2020042188A1 (zh) * 2018-08-31 2020-03-05 华为技术有限公司 一种图像拍摄方法和装置
CN111343382B (zh) * 2020-03-09 2021-09-10 Oppo广东移动通信有限公司 拍照方法、装置、电子设备及存储介质
CN111294518B (zh) * 2020-03-09 2021-04-27 Oppo广东移动通信有限公司 人像构图肢体截断检测方法、装置、终端及存储介质
CN113727012B (zh) * 2020-08-27 2022-09-27 荣耀终端有限公司 一种拍摄方法及终端
CN116528046A (zh) * 2020-11-09 2023-08-01 华为技术有限公司 目标用户追焦拍摄方法、电子设备及存储介质
CN113301251B (zh) * 2021-05-20 2023-10-20 努比亚技术有限公司 辅助拍摄方法、移动终端及计算机可读存储介质
CN115423752B (zh) * 2022-08-03 2023-07-07 荣耀终端有限公司 一种图像处理方法、电子设备及可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004247869A (ja) * 2003-02-12 2004-09-02 Nikon Corp 電子カメラ
CN109196852A (zh) * 2016-11-24 2019-01-11 华为技术有限公司 拍摄构图引导方法及装置
CN107025437A (zh) * 2017-03-16 2017-08-08 南京邮电大学 基于智能构图及微表情分析的智能拍照方法及装置
CN111160201A (zh) * 2019-12-20 2020-05-15 万翼科技有限公司 一种人脸图像上传方法、装置、电子设备及存储介质
CN111432114A (zh) * 2019-12-31 2020-07-17 武汉星巡智能科技有限公司 基于拍摄构图评分方法、装置、设备及存储介质

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
EP4510603A1 (en) 2025-02-19
CN117135441A (zh) 2023-11-28
CN117135441B (zh) 2024-09-27
EP4510603A4 (en) 2025-10-01
US20250338010A1 (en) 2025-10-30

Similar Documents

Publication Publication Date Title
CN109495688B (zh) 电子设备的拍照预览方法、图形用户界面及电子设备
JP7574525B2 (ja) 高さ測定方法および装置、ならびに端末
CN113850726B (zh) 图像变换方法和装置
WO2021121236A1 (zh) 一种控制方法、电子设备、计算机可读存储介质、芯片
CN110807361B (zh) 人体识别方法、装置、计算机设备及存储介质
CN111742351A (zh) 用于生成包括通过与面部相对应的3d化身反映面部运动的3d化身的图像的电子设备及操作其的方法
CN112447273A (zh) 辅助健身的方法和电子装置
CN111242090A (zh) 基于人工智能的人脸识别方法、装置、设备及介质
CN108712603B (zh) 一种图像处理方法及移动终端
WO2024174626A1 (zh) 一种图像抓拍方法及电子设备
WO2021169394A1 (zh) 基于深度的人体图像美化方法及电子设备
CN111385514B (zh) 人像处理方法和装置以及终端
US20230076109A1 (en) Method and electronic device for adding virtual item
US12249145B2 (en) Prompt method and electronic device for fitness training
US12201893B2 (en) Target user locking method and electronic device
CN115423752B (zh) 一种图像处理方法、电子设备及可读存储介质
CN110956571A (zh) 基于slam进行虚实融合的方法及电子设备
CN111797754B (zh) 图像检测的方法、装置、电子设备及介质
CN114741559A (zh) 确定视频封面的方法、设备及存储介质
CN114205512A (zh) 拍摄方法和装置
WO2024093762A1 (zh) 引导框显示方法及电子设备
CN115223236A (zh) 设备控制方法和电子设备
CN114827445A (zh) 图像处理方法及相关装置
WO2024125319A1 (zh) 虚拟人物的显示方法及电子设备
CN117892810A (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: 23923789

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023923789

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2023923789

Country of ref document: EP

Effective date: 20241112

WWE Wipo information: entry into national phase

Ref document number: 18870093

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWP Wipo information: published in national office

Ref document number: 18870093

Country of ref document: US