WO2019114508A1 - Image processing method, apparatus, computer readable storage medium, and electronic device - Google Patents

Image processing method, apparatus, computer readable storage medium, and electronic device Download PDF

Info

Publication number
WO2019114508A1
WO2019114508A1 PCT/CN2018/116592 CN2018116592W WO2019114508A1 WO 2019114508 A1 WO2019114508 A1 WO 2019114508A1 CN 2018116592 W CN2018116592 W CN 2018116592W WO 2019114508 A1 WO2019114508 A1 WO 2019114508A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
image
user identity
images
master
Prior art date
Application number
PCT/CN2018/116592
Other languages
French (fr)
Chinese (zh)
Inventor
达剑
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019114508A1 publication Critical patent/WO2019114508A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • 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
    • 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/178Human faces, e.g. facial parts, sketches or expressions estimating age from face image; using age information for improving recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Library & Information Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)
  • Image Analysis (AREA)
  • Collating Specific Patterns (AREA)
  • Image Processing (AREA)

Abstract

An image processing method, comprising: acquiring faces in images; acquiring from among the images an image set featuring the same faces; recognizing age values corresponding to the faces in the images in the image set; according to the age values, generating sorting information for the images in the image set; and according to the sorting information and the image set, generating a time sequence photo album comprising the images in the image set.

Description

图像处理方法、装置、计算机可读存储介质和电子设备Image processing method, device, computer readable storage medium, and electronic device
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年12月13日提交中国专利局、申请号为201711331605.9、发明名称为“图像处理方法、装置、存储介质和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on Dec. 13, 2017, filed on Jan. 13,,,,,,,,,,,,,,,,,,,,,,,,,,,,, In this application.
技术领域Technical field
本申请涉及计算机技术领域,特别是涉及一种图像处理方法、存储介质和电子设备。The present application relates to the field of computer technology, and in particular, to an image processing method, a storage medium, and an electronic device.
背景技术Background technique
随着电子设备的普及和移动互联网的迅速发展,电子设备的用户使用量越来越大。而相册功能已经成为电子设备的常用应用之一,属于用户使用频率极高的应用。电子设备的相册中都储存了大量的图像,传统的电子设备相册有提供各种图像浏览和分类的功能。With the popularity of electronic devices and the rapid development of mobile Internet, the use of electronic devices is increasing. The photo album function has become one of the commonly used applications of electronic devices, and belongs to applications with extremely high user frequency. A large number of images are stored in the album of the electronic device, and the traditional electronic device album has the functions of providing various image browsing and classification.
传统方法在对相册中的照片进行浏览的过程中,通常都是按照图像类型或者图像的修改时间或创建时间等几种常规的方式进行分类,难以激发用户对所分类的相册或图像集合中的照片进行查看的欲望,用户粘度较差。In the process of browsing photos in an album, the traditional method is usually classified according to image types or image modification time or creation time, and it is difficult to motivate the user to sort the classified albums or image collections. The desire to view the photos, the user's viscosity is poor.
发明内容Summary of the invention
本申请实施例提供一种图像处理方法、装置、存储介质和电子设备。Embodiments of the present application provide an image processing method, apparatus, storage medium, and electronic device.
一种图像处理方法,包括:An image processing method comprising:
获取图像中的人脸;Get the face in the image;
获取所述图像中具有相同人脸的图像集合;Obtaining a set of images having the same face in the image;
识别所述图像集合中的图像的人脸对应的年龄值;Identifying an age value corresponding to a face of the image in the set of images;
根据所述年龄值生成对所述图像集合中的图像的排序信息;Generating ranking information for images in the set of images based on the age values;
根据所述排序信息和所述图像集合,生成包括所述图像集合中图像的具有时序的相册。Based on the ranking information and the set of images, an album having a sequence of images in the set of images is generated.
一种图像处理装置,所述装置包括:An image processing apparatus, the apparatus comprising:
图像集合获取模块,用于获取图像中的人脸;获取所述图像中具有相同人脸的图像集合;An image collection obtaining module, configured to acquire a human face in the image; and acquire an image collection having the same human face in the image;
年龄值识别模块,用于识别所述图像集合中的图像的人脸对应的年龄值;An age value identification module, configured to identify an age value corresponding to a face of the image in the image set;
排序信息生成模块,用于根据所述年龄值生成对所述图像集合中的图像的排序信息;a sorting information generating module, configured to generate, according to the age value, sorting information of an image in the image set;
相册生成模块,用于根据所述排序信息和所述图像集合,生成包括所述图像集合中图像的具有时序的相册。And an album generating module, configured to generate, according to the sorting information and the image set, a photo album having a sequence of images in the image set.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现本申请任意实施例所述的图像处理方法的操作。A computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the operations of the image processing method described in any of the embodiments herein.
一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本申请任意实施例所述的图像处理方法的操作。An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the computer program to implement the operation of the image processing method according to any of the embodiments of the present application .
上述图像处理方法、装置、存储介质和电子设备,通过获取图像中的人脸;获取图像中具有相同人脸的图像集合,并识别图像集合中的图像的人脸对应的年龄值,再按照每个图像中的人脸的年龄值生成对图像的排序信息,根据排序信息和图像集合,生成包括图像集合中图像的具有时序的相册,从而使得该相册中的图像可按照该时序来显示,提高了用户使用粘度,也提高了对图像进行分类和显示的灵活性。The above image processing method, apparatus, storage medium, and electronic device acquire a face in an image; acquire an image set having the same face in the image, and identify an age value corresponding to the face of the image in the image set, and then follow each The age value of the face in the image generates sorting information for the image, and according to the sorting information and the image set, generates a time-series album including the image in the image set, so that the image in the album can be displayed according to the time series, thereby improving The user's use of viscosity also increases the flexibility to classify and display images.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为一个实施例中图像处理方法的应用场景图。FIG. 1 is an application scenario diagram of an image processing method in an embodiment.
图2为一个实施例中电子设备的内部结构示意图。2 is a schematic diagram showing the internal structure of an electronic device in an embodiment.
图3为一个实施例中图像处理方法的流程图。3 is a flow chart of an image processing method in one embodiment.
图4A为一个实施例中对相册中的图像进行展示的示意图。4A is a schematic diagram showing an image in an album in one embodiment.
图4B为另一个实施例中对相册中的图像进行展示的示意图。4B is a schematic diagram showing an image in an album in another embodiment.
图4C为一个实施例中对图像进行划分以及对相册中的图像进行展示的示意图。4C is a schematic diagram of dividing an image and displaying an image in an album in one embodiment.
图5为一个实施例中形成图像集合的流程图。Figure 5 is a flow diagram of forming an image collection in one embodiment.
图6为一个实施例中根据图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸的流程图。6 is a flow diagram of determining a master face from a face area and/or a face definition occupied by each face in an image in one embodiment.
图7为一个实施例中当识别出图像中包含多个人脸时,检测图像中的剩余人脸是否与已有的用户身份对应,当是,则将剩余人脸分入对应已有的用户身份中,得到剩余人脸对应的用户身份的流程图。FIG. 7 is a diagram showing, in an embodiment, when it is recognized that a plurality of faces are included in an image, whether the remaining faces in the detected image correspond to existing user identities, and if yes, the remaining faces are classified into corresponding existing user identities. In the flowchart of obtaining the user identity corresponding to the remaining faces.
图8为一个实施例中对疑似路人人脸的处理的流程图。Figure 8 is a flow diagram of the processing of a suspected passerby face in one embodiment.
图9为一个实施例中对新增图像的图像集合划分的流程图。Figure 9 is a flow diagram of the division of image sets for new images in one embodiment.
图10为一个实施例中图像处理装置的结构框图。Figure 10 is a block diagram showing the structure of an image processing apparatus in an embodiment.
图11为另一个实施例中图像处理装置的结构框图。Figure 11 is a block diagram showing the structure of an image processing apparatus in another embodiment.
图12为一个实施例中图像处理电路的示意图。Figure 12 is a schematic illustration of an image processing circuit in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
在一个实施例中,如图1所示,提供了一种图像处理方法的应用场景图,该应用环境包括电子设备110、服务器120。终端110和服务器120之间通过网络进行连接。在电子设备110中存储有图像,上述图像可存储于电子设备110内存中,也可存储于电子设备110内置SD(Secure Digital Memory Card,安全数码卡)卡中。或者服务器120上也可存储有图像,存储在服务器120上的图像可为电子设备在云端存储的图像。电子设备可对本地或云端存储的图像进行处理,比如根据图像形成图像集合,或者对图像集合中的图像进行排序显示等处理。In an embodiment, as shown in FIG. 1 , an application scenario diagram of an image processing method is provided, where the application environment includes an electronic device 110 and a server 120. The terminal 110 and the server 120 are connected through a network. An image is stored in the electronic device 110, and the image may be stored in the internal memory of the electronic device 110 or may be stored in an SD (Secure Digital Memory Card) card built into the electronic device 110. Alternatively, the server 120 may also store an image, and the image stored on the server 120 may be an image stored by the electronic device in the cloud. The electronic device can process images stored locally or in the cloud, such as forming a collection of images from the image, or sorting and displaying the images in the collection of images.
图2为一个实施例中电子设备的内部结构示意图。如图2所示,该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的图像处理方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以下各个实施例所提供的一种图像处理方法。内存储器为非易失性存储介质中的操作系统计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示图像等可视信息, 还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令。该电子设备可以是手机、平板电脑或者个人数字助理或穿戴式设备等。2 is a schematic diagram showing the internal structure of an electronic device in an embodiment. As shown in FIG. 2, the electronic device includes a processor, a memory, and a display screen connected by a system bus. The processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory is used to store data, programs, etc., and at least one computer program is stored on the memory, and the computer program can be executed by the processor to implement an image processing method suitable for an electronic device provided in the embodiments of the present application. The memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random storage memory (Random-Access-Memory, RAM). For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by a processor for implementing an image processing method provided by the various embodiments below. The internal memory provides a cached operating environment for operating system computer programs in a non-volatile storage medium. The display screen can be a touch screen, such as a capacitive screen or an electronic screen, for displaying visual information such as an image, and can also be used to detect a touch operation applied to the display screen to generate a corresponding command. The electronic device can be a cell phone, a tablet or a personal digital assistant or a wearable device.
本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。比如该电子设备还可包括摄像头,可通过该摄像头生成图像,并对该图像进行处理。It will be understood by those skilled in the art that the structure shown in FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied. The specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements. For example, the electronic device can further include a camera through which an image can be generated and processed.
在一个实施例中,如图3所示,提供了一种图像处理方法,本实施例主要以该方法应用于如图1所示的电子设备中为例进行说明。该方法包括:In an embodiment, as shown in FIG. 3, an image processing method is provided. This embodiment is mainly applied to the electronic device shown in FIG. 1 as an example. The method includes:
操作302,获取图像中的人脸。 Operation 302, obtaining a face in the image.
可选地,图像为包含人脸的图像,电子设备可从本机和/或其它设备中的多用户家庭共享相册中获取图像,还可为其它设备中所共享的图像,该共享的图像为电子设备具有访问权限的多用户家庭共享相册中的图像,识别并获取该图像中的人脸。Optionally, the image is an image including a human face, and the electronic device may acquire an image from a multi-user family shared album in the local device and/or other devices, and may also be an image shared by other devices, and the shared image is The multi-user family with access rights of the electronic device shares the image in the album, and recognizes and acquires the face in the image.
电子设备可接收图像划分指令,该划分指令可指定对应的一个或多个图像,并获取该划分指令指定图像。还可自动获取图像,比如可在息屏充电的状态来来获取的图像,或者在电子设备上的资源使用率较低和/或电量超过预设电量阈值的状态下,自动获取图像。该资源使用率包括但不限于CPU使用率和内存使用率等其中的一种或多种。针对获取的图像,可进一步获取该图像中的人脸。The electronic device may receive an image division instruction that may specify a corresponding one or more images and acquire the division instruction designation image. It is also possible to automatically acquire an image, such as an image that can be acquired in a state of being charged by the screen, or automatically acquire an image in a state where the resource usage rate on the electronic device is low and/or the power exceeds the preset power threshold. The resource usage includes, but is not limited to, one or more of CPU usage and memory usage. For the acquired image, the face in the image can be further obtained.
在一个实施例中,当检测到电子设备或预设的云端上新增了图像时,可自动获取该图像中的人脸。In one embodiment, when an image is added to the electronic device or the preset cloud, the face in the image is automatically acquired.
操作304,获取图像中具有相同人脸的图像集合。 Operation 304, acquiring a set of images having the same face in the image.
可选地,该图像集合为根据人脸而划分形成的图像的集合,每种图像集合中的图像为包含相同人脸的图像。电子设备预设了人脸和图像集合之间的对应关系,根据获取的人脸,可按照预设的对应关系从图像中获取具有相同人脸的图像集合。Optionally, the image set is a set of images formed according to a face, and the image in each image set is an image containing the same face. The electronic device presets a correspondence between the face and the image set. According to the acquired face, the image set having the same face can be acquired from the image according to the preset correspondence.
在一个实施例中,当检测到图像集合中包含的图像有变动时,可自动获取对应的图像集合。其中,图像的变动包含图像的增加和/或减少,还可包括对已有图像中的像素进行的修改,比如对已有图像进行美颜处理等。In one embodiment, when it is detected that there is a change in the image contained in the image collection, the corresponding image collection may be automatically acquired. The change of the image includes an increase and/or decrease of the image, and may also include modifying the pixels in the existing image, such as performing beauty treatment on the existing image.
操作306,识别图像集合中的图像的人脸对应的年龄值。 Operation 306, identifying an age value corresponding to a face of the image in the image collection.
年龄值表示电子识别出的图像中的人脸所呈现出的年龄的大小。可选地,电子设备可对图像集合中的每个图像,识别对应图像中的人脸在图像中的人脸区域,并识别人脸上的与年龄相关的部位的特征数据。该部位可包含多个,根据每个部位的特征数据进行分析,计算出该人脸对应的年龄值。其中,该部位包括如瞳孔、眼角、嘴角、鼻子等明显会随着年龄变化的部位。比如,可根据图像上显示的皮肤纹理、毛孔大小、眼袋、眼角等部位上的特征进行综合分析,计算出该人脸对应的年龄值。如图4A所示,可按照上述的部位对图像1~4中的人脸对应的年龄值进行识别,比如识别出图4A中的图像1中的人脸的年龄值为8岁,图像2中的人脸的年龄值为16岁,图像3中的人脸的年龄值为25岁,图像4中的人脸的年龄值为40岁等。The age value indicates the size of the age presented by the face in the electronically recognized image. Optionally, the electronic device may identify a face region of the face in the image in the image corresponding to each image in the image set, and identify feature data of the age-related portion of the face of the person. The part may include a plurality of pieces, and the analysis is performed according to the feature data of each part, and the age value corresponding to the face is calculated. Among them, the part includes a part such as a pupil, an eye corner, a corner of the mouth, a nose, and the like which obviously change with age. For example, a comprehensive analysis can be performed according to the characteristics of the skin texture, the pore size, the eye bag, the eye corner, and the like displayed on the image, and the age value corresponding to the face is calculated. As shown in FIG. 4A, the age value corresponding to the face in the images 1 to 4 can be identified according to the above-mentioned part, for example, the age value of the face in the image 1 in FIG. 4A is recognized as 8 years old, in the image 2 The age of the face is 16 years old, the age of the face in image 3 is 25 years old, and the age of the face in image 4 is 40 years old.
操作308,根据年龄值生成对图像集合中的图像的排序信息。 Operation 308, generating ranking information for the images in the image collection based on the age value.
可选地,该排序信息表示对图像集合中的图像进行排序显示的信息,排序信息中包含了图像集合中的每张图片在该图像集合中的排序的次序,使得可根据该排序的次序进行排序显示。该排序信息可为按照年龄值从小到大的排序的信息,还可为按照年龄值从大到小的排序信息。以按照年龄值从小到大的排序信息为例,图像中的年龄值越小,当在进行对图像集合中的图像进行播放或显示的过程中,对应图像在图像集合中的显示的顺序越靠前。Optionally, the sorting information represents information for sorting and displaying the images in the image set, and the sorting information includes an order of sorting each image in the image set in the image set, so that the order of the sorting may be performed according to the order of the sorting. Sort display. The sorting information may be sorted information according to age values from small to large, and may also be sorted information according to age values from large to small. Taking the sorting information from small to large according to the age value as an example, the smaller the age value in the image, the more the order of display of the corresponding image in the image set is in the process of playing or displaying the image in the image set. before.
操作310,根据排序信息和图像集合,生成包括图像集合中图像的具有时序的相册。 Operation 310, based on the sorting information and the image set, generate a photo album having a sequence including images in the image set.
电子设备可将该图像集合中具有相同人脸的图像聚集在一处,而形成相应的相册。且 根据该排序信息,生成各个图像在相册中的展示的顺序,从而形成了具有时序的相册。比如,可按照图像集合中的图像,按照相同人脸的年龄值进行从大到小排序,或从大到小的排序,生成的时序即为年龄顺序或年龄逆序的图像排序的相册。The electronic device can gather images of the same face in the image collection in one place to form a corresponding album. And based on the sorting information, the order in which the respective images are displayed in the album is generated, thereby forming an album having a time series. For example, the images in the image set may be sorted from large to small according to the age value of the same face, or sorted from large to small, and the generated time series is an album sorted by an age order or an age reversed image.
上述的图像处理方法,通过获取图像中的人脸;获取图像中具有相同人脸的图像集合,并识别图像集合中的图像的人脸对应的年龄值,再按照每个图像中的人脸的年龄值生成对图像的排序信息,根据排序信息和图像集合,生成包括图像集合中图像的具有时序的相册,从而使得该相册中的图像可按照该时序来显示,提供了一种全新的图像分类和查看的方式,使得对图像进行分类和查看的方式更多,提高了用户使用粘度,也提高了对图像进行分类和显示的灵活性。The image processing method described above, by acquiring a face in an image; acquiring an image set having the same face in the image, and identifying an age value corresponding to the face of the image in the image set, and then following the face of each image The age value generates sorting information for the image, and according to the sorting information and the image set, generates a time-series album including the image in the image set, so that the image in the album can be displayed according to the timing, providing a brand-new image classification And the way of viewing, the way to classify and view images is more, which improves the user's viscosity and improves the flexibility of classifying and displaying images.
在一个实施例中,在操作310之后,还包括:将具有时序的相册按照时序进行播放。In one embodiment, after operation 310, further comprising: playing the album with timing in a time series.
可选地,时序包括按照年龄值进行顺序排序和/或逆序排序,具有时序的相册包括幻灯片、短片或影集中的任意一种形式的文件。即可按照年龄值的大小进行从大到小的排序,或者从小到大的排序。Optionally, the timing includes sequential ordering and/or reverse ordering according to age values, and the album with time series includes files of any form in a slide, a movie or an album. You can sort from large to small, or from small to large, depending on the age.
可选地,电子设备可接收对具有时序的相册中的图像的播放指令,根据该播放指令获取上述对应相册的时序,再按照该时序对相册中的图像进行顺序展示。电子设备可提供用于播放相册中的图像的虚拟按钮,当接收到对该虚拟按钮的点击操作时,可触发该播放指令。还可预设用于触发播放指令的开启语音信息。通过调用语音接收装置,接收对应的语音信息,当检测到该语音信息与该开启语音信息匹配时,也可触发该播放指令。Optionally, the electronic device may receive a play instruction for the image in the album with time series, obtain the timing of the corresponding album according to the play instruction, and sequentially display the images in the album according to the timing. The electronic device can provide a virtual button for playing an image in the album, which can be triggered when a click operation on the virtual button is received. It is also possible to preset an open voice message for triggering a play command. The corresponding voice information is received by calling the voice receiving device, and when the voice information is detected to match the open voice information, the play command may also be triggered.
在接收到对相册中的图像的播放指令后,可获取预先生成的相册的时序,并按照该时序对相册中的图像进行顺序展示。比如,可按照该播放指令对相册中的图像进行幻灯片播放,或者生成一个短片或影集,以供用户阅览。After receiving the play instruction for the image in the album, the timing of the pre-generated album may be acquired, and the images in the album are sequentially displayed according to the timing. For example, the image in the album may be played in a slide show according to the play command, or a short film or album may be generated for the user to view.
如图4A以及图4B所示,该相册1中包含图像1~图像4;相册2中包含图像5至图像7。每个相册还设置了对应的时序,如相册1中图像的时序为按照图像1~图像4的顺序排序,相册2为按照图像5~图像7的顺序排序。电子设备可按照该排序将具有时序的相册中的图像进行播放,以展示一个相册中的人物从小到大或从大到小的图像演变。As shown in FIG. 4A and FIG. 4B, the album 1 includes images 1 to 4; and the album 2 includes images 5 to 7. Each album is also set with a corresponding timing. For example, the timing of the images in the album 1 is sorted in the order of the images 1 to 4, and the album 2 is sorted in the order of the images 5 to 7. The electronic device can play the images in the album with time series according to the sorting to show the evolution of the characters in an album from small to large or from large to small.
在一个实施例中,操作306包括:当同一图像集合的多个图像中,人脸的年龄值相同时,根据多个图像的生成时间生成对多个图像的排序信息。In one embodiment, operation 306 includes generating ranking information for the plurality of images based on the generation times of the plurality of images when the age values of the faces are the same among the plurality of images of the same image set.
可选地,当存在多张图像的中,人脸的年龄值相同时,可进一步对该多张图像的生成时间进行比较。按照该生成时间来对该多张图像进行排序。比如可按照生成时间的从小到大排序,或者从大到小进行排序。Optionally, when there are multiple images, when the age values of the faces are the same, the generation time of the multiple images may be further compared. The plurality of images are sorted according to the generation time. For example, it can be sorted according to the generation time from small to large, or from large to small.
在一个实施例中,当排序信息为根据年龄值从小到大的排序信息时,则针对相同年龄值的图像,按照生成时间从早到晚进行排序;当排序信息为根据年龄值从大到小的排序信息时,则针对相同年龄值的图像,按照生成时间从晚到早进行排序。以排序信息为根据年龄值从小到大的排序信息为例,当存在三张图像,其中的人脸均为用户A的人脸,且判定该用户A的人脸的年龄值均为25岁时,则可进一步比较三张图像的生成时间的大小,生成对这三张图像的排序信息。并针对该三张图像,将生成时间较早的图像排序在前。In one embodiment, when the ranking information is sorting information according to the age value from small to large, the images for the same age value are sorted from morning to night according to the generation time; when the sorting information is according to the age value from large to small When sorting information, the images of the same age value are sorted from late to early according to the generation time. Taking the sorting information as the sorting information according to the age value from small to large as an example, when there are three images, wherein the face is the face of the user A, and the age value of the face of the user A is determined to be 25 years old. Then, the size of the generation time of the three images can be further compared, and the sorting information of the three images is generated. And for the three images, the image with the earlier generation time is sorted first.
通过按照生成时间来对相同年龄值的图像进行排序,进一步提高了对图像排序的规范性。The ordering of image sorting is further improved by sorting images of the same age value according to the generation time.
在一个实施例中,上述方法还包括形成图像集合的操作,该操作可在操作304之前执行,如图5所示,包括:In one embodiment, the above method further includes an operation of forming an image set, the operation being performed prior to operation 304, as shown in FIG. 5, comprising:
操作502,对图像中的人脸进行人脸识别,确定图像中的人脸对应的用户身份。Operation 502, performing face recognition on the face in the image, and determining a user identity corresponding to the face in the image.
电子设备可对图像进行人脸识别,提取其中的人脸特征信息,根据该人脸特征信息来识别出人脸的用户身份。举例来说,电子设备可针对图像A,识别出其中的人脸所属的为 用户A的人脸,及其用户身份为用户A。The electronic device can perform face recognition on the image, extract face feature information therein, and identify the user identity of the face according to the face feature information. For example, the electronic device may identify, for the image A, a face in which the face belongs to the user A, and the user identity is the user A.
在一个实施例中,针对从图像中提取出的人脸特征信息,可进一步检测该人脸特征信息是否与已有识别出的某一用户身份的人脸特征信息相匹配,当匹配时,则判定该图像中的人脸对应的用户身份即为匹配出的用户身份。当不存在与该人脸特征信息相匹配的用户身份时,则表示该用户身份为新出现的用户身份。可对应创建一个新的用户身份,作为该图像中的人脸对应的用户身份。并根据该图像中的人脸的人脸特征信息,生成新创建的用户身份对应的人脸特征信息。比如可直接将图像中的人脸特征信息作为该用户身份对应的人脸特征信息。In an embodiment, for the facial feature information extracted from the image, the facial feature information may be further detected to match the face feature information of the existing identified identity of the user, and when matching, It is determined that the user identity corresponding to the face in the image is the matched user identity. When there is no user identity matching the facial feature information, it indicates that the user identity is a newly appearing user identity. A new user identity can be created correspondingly as the user identity corresponding to the face in the image. And generating facial feature information corresponding to the newly created user identity according to the facial feature information of the face in the image. For example, the face feature information in the image can be directly used as the face feature information corresponding to the user identity.
操作504,将图像划分至与用户身份对应的图像集合中,形成具有相同人脸的图像集合。 Operation 504, dividing the image into an image collection corresponding to the user identity to form an image collection having the same face.
电子设备针对每种用户身份设置了对应的图像集合,该图像集合中的图像为具有相同用户身份的图像。电子设备可建立不同用户身份与不同图像集合之间的映射关系,使得根据该对应关系,将相同用户身份的图像划分至同一个图像集合中,形成具有相同人脸的图像集合。The electronic device sets a corresponding image set for each user identity, and the images in the image set are images having the same user identity. The electronic device can establish a mapping relationship between different user identities and different image sets, so that images of the same user identity are divided into the same image set according to the corresponding relationship to form an image set having the same face.
在一个实施例中,针对已识别出的用户身份的图像,可对其设置用户身份标记,以标记该图像中的人脸的用户身份,且使得在后续的处理过程中,可根据该标记判定出该图像为已经识别出用户身份的图像,避免重复识别。并根据该用户身份标记,将该图像划分至与该用户身份标记对应的图像集合中。In one embodiment, for an image of the identified user identity, a user identity tag can be set thereon to mark the user identity of the face in the image, and such that in subsequent processing, the flag can be determined The image is an image that has identified the user's identity, avoiding duplicate recognition. And according to the user identity mark, the image is divided into an image set corresponding to the user identity mark.
在一个实施例中,当识别出的用户身份为已有的用户身份时,可获取与该已有的用户身份对应的图像集合,将该图像划分至对应图像集合中。当识别出的用户身份为新的用户身份时,则创建一个与该新的用户身份对应的图像集合,将该图像划分至所创建的图像集合中。In an embodiment, when the identified user identity is an existing user identity, an image set corresponding to the existing user identity may be acquired, and the image is divided into corresponding image sets. When the identified user identity is a new user identity, a set of images corresponding to the new user identity is created, and the image is divided into the created image collection.
举例来说,当识别出的图像的用户身份为已存在的用户A,则直接获取与该用户A对应的图像集合A,并将该图像划分至该图像集合A中。当识别出的用户A为不存在的用户,则创建一个与该用户A对应的图像集合A,并将该图像划分至该图像集合A中,以使得图像集合A中的图像均为包含用户A的人脸的图像。比如存在如图4C所示的图像8,当识别出图像8中的人脸对应的用户身份为如图4B中所示的图像集合对应的用户身份时,可将图像8划分至该图4B对应的图像集合中。并对划分后的图像集合中,每个图像中的人脸对应的年龄值生成对该图像的排序信息,并生成具有时序的相册并展示。比如可按照年龄值的大小进行顺序排序,如当识别出图像8中的人脸对应的年龄值处于图像6和图像7之间时,则生成的排序信息中,图像8的排序顺序则位于图像6和图像7之间,生成如图4C中所示的图像5-图像6-图像8-图像7的具有时序的相册。For example, when the user identity of the recognized image is the existing user A, the image set A corresponding to the user A is directly acquired, and the image is divided into the image set A. When the identified user A is a non-existing user, an image set A corresponding to the user A is created, and the image is divided into the image set A, so that the images in the image set A are all included in the user A. The image of the face. For example, there is an image 8 as shown in FIG. 4C. When it is recognized that the user identity corresponding to the face in the image 8 is the user identity corresponding to the image set as shown in FIG. 4B, the image 8 may be divided into the corresponding FIG. 4B. In the collection of images. And in the divided image set, the age value corresponding to the face in each image generates sorting information for the image, and generates an album with time series and displays. For example, the order may be sorted according to the age value. For example, when it is recognized that the age value corresponding to the face in the image 8 is between the image 6 and the image 7, the sort order of the image 8 is located in the image. Between 6 and image 7, a time-stamped album of image 5-image 6-image 8-image 7 as shown in Fig. 4C is generated.
上述实施例中,通过对图像中的人脸进行识别,判断出该人脸所属的用户,然后将该图像划分至与该用户对应的图像集合中,实现了按照图像人脸所属的用户身份进行图像划分,将包含相同用户的人脸的图像划分至相同的图像集合中,提高了图像划分的灵活性。In the above embodiment, by identifying the face in the image, the user to which the face belongs is determined, and then the image is divided into an image set corresponding to the user, thereby realizing the identity of the user to which the image face belongs. The image division divides the image of the face containing the same user into the same image set, which improves the flexibility of image division.
在一个实施例中,操作302包括:当图像中包含多个人脸时,确定多个人脸中的主人脸。In one embodiment, operation 302 includes determining a master face of the plurality of faces when the image includes a plurality of faces.
图像中的人脸可包括多个,当识别出其中的人脸包括多个时,可进一步识别其中哪张人脸该图像中的主人脸。每张图像的主人脸指的是每张图像中核心人物的人脸,且清晰度达到阈值可以识别出人脸对应的身份的主人脸。核心人物是指图像中唯一的主人脸对应的人物或者多人合影图像中主人脸对应的人物,或者图像中不是主人脸却与属于不同用户身份的主人脸出现在同一张图像上的次数达到了设定阈值的人脸对应的人物。The face in the image may include a plurality of, and when it is recognized that the face includes a plurality of faces, it may further identify which of the faces is the master face in the image. The master face of each image refers to the face of the core person in each image, and the resolution reaches a threshold value to identify the master face of the identity corresponding to the face. The core character refers to the person corresponding to the owner's face in the image or the character corresponding to the owner's face in the multi-person group image, or the number of times the image is not the master face but appears on the same image as the owner's face belonging to a different user identity. The person corresponding to the face whose threshold is set.
在一个实施例中,每张图像只提取出一张人脸作为主人脸。根据人脸识别算法对获取的每张图像的主人脸进行人脸识别,得到每张图像的主人脸所对应的人脸类别。人脸类别指的是主人脸识别结果所对应的人物身份。可选地,电子设备从相册中获取一张单人照片, 照片即为图像,从该单人照片中提取主人脸。因为是单人照片,图像中只有一张人脸,当该单人人脸的清晰度也已经达到了可以识别出人脸的阈值,则将该单人照片中的人脸标记为主人脸。对该主人脸进行人脸识别之后,得出该主人脸对应的身份是张三,即得到该主人脸所对应的用户身份是张三。对其他单人或非单人图像一样,提取核心人物的且清晰度达到阈值可以识别出人脸对应的身份的人脸,标记为主人脸,并对主人脸进行人脸识别,得出该主人脸对应的身份,该身份便是该主人脸对应的人脸类别。In one embodiment, only one face is extracted as a master face for each image. Face recognition is performed on the master face of each image obtained according to the face recognition algorithm, and the face category corresponding to the owner face of each image is obtained. The face category refers to the identity of the person corresponding to the result of the master's face recognition. Optionally, the electronic device obtains a single photo from the album, and the photo is an image, and the owner's face is extracted from the single photo. Because it is a single photo, there is only one face in the image. When the clarity of the single face has reached the threshold that can recognize the face, the face in the single photo is marked as the main face. After the face recognition of the owner's face, it is found that the identity corresponding to the owner's face is Zhang San, that is, the user identity corresponding to the owner's face is Zhang San. For other single-person or non-single-person images, the face of the core character is extracted and the sharpness reaches the threshold, and the face corresponding to the identity of the face can be identified, marked as the main face, and the face of the master face is recognized, and the owner is obtained. The identity corresponding to the face, which is the face category corresponding to the owner's face.
当某张图像中核心人物的人脸的清晰度未达到可以识别出人脸对应的身份的清晰度阈值,则继续检查相册中的其他图像中是否已经有相似且已经标记为主人脸的人脸存在,当存在,则将这张人脸与该主人脸标记为一类主人脸。反之不存在,但是在相册中的其他图像中存在与该张图像中的核心人物的人脸相似的人脸出现了预设次数,则从这些相似人脸中选一张最清晰的作为主人脸,将这些相似人脸标记为一类主人脸,并对该主人脸进行人脸识别,得出该主人脸对应的身份,该身份便是该主人脸对应的用户身份,也是该张图像中的核心人物的人脸所对应的用户身份。预设次数可以设置为5次,当然,在其他实施例中,也可以设置为其他合理的次数,例如3次、4次、6次、10次等。When the sharpness of the face of the core person in an image does not reach the sharpness threshold of the identity corresponding to the face, continue to check whether other faces in the album have similar faces that have been marked as the face of the face. Exist, when present, mark this face and the owner's face as a type of master face. Conversely, if there is a preset number of faces in the other images in the album that are similar to the faces of the core characters in the image, then the clearest one is selected as the master face from the similar faces. Marking these similar faces as a type of master face, and performing face recognition on the master face, the identity corresponding to the master face is obtained, and the identity is the user identity corresponding to the master face, and is also the core in the image. The user identity of the person's face. The preset number of times can be set to 5 times. Of course, in other embodiments, other reasonable times can be set, for example, 3 times, 4 times, 6 times, 10 times, and the like.
在一个实施例中,主人脸还可包括多个,当包括多个时,可获取图像中的其中一个主人脸。其中,获取的主人脸可根据用户的选取操作来确定。In one embodiment, the master face may also include a plurality of, when a plurality of faces are included, one of the master faces in the image may be acquired. The obtained master face may be determined according to a user's selection operation.
在一个实施例中,针对每个主人脸,识别出对应人脸所属的用户身份,进而可将该同一张照片,划分至每个主人脸的用户身份对应的图像集合中。举例来说,当一张照片中存在人脸A和人脸B时,可按照上述的方式进行人脸检测,并判定出人脸A和人脸B均为主人脸时,可进一步识别该人脸A对应的用户身份A,以及人脸B对应的用户身份B,并将该图像同时划分至用户A对应的图像集合A和用户对应的图像集合B之中。In one embodiment, for each master face, the identity of the user to which the corresponding face belongs is identified, and the same photo may be divided into an image set corresponding to the user identity of each master face. For example, when there is a face A and a face B in a photo, the face detection can be performed in the above manner, and when the face A and the face B are both the master face, the person can be further identified. The user identity A corresponding to the face A and the user identity B corresponding to the face B are simultaneously divided into the image set A corresponding to the user A and the image set B corresponding to the user.
在一个实施例中,确定多个人脸中的主人脸,包括:根据图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸。In one embodiment, determining a master face of the plurality of faces includes determining a master face based on a face area and/or a face definition occupied by each face in the image.
电子设备从本地或云端的相册中获取图像,该图像中包含没有人脸的图像(纯自然风光类)、单人图像及多人合影图像,其中单人图像及多人合影图像中都包含了人脸。对于单人照片,图像中只有一张人脸,当该单人人脸的清晰度也已经达到了可以识别出人脸的阈值,则将该单人照片中的人脸标记为主人脸。对于多人合影图像,则可按照该图像中的人脸的人脸面积和/或人脸清晰度等其中的任意一种或多种的结合来确定主人脸。The electronic device obtains an image from a local or cloud album containing images of no human face (pure natural scenery), single-person images, and multi-person group images, including single-person images and multi-person group images. human face. For a single photo, there is only one face in the image. When the clarity of the single face has reached the threshold that can recognize the face, the face in the single photo is marked as the main face. For a multi-person group image, the master face can be determined according to a combination of any one or more of a face area and/or a face definition of the face in the image.
可选地,从多人合影图像中获取人脸面积最大的人脸,判断人脸的清晰度是否符合识别出人脸的清晰度阈值,且该人脸是否符合预设条件。若是,则将人脸面积最大的人脸作为多人合影图像的主人脸,若否,则继续从多人合影图像中获取人脸面积大小次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸面积达到最小阈值或获取到主人脸为止。按照人脸面积从大到小的顺序依次获取主人脸,从而可提高对主人脸确定的准确性。Optionally, the face with the largest face area is obtained from the multi-person group image, and it is determined whether the clarity of the face conforms to the clarity threshold of the recognized face, and whether the face meets the preset condition. If yes, the face with the largest face area is used as the master face of the multi-person group image. If not, the face with the second largest face size is continuously obtained from the multi-person group image, and it is determined whether the face meets the preset condition. Repeat until the face area reaches the minimum threshold or gets the owner's face. The master face is obtained in order from the largest to the smallest, so that the accuracy of the master face can be improved.
对于多人合影图像,还可按照人脸清晰度从大到小的顺序获取主人脸。可选地,从多人合影图像中获取人脸清晰度最大的人脸,判断人脸的人脸面积是否符合识别出的人脸的人脸面积阈值,且该人脸是否符合预设条件。当是,则将该人脸清晰度最大的人脸作为多人合影图像的主人脸,当否,则继续从多人合影图像中获取人脸清晰度大小次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸清晰度达到最小清晰度阈值或获取到主人脸为止。For multi-person group images, the master face can also be obtained in descending order of face clarity. Optionally, the face with the largest face resolution is obtained from the multi-person group image, and the face area of the face is determined to meet the face area threshold of the recognized face, and whether the face meets the preset condition. When yes, the face with the largest face resolution is used as the master face of the multi-person group image. If not, the face of the face resolution second is continuously obtained from the multi-person group image, and the face is judged to be in conformity. The preset condition is repeated until the face resolution reaches the minimum definition threshold or the owner's face is acquired.
在一个实施例中,如图6所示,根据图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸,包括:In one embodiment, as shown in FIG. 6, the master face is determined based on the face area and/or face definition occupied by each face in the image, including:
操作602,从图像中获取人脸面积最大的人脸,判断人脸是否符合预设条件,若是,则执行操作604,否则,执行操作606。 Operation 602, obtaining a face with the largest face area from the image, determining whether the face meets the preset condition, and if so, performing operation 604, otherwise, performing operation 606.
当图像为多人合影图像时,从多人合影图像中获取核心人物的人脸,且清晰度达到阈值可以识别出人脸对应的身份的主人脸。可选地,从多人合影图像中获取人脸面积最大的 人脸,再判断人脸是否符合预设条件。预设条件包括但不限于以下:判断人脸的清晰度是否达到可以识别出人脸对应的身份的阈值,当是再进一步判断人脸面积最大的人脸的拍摄角度和焦点,判断拍摄角度是否是正脸,判断拍摄焦点是否为该人脸面积最大的人脸,判断该人脸面积最大的人脸是否离镜头最近。When the image is a multi-person group image, the face of the core person is obtained from the multi-person group image, and the resolution reaches a threshold value to identify the master face of the identity corresponding to the face. Optionally, the face with the largest face area is obtained from the multi-person group image, and then the face is determined to meet the preset condition. The preset conditions include, but are not limited to, the following: determining whether the sharpness of the face reaches a threshold value that can identify the identity corresponding to the face, and when it is further determining the shooting angle and focus of the face with the largest face area, determining whether the shooting angle is It is a positive face, and it is judged whether the shooting focus is the face with the largest face area, and it is judged whether the face with the largest face area is closest to the lens.
操作604,将人脸面积最大的人脸作为图像的主人脸。In operation 604, the face with the largest face area is taken as the master face of the image.
操作606,继续从图像中获取人脸面积大小次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸面积达到最小阈值或获取到主人脸为止。In operation 606, the face of the face area is obtained from the image, and the face is determined to meet the preset condition, and the execution is repeated until the face area reaches the minimum threshold or the owner's face is acquired.
当判断结果为同时满足上述预设条件,则说明人脸面积最大的人脸应该是核心人物对应的人脸,于是将人脸面积最大的人脸作为多人合影图像的主人脸,并进行标记为主人脸。When the judgment result is that the above preset condition is satisfied at the same time, the face with the largest face area should be the face corresponding to the core person, and the face with the largest face area is used as the master face of the multi-person group image and marked. For the owner's face.
当判断结果为不满足上述预设条件,则说明人脸面积最大的人脸不是核心人物对应的人脸,则继续从多人合影图像中获取人脸面积大小次之的人脸,判断人脸是否符合预设条件,当判断结果为同时满足上述预设条件,则说明人脸面积次之的人脸应该是核心人物对应的人脸,于是将人脸面积次之的人脸作为多人合影图像的主人脸,并进行标记为主人脸。When the judgment result is that the preset condition is not satisfied, it indicates that the face with the largest face area is not the face corresponding to the core person, and then the face whose face size is second largest is obtained from the multi-person group image, and the face is judged. Whether the pre-set condition is met, and when the judgment result satisfies the above-mentioned preset condition, the face whose face area is second should be the face corresponding to the core person, so that the face with the face area second is taken as a multi-person group photo The owner's face of the image is marked as the main face.
当人脸面积次之的人脸还不符合预设条件,则说明人脸面积次之的人脸还不是核心人物对应的人脸。继续从多人合影图像中获取人脸面积大小再次之的人脸,重复执行直到人脸达到最小阈值或获取到主人脸为止。即预设了一个人脸面积的最小阈值,当在人脸面积大于该最小阈值的人脸中,还是未找到符合预设条件的人脸,那么就对这张图像停止获取主人脸。When the face whose face area is second is not in accordance with the preset condition, it means that the face whose face area is second is not the face corresponding to the core person. Continue to obtain the face whose face size is again from the multi-person group image, and repeat until the face reaches the minimum threshold or gets the owner's face. That is, a minimum threshold of a face area is preset. When a face whose face area is larger than the minimum threshold is not found, the face that meets the preset condition is not found, then the owner's face is stopped for the image.
在一个实施例中,根据图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸,包括:从图像中获取人脸清晰度最高的人脸,判断人脸是否符合预设条件;若是,则将人脸清晰度最高的人脸作为图像的主人脸;若否,则继续从图像中获取人脸清晰度次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸清晰度达到最小清晰度阈值或获取到主人脸为止。In one embodiment, determining the master face according to the face area and/or the face definition occupied by each face in the image comprises: obtaining the face with the highest face resolution from the image, and determining whether the face conforms to the preset. Condition; if yes, the face with the highest face resolution is used as the master face of the image; if not, the face whose face is the second most clear is obtained from the image, and it is determined whether the face meets the preset condition and is repeatedly executed. Until the face resolution reaches the minimum sharpness threshold or gets the owner's face.
当图像为多人合影图像时,从多人合影图像中获取核心人物的人脸,且人脸清晰度达到阈值可以识别出人脸对应的身份的主人脸。可选地,从多人合影图像中获取人脸清晰度最大的人脸,再判断人脸是否符合预设条件。预设条件包括但不限于以下:判断人脸的清晰度是否达到可以识别出人脸对应的身份的阈值,若是再进一步判断人脸面积最大的人脸的拍摄角度和焦点,判断拍摄角度是否是正脸,判断拍摄焦点是否为该人脸面积最大的人脸,判断该人脸面积最大的人脸是否离镜头最近。When the image is a multi-person group image, the face of the core person is obtained from the multi-person group image, and the face resolution reaches a threshold value to identify the master face of the identity corresponding to the face. Optionally, the face with the largest facial expression is obtained from the multi-person group image, and then the face is determined to meet the preset condition. The preset conditions include, but are not limited to, the following: determining whether the sharpness of the face reaches a threshold value that can identify the identity corresponding to the face, and if it is further determining the shooting angle and focus of the face with the largest face area, determining whether the shooting angle is positive The face determines whether the shooting focus is the face with the largest face area, and determines whether the face with the largest face area is closest to the lens.
当判断结果为同时满足上述预设条件,则说明人脸清晰度最高的人脸应该是核心人物对应的人脸,于是将人脸清晰度最高的人脸作为多人合影图像的主人脸,并进行标记为主人脸。When the judgment result is that the above preset condition is satisfied at the same time, the face with the highest face resolution should be the face corresponding to the core person, and the face with the highest face resolution is used as the master face of the multi-person group image, and Mark the face as the main face.
当判断结果为不满足上述预设条件,则说明人脸清晰度最大的人脸不是核心人物对应的人脸,则继续从多人合影图像中获取人脸清晰度次之的人脸,判断人脸是否符合预设条件,当判断结果为同时满足上述预设条件,则说明人脸清晰度次之的人脸应该是核心人物对应的人脸,于是将人脸清晰度次之的人脸作为多人合影图像的主人脸,并进行标记为主人脸。When the judgment result is that the above preset condition is not satisfied, it indicates that the face with the largest face resolution is not the face corresponding to the core person, and then the face with the face clarity is obtained from the multi-person group image, and the person is judged. Whether the face meets the preset condition, and when the judgment result is that the above-mentioned preset condition is satisfied at the same time, the face whose face resolution is second should be the face corresponding to the core character, so that the face with the second face of the face is used as the face Multiplayer takes a picture of the owner's face and marks it as the main face.
当人脸清晰度次之的人脸还不符合预设条件,则说明人脸清晰度次之的人脸还不是核心人物对应的人脸。继续从多人合影图像中获取人脸清晰度再次之的人脸,重复执行直到人脸达到最小清晰度阈值或获取到主人脸为止。即预设了一个人脸清晰度的最小阈值,当在人脸清晰度大于该最小清晰度阈值的人脸中,还是未找到符合预设条件的人脸,那么就对这张图像停止获取主人脸。When the face whose face resolution is second is not in accordance with the preset condition, the face whose face resolution is second is not the face corresponding to the core character. Continue to obtain the face whose face resolution is again from the multi-person group image, and repeat until the face reaches the minimum definition threshold or the owner's face is acquired. That is, a minimum threshold of the face sharpness is preset. When a face whose face definition is greater than the minimum sharpness threshold is not found, the face that meets the preset condition is not found, then the owner of the image is stopped. face.
本申请实施例中,因为相比于单人图像,从多人合影图像中比较难确定主人脸,所以按照人脸面积和/或人脸清晰度从大到小的顺序依次判断是否能够作为主人脸,这样不会遗漏主人脸。且设置了预设条件,只有满足这些预设条件的人脸才能成为主人脸,这样获 取的主人脸的结果就更加准确。In the embodiment of the present application, since it is more difficult to determine the master face from the multi-person group image than the single-person image, it is determined whether the face area and/or the face definition are in descending order. Face, so that the master's face will not be missed. And the preset condition is set, and only the face that satisfies these preset conditions can become the master face, and the result of obtaining the master face is more accurate.
在一个实施例中,操作602包括:从图像中获取人脸面积最大的人脸,判断人脸的角度和焦点是否符合预设条件。In an embodiment, the operation 602 includes: obtaining a face with the largest face area from the image, and determining whether the angle and the focus of the face meet the preset condition.
本申请实施例中,从多人合影图像中获取核心人物的人脸,且清晰度达到阈值可以识别出人脸对应的身份的主人脸。可选地,从多人合影图像中获取人脸面积最大的人脸,再判断人脸是否符合预设条件。预设条件包括但不限于以下:判断人脸的清晰度是否达到可以识别出人脸对应的身份的阈值,若是再进一步判断人脸面积最大的人脸的拍摄角度和焦点,判断拍摄角度是否是正脸,判断拍摄焦点是否为该人脸面积最大的人脸,判断该人脸面积最大的人脸是否离镜头最近。只有满足这些预设条件的人脸才能成为主人脸,这样获取的主人脸的结果就更加准确。In the embodiment of the present application, the face of the core person is obtained from the multi-person group image, and the resolution reaches a threshold to identify the owner face of the identity corresponding to the face. Optionally, the face with the largest face area is obtained from the multi-person group image, and then the face is determined to meet the preset condition. The preset conditions include, but are not limited to, the following: determining whether the sharpness of the face reaches a threshold value that can identify the identity corresponding to the face, and if it is further determining the shooting angle and focus of the face with the largest face area, determining whether the shooting angle is positive The face determines whether the shooting focus is the face with the largest face area, and determines whether the face with the largest face area is closest to the lens. Only the face that meets these preset conditions can become the master's face, and the result of the acquired master face is more accurate.
在一个实施例中,操作504包括:当识别出图像中包含多个人脸时,检测图像中的剩余人脸是否与已有的用户身份对应,若是,则将剩余人脸分入对应已有的用户身份中,得到剩余人脸对应的用户身份。操作506包括:将图像划分至剩余人脸对应的用户身份对应的图像集合中,将该剩余人脸对应的用户身份对应的图像集合作为图像集合。In an embodiment, the operation 504 includes: when it is recognized that the image includes multiple faces, detecting whether the remaining faces in the image correspond to existing user identities, and if so, dividing the remaining faces into corresponding existing ones. In the user identity, the user identity corresponding to the remaining faces is obtained. The operation 506 includes: dividing the image into an image set corresponding to the user identity corresponding to the remaining face, and using the image set corresponding to the user identity corresponding to the remaining face as the image set.
从图像中获取每张图像的主人脸之后,获取每张图像中的剩余人脸。剩余人脸包括每张图像对除了标记为主人脸和疑似路人人脸之外剩余的人脸。对于单人图像就不存在剩余人脸,但是对于多人合影图像则会存在剩余人脸。对于剩余人脸的处理,只需要根据对剩余人脸进行人脸识别所得的识别结果,将剩余人脸分入已有的用户身份中,不会为剩余人脸专门新增用户身份。已有的用户身份都是每张图像的核心人物的人脸对应的用户身份,所以能够分入已有的用户身份中的剩余人脸自然也是核心人物的人脸,从而实现不会将非核心人物对应的人脸分入这些用户身份中。例如,相册中包含了1000张图像,每张图像只提取出一张人脸作为主人脸。则从这1000张图像中最多产生1000张主人脸,即使这1000张图像中有很多都是多人合影图像,也最多只会产生1000张主人脸。再对这1000张主人脸进行人脸识别,得出该主人脸对应的身份,该身份便是该主人脸对应的用户身份,例如识别之后,这1000张主人脸分别属于10个用户身份。将剩余人脸分入已有的用户身份中,得到剩余人脸所对应的用户身份。当部分剩余人脸不能分入已有的用户身份中,则将这些剩余人脸标记为疑似路人人脸。After obtaining the master face of each image from the image, the remaining faces in each image are acquired. The remaining faces include the remaining faces of each image except for the faces marked as the main face and the suspected passerby face. There is no remaining face for a single-person image, but there are remaining faces for a multi-person group image. For the processing of the remaining faces, it is only necessary to divide the remaining faces into the existing user identity according to the recognition result obtained by performing face recognition on the remaining faces, and the user identity is not newly added for the remaining faces. The existing user identity is the user identity corresponding to the face of the core character of each image, so the remaining faces that can be separated into the existing user identity are naturally also the faces of the core characters, thereby achieving non-core The faces corresponding to the characters are assigned to these user identities. For example, the album contains 1000 images, and each image extracts only one face as the master face. Then, up to 1000 master faces are generated from the 1000 images, and even if many of the 1000 images are multi-person group images, only a maximum of 1000 master faces are generated. Then, the face recognition of the 1000 master faces is performed, and the identity corresponding to the master face is obtained. The identity is the user identity corresponding to the master face. For example, after the recognition, the 1000 master faces belong to 10 user identities respectively. The remaining faces are divided into existing user identities to obtain the user identities corresponding to the remaining faces. When some of the remaining faces cannot be separated into the existing user identity, the remaining faces are marked as suspected passers-by faces.
由上面的操作对图像中的主人脸和剩余人脸进行了分类,对于能够进行分类的都分入了对应的用户身份。然后,根据图像中的主人脸和剩余人脸所能分入的用户身份,将图像分入用户身份对应的图像集合。具体地,如果一张图像的主人脸和剩余人脸分别分入了3个类别,则该图像将会同时出现在这3个类别中。例如,一张图像包括了3张人脸,分别是张三、李四和王五。其中,这张图像的主人脸是张三,剩余2张人脸在已有的主人脸中找到了相似的主人脸,于是将这2张剩余人脸分入了李四和王五的用户身份中。那么最终将会在张三图像集合中显示这张图像,也会在李四图像集合中显示这张图像,当然还会在王五图像集合中显示这张图像。因为这3个身份对应的人物都是已有主人脸的核心人物。The master face and the remaining faces in the image are classified by the above operations, and the corresponding user identity is assigned to those that can be classified. Then, according to the identity of the user that the master face and the remaining faces in the image can be separated, the image is divided into image sets corresponding to the user identity. Specifically, if the owner's face and the remaining faces of an image are respectively classified into three categories, the image will appear in the three categories at the same time. For example, an image consists of three faces, namely Zhang San, Li Si, and Wang Wu. Among them, the owner's face of this image is Zhang San, and the remaining two faces find a similar master face in the existing master's face, so the two remaining faces are divided into the user's identity of Li Si and Wang Wu. in. Then the image will eventually be displayed in the Zhang San image collection, and will also be displayed in the Li Si image collection, and of course the image will be displayed in the Wang Wu image collection. Because the characters corresponding to these three identities are the core figures of the owner's face.
本申请实施例中,首先,获取图像的主人脸,再对主人脸进行人脸识别,得到主人脸所对应的用户身份。因为主人脸为每张图像中核心人物的人脸,非核心人物的人脸不会作为主人脸,所以用户身份就只包括图像中核心人物的人脸的分类。再从图像中获取剩余人脸,对图像中的剩余人脸进行人脸识别,将剩余人脸分入已有的用户身份中,得到剩余人脸所对应的用户身份。按照图像中的主人脸和剩余人脸所能分入的用户身份,将图像分入用户身份对应的图像集合。图像集合之间是通过图像中的主人脸和剩余人脸所能分入的用户身份来区分的,因为用户身份只包括图像中核心人物的人脸的分类,所以自然也不会出现大量非核心人物的图像集合。In the embodiment of the present application, first, the owner's face of the image is acquired, and then the face of the master is recognized by the face, and the user identity corresponding to the owner's face is obtained. Since the master's face is the face of the core character in each image, the face of the non-core character does not act as the master face, so the user identity only includes the classification of the face of the core character in the image. Then, the remaining faces are obtained from the image, the face of the remaining faces in the image is recognized, and the remaining faces are divided into the existing user identity to obtain the user identity corresponding to the remaining faces. According to the identity of the user that can be separated by the owner's face and the remaining faces in the image, the image is divided into image collections corresponding to the user's identity. The image collection is distinguished by the user identity that can be separated by the master face and the remaining faces in the image. Because the user identity only includes the classification of the face of the core character in the image, naturally there will not be a large number of non-cores. A collection of images of people.
在一个实施例中,如图7所示,当识别出图像中包含多个人脸时,检测图像中的剩余 人脸是否与已有的用户身份对应,若是,则将剩余人脸分入对应已有的用户身份中,得到剩余人脸对应的用户身份,包括:In an embodiment, as shown in FIG. 7, when it is recognized that the image includes multiple faces, whether the remaining faces in the image are detected to correspond to the existing user identity, and if so, the remaining faces are classified into corresponding In some user identities, the user identity corresponding to the remaining faces is obtained, including:
操作702,获取图像中的剩余人脸,依次对剩余人脸进行人脸识别。In operation 702, the remaining faces in the image are acquired, and the remaining faces are sequentially recognized by the face.
从多人合影图像中获取每张图像的主人脸之后,获取每张图像中的剩余人脸。剩余人脸包括每张图像对除了标记为主人脸和疑似路人人脸之外剩余的人脸。对于剩余人脸,依次对每张图像中的剩余人脸进行人脸识别,得出剩余人脸对应的身份。将剩余人脸分入已有的用户身份中,得到剩余人脸所对应的用户身份。当部分剩余人脸不能分入已有的用户身份中,则将这些剩余人脸标记为疑似路人人脸。After obtaining the master face of each image from the multi-person group image, the remaining faces in each image are acquired. The remaining faces include the remaining faces of each image except for the faces marked as the main face and the suspected passerby face. For the remaining faces, face recognition is performed on the remaining faces in each image in turn, and the identity corresponding to the remaining faces is obtained. The remaining faces are divided into existing user identities to obtain the user identities corresponding to the remaining faces. When some of the remaining faces cannot be separated into the existing user identity, the remaining faces are marked as suspected passers-by faces.
操作704,判断剩余人脸是否属于已有的用户身份,若是,则执行操作706,否则,执行操作708。 Operation 704, determining whether the remaining faces belong to the existing user identity, and if so, performing operation 706, otherwise, performing operation 708.
操作706,将剩余人脸分入用户身份中,得到剩余人脸所对应的用户身份。In operation 706, the remaining faces are divided into user identities, and the user identity corresponding to the remaining faces is obtained.
操作708,将剩余人脸标记为疑似路人人脸。 Operation 708, marking the remaining faces as suspected passers-by faces.
可选地,判断剩余人脸中是否存在属于已有的用户身份。根据识别出的剩余人脸对应的身份,判断剩余人脸对应的身份是否与已有的主人脸身份相同,当相同则将剩余人脸分入对应的用户身份,该用户身份即为剩余人脸所对应的用户身份。Optionally, it is determined whether there is an existing user identity in the remaining faces. According to the identified identity of the remaining faces, it is determined whether the identity corresponding to the remaining faces is the same as the existing owner's face identity. When the same, the remaining faces are assigned to the corresponding user identity, and the user identity is the remaining face. The corresponding user identity.
当剩余人脸对应的身份在已有的主人脸中没有相同的身份,则说明剩余人脸不属于已有的用户身份,那么就将剩余人脸标记为疑似路人人脸。且将相同身份的疑似路人人脸标记为一类。When the identity corresponding to the remaining faces does not have the same identity in the existing master face, it indicates that the remaining faces do not belong to the existing user identity, and then the remaining faces are marked as suspected passers-by faces. And the suspected passerby faces of the same identity are marked as one type.
本申请实施例中,对于剩余人脸的分类处理,需要根据对剩余人脸进行人脸识别所得的身份结果,将剩余人脸分入已有的用户身份中,不会为剩余人脸专门新增用户身份,所以自然不会将非核心人物对应的人脸分为一个用户身份。如此,则图像分类后只会显示核心人物的图像集合。避免了传统方法中出现大量非核心人物的图像集合,不贴合用户实际需求,降低了信息的有效性。In the embodiment of the present application, for the classification process of the remaining faces, the remaining faces are classified into the existing user identity according to the identity result obtained by performing face recognition on the remaining faces, and the remaining faces are not newly added. Increase the user's identity, so naturally the face corresponding to the non-core person will not be divided into a user identity. In this way, only the image collection of the core person will be displayed after the image is classified. It avoids the image collection of a large number of non-core characters in the traditional method, does not meet the actual needs of users, and reduces the effectiveness of information.
在一个实施例中,如图8所示,上述方法还包括对疑似路人人脸的处理的操作,该操作可在将剩余人脸标记为疑似路人人脸之后执行,包括:In one embodiment, as shown in FIG. 8, the above method further includes an operation of processing the suspected passerby face, the operation being performed after marking the remaining face as a suspected passerby face, including:
操作802,计算相册中疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数。 Operation 802 calculates the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image in the album.
当剩余人脸对应的身份在已有的主人脸中没有相同的身份,则说明剩余人脸不属于已有的用户身份,那么就将剩余人脸标记为疑似路人人脸。在将剩余人脸标记为疑似路人人脸之后,在相册中的所有图像中分别计算每一类疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数,即计算相同身份的疑似路人人脸与不同身份的主人脸一起合影的次数。例如,计算身份为A的疑似路人人脸与不同身份的主人脸一起合影的次数,具体为,假设主人脸有张三、李四和王五等10个主人脸。那么计算身份为A的疑似路人人脸与这10个主人脸中的任何之一合影的次数。相册中有一张图像是A与张三、李四和王五四人的合影,那么身份为A的疑似路人人脸与不同身份的主人脸一起合影的次数就为3次。当相册中还有一张图像是A与张三俩人的合影,一张图像是A与王五俩人的合影。那么此时身份为A的疑似路人人脸与不同身份的主人脸一起合影的次数就为5次。When the identity corresponding to the remaining faces does not have the same identity in the existing master face, it indicates that the remaining faces do not belong to the existing user identity, and then the remaining faces are marked as suspected passers-by faces. After marking the remaining faces as suspected passers-by faces, the number of times each suspected passerby face and the owner face belonging to a different user identity appear on the same image are calculated in all the images in the album, that is, the same identity is calculated. The number of times the suspected passerby face was photographed with the owner's face of different identities. For example, the number of times the suspected passerby face of the identity A is photographed with the owner's face of different identities is calculated. Specifically, it is assumed that the owner's face has 10 master faces such as Zhang San, Li Si, and Wang Wu. Then count the number of times the suspected passerby face with the identity A is taken with any of the 10 master faces. There is an image in the album that is a group photo of A and Zhang San, Li Si and Wang Wu. Then the number of suspected passers-by faces with A is taken together with the owner's face of different identities three times. When there is another image in the album, it is a photo of A and Zhang San. One image is a photo of A and Wang Wu. Then, the number of suspected passers-by faces with the identity A and the owner's face of different identities at this time is 5 times.
操作804,判断次数是否达到设定阈值,若是,则执行操作806,否则,执行操作808。 Operation 804, determining whether the number of times has reached a set threshold, and if so, performing operation 806, otherwise, performing operation 808.
设定阈值,可以是设置了相册中疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数最低为5次,当然,在其他实施例中,也可以设置为其他合理的次数,例如6次、7次、8次、9次、10次等。The threshold value may be set to a minimum of 5 times when the suspected passerby face and the owner's face belonging to different user identities appear on the same image in the album. Of course, in other embodiments, other reasonable ones may be set. The number of times, for example, 6 times, 7 times, 8 times, 9 times, 10 times, and the like.
操作806,将疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份。At operation 806, the suspected passerby face is added as the main face, and the user identity corresponding to the suspected passerby face is obtained.
操作808,保持为疑似路人人脸。 Operation 808, keeping the suspected passerby face.
判断疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数是否达到了设定阈值(例如5次),当达到了5次则将疑似路人人脸新增为主人脸,得到疑似路 人人脸所对应的用户身份。在本实施例中,身份为A的疑似路人人脸与不同身份的主人脸一起合影的次数就为5次,就会将身份为A的疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份。当未达到了5次则保持为疑似路人人脸。等待下次相册中新增图像时候,再对疑似路人人脸重新计算与属于不同用户身份的主人脸出现在同一张图像上的次数。Judging whether the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image has reached a set threshold (for example, 5 times), and when it reaches 5 times, the suspected passerby face is added as the main face. Get the identity of the user corresponding to the suspected passerby face. In this embodiment, the number of suspected passers-by faces with the identity A and the owner's face of different identities are taken 5 times, and the suspected passerby face with the identity A is added as the main face, and the suspected passerby is obtained. The user identity corresponding to the face. When it has not reached 5 times, it will remain as a suspected passerby face. Waiting for the new image in the next album to recalculate the number of times the suspected passerby face appears on the same image as the owner's face belonging to a different user identity.
本申请实施例中,对相册中的每一类疑似路人人脸,计算每一类疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数。当次数达到了设定阈值,则将疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份。对相册中的疑似路人人脸也进行了处理,使之满足条件既可以新增为主人脸,这样就有效避免了对每张图像只提取出一张人脸作为主人脸,而造成遗漏核心人物。In the embodiment of the present application, for each type of suspected passerby face in the album, the number of times each suspected passerby face and the owner face belonging to a different user identity appear on the same image are calculated. When the number of times reaches the set threshold, the suspected passerby face is added as the main face, and the user identity corresponding to the suspected passerby face is obtained. The suspected passerby face in the album has also been processed so that it can be added to the main face, which effectively avoids extracting only one face as the master face for each image, resulting in missing core characters. .
在一个实施例中,如图9所示,上述方法还包括对新增图像的图像集合划分的操作,该操作可在按照图像中的主人脸和剩余人脸所能分入的用户身份,将图像分入用户身份对应的图像集合之后执行,包括:In one embodiment, as shown in FIG. 9, the above method further includes an operation of dividing the image set of the newly added image, and the operation may be performed according to the identity of the user that can be separated according to the owner's face and the remaining faces in the image. The image is executed after being divided into the image collection corresponding to the user identity, including:
操作902,获取新增图像。 Operation 902, obtaining a new image.
相册中的图像并不是一成不变的,而是动态变化的,例如,可以随着用户不断的拍摄照片而新增,也可以由于用户从云端下载照片至相册中。或者相册本来就是在云端,云端相册中的图像有所新增。获取这些新增的图像。The images in the album are not static, but are dynamically changed. For example, they can be added as the user takes photos continuously, or they can download photos from the cloud to the album. Or the album is originally in the cloud, the image in the cloud album has been added. Get these new images.
操作904,对新增图像根据新增图像之前的图像处理方法进行分类,按照新增图像中的主人脸和剩余人脸所能分入的用户身份,将新增图像分入用户身份对应的图像集合。In operation 904, the newly added image is classified according to the image processing method before the newly added image, and the newly added image is divided into the image corresponding to the user identity according to the user identity that the owner face and the remaining face in the newly added image can be separated. set.
对新增图像根据新增图像之前的图像处理方法进行分类,具体地,首先从新增图像获取主人脸,当新增图像为单人图像,则获取图像中唯一的一张人脸,判断这张人脸的清晰度是否已经达到了可以识别出人脸的阈值。当该单人人脸的清晰度已经达到了可以识别出人脸的阈值,则将该单人照片中的人脸标记为主人脸,对该主人脸进行人脸识别之后,得出该主人脸所对应的用户身份。The new image is classified according to the image processing method before the newly added image. Specifically, the owner's face is first acquired from the newly added image. When the newly added image is a single-person image, the only one face in the image is acquired, and this is determined. Whether the definition of the face has reached the threshold that can recognize the face. When the definition of the face of the single person has reached a threshold value for recognizing the face, the face in the single-person photo is marked as the main face, and after the face recognition is performed on the master face, the master face is obtained. The corresponding user identity.
当该单人人脸的清晰度未达到可以识别出人脸对应的身份的清晰度阈值,则继续检查相册中的其他图像中是否已经有相似且已经标记为主人脸的人脸存在,当存在,则将该单人人脸与该主人脸标记为一类主人脸。反之不存在,但是在相册中的其他图像中存在与该该单人人脸相似的人脸出现了预设次数,则从这些相似人脸中选一张最清晰的作为主人脸,将这些相似人脸标记为一类主人脸,并对该主人脸进行人脸识别,得出该主人脸对应的身份,该身份便是该单身人脸对应的用户身份。When the clarity of the single face does not reach the sharpness threshold of the identity corresponding to the face, then continue to check whether other faces in the album have similar faces that have been marked as the face of the face, when present , the single person face and the owner's face are marked as a master face. Conversely, if there is a preset number of faces similar to the single face in other images in the album, then the most clear one is selected as the master face from the similar faces, and the similar persons are The face is marked as a type of master face, and the face of the master face is recognized, and the identity corresponding to the master face is obtained, and the identity is the user identity corresponding to the single face.
当该单人人脸的清晰度未达到可以识别出人脸对应的身份的清晰度阈值,且相册中的其他图像中也不存在已经有相似且已经标记为主人脸的人脸存在,且相册中的其他图像中出现与该单人人脸相似的人脸的次数也未达到预设次数。则说明该模糊的单人人脸并不是核心人物的人脸,将这些满足上述3个条件的模糊单人人脸标记为疑似路人人脸。When the clarity of the single person's face does not reach the sharpness threshold of the identity corresponding to the face, and there are no other faces in the album that are already similar and have been marked as the face of the face, and the album The number of faces in the other images in which the face is similar to the single face has not reached the preset number of times. It is indicated that the blurred single person face is not the face of the core person, and the fuzzy single face that satisfies the above three conditions is marked as a suspected passerby face.
当新增图像为多人合影图像,则从多人合影图像中按照人脸面积从大到小的顺序获取主人脸,重复执行直到人脸达到最小阈值或获取到主人脸为止。获取新增图像中的剩余人脸,对剩余人脸进行人脸识别,将剩余人脸分入已有的用户身份中,得到剩余人脸所对应的用户身份。当部分剩余人脸不能分入已有的用户身份中,则将这些剩余人脸标记为疑似路人人脸。When the newly added image is a multi-person group image, the master face is acquired from the multi-person group image in descending order of the face area, and is repeatedly executed until the face reaches the minimum threshold or the owner's face is acquired. Obtain the remaining faces in the newly added image, perform face recognition on the remaining faces, and divide the remaining faces into the existing user identity to obtain the user identity corresponding to the remaining faces. When some of the remaining faces cannot be separated into the existing user identity, the remaining faces are marked as suspected passers-by faces.
按照图像中的主人脸和剩余人脸所能分入的用户身份,将图像分入用户身份对应的图像集合。According to the identity of the user that can be separated by the owner's face and the remaining faces in the image, the image is divided into image collections corresponding to the user's identity.
操作906,重新计算疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数。 Operation 906, recalculating the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image.
因为新增了图像,所以需要重新计算疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数。Since the image is newly added, it is necessary to recalculate the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image.
操作908,判断次数是否达到设定阈值,若是,则执行操作910,否则,执行操作912。 Operation 908, determining whether the number of times has reached a set threshold, and if so, performing operation 910; otherwise, performing operation 912.
操作910,将疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份,将包含疑似路人人脸的图像分入用户身份对应的图像集合。In operation 910, the suspected passerby face is added as the main face, and the user identity corresponding to the suspected passerby face is obtained, and the image containing the suspected passerby face is divided into the image set corresponding to the user identity.
操作912,保持为疑似路人人脸。 Operation 912 remains as a suspected passerby face.
判断疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数否达到设定阈值,当达到了设定阈值则将疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份,将包含疑似路人人脸的图像分入用户身份对应的图像集合。当未达到了设定阈值则保持为疑似路人人脸,等待下次相册中新增图像时候,再对疑似路人人脸重新计算与属于不同用户身份的主人脸出现在同一张图像上的次数。Judging whether the number of suspected passers-by faces and the owner's face belonging to different user identities appear on the same image reaches the set threshold. When the set threshold is reached, the suspected passerby face is added as the main face, and the suspected passerby face is obtained. The corresponding user identity is used to divide the image containing the suspected passerby face into the image set corresponding to the user identity. When the set threshold is not reached, it remains as a suspected passerby face. When the new image is added in the next album, the suspected passerby face is recalculated to the number of times the owner's face belonging to a different user identity appears on the same image.
本申请实施例中,当新增图像时候,对新增图像根据新增图像之前的图像处理方法进行分类,按照新增图像中的主人脸和剩余人脸所能分入的用户身份,将新增图像分入用户身份对应的图像集合。再重新计算疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数。因为新增了图像,则疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数可能也已经更新,即疑似路人人脸也可能变为了主人脸。因此,通过重新计算就可以实现实时将疑似路人人脸更新为主人脸。In the embodiment of the present application, when the image is added, the new image is classified according to the image processing method before the new image is added, and the user identity that can be separated by the owner face and the remaining face in the newly added image is used. The added image is divided into a collection of images corresponding to the user's identity. Then recalculate the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image. Because of the addition of images, the number of suspected passers-by faces and the owner's face belonging to different user identities may have been updated on the same image, that is, the suspected passerby face may also become the master's face. Therefore, it is possible to update the suspected passerby face to the main face in real time by recalculating.
在一个实施例中,还提供了一种图像处理方法,以该方法应用于图1中的电子设备为例进行说明,包括:In an embodiment, an image processing method is also provided, which is applied to the electronic device in FIG. 1 as an example, and includes:
(1)电子设备从本地或云端的相册获取图像的人脸。(1) The electronic device obtains the face of the image from a local or cloud album.
(2)从图像中获取主人脸。包括从单人图像中和多人合影图像中获取主人脸。在多人合影图像中按照人脸面积从大到小的顺序获取主人脸。从多人合影图像中获取人脸面积最大的人脸,判断人脸是否符合预设条件。当是,则将人脸面积最大的人脸作为多人合影图像的主人脸;当否,则继续从多人合影图像中获取人脸面积大小次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸面积达到最小阈值或获取到主人脸为止。(2) Get the owner's face from the image. This includes obtaining the master's face from a single-person image and a multi-person group photo. In the multi-person group image, the master face is obtained in order of the face area from large to small. The face with the largest face area is obtained from the multi-person group image, and it is determined whether the face meets the preset condition. When yes, the face with the largest face area is used as the master face of the multi-person group image; if not, the face with the second largest face size is continuously obtained from the multi-person group image, and it is determined whether the face meets the preset condition. Repeat until the face area reaches the minimum threshold or gets the owner's face.
(3)对图像的主人脸进行人脸识别,得到主人脸所对应的用户身份。(3) Perform face recognition on the owner's face of the image to obtain the user identity corresponding to the owner's face.
(4)获取多人合影图像中的剩余人脸,依次对剩余人脸进行人脸识别。判断剩余人脸是否属于已有的用户身份,若是,则将剩余人脸分入用户身份中,得到剩余人脸所对应的用户身份,若否,则将剩余人脸标记为疑似路人人脸。(4) Acquiring the remaining faces in the multi-person group image, and performing face recognition on the remaining faces in turn. Determine whether the remaining faces belong to the existing user identity. If yes, divide the remaining faces into the user identity to obtain the user identity corresponding to the remaining faces. If not, mark the remaining faces as suspected passers-by faces.
(5)计算相册中疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数。判断次数是否达到设定阈值;若是,则将疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份;若否,则保持为疑似路人人脸。(5) Calculate the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image in the album. Whether the number of judgments reaches the set threshold; if so, the suspected passerby face is added as the main face, and the user identity corresponding to the suspected passerby face is obtained; if not, the suspected passerby face is maintained.
(6)按照图像中的主人脸和剩余人脸所能分入的用户身份,将图像分入用户身份对应的图像集合。(6) According to the identity of the user that can be separated by the master face and the remaining faces in the image, the image is divided into image sets corresponding to the user identity.
(7)获取新增图像的人脸。(7) Obtain the face of the newly added image.
(8)对新增图像根据新增图像之前的图像处理方法进行分类,按照新增图像中的主人脸和剩余人脸所能分入的用户身份,将新增图像分入用户身份对应的图像集合。重新计算疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数;判断次数是否达到设定阈值;若是,则将疑似路人人脸新增为主人脸,得到疑似路人人脸所对应的用户身份,将包含疑似路人人脸的图像分入用户身份对应的图像集合,若否,则保持为疑似路人人脸。(8) classify the newly added image according to the image processing method before the newly added image, and divide the newly added image into the image corresponding to the user identity according to the identity of the user that can be separated by the owner face and the remaining faces in the newly added image. set. Recalculating the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image; whether the number of judgments reaches the set threshold; if so, adding the suspected passerby face to the main face, and obtaining the suspected passerby face The corresponding user identity divides the image containing the suspected passerby face into the image set corresponding to the user identity, and if not, remains as the suspected passerby face.
(9)获取图像中具有相同人脸的图像集合;识别图像集合中的图像的人脸对应的年龄值。(9) Acquiring an image set having the same face in the image; and identifying an age value corresponding to the face of the image in the image set.
(10)根据年龄值生成对图像集合中的图像的排序信息;根据排序信息和图像集合,生成包括图像集合中图像的具有时序的相册。(10) generating sorting information for the image in the image set based on the age value; generating a time-series album including the image in the image set based on the sorting information and the image set.
(11)将具有时序的相册按照时序进行播放。(11) Play the album with time series in time series.
上述图像处理方法,通过将图像按照其中的人脸所属的用户身份进行分类,将每张图 像划分至和其中的人脸的用户身份对应的图像集合中。再获取具有相同人脸的图像集合;识别图像集合中的图像的人脸对应的年龄值;根据年龄值生成对图像集合中的图像的排序信息;根据排序信息和图像集合,生成包括图像集合中图像的具有时序的相册,将具有时序的相册按照时序进行播放,方便帮助用户记录不同年龄的图像故事,增加了用户的粘度。The above image processing method divides each image into an image set corresponding to the user's identity of the face in which the image is classified according to the user identity to which the face belongs. And acquiring an image set having the same face; identifying an age value corresponding to the face of the image in the image set; generating sorting information for the image in the image set according to the age value; generating the included image set according to the sorting information and the image set The image has a sequence of albums, and the time-stamped albums are played in time series, which is convenient for helping users to record image stories of different ages and increasing the viscosity of the user.
在一个实施例中,如图10所示,提供了一种图像处理装置,该装置包括:In one embodiment, as shown in FIG. 10, an image processing apparatus is provided, the apparatus comprising:
图像集合获取模块1002,用于获取图像中的人脸;获取图像中具有相同人脸的图像集合。The image set obtaining module 1002 is configured to acquire a face in the image; and acquire an image set having the same face in the image.
年龄值识别模块1004,用于识别图像集合中的图像的人脸对应的年龄值。The age value identification module 1004 is configured to identify an age value corresponding to a face of the image in the image collection.
排序信息生成模块1006,用于根据年龄值生成对图像集合中的图像的排序信息。The sorting information generating module 1006 is configured to generate sorting information for the images in the image set according to the age value.
相册生成模块1008,用于根据排序信息和图像集合,生成包括图像集合中图像的具有时序的相册。The album generating module 1008 is configured to generate a time-series album including images in the image collection according to the sorting information and the image set.
在一个实施例中,图像集合获取模块1002还用于对图像中的人脸进行人脸识别,确定图像中的人脸对应的用户身份,将图像划分至与用户身份对应的图像集合中,形成具有相同人脸的图像集合。In an embodiment, the image set obtaining module 1002 is further configured to perform face recognition on a face in the image, determine a user identity corresponding to the face in the image, and divide the image into an image set corresponding to the user identity to form an image set. A collection of images with the same face.
在一个实施例中,图像集合获取模块1002还用于当图像中包含多个人脸时,确定多个人脸中的主人脸。In an embodiment, the image set obtaining module 1002 is further configured to determine a master face of the plurality of faces when the image includes multiple faces.
在一个实施例中,图像集合获取模块1002还用于根据图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸。In one embodiment, the image set acquisition module 1002 is further configured to determine a master face based on a face area and/or a face definition occupied by each face in the image.
在一个实施例中,图像集合获取模块1002还用于从图像中获取人脸面积最大的人脸,判断人脸是否符合预设条件;若是,则将人脸面积最大的人脸作为图像的主人脸;若否,则继续从图像中获取人脸面积大小次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸面积达到最小面积阈值或获取到主人脸为止。In an embodiment, the image set obtaining module 1002 is further configured to obtain a face with the largest face area from the image, and determine whether the face meets the preset condition; if yes, the face with the largest face area is used as the image owner. Face; if not, continue to obtain the face whose face area is the second largest from the image, determine whether the face meets the preset condition, and repeat until the face area reaches the minimum area threshold or obtains the owner's face.
在一个实施例中,图像集合获取模块1002还用于从图像中获取人脸清晰度最高的人脸,判断人脸是否符合预设条件;若是,则将人脸清晰度最高的人脸作为图像的主人脸;若否,则继续从图像中获取人脸清晰度次之的人脸,判断人脸是否符合预设条件,重复执行直到人脸清晰度达到最小清晰度阈值或获取到主人脸为止。In an embodiment, the image set obtaining module 1002 is further configured to obtain a face with the highest face resolution from the image, and determine whether the face meets the preset condition; if yes, the face with the highest face resolution is used as the image. The master's face; if not, continue to obtain the face whose face is the second most clear from the image, determine whether the face meets the preset condition, and repeat until the face resolution reaches the minimum sharpness threshold or obtains the master's face. .
在一个实施例中,排序信息生成模块1006还用于当同一图像集合中的多个图像中,人脸的年龄值相同时,根据多个图像的生成时间生成对多个图像的排序信息。In one embodiment, the ranking information generating module 1006 is further configured to generate, when the age values of the faces are the same among the plurality of images in the same image set, the ranking information for the plurality of images according to the generation time of the plurality of images.
在一个实施例中,如图11所示,提供了又一种图像处理装置,该装置还包括:In one embodiment, as shown in FIG. 11, yet another image processing apparatus is provided, the apparatus further comprising:
播放模块1010,用于将具有时序的相册按照时序进行播放,时序包括按照年龄值进行顺序排序和/或逆序排序,具有时序的相册包括幻灯片、短片或影集中的任意一种形式的文件。The playing module 1010 is configured to play the album with time series in time series, the sequence includes sorting by the age value and/or sorting in reverse order, and the album with the time series includes any one of a slide, a movie or an album.
在一个实施例中,图像集合获取模块1002还用于从本机和/或其它设备中的多用户家庭共享相册中获取图像。In one embodiment, the image collection acquisition module 1002 is further for acquiring images from a multi-user family shared album in the local machine and/or other devices.
上述图像处理装置中各个模块的划分仅用于举例说明,在其他实施例中,可将图像处理装置按照需要划分为不同的模块,以完成上述图像处理装置的全部或部分功能。The division of each module in the above image processing apparatus is for illustrative purposes only. In other embodiments, the image processing apparatus may be divided into different modules as needed to complete all or part of the functions of the image processing apparatus.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述各实施例所提供的图像处理方法的操作。In one embodiment, a computer readable storage medium is provided having stored thereon a computer program that, when executed by a processor, implements the operations of the image processing methods provided by the various embodiments described above.
一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述各实施例所提供的图像处理方法的操作。An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor performing the operations of the image processing methods provided by the various embodiments described above when executing the computer program.
本申请实施例还提供了一种计算机程序产品。一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各实施例所提供的图像处理方法的操作。The embodiment of the present application also provides a computer program product. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the operations of the image processing methods provided by the various embodiments described above.
本申请实施例还提供一种电子设备。上述电子设备中包括图像处理电路,图像处理电路可以利用硬件和/或软件组件实现,可包括定义ISP(Image Signal Processing,图像信号处理)管线的各种处理单元。图12为一个实施例中图像处理电路的示意图。如图12所示, 为便于说明,仅示出与本申请实施例相关的图像处理技术的各个方面。An embodiment of the present application further provides an electronic device. The above electronic device includes an image processing circuit, and the image processing circuit can be implemented by using hardware and/or software components, and can include various processing units defining an ISP (Image Signal Processing) pipeline. Figure 12 is a schematic illustration of an image processing circuit in one embodiment. As shown in FIG. 12, for convenience of explanation, only various aspects of the image processing technique related to the embodiment of the present application are shown.
如图12所示,图像处理电路包括ISP处理器1240和控制逻辑器1250。成像设备1210捕捉的图像数据首先由ISP处理器1240处理,ISP处理器1240对图像数据进行分析以捕捉可用于确定和/或成像设备1210的一个或多个控制参数的图像统计信息。成像设备1210可包括具有一个或多个透镜1212和图像传感器1214的照相机。图像传感器1214可包括色彩滤镜阵列(如Bayer滤镜),图像传感器1214可获取用图像传感器1214的每个成像像素捕捉的光强度和波长信息,并提供可由ISP处理器1240处理的一组原始图像数据。传感器1220(如陀螺仪)可基于传感器1220接口类型把采集的图像处理的参数(如防抖参数)提供给ISP处理器1240。传感器1220接口可以利用SMIA(Standard Mobile Imaging Architecture,标准移动成像架构)接口、其它串行或并行照相机接口或上述接口的组合。As shown in FIG. 12, the image processing circuit includes an ISP processor 1240 and a control logic 1250. The image data captured by imaging device 1210 is first processed by ISP processor 1240, which analyzes the image data to capture image statistics that can be used to determine and/or control one or more control parameters of imaging device 1210. Imaging device 1210 can include a camera having one or more lenses 1212 and image sensors 1214. Image sensor 1214 may include a color filter array (such as a Bayer filter) that may acquire light intensity and wavelength information captured with each imaging pixel of image sensor 1214 and provide a set of primitives that may be processed by ISP processor 1240 Image data. A sensor 1220, such as a gyroscope, can provide acquired image processing parameters, such as anti-shake parameters, to the ISP processor 1240 based on the sensor 1220 interface type. The sensor 1220 interface may utilize a SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above.
此外,图像传感器1214也可将原始图像数据发送给传感器1220,传感器1220可基于传感器1220接口类型把原始图像数据提供给ISP处理器1240,或者传感器1220将原始图像数据存储到图像存储器1230中。In addition, image sensor 1214 can also transmit raw image data to sensor 1220, sensor 1220 can provide raw image data to ISP processor 1240 based on sensor 1220 interface type, or sensor 1220 can store raw image data into image memory 1230.
ISP处理器1240按多种格式逐个像素地处理原始图像数据。例如,每个图像像素可具有12、10、12或14比特的位深度,ISP处理器1240可对原始图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。The ISP processor 1240 processes the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 12, 10, 12, or 14 bits, and the ISP processor 1240 may perform one or more image processing operations on the raw image data, collecting statistical information about the image data. Among them, image processing operations can be performed with the same or different bit depth precision.
ISP处理器1240还可从图像存储器1230接收图像数据。例如,传感器1220接口将原始图像数据发送给图像存储器1230,图像存储器1230中的原始图像数据再提供给ISP处理器1240以供处理。图像存储器1230可为存储器装置的一部分、存储设备、或电子设备内的独立的专用存储器,并可包括DMA(Direct Memory Access,直接直接存储器存取)特征。 ISP processor 1240 can also receive image data from image memory 1230. For example, sensor 1220 interface transmits raw image data to image memory 1230, which is then provided to ISP processor 1240 for processing. Image memory 1230 can be part of a memory device, a storage device, or a separate dedicated memory within an electronic device, and can include DMA (Direct Memory Access) features.
当接收到来自图像传感器1214接口或来自传感器1220接口或来自图像存储器1230的原始图像数据时,ISP处理器1240可进行一个或多个图像处理操作,如时域滤波。处理后的图像数据可发送给图像存储器1230,以便在被显示之前进行另外的处理。ISP处理器1240还可从图像存储器1230接收处理数据,对处理数据进行原始域中以及RGB和YCbCr颜色空间中的图像数据处理。处理后的图像数据可输出给显示器1280,以供用户观看和/或由图形引擎或GPU(Graphics Processing Unit,图形处理器)进一步处理。此外,ISP处理器1240的输出还可发送给图像存储器1230,且显示器1280可从图像存储器1230读取图像数据。在一个实施例中,图像存储器1230可被配置为实现一个或多个帧缓冲器。此外,ISP处理器1240的输出可发送给编码器/解码器1270,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器1280设备上之前解压缩。When receiving raw image data from the image sensor 1214 interface or from the sensor 1220 interface or from the image memory 1230, the ISP processor 1240 can perform one or more image processing operations, such as time domain filtering. The processed image data can be sent to image memory 1230 for additional processing prior to being displayed. The ISP processor 1240 can also receive processing data from the image memory 1230, processing the processed data in image data in the original domain and in the RGB and YCbCr color spaces. The processed image data can be output to display 1280 for viewing by a user and/or further processed by a graphics engine or GPU (Graphics Processing Unit). Additionally, the output of ISP processor 1240 can also be sent to image memory 1230, and display 1280 can read image data from image memory 1230. In one embodiment, image memory 1230 can be configured to implement one or more frame buffers. Additionally, the output of ISP processor 1240 can be sent to encoder/decoder 1270 to encode/decode image data. The encoded image data can be saved and decompressed before being displayed on the display 1280 device.
ISP处理器1240处理图像数据的操作包括:对图像数据进行VFE(Video Front End,视频前端)处理和CPP(Camera Post Processing,摄像头后处理)处理。对图像数据的VFE处理可包括修正图像数据的对比度或亮度、修改以数字方式记录的光照状态数据、对图像数据进行补偿处理(如白平衡,自动增益控制,γ校正等)、对图像数据进行滤波处理等。对图像数据的CPP处理可包括对图像进行缩放、向每个路径提供预览帧和记录帧。其中,CPP可使用不同的编解码器来处理预览帧和记录帧。ISP处理器1240处理后的图像数据可发送给美颜模块1260,以便在被显示之前对图像进行美颜处理。美颜模块1260对图像数据美颜处理可包括:美白、祛斑、磨皮、瘦脸、祛痘、增大眼睛等。其中,美颜模块1260可为移动终端中CPU(Central Processing Unit,中央处理器)、GPU或协处理器等。美颜模块1260处理后的数据可发送给编码器/解码器1270,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器1280设备上之前解压缩。其中,美颜模块1260还可位于编码器/解码器1270与显示器1280之间,即美颜模块对已成像的图像进行美颜处理。上述编码器/解码器1270可为移动终端中CPU、GPU或协处理器等。The ISP processor 1240 processes the image data by performing VFE (Video Front End) processing and CPP (Camera Post Processing) processing on the image data. The VFE processing of the image data may include correcting the contrast or brightness of the image data, modifying the digitally recorded illumination state data, performing compensation processing on the image data (such as white balance, automatic gain control, gamma correction, etc.), and performing image data. Filter processing, etc. CPP processing of image data may include scaling the image, providing a preview frame and a recording frame to each path. Among them, CPP can use different codecs to process preview frames and record frames. The image data processed by the ISP processor 1240 can be sent to the beauty module 1260 to perform a cosmetic process on the image before being displayed. The beauty module 1260 can process the beauty of the image data, including: whitening, freckle, dermabrasion, face-lifting, acne, eye enlargement, and the like. The beauty module 1260 can be a CPU (Central Processing Unit), a GPU, a coprocessor, or the like in the mobile terminal. The processed data of the beauty module 1260 can be sent to the encoder/decoder 1270 to encode/decode the image data. The encoded image data can be saved and decompressed before being displayed on the display 1280 device. The beauty module 1260 can also be located between the encoder/decoder 1270 and the display 1280, that is, the beauty module performs cosmetic processing on the imaged image. The encoder/decoder 1270 described above may be a CPU, a GPU, a coprocessor, or the like in a mobile terminal.
ISP处理器1240确定的统计数据可发送给控制逻辑器1250单元。例如,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、透镜1212阴影校正等图像传感器1214统计信息。控制逻辑器1250可包括执行一个或多个例程(如固件)的处理器和/或微控制器,一个或多个例程可根据接收的统计数据,确定成像设备1210的控制参数以及ISP处理器1240的控制参数。例如,成像设备1210的控制参数可包括传感器1220控制参数(例如增益、曝光控制的积分时间)、照相机闪光控制参数、透镜1212控制参数(例如聚焦或变焦用焦距)、或这些参数的组合。ISP控制参数可包括用于自动白平衡和颜色调整(例如,在RGB处理期间)的增益水平和色彩校正矩阵,以及透镜1212阴影校正参数。The statistics determined by the ISP processor 1240 can be sent to the control logic 1250 unit. For example, the statistical data may include image sensor 1214 statistical information such as auto exposure, auto white balance, auto focus, flicker detection, black level compensation, lens 1212 shading correction, and the like. Control logic 1250 can include a processor and/or a microcontroller that executes one or more routines (such as firmware) that can determine control parameters of imaging device 1210 and ISP processing based on received statistical data. Control parameters of the device 1240. For example, control parameters of imaging device 1210 may include sensor 1220 control parameters (eg, gain, integration time for exposure control), camera flash control parameters, lens 1212 control parameters (eg, focus or zoom focal length), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing), as well as lens 1212 shading correction parameters.
运用图12中图像处理技术可实现如上的图像处理方法。The image processing method as above can be realized by using the image processing technique of FIG.
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database or other medium used herein may include non-volatile and/or volatile memory. Suitable non-volatile memories can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as an external cache. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization. Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the claims. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (17)

  1. 一种图像处理方法,包括:An image processing method comprising:
    获取图像中的人脸;Get the face in the image;
    获取所述图像中具有相同人脸的图像集合;Obtaining a set of images having the same face in the image;
    识别所述图像集合中的图像的人脸对应的年龄值;Identifying an age value corresponding to a face of the image in the set of images;
    根据所述年龄值生成对所述图像集合中的图像的排序信息;及Generating sorting information for images in the set of images based on the age values; and
    根据所述排序信息和所述图像集合,生成包括所述图像集合中图像的具有时序的相册。Based on the ranking information and the set of images, an album having a sequence of images in the set of images is generated.
  2. 根据权利要求1所述的方法,其特征在于,所述获取图像中的人脸,包括:The method according to claim 1, wherein the acquiring a face in the image comprises:
    当所述图像中包含多个人脸时,确定所述多个人脸中的主人脸。When a plurality of faces are included in the image, a master face of the plurality of faces is determined.
  3. 根据权利要求2所述的方法,其特征在于,所述确定所述多个人脸中的主人脸,包括:The method according to claim 2, wherein the determining a master face of the plurality of faces comprises:
    根据所述图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸。The master face is determined based on the face area and/or face definition occupied by each face in the image.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述图像中每个人脸占据的人脸面积和/或人脸清晰度确定主人脸,包括:The method according to claim 3, wherein the determining the master face based on the face area and/or the face definition occupied by each face in the image comprises:
    从所述图像中获取人脸面积最大的人脸,判断所述人脸是否符合预设条件;Obtaining a face with the largest face area from the image, and determining whether the face meets a preset condition;
    若是,则将所述人脸面积最大的人脸作为所述图像的主人脸;If yes, the face with the largest face area is used as the master face of the image;
    若否,则继续从所述图像中获取人脸面积大小次之的人脸,判断所述人脸是否符合预设条件,重复执行直到所述人脸面积达到最小面积阈值或获取到主人脸为止;和/或If not, the face of the face area is obtained from the image, and the face is determined to meet the preset condition, and the execution is repeated until the face area reaches the minimum area threshold or the owner's face is obtained. ;and / or
    从所述图像中获取人脸清晰度最高的人脸,判断所述人脸是否符合预设条件;Obtaining a face with the highest facial expression from the image, and determining whether the face meets a preset condition;
    若是,则将所述人脸清晰度最高的人脸作为所述图像的主人脸;If yes, the face with the highest face resolution is used as the master face of the image;
    若否,则继续从所述图像中获取人脸清晰度次之的人脸,判断所述人脸是否符合预设条件,重复执行直到所述人脸清晰度达到最小清晰度阈值或获取到主人脸为止。If not, proceed to obtain a face whose face is second in sharpness from the image, determine whether the face meets a preset condition, and repeat execution until the face resolution reaches a minimum definition threshold or acquires a master. The face is up.
  5. 根据权利要求4所述的方法,其特征在于,从所述图像中获取人脸面积最大的人脸,判断所述人脸是否符合预设条件,包括:The method according to claim 4, wherein the face having the largest face area is obtained from the image, and determining whether the face meets a preset condition comprises:
    从所述图像中获取人脸面积最大的人脸,判断所述人脸的角度和焦点是否符合预设条件。Obtaining a face with the largest face area from the image, and determining whether the angle and focus of the face conform to a preset condition.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述根据所述年龄值生成对所述图像集合中的图像的排序信息,包括:The method according to any one of claims 1 to 5, wherein the generating the ranking information of the image in the image set according to the age value comprises:
    当同一图像集合中的多个图像中,人脸的年龄值相同时,根据所述多个图像的生成时间生成对所述多个图像的排序信息。When the age values of the faces are the same among the plurality of images in the same image set, the ranking information for the plurality of images is generated according to the generation time of the plurality of images.
  7. 根据权利要求1至5中任一项所述的方法,其特征在于,在所述根据所述排序信息和所述图像集合,生成包括所述图像集合中图像的具有时序的相册之后,还包括:The method according to any one of claims 1 to 5, further comprising, after the generating an album having a sequence of images in the image set according to the sorting information and the image set, further comprising :
    将所述具有时序的相册按照所述时序进行播放,所述时序包括按照年龄值进行顺序排序和/或逆序排序,所述具有时序的相册包括幻灯片、短片或影集中的任意一种形式的文件。Playing the album with time series according to the timing, the sequence includes sequentially sorting and/or reverse sorting according to an age value, and the album with time series includes any one of a slide, a short film or an album. file.
  8. 根据权利要求1至5中任一项所述的方法,其特征在于,所述获取图像中的人脸,包括:The method according to any one of claims 1 to 5, wherein the acquiring a face in the image comprises:
    从多用户家庭共享相册中获取图像中的人脸。Get the faces in the image from a multi-user family shared album.
  9. 根据权利要求1至5中任一项所述的方法,其特征在于,在所述获取所述图像中具有相同人脸的图像集合之前,还包括:The method according to any one of claims 1 to 5, further comprising: before the acquiring the image set having the same face in the image, further comprising:
    对图像中的人脸进行识别,确定所述图像中的人脸对应的用户身份;及Identifying a face in the image to determine a user identity corresponding to the face in the image; and
    将所述图像划分至与所述用户身份对应的图像集合中,形成具有相同人脸的图像集合。The image is divided into image sets corresponding to the user identity to form an image collection having the same face.
  10. 根据权利要求9所述的方法,其特征在于,所述将所述图像划分至与所述用户身 份对应的图像集合中,形成具有相同人脸的图像集合,包括:The method according to claim 9, wherein the dividing the image into an image set corresponding to the user identity to form an image set having the same face comprises:
    当识别出的所述用户身份为已有的用户身份时,获取与所述已有的用户身份对应的图像集合,将所述图像划分至对应的图像集合中,形成具有相同人脸的图像集合;And when the identified user identity is an existing user identity, acquiring an image set corresponding to the existing user identity, and dividing the image into a corresponding image set to form an image set having the same face ;
    当识别出的所述用户身份为新的用户身份时,创建一个与所述新的用户身份对应的图像集合,将所述图像划分至所创建的图像集合中,形成具有相同人脸的图像集合。When the identified user identity is a new user identity, create an image set corresponding to the new user identity, and divide the image into the created image set to form an image set having the same face. .
  11. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method of claim 2, wherein the method further comprises:
    获取所述图像的主人脸,对所述主人脸进行人脸识别,得到所述主人脸所对应的用户身份。Obtaining a master face of the image, performing face recognition on the master face, and obtaining a user identity corresponding to the master face.
  12. 根据权利要求11所述的方法,其特征在于,还包括:The method of claim 11 further comprising:
    获取所述图像中的剩余人脸,依次对所述剩余人脸进行人脸识别;Acquiring the remaining faces in the image, and performing face recognition on the remaining faces in turn;
    当所述剩余人脸属于已有的用户身份时,将所述剩余人脸分入对应已有的用户身份中,得到所述剩余人脸所对应的用户身份;When the remaining human face belongs to an existing user identity, the remaining human face is divided into the corresponding existing user identity, and the user identity corresponding to the remaining human face is obtained;
    当所述剩余人脸不属于已有的用户身份时,则将所述剩余人脸标记为疑似路人人脸。When the remaining face does not belong to an existing user identity, the remaining face is marked as a suspected passerby face.
  13. 根据权利要求12所述的方法,其特征在于,还包括:The method of claim 12, further comprising:
    计算相册中疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数;Calculating the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image in the album;
    当所述次数达到设定阈值,则将所述疑似路人人脸新增为主人脸,得到所述疑似路人人脸所对应的用户身份。When the number of times reaches the set threshold, the suspected passerby face is added as the main face, and the user identity corresponding to the suspected passerby face is obtained.
  14. 根据权利要求13所述的方法,其特征在于,还包括:The method of claim 13 further comprising:
    获取新增图像中的主人脸和剩余人脸,按照所述新增图像中的主人脸和剩余人脸所能分入的用户身份,将所述新增图像分入用户身份对应的图像集合,再重新计算计算相册中疑似路人人脸与属于不同用户身份的主人脸出现在同一张图像上的次数,当所述次数达到设定阈值,则将所述疑似路人人脸新增为主人脸,得到所述疑似路人人脸所对应的用户身份。Obtaining the master face and the remaining faces in the newly added image, and dividing the newly added image into the image set corresponding to the user identity according to the user identity that the master face and the remaining faces in the newly added image can be separated into, Recalculating the number of times the suspected passerby face and the owner's face belonging to different user identities appear on the same image in the album, and when the number of times reaches the set threshold, the suspected passerby face is added as the main face. Obtaining the identity of the user corresponding to the suspected passerby face.
  15. 一种图像处理装置,其特征在于,所述装置包括:An image processing apparatus, characterized in that the apparatus comprises:
    图像集合获取模块,用于获取图像中的人脸;获取所述图像中具有相同人脸的图像集合;An image collection obtaining module, configured to acquire a human face in the image; and acquire an image collection having the same human face in the image;
    年龄值识别模块,用于识别所述图像集合中的图像的人脸对应的年龄值;An age value identification module, configured to identify an age value corresponding to a face of the image in the image set;
    排序信息生成模块,用于根据所述年龄值生成对所述图像集合中的图像的排序信息;a sorting information generating module, configured to generate, according to the age value, sorting information of an image in the image set;
    相册生成模块,用于根据所述排序信息和所述图像集合,生成包括所述图像集合中图像的具有时序的相册。And an album generating module, configured to generate, according to the sorting information and the image set, a photo album having a sequence of images in the image set.
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至14中任一项所述的图像处理方法的操作。A computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to perform the operations of the image processing method according to any one of claims 1 to 14.
  17. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,其特征在于,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至14中任一项所述的图像处理方法的操作。An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein the instructions are executed by the processor, causing the processor to perform any of claims 1 to 14 The operation of the image processing method described in the item.
PCT/CN2018/116592 2017-12-13 2018-11-21 Image processing method, apparatus, computer readable storage medium, and electronic device WO2019114508A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711331605.9 2017-12-13
CN201711331605.9A CN108108415B (en) 2017-12-13 2017-12-13 Image processing method, image processing apparatus, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2019114508A1 true WO2019114508A1 (en) 2019-06-20

Family

ID=62215835

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/116592 WO2019114508A1 (en) 2017-12-13 2018-11-21 Image processing method, apparatus, computer readable storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN108108415B (en)
WO (1) WO2019114508A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035685A (en) * 2020-08-17 2020-12-04 中移(杭州)信息技术有限公司 Album video generating method, electronic device and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108108415B (en) * 2017-12-13 2020-07-21 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, storage medium, and electronic device
CN109582811B (en) * 2018-12-17 2021-08-31 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110009646B (en) * 2019-04-15 2023-08-18 天意有福科技股份有限公司 Electronic album generation method and device, electronic equipment and storage medium
CN110147461A (en) * 2019-04-30 2019-08-20 维沃移动通信有限公司 Image display method, device, terminal device and computer readable storage medium
CN112131915B (en) * 2019-06-25 2023-03-24 杭州海康威视数字技术股份有限公司 Face attendance system, camera and code stream equipment
CN110490162A (en) * 2019-08-23 2019-11-22 北京搜狐新时代信息技术有限公司 The methods, devices and systems of face variation are shown based on recognition of face unlocking function
CN111835987A (en) * 2020-06-08 2020-10-27 广东以诺通讯有限公司 Video generation method based on face recognition
CN112163121B (en) * 2020-11-03 2021-03-23 万得信息技术股份有限公司 Video content information intelligent analysis processing method based on big data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009201041A (en) * 2008-02-25 2009-09-03 Oki Electric Ind Co Ltd Content retrieval apparatus, and display method thereof
CN105117207A (en) * 2015-07-27 2015-12-02 小米科技有限责任公司 Album creating method and apparatus
CN105531741A (en) * 2013-09-26 2016-04-27 富士胶片株式会社 Device for determining principal facial image in photographic image, and method and program for controlling same
CN108108415A (en) * 2017-12-13 2018-06-01 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751901B (en) * 2009-12-18 2014-09-24 康佳集团股份有限公司 Method and device for playing dynamic electronic album

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009201041A (en) * 2008-02-25 2009-09-03 Oki Electric Ind Co Ltd Content retrieval apparatus, and display method thereof
CN105531741A (en) * 2013-09-26 2016-04-27 富士胶片株式会社 Device for determining principal facial image in photographic image, and method and program for controlling same
CN105117207A (en) * 2015-07-27 2015-12-02 小米科技有限责任公司 Album creating method and apparatus
CN108108415A (en) * 2017-12-13 2018-06-01 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035685A (en) * 2020-08-17 2020-12-04 中移(杭州)信息技术有限公司 Album video generating method, electronic device and storage medium

Also Published As

Publication number Publication date
CN108108415B (en) 2020-07-21
CN108108415A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
WO2019114508A1 (en) Image processing method, apparatus, computer readable storage medium, and electronic device
CN107808136B (en) Image processing method, image processing device, readable storage medium and computer equipment
CN107766831B (en) Image processing method, image processing device, mobile terminal and computer-readable storage medium
CN107730444B (en) Image processing method, image processing device, readable storage medium and computer equipment
WO2019233266A1 (en) Image processing method, computer readable storage medium and electronic device
CN107886484B (en) Beautifying method, beautifying device, computer-readable storage medium and electronic equipment
CN107945135B (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN107862653B (en) Image display method, image display device, storage medium and electronic equipment
CN107862658B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
WO2019233392A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
CN110580428A (en) image processing method, image processing device, computer-readable storage medium and electronic equipment
US20050200722A1 (en) Image capturing apparatus, image capturing method, and machine readable medium storing thereon image capturing program
US8009204B2 (en) Image capturing apparatus, image capturing method, image processing apparatus, image processing method and computer-readable medium
CN107368806B (en) Image rectification method, image rectification device, computer-readable storage medium and computer equipment
CN107820017B (en) Image shooting method and device, computer readable storage medium and electronic equipment
CN107993209B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107833197A (en) Method, apparatus, computer-readable recording medium and the electronic equipment of image procossing
IES20080161A2 (en) Face detection in mid-shot digital images
CN109712177B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107622497B (en) Image cropping method and device, computer readable storage medium and computer equipment
CN107424117B (en) Image beautifying method and device, computer readable storage medium and computer equipment
CN109035147B (en) Image processing method and device, electronic device, storage medium and computer equipment
CN109242794B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
WO2017193796A1 (en) Photographing processing method and apparatus for smartwatch
CN107844764B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium

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: 18889182

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18889182

Country of ref document: EP

Kind code of ref document: A1