CN110348419B - Method and device for photographing - Google Patents

Method and device for photographing Download PDF

Info

Publication number
CN110348419B
CN110348419B CN201910649435.1A CN201910649435A CN110348419B CN 110348419 B CN110348419 B CN 110348419B CN 201910649435 A CN201910649435 A CN 201910649435A CN 110348419 B CN110348419 B CN 110348419B
Authority
CN
China
Prior art keywords
person
adjustment information
face area
position adjustment
key point
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.)
Active
Application number
CN201910649435.1A
Other languages
Chinese (zh)
Other versions
CN110348419A (en
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.)
Samsung Electronics China R&D Center
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics China R&D Center
Samsung Electronics 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 Samsung Electronics China R&D Center, Samsung Electronics Co Ltd filed Critical Samsung Electronics China R&D Center
Priority to CN201910649435.1A priority Critical patent/CN110348419B/en
Publication of CN110348419A publication Critical patent/CN110348419A/en
Application granted granted Critical
Publication of CN110348419B publication Critical patent/CN110348419B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Psychiatry (AREA)
  • Social Psychology (AREA)
  • User Interface Of Digital Computer (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for taking a picture. One embodiment of the method comprises: obtaining a photograph including at least one person; carrying out edge detection on the photo to obtain the outline characteristics of at least one person; carrying out face recognition based on the outline characteristics of at least one person to obtain a face area of the at least one person; inputting the outline characteristics and the face area of at least one person into a pre-trained neural network model to obtain position adjustment information; and outputting the position adjustment information. According to the embodiment, when a plurality of persons take a picture, the face area (expression and sight line) of the person is used as a main characteristic, the target characteristics such as standing position and posture are used as auxiliary characteristics, pre-analysis is carried out, and the face area, the standing position and the posture which affect the shooting effect are prompted to be adjusted by the person to be shot in a voice mode according to the analysis result, so that the aims of shortening the shooting time and improving the shooting quality are achieved.

Description

用于拍照的方法和装置Method and device for taking pictures

技术领域technical field

本公开的实施例涉及计算机技术领域,具体涉及用于拍照的方法和装置。The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method and device for taking pictures.

背景技术Background technique

随着科技的发展,带摄像头的智能设备已成为当前时代的主流终端设备,并且已成为拍照的主要工具。在多人同时拍照时,经常会因为某些人被遮挡,或面部表情和视线不能达到拍照者满意的效果,或者对肢体动作不能达到拍照者满意的效果,从而导致多次重拍,影响拍照效率,降低了用户的体验。With the development of science and technology, smart devices with cameras have become mainstream terminal devices in the current era, and have become the main tool for taking pictures. When many people are taking pictures at the same time, it is often because some people are blocked, or the facial expressions and sight lines cannot meet the photographer's satisfaction, or the body movements cannot meet the photographer's satisfaction, which will lead to multiple retakes and affect the photography. Efficiency, reducing the user experience.

发明内容Contents of the invention

本公开的实施例提出了用于拍照的方法和装置。Embodiments of the present disclosure propose methods and devices for taking pictures.

第一方面,本公开的实施例提供了一种用于拍照的方法,包括:获取包括至少一个人物的照片;对照片进行边缘检测,得到至少一个人物的轮廓特征;基于至少一个人物的轮廓特征进行人脸识别,得到至少一个人物的脸部区域;将至少一个人物的轮廓特征和脸部区域输入预先训练的神经网络模型,得到位置调整信息;输出位置调整信息。In a first aspect, an embodiment of the present disclosure provides a method for taking pictures, including: acquiring a photo including at least one person; performing edge detection on the photo to obtain at least one person's profile feature; based on the at least one person's profile feature Perform face recognition to obtain at least one person's face area; input the at least one person's contour feature and face area into a pre-trained neural network model to obtain position adjustment information; output the position adjustment information.

在一些实施例中,该方法还包括:基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征;将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或表情调整信息;输出位置调整信息和/或表情调整信息。In some embodiments, the method also includes: performing key point recognition based on the face area of at least one character to obtain key point features of at least one character; The network model obtains position adjustment information and/or expression adjustment information; outputs position adjustment information and/or expression adjustment information.

在一些实施例中,该方法还包括:基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征;将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或视线调整信息;输出位置调整信息和/或视线调整信息。In some embodiments, the method also includes: performing key point recognition based on the face area of at least one character to obtain key point features of at least one character; The network model obtains position adjustment information and/or line of sight adjustment information; outputs position adjustment information and/or line of sight adjustment information.

在一些实施例中,视线调整信息包括待调整的人物在照片中的顺序位置和头部旋转的方向和角度。In some embodiments, the line-of-sight adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and angle of head rotation.

在一些实施例中,位置调整信息包括待调整的人物在照片中的顺序位置和待移动的方向和距离。In some embodiments, the position adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and distance to be moved.

第二方面,本公开的实施例提供了一种用于拍照的装置,包括:获取单元,被配置成获取包括至少一个人物的照片;第一检测单元,被配置成对照片进行边缘检测,得到至少一个人物的轮廓特征;第二检测单元,被配置成基于至少一个人物的轮廓特征进行人脸识别,得到至少一个人物的脸部区域;调整单元,被配置成将至少一个人物的轮廓特征和脸部区域输入预先训练的神经网络模型,得到位置调整信息;输出单元,被配置成输出位置调整信息。In a second aspect, an embodiment of the present disclosure provides a device for taking pictures, including: an acquisition unit configured to acquire a photo including at least one person; a first detection unit configured to perform edge detection on the photo to obtain The outline feature of at least one person; the second detection unit is configured to perform face recognition based on the outline feature of at least one person to obtain the face area of at least one person; the adjustment unit is configured to combine the outline feature of at least one person and The face area is input into the pre-trained neural network model to obtain position adjustment information; the output unit is configured to output the position adjustment information.

在一些实施例中,该装置还包括第三检测单元,被配置成:基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征;以及调整单元进一步被配置成将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或表情调整信息;以及输出单元进一步被配置成输出位置调整信息和/或表情调整信息。In some embodiments, the device further includes a third detection unit configured to: perform key point recognition based on the face area of at least one person to obtain key point features of at least one person; and the adjustment unit is further configured to at least A person's contour features, facial regions, and key point features are input into the neural network model to obtain position adjustment information and/or expression adjustment information; and the output unit is further configured to output position adjustment information and/or expression adjustment information.

在一些实施例中,该装置还包括第四检测单元,被配置成:基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征;以及调整单元进一步被配置成将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或视线调整信息;输出位置调整信息和/或视线调整信息。In some embodiments, the device further includes a fourth detection unit configured to: perform key point recognition based on the face area of at least one person to obtain key point features of at least one person; and the adjustment unit is further configured to at least A character's contour features, face area, and key point features are input into the neural network model to obtain position adjustment information and/or line of sight adjustment information; output position adjustment information and/or line of sight adjustment information.

在一些实施例中,视线调整信息包括待调整的人物在照片中的顺序位置和头部旋转的方向和角度。In some embodiments, the line-of-sight adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and angle of head rotation.

在一些实施例中,位置调整信息包括待调整的人物在照片中的顺序位置和待移动的方向和距离。In some embodiments, the position adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and distance to be moved.

第三方面,本公开的实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一的方法。In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when one or more programs are processed by one or more executed by a processor, so that one or more processors implement the method according to any one of the first aspect.

第四方面,本公开的实施例提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现如第一方面中任一的方法。In a fourth aspect, the embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, wherein, when the program is executed by a processor, the method according to any one of the first aspect is implemented.

本公开的实施例提供的用于拍照的方法和装置,根据已训练好的神经网络模型,在多人拍照时,以人物脸部区域(表情、视线)为主特征,站立位置、姿态等目标特征为辅助特征,进行预分析,根据分析结果以语音的方式提示被拍摄者对影响拍摄效果的脸部区域、站立位置、姿态等进行调整,从而达到缩短拍摄时间、提高拍摄质量的目的。In the method and device for taking pictures provided by the embodiments of the present disclosure, according to the trained neural network model, when multiple people take pictures, the facial area (expression, line of sight) of the person is the main feature, and the standing position, posture and other targets The features are auxiliary features, pre-analyzed, and according to the analysis results, the subject will be prompted to adjust the facial area, standing position, posture, etc. that affect the shooting effect, so as to shorten the shooting time and improve the shooting quality.

附图说明Description of drawings

通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present disclosure will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

图1是本公开的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;

图2是根据本公开的用于拍照的方法的一个实施例的流程图;FIG. 2 is a flowchart of one embodiment of a method for taking pictures according to the present disclosure;

图3a-3e是根据本公开的用于拍照的方法的一个应用场景的示意图;3a-3e are schematic diagrams of an application scenario of the method for taking pictures according to the present disclosure;

图4是根据本公开的用于拍照的方法的另一个实施例的流程图;FIG. 4 is a flowchart of another embodiment of a method for taking pictures according to the present disclosure;

图5是根据本公开的用于拍照的装置的一个实施例的结构示意图;Fig. 5 is a schematic structural diagram of an embodiment of a device for taking pictures according to the present disclosure;

图6是适于用来实现本公开的实施例的电子设备的计算机系统的结构示意图。FIG. 6 is a structural schematic diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present disclosure.

具体实施方式Detailed ways

下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present disclosure will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.

需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。It should be noted that, in the case of no conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and embodiments.

图1示出了可以应用本公开的用于拍照的方法或用于拍照的装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 to which embodiments of the method for taking pictures or the apparatus for taking pictures of the present disclosure can be applied.

如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , a system architecture 100 may include terminal devices 101 , 102 , 103 , a network 104 and a server 105 . The network 104 is used as a medium for providing communication links between the terminal devices 101 , 102 , 103 and the server 105 . Network 104 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如拍照类应用、网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。Users can use terminal devices 101 , 102 , 103 to interact with server 105 via network 104 to receive or send messages and the like. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as camera applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有摄像头的各种电子设备,包括但不限于相机、智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices with cameras, including but not limited to cameras, smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III , Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) Players, Laptop Portable Computers and Desktop Computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as a plurality of software or software modules (for example, to provide distributed services), or as a single software or software module. No specific limitation is made here.

服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103上拍摄的照片提供支持的后台调整服务器。后台调整服务器可以对接收到的照片等数据进行分析等处理,并将处理结果(例如提醒调整人体位置或表情的信息)反馈给终端设备,再由终端设备以语音或文字形式输出。The server 105 may be a server that provides various services, for example, a background adjustment server that supports photos taken on the terminal devices 101 , 102 , 103 . The background adjustment server can analyze and process the received photos and other data, and feed back the processing results (such as information reminding to adjust the body position or expression) to the terminal device, and then the terminal device outputs it in the form of voice or text.

需要说明的是,服务器可以是硬件,也可以是软件。当服务器为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。It should be noted that the server may be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or can be implemented as a single software or software module. No specific limitation is made here.

需要说明的是,本公开的实施例所提供的用于拍照的方法可以由终端设备101、102、103执行,也可以由服务器105执行。相应地,用于拍照的装置可以设置于终端设备101、102、103中,也可以设置于服务器105中。在此不做具体限定。It should be noted that the method for taking pictures provided by the embodiments of the present disclosure may be executed by the terminal devices 101 , 102 , 103 or by the server 105 . Correspondingly, the device for taking pictures can be set in the terminal devices 101 , 102 , 103 or in the server 105 . No specific limitation is made here.

应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in Fig. 1 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.

继续参考图2,示出了根据本公开的用于拍照的方法的一个实施例的流程200。该用于拍照的方法,包括以下步骤:Continuing to refer to FIG. 2 , a flow 200 of an embodiment of the method for taking pictures according to the present disclosure is shown. The method for taking pictures includes the following steps:

步骤201,获取包括至少一个人物的照片。Step 201, acquire a photo including at least one person.

在本实施例中,用于拍照的方法的执行主体(例如图1所示的服务器或终端设备)可以通过有线连接方式或者无线连接方式从用户利用其进行拍照的终端接收包括至少一个人物的照片。一个人物也会出现被其它物品遮挡的情况。多个人物的集体照更容易出现被其它人遮挡的情况。In this embodiment, the executing subject of the method for taking pictures (for example, the server or terminal device shown in FIG. 1 ) may receive a picture including at least one character from the terminal that the user uses to take pictures through a wired connection or a wireless connection. . A character may also appear to be obscured by other objects. Group photos of multiple people are more likely to be blocked by other people.

步骤202,对照片进行边缘检测,得到至少一个人物的轮廓特征。Step 202, performing edge detection on the photo to obtain at least one person's contour feature.

在本实施例中,通过边缘检测算法,将人物与背景分离,并提取出人物的位置、姿态等特征信息,得到每个人物的轮廓特征。可采用现有技术中的边缘检测算法,例如,基于小波变换的多尺度边缘检测算法等。如图3a所示,进行边缘检测后,可确定出照片中每个人物的轮廓。In this embodiment, an edge detection algorithm is used to separate the characters from the background, and feature information such as the position and posture of the characters are extracted to obtain the contour features of each character. An edge detection algorithm in the prior art may be used, for example, a multi-scale edge detection algorithm based on wavelet transform and the like. As shown in Figure 3a, after performing edge detection, the outline of each person in the photo can be determined.

步骤203,基于至少一个人物的轮廓特征进行人脸识别,得到至少一个人物的脸部区域。Step 203, performing face recognition based on the contour features of at least one person to obtain the face area of at least one person.

在本实施例中,基于步骤202确定出的轮廓特征进一步进行人脸识别,得到每个人物的脸部区域。先确定轮廓,可以缩小识别的区域,从而提高人脸识别速度。可采用现有的人脸识别技术识别出人脸区域。不需要进行身份核验,因此可采用速度高但粒度粗的神经网络模型用于人脸识别。In this embodiment, face recognition is further performed based on the contour features determined in step 202 to obtain the face area of each person. First determine the outline, you can narrow the recognized area, thereby improving the speed of face recognition. The existing face recognition technology can be used to identify the face area. No identity verification is required, so a high-speed but coarse-grained neural network model can be used for face recognition.

步骤204,将至少一个人物的轮廓特征和脸部区域输入预先训练的神经网络模型,得到位置调整信息。Step 204, input the contour feature and face area of at least one person into the pre-trained neural network model to obtain position adjustment information.

在本实施例中,具体实施如图3b所示。如果检测的目标仅是不遮挡,则可不需要提取关键点特征,只需要轮廓特征和脸部区域即可。可将标注了轮廓特征、脸部区域、位置调整信息的包括至少一个人物的照片作为训练样本来有监督地训练神经网络模型。神经网络模型的输入为照片中人物的轮廓特征、脸部区域,预期输出为位置调整信息。通过不断调整神经网络模型的参数,使得神经网络模型的输出达到预期输出的效果。基本原理是识别出哪个人的脸部区域不完整,即被遮挡,然后计算出向哪个方向移动多少才能不被遮挡。神经网络模型的输出结果可以是让被遮挡的人移动,也可以是让挡住别人的人移动,最终实现所有的人都不被遮挡。可选地,可计算出两种移动方式的移动幅度,选择让移动幅度小的人移动。例如,A被B遮挡,如果让A移动,则需要移动10cm,才能既不会被B或其它人遮挡也不会遮挡别人,但如果让B移动,则需要移动5cm,才能既不会遮挡A或别人,也不会被其它人遮挡。则最终可以将让B移动的方案作为最优的调整方案。可选地,也可将两种方案都告知被拍者,由被拍者自己选择让谁移动。可选地,也可只输出谁被遮挡,以及哪个部位被遮挡,不计算移动距离,通知被拍者后由被拍者自己移动。In this embodiment, the specific implementation is shown in Fig. 3b. If the detected target is only unoccluded, it is not necessary to extract key point features, only contour features and face areas are required. The neural network model can be trained in a supervised manner by using photos including at least one person marked with outline features, face regions, and position adjustment information as training samples. The input of the neural network model is the contour features and face area of the person in the photo, and the expected output is position adjustment information. By continuously adjusting the parameters of the neural network model, the output of the neural network model can achieve the expected output effect. The basic principle is to identify which person's face area is incomplete, that is, it is blocked, and then calculate how much to move in which direction to not be blocked. The output of the neural network model can be to move the occluded person, or to move the person blocking others, and finally realize that all people are not occluded. Optionally, the moving ranges of the two moving modes can be calculated, and the person with the smaller moving range is selected to move. For example, if A is blocked by B, if you want A to move, you need to move 10cm so that it will neither be blocked by B or others nor others, but if you let B move, you need to move 5cm so that you can neither block A or others, and will not be obscured by others. In the end, the scheme of moving B can be regarded as the optimal adjustment scheme. Optionally, both schemes can also be informed to the person being photographed, and the person being photographed can choose who to move. Optionally, it is also possible to only output who is blocked and which part is blocked, and the moving distance is not calculated, and the person being photographed is notified and then the person being photographed moves by himself.

步骤205,输出位置调整信息。Step 205, outputting position adjustment information.

在本实施例中,可通过语音或文字输出位置调整信息。如图3c所示为以语音的形式反馈给被拍照都。如果本公开的执行主体为终端设备,则可直接通过语音或文字输出位置调整信息。如果本公开的执行主体为服务器,则需要将位置调整信息发送到终端设备上,由终端设备输出位置调整信息。In this embodiment, the position adjustment information can be output by voice or text. As shown in Figure 3c, it is fed back to the photographed city in the form of voice. If the subject of execution of the present disclosure is a terminal device, the position adjustment information may be output directly through voice or text. If the subject of execution of the present disclosure is a server, it is necessary to send the position adjustment information to the terminal device, and the terminal device outputs the position adjustment information.

继续参见图3d,图3d是根据本实施例的用于拍照的方法的应用场景的一个示意图。在图3d的应用场景中,多人拍照时,被拍摄者脸部有部分遮挡。具体过程如下所示:Continuing to refer to FIG. 3d, FIG. 3d is a schematic diagram of an application scenario of the method for taking pictures according to this embodiment. In the application scenario shown in Figure 3d, when multiple people take pictures, the faces of the people being photographed are partially blocked. The specific process is as follows:

步骤S01:相机启动,进入拍照模式Step S01: Start the camera and enter the camera mode

步骤S02:通过边缘检测算法,将人物与背景分离,并提取出人物的位置、姿态等特征信息。Step S02: Using an edge detection algorithm, separate the person from the background, and extract feature information such as the person's position and posture.

步骤S03:通过面部识别算法,识别出各个被拍摄者的脸部区域。Step S03: Recognize the face area of each subject through the facial recognition algorithm.

步骤S04:针对人物的位置、姿态、脸部区域,输入已训练好的神经网络Step S04: Input the trained neural network for the position, posture, and face area of the person

步骤S05:神经网络对特征信息进行分析,如图3d,通过脸部区域及关键特征点信息可获知有被拍摄者的脸部区域被遮挡,并结合步骤S02中所获取的人物位置信息,得知从右边数第3位被拍摄者的脸部被遮蔽,并结合步骤S02中所获取的人物与背景信息,则可得出调整信息,如“右边数第3位被拍摄者的脸部被遮蔽,请往右稍微移动一下”。Step S05: The neural network analyzes the feature information, as shown in Figure 3d, through the face area and key feature point information, it can be known that the face area of the subject is blocked, and combined with the character position information obtained in step S02, we can get Knowing that the face of the third person to be photographed from the right is covered, and combined with the person and background information obtained in step S02, the adjustment information can be obtained, such as "the face of the third person to be photographed from the right is blocked Obscuration, please move a little to the right".

步骤S06:调整信息以语音的形式反馈给被拍照者。Step S06: The adjustment information is fed back to the person being photographed in the form of voice.

步骤S07:重复步骤S02~步骤S06,当所有调整满足要求时,完成拍照。Step S07: Steps S02 to S06 are repeated, and when all adjustments meet the requirements, the photographing is completed.

本公开的上述实施例提供的方法通过检测出被拍照者的轮廓和脸部区域,来判断出人脸是否被遮挡,如果被遮挡则提醒被拍照者改变位置。从而达到缩短拍摄时间,提高拍摄质量的目的。The method provided by the above-mentioned embodiments of the present disclosure determines whether the face is blocked by detecting the outline and face area of the person being photographed, and reminds the person being photographed to change the position if it is blocked. So as to achieve the purpose of shortening the shooting time and improving the shooting quality.

进一步参考图4,其示出了用于拍照的方法的又一个实施例的流程400。该用于拍照的方法的流程400,包括以下步骤:Further referring to FIG. 4 , it shows a flow 400 of still another embodiment of the method for taking pictures. The flow 400 of the method for taking pictures includes the following steps:

步骤401,获取包括至少一个人物的照片;。Step 401, acquiring a photo including at least one person;.

步骤402,对照片进行边缘检测,得到至少一个人物的轮廓特征。Step 402, performing edge detection on the photo to obtain at least one profile feature of a person.

步骤403,基于至少一个人物的轮廓特征进行人脸识别,得到至少一个人物的脸部区域。Step 403, performing face recognition based on the contour features of at least one person, and obtaining the face area of at least one person.

步骤401-403与步骤201-203基本相同,因此不再赘述。Steps 401-403 are basically the same as steps 201-203, so they are not repeated here.

步骤404,基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征。Step 404: Perform key point recognition based on the face area of at least one person to obtain key point features of at least one person.

在本实施例中,通过面部特征点检测技术,根据上一部识别出脸部区域,自动定位出面部关键特征点,如眼睛、鼻尖、嘴角点等人脸各部件的轮廓点。In this embodiment, through the facial feature point detection technology, the face area is recognized according to the previous part, and the key feature points of the face are automatically located, such as the outline points of the parts of the face such as eyes, nose tip, and mouth corners.

步骤405,将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或表情调整信息和/或视线调整信息。Step 405: Input the contour features, face area, and key point features of at least one person into the neural network model to obtain position adjustment information and/or expression adjustment information and/or gaze adjustment information.

在本实施例中,该模型的输入除了轮廓特征、脸部区域之外还包括了关键点特征。这样使得该模型不仅能判断出人脸是否被遮挡还能判断出表情是否不到位(例如,通过嘴角等关键点判断出被拍照者没有笑),被拍照者的视线是否看向相机等。从而生成调整信息,调整信息包括以下至少一项:位置调整信息、表情调整信息、视线调整信息。调整信息中包括待调整人的位置,例如,第二排左侧第三个,还包括要调整的内容。位置调整信息包括待调整的人物在照片中的顺序位置和待移动的方向和距离。视线调整信息包括待调整的人物在照片中的顺序位置和头部旋转的方向和角度。表情调整信息包括待调整的人物在照片中的顺序位置和调整目标,例如笑一下、别皱眉等。In this embodiment, the input of the model includes key point features in addition to contour features and face regions. In this way, the model can not only judge whether the face is blocked, but also judge whether the expression is not in place (for example, judge whether the person being photographed is not smiling through key points such as the corner of the mouth), whether the person being photographed is looking at the camera, etc. Thus, adjustment information is generated, and the adjustment information includes at least one of the following: position adjustment information, expression adjustment information, and line of sight adjustment information. The adjustment information includes the position of the person to be adjusted, for example, the third person on the left in the second row, and the content to be adjusted. The position adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and distance to be moved. The line-of-sight adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and angle of head rotation. The expression adjustment information includes the sequential position of the person to be adjusted in the photo and the adjustment target, such as smiling or not frowning.

步骤406,输出位置调整信息和/或表情调整信息和/或视线调整信息。Step 406, outputting position adjustment information and/or expression adjustment information and/or line of sight adjustment information.

在本实施例中,如果有必要进行调整,则输出以下至少一项调整信息:位置调整信息、表情调整信息、视线调整信息。In this embodiment, if adjustment is necessary, at least one of the following adjustment information is output: position adjustment information, expression adjustment information, and line of sight adjustment information.

图3e为多人拍照时,被拍摄者视线需要调整的应用场景。具体过程如下所示:Figure 3e is an application scenario where the line of sight of the subject needs to be adjusted when multiple people are taking pictures. The specific process is as follows:

步骤S01:相机启动,进入拍照模式。Step S01: The camera starts up and enters into a photographing mode.

步骤S02:通过边缘检测算法,将人物与背景分离,并提取出人物的位置、姿态等特征信息。Step S02: Using an edge detection algorithm, separate the person from the background, and extract feature information such as the person's position and posture.

步骤S03:通过面部识别算法,识别出各个被拍摄者的脸部区域。Step S03: Recognize the face area of each subject through the facial recognition algorithm.

步骤S04:通过面部特征点检测技术,根据上一部识别出脸部区域,自动定位出面部关键特征点,如眼睛、鼻尖、嘴角点等人脸各部件的轮廓点,通过双眼特征点的位置分布信息,进行视线判断。Step S04: Through the facial feature point detection technology, according to the previous part to identify the face area, automatically locate the key feature points of the face, such as the contour points of the parts of the face such as eyes, nose tip, mouth corner points, etc., through the position of the feature points of the eyes Distribute information and make line-of-sight judgments.

步骤S05:针对人物的位置、姿态、面部特征及关键特征点信息,输入已训练好的神经网络。Step S05: Input the trained neural network for the position, posture, facial features and key feature point information of the person.

步骤S06:神经网络对特征信息进行分析,如图3e,通过面部特征及关键特征点信息可获知有被拍摄者的视线需要调整,并结合步骤2中所获取的人物位置信息,得知从右边数第3位被拍摄者的视线需要调整,则可得出调整信息,如“右边数第3位被拍摄者请看这里”。Step S06: The neural network analyzes the feature information, as shown in Figure 3e, through the facial features and key feature point information, it can be known that the subject's line of sight needs to be adjusted, and combined with the character position information obtained in step 2, it is known that from the right If the line of sight of the third subject from the right needs to be adjusted, the adjustment information can be obtained, such as "the third subject from the right, please look here".

步骤S07:调整信息以语音的形式反馈给被拍照者Step S07: The adjustment information is fed back to the person being photographed in the form of voice

步骤S08:重复步骤S02~步骤S07,当所有调整满足要求时,完成拍照。Step S08: Repeat steps S02 to S07, and when all adjustments meet the requirements, the photographing is completed.

从图4中可以看出,与图2对应的实施例相比,本实施例中的用于拍照的方法的流程400体现了对表现、视线进行检测的步骤。由此,本实施例描述的方案可以进一步地帮助拍出高质量的照片。It can be seen from FIG. 4 that, compared with the embodiment corresponding to FIG. 2 , the process 400 of the method for taking pictures in this embodiment embodies the steps of detecting performance and line of sight. Therefore, the solution described in this embodiment can further help to take high-quality photos.

进一步参考图5,作为对上述各图所示方法的实现,本公开提供了一种用于拍照的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 5 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for taking pictures. This device embodiment corresponds to the method embodiment shown in FIG. 2 , and the device Specifically, it can be applied to various electronic devices.

如图5所示,本实施例的用于拍照的装置500包括:获取单元501、第一检测单元502、第二检测单元503和输出单元505。获取单元501,被配置成获取包括至少一个人物的照片;第一检测单元502,被配置成对照片进行边缘检测,得到至少一个人物的轮廓特征;第二检测单元503,被配置成基于至少一个人物的轮廓特征进行人脸识别,得到至少一个人物的脸部区域;调整单元504,被配置成将至少一个人物的轮廓特征和脸部区域输入预先训练的神经网络模型,得到位置调整信息;输出单元505,被配置成输出位置调整信息。As shown in FIG. 5 , the device 500 for taking pictures in this embodiment includes: an acquisition unit 501 , a first detection unit 502 , a second detection unit 503 and an output unit 505 . The acquisition unit 501 is configured to acquire a photo including at least one person; the first detection unit 502 is configured to perform edge detection on the photo to obtain the outline feature of at least one person; the second detection unit 503 is configured to be based on at least one Perform face recognition on the contour features of the person to obtain at least one face area of the person; the adjustment unit 504 is configured to input the contour feature and face area of at least one person into the pre-trained neural network model to obtain position adjustment information; output A unit 505 configured to output position adjustment information.

在本实施例中,用于拍照的装置500的获取单元501、第一检测单元502、第二检测单元503和输出单元505的具体处理可以参考图2对应实施例中的步骤201、步骤202、步骤203、步骤204和步骤205。In this embodiment, the specific processing of the acquisition unit 501, the first detection unit 502, the second detection unit 503, and the output unit 505 of the device 500 for photographing can refer to steps 201, 202, Step 203 , step 204 and step 205 .

在本实施例的一些可选的实现方式中,装置500还包括第三检测单元(附图中未示出),被配置成:基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征;以及调整单元进一步被配置成将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或表情调整信息;以及输出单元进一步被配置成输出位置调整信息和/或表情调整信息。In some optional implementations of this embodiment, the device 500 further includes a third detection unit (not shown in the drawings), configured to: perform key point recognition based on the facial area of at least one person, and obtain at least one The key point feature of the character; and the adjustment unit is further configured to input the contour feature, face area, and key point feature of at least one character into the neural network model to obtain position adjustment information and/or expression adjustment information; and the output unit is further configured to output position adjustment information and/or expression adjustment information.

在本实施例的一些可选的实现方式中,装置500还包括第四检测单元(附图中未示出),被配置成:基于至少一个人物的脸部区域进行关键点识别,得到至少一个人物的关键点特征;以及调整单元进一步被配置成将至少一个人物的轮廓特征、脸部区域、关键点特征输入神经网络模型,得到位置调整信息和/或视线调整信息;输出位置调整信息和/或视线调整信息。In some optional implementations of this embodiment, the device 500 further includes a fourth detection unit (not shown in the drawings), configured to: perform key point recognition based on the face area of at least one person, and obtain at least one The key point features of the character; and the adjustment unit is further configured to input the contour feature, face area, and key point feature of at least one character into the neural network model to obtain position adjustment information and/or line of sight adjustment information; output position adjustment information and/or or sight adjustment information.

在本实施例的一些可选的实现方式中,视线调整信息包括待调整的人物在照片中的顺序位置和头部旋转的方向和角度。In some optional implementation manners of this embodiment, the line-of-sight adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and angle of head rotation.

在本实施例的一些可选的实现方式中,位置调整信息包括待调整的人物在照片中的顺序位置和待移动的方向和距离。In some optional implementation manners of this embodiment, the position adjustment information includes the sequential position of the person to be adjusted in the photo and the direction and distance to be moved.

下面参考图6,其示出了适于用来实现本公开的实施例的电子设备(例如图1中的服务器或终端设备)600的结构示意图。本公开的实施例中的终端设备可以包括但不限于诸如相机、移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图6示出的终端设备/服务器仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。Referring now to FIG. 6 , it shows a schematic structural diagram of an electronic device (such as the server or terminal device in FIG. 1 ) 600 suitable for implementing the embodiments of the present disclosure. The terminal equipment in the embodiments of the present disclosure may include but not limited to cameras, mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), car mobile terminals such as terminals (for example, car navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, and the like. The terminal device/server shown in FIG. 6 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.

如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may be randomly accessed according to a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608. Various appropriate actions and processes are executed by programs in the memory (RAM) 603 . In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored. The processing device 601 , ROM 602 and RAM 603 are connected to each other through a bus 604 . An input/output (I/O) interface 605 is also connected to the bus 604 .

通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图6中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。Typically, the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 607 such as a computer; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 6 shows electronic device 600 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided. Each block shown in FIG. 6 may represent one device, or may represent multiple devices as required.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开的实施例的方法中限定的上述功能。需要说明的是,本公开的实施例所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609 , or from storage means 608 , or from ROM 602 . When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the embodiments of the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取包括至少一个人物的照片;对照片进行边缘检测,得到至少一个人物的轮廓特征;基于至少一个人物的轮廓特征进行人脸识别,得到至少一个人物的脸部区域;将至少一个人物的轮廓特征和脸部区域输入预先训练的神经网络模型,得到位置调整信息;输出位置调整信息。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires a photo including at least one person; performs edge detection on the photo to obtain at least one person Contour features of at least one character; face recognition based on the contour features of at least one character to obtain the face area of at least one character; input the contour features and face area of at least one character into the pre-trained neural network model to obtain position adjustment information; output Position adjustment information.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的实施例的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.

描述于本公开的实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取单元、第一检测单元、第二检测单元、调整单元和输出单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取包括至少一个人物的照片的单元”。The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The described units may also be set in a processor. For example, it may be described as: a processor includes an acquisition unit, a first detection unit, a second detection unit, an adjustment unit, and an output unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances, for example, the acquisition unit may also be described as "a unit that acquires a photo including at least one person".

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principle. It should be understood by those skilled in the art that the scope of the invention involved in this disclosure is not limited to the technical solution formed by the specific combination of the above technical features, but also covers the technical solutions made by the above technical features without departing from the inventive concept. Other technical solutions formed by any combination of or equivalent features thereof. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

Claims (12)

1. A method for taking a photograph, comprising:
obtaining a photograph including at least one person;
carrying out edge detection on the photo to obtain the outline characteristics of the at least one person;
performing face recognition based on the outline characteristics of the at least one person to obtain a face area of the at least one person;
inputting the contour feature and the face area of the at least one person into a pre-trained neural network model to obtain position adjustment information, wherein the position adjustment information comprises: the person being blocked and the location being blocked;
and outputting the position adjustment information.
2. The method of claim 1, wherein the method further comprises:
performing key point identification on the basis of the face area of the at least one person to obtain key point characteristics of the at least one person;
inputting the contour feature, the face area and the key point feature of the at least one figure into the neural network model to obtain position adjustment information and/or expression adjustment information;
and outputting the position adjustment information and/or the expression adjustment information.
3. The method of claim 1, wherein the method further comprises:
performing key point identification on the basis of the face area of the at least one person to obtain key point characteristics of the at least one person;
inputting the contour feature, the face area and the key point feature of the at least one person into the neural network model to obtain position adjustment information and/or sight line adjustment information;
and outputting the position adjustment information and/or the sight line adjustment information.
4. The method according to claim 3, wherein the sight line adjustment information includes a sequential position of the person to be adjusted in the photograph and a direction and angle of head rotation.
5. The method according to one of claims 1 to 4, wherein the position adjustment information comprises the sequential position of the person to be adjusted in the photograph and the direction and distance to be moved.
6. An apparatus for taking a picture, comprising:
an acquisition unit configured to acquire a photograph including at least one person;
a first detection unit configured to perform edge detection on the photo to obtain an outline feature of the at least one person;
a second detection unit configured to perform face recognition based on the contour feature of the at least one person to obtain a face region of the at least one person;
an adjusting unit configured to input the contour feature and the face region of the at least one person into a pre-trained neural network model to obtain position adjustment information, wherein the position adjustment information includes: the person being blocked and the location being blocked;
an output unit configured to output the position adjustment information.
7. The apparatus of claim 6, wherein the apparatus further comprises a third detection unit configured to:
performing key point identification on the basis of the face area of the at least one person to obtain key point characteristics of the at least one person; and
the adjusting unit is further configured to input the contour feature, the face area and the key point feature of the at least one person into the neural network model, so as to obtain position adjusting information and/or expression adjusting information; and
the output unit is further configured to output the position adjustment information and/or the expression adjustment information.
8. The apparatus of claim 6, wherein the apparatus further comprises a fourth detection unit configured to:
performing key point identification on the basis of the face area of the at least one person to obtain key point characteristics of the at least one person; and
the adjusting unit is further configured to input the contour feature, the face area and the key point feature of the at least one person into the neural network model, so as to obtain position adjusting information and/or sight line adjusting information;
and outputting the position adjustment information and/or the sight line adjustment information.
9. The apparatus according to claim 8, wherein the sight line adjustment information includes a sequential position of the person to be adjusted in the photograph and a direction and angle of head rotation.
10. The apparatus according to one of claims 6 to 9, wherein the position adjustment information comprises the sequential position of the person to be adjusted in the photograph and the direction and distance to be moved.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN201910649435.1A 2019-07-18 2019-07-18 Method and device for photographing Active CN110348419B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910649435.1A CN110348419B (en) 2019-07-18 2019-07-18 Method and device for photographing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910649435.1A CN110348419B (en) 2019-07-18 2019-07-18 Method and device for photographing

Publications (2)

Publication Number Publication Date
CN110348419A CN110348419A (en) 2019-10-18
CN110348419B true CN110348419B (en) 2023-03-24

Family

ID=68178705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910649435.1A Active CN110348419B (en) 2019-07-18 2019-07-18 Method and device for photographing

Country Status (1)

Country Link
CN (1) CN110348419B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113012042B (en) * 2019-12-20 2023-01-20 海信集团有限公司 Display device, virtual photo generation method, and storage medium
CN111444555B (en) * 2020-03-23 2024-03-26 深圳云天励飞技术有限公司 Temperature measurement information display method and device and terminal equipment
CN112235459B (en) * 2020-09-30 2022-03-04 咪咕音乐有限公司 Volume adjustment method, electronic device, and computer-readable storage medium
CN116529779A (en) * 2020-10-13 2023-08-01 Oppo广东移动通信有限公司 Electronic device, method of controlling electronic device, and computer-readable storage medium
CN112714259B (en) * 2020-12-30 2022-12-27 广州极飞科技股份有限公司 State adjustment method and device for object to be shot
CN113033506A (en) * 2021-05-20 2021-06-25 杭州宇泛智能科技有限公司 Portrait identification interaction method and device and electronic equipment
CN113240695A (en) * 2021-06-02 2021-08-10 四川轻化工大学 Electric power operation personnel wearing identification method based on posture perception
CN114598817B (en) * 2022-03-04 2024-06-18 无锡乐骐科技股份有限公司 Man-machine interaction judgment method and device based on multi-man interaction judgment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933607A (en) * 2016-05-26 2016-09-07 维沃移动通信有限公司 Photographing effect adjusting method of mobile terminal and mobile terminal
CN106131393A (en) * 2016-06-15 2016-11-16 北京小米移动软件有限公司 Take pictures reminding method and device
CN108462826A (en) * 2018-01-23 2018-08-28 维沃移动通信有限公司 A kind of method and mobile terminal of auxiliary photo-taking
CN109348135A (en) * 2018-11-21 2019-02-15 Oppo广东移动通信有限公司 Photographing method and device, storage medium and terminal equipment
CN109660719A (en) * 2018-12-11 2019-04-19 维沃移动通信有限公司 A kind of information cuing method and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933607A (en) * 2016-05-26 2016-09-07 维沃移动通信有限公司 Photographing effect adjusting method of mobile terminal and mobile terminal
CN106131393A (en) * 2016-06-15 2016-11-16 北京小米移动软件有限公司 Take pictures reminding method and device
CN108462826A (en) * 2018-01-23 2018-08-28 维沃移动通信有限公司 A kind of method and mobile terminal of auxiliary photo-taking
CN109348135A (en) * 2018-11-21 2019-02-15 Oppo广东移动通信有限公司 Photographing method and device, storage medium and terminal equipment
CN109660719A (en) * 2018-12-11 2019-04-19 维沃移动通信有限公司 A kind of information cuing method and mobile terminal

Also Published As

Publication number Publication date
CN110348419A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
CN110348419B (en) Method and device for photographing
US12094229B2 (en) Character recognition method and apparatus, computer device, and storage medium
TWI771645B (en) Text recognition method and apparatus, electronic device, storage medium
CN109993150B (en) Method and device for identifying age
US20190139207A1 (en) Method and device for providing image
CN110162670B (en) Method and device for generating expression package
US8879803B2 (en) Method, apparatus, and computer program product for image clustering
US11621997B2 (en) Dynamically assigning storage locations for messaging system data
US20170372056A1 (en) Visual data processing of response images for authentication
CN111696176B (en) Image processing method, image processing device, electronic equipment and computer readable medium
CN110458218B (en) Image classification method and device and classification network training method and device
CN106415664A (en) System and methods of generating user facial expression library for messaging and social networking applications
CN110059623B (en) Method and apparatus for generating information
US9183430B2 (en) Portable electronic apparatus and interactive human face login method
CN111259967A (en) Image classification and neural network training method, device, equipment and storage medium
CN110197230B (en) Method and apparatus for training a model
WO2021088790A1 (en) Display style adjustment method and apparatus for target device
US20220398689A1 (en) Facial image deformation method, apparatus, electronic device and computer readable medium
US20140232748A1 (en) Device, method and computer readable recording medium for operating the same
KR101979650B1 (en) Server and operating method thereof
WO2021190625A1 (en) Image capture method and device
CN113850212A (en) Image generation method, device, device and storage medium
CN116596748A (en) Image stylization processing method, apparatus, device, storage medium, and program product
TWI770531B (en) Face recognition method, electronic device and storage medium thereof
WO2021057644A1 (en) Photographing method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant