Multi-face image processing method, device, equipment and storage medium
By obtaining the key point information of multiple faces in the image and constructing the face grid structure, the problem of the inability of the existing technology to process multiple face images is solved, and efficient beautification processing of multiple face images is achieved, improving the image quality. .
Patent Information
- Application Number
- CN201910859873.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-11
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-09-11
AI Technical Summary
Existing beautification technology cannot effectively process multi-face images, and the beautification effect on single-face images is also poor.
By obtaining the key point information of multiple faces in the image, determining the boundary of the face grid and constructing the face grid structure, the face shape is adjusted, including expanding the minimum face outline area, reducing the overlapping grid boundaries, and constructing the face network structure. And map the changing image according to the adjustment operation.
It realizes efficient beautification processing of multi-face images, improves the image processing effect, and can better meet users' high requirements for photo quality.
Smart Images

Figure CN112488909B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to a method, device, equipment and storage medium for processing multiple faces of an image. Background Art
[0002] With the continuous development of photography and beautification technology, users have higher and higher requirements for photo quality. Most of the existing beautification technologies can only process a single face in an image, and cannot beautify images with multiple faces. Even if some can beautify multiple faces, the effect is not good. Summary of the invention
[0003] The embodiments of the present invention provide a method, apparatus, device and storage medium for processing multiple faces of an image, so as to realize the processing of multiple faces of an image and improve the image processing effect.
[0004] In a first aspect, an embodiment of the present invention provides a method for processing a multi-face image, comprising:
[0005] Get key point information of multiple faces in the image;
[0006] For each face, determining the face grid boundary according to the key point information;
[0007] Constructing a face grid structure according to the key point information and the face grid boundary;
[0008] The face shape of the human face is adjusted according to the face grid structure.
[0009] Further, for each face, the face grid boundary is determined according to the key point information, including:
[0010] Determine the minimum face contour area according to the key point information;
[0011] The minimum face contour area is expanded by a set multiple to obtain a face grid boundary.
[0012] Further, determining the minimum face contour area according to the key point information includes:
[0013] Obtaining a minimum rectangle formed by the key point information;
[0014] The area formed by the minimum rectangle is determined as the minimum face contour area.
[0015] Further, the minimum face contour area is expanded by a set multiple to obtain a face grid boundary, including:
[0016] Determining whether the face is the first face to be recognized;
[0017] If not, determining whether the face grid boundary overlaps with the face grid boundaries of other recognized faces;
[0018] If they overlap, the face grid boundary is reduced until the reduced face grid boundary does not overlap with the face grid boundaries of other recognized faces.
[0019] Further, reducing the face grid boundary includes:
[0020] If the face grid boundary is reduced to the minimum face contour area and still overlaps with the face grid boundaries of other recognized faces, processing of the face is abandoned.
[0021] Further, constructing a face grid structure according to the key point information and the face grid boundary includes:
[0022] Determine the key points with adjacent positions as the first target key points;
[0023] Determine an edge point located on the boundary of the face mesh, and determine a key point adjacent to the edge point as a second target key point;
[0024] The first target key point is connected with the first target key point as a vertex, and the edge point and the second target key point are connected with the edge point and the second target key point as vertices to obtain a face network structure.
[0025] Further, adjusting the face shape of the face according to the face grid structure includes:
[0026] receiving an adjustment operation applied to the face;
[0027] Adjust the grid where the key point is located according to the adjustment operation;
[0028] The adjusted mesh is mapped to the face image to obtain a face with adjusted face shape.
[0029] In a second aspect, an embodiment of the present invention further provides a multi-face image processing device, the device comprising:
[0030] A key point information acquisition module is used to obtain key point information of multiple faces in an image;
[0031] A face grid boundary determination module, used to determine the face grid boundary of each face according to the key point information;
[0032] A face grid structure construction module, used to construct a face grid structure according to the key point information and the face grid boundary;
[0033] The face shape adjustment module is used to adjust the face shape of the human face according to the face grid structure.
[0034] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0035] one or more processors;
[0036] A memory for storing one or more programs;
[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-face image processing method as described in the embodiment of the present invention.
[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-face image processing method as described in the embodiment of the present invention.
[0039] In an embodiment of the present invention, key point information of multiple faces in an image is first obtained, and then for each face, a face grid boundary is determined according to the key point information, and then a face grid structure is constructed according to the key point information and the face grid boundary, and finally the face shape of the face is adjusted according to the face grid structure. The multi-face image processing method provided by an embodiment of the present invention constructs a face grid structure for each face according to the key point information, and adjusts the face shape of the face according to the face grid structure, thereby realizing multi-face image processing and improving the image processing effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of a multi-face image processing method in Embodiment 1 of the present invention;
[0041] Figure 2a is a schematic diagram of a face image in Embodiment 1 of the present invention;
[0042] Figure 2b is an example diagram of key points of a face in Embodiment 1 of the present invention;
[0043] Figure 2c is an example diagram of key points of a face in Embodiment 1 of the present invention;
[0044] Figure 3a This is an example diagram of determining the minimum rectangle based on key point information in the first embodiment of the present invention;
[0045] Figure 3b is an example diagram of the minimum face contour area determined in the first embodiment of the present invention;
[0046] Figure 3cis an example diagram for determining the boundary of a face grid in Embodiment 1 of the present invention;
[0047] Figure 3d is an example diagram of key points and face mesh boundaries in Embodiment 1 of the present invention;
[0048] Figure 3e This is an example diagram of a face network structure constructed in Embodiment 1 of the present invention;
[0049] Figure 4 is a schematic structural diagram of a multi-face image processing device in Embodiment 2 of the present invention;
[0050] Figure 5 It is a structural diagram of a computer device in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0051] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0052] Embodiment 1
[0053] Figure 1 This is a flowchart of a multi-face image processing method provided in the first embodiment of the present invention. This embodiment is applicable to the case of adjusting the face shape of multi-face images. The method can be executed by a multi-face image processing device, which can be implemented by software and / or hardware and can be configured in electronic devices, including mobile terminals such as mobile phones, tablets, PDAs (personal digital assistants), smart wearable devices (such as smart glasses, smart watches), and non-mobile terminals such as servers, workstations, smart TVs, and personal computers. Figure 1 As shown, the method specifically comprises the following steps:
[0054] Step 110, obtaining key point information of multiple faces in the image.
[0055] Among them, the key point information can be the coordinate information of the key point in the image, and the key point information of the face is obtained by performing face detection on the image. Face detection can also be called face key point detection, positioning or face alignment, which refers to locating the key area positions of the face in an image containing a face, including eyebrows, eyes, nose, mouth, facial contours, etc.
[0056] It should be noted that the number of facial key points can be set by technical personnel in this field according to actual conditions. For static image processing, due to the low real-time requirements, relatively dense facial key points, such as 1,000, can be detected. This method can not only locate important facial feature points, but also accurately describe the contours of the facial features. For live broadcasts, etc., the real-time requirements are higher, and relatively sparse facial key points, such as 68, 81, and 106, can be detected to locate the more obvious and important feature points on the face (such as eye key points, eyebrow key points, nose key points, mouth key points, contour key points, etc.), so as to reduce the processing volume and reduce the processing time. For example, for Figure 2a Performing face detection on the image shown in the figure, we can obtain the following Figure 2b The 68 facial key points shown, or Figure 2c The 106 facial landmarks shown.
[0057] In this embodiment, the image contains multiple faces, and key point information of each face needs to be obtained separately.
[0058] Step 120: for each face, determine the face grid boundary according to the key point information.
[0059] The face grid boundary is used to construct the face grid structure. Specifically, the process of determining the face grid boundary according to the key point information may be to determine the minimum face contour area according to the key point information; and to expand the minimum face contour area by a set multiple to obtain the face grid boundary.
[0060] The minimum face contour area can be understood as the minimum image area covering all key points. In this embodiment, the minimum rectangle formed by the key point information is firstly obtained, and then the area formed by the minimum rectangle is determined as the minimum face contour area.
[0061] Specifically, first obtain the coordinates of the four vertices of the minimum rectangle. Assuming that the key point information of the face is (x1, y1), (x2, y2)....(xn, yn), the coordinates of the four vertices of the minimum rectangle are (min(x1, x2...xn), min(y1, y2....yn)), (min(x1, x2...xn), max(y1, y2....yn)), (max(x1, x2...xn), min(y1, y2....yn)), (max(x1, x2...xn), max(y1, y2....yn)). Figure 3a This is an example of determining the minimum rectangle based on key point information. Figure 3b is an example of the minimum face contour area determined. Figure 3aAs shown in the figure, there are 68 key points in total, among which there are 17 contour key points, and the corresponding numbers are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17; there are 10 eyebrow key points, and the corresponding numbers are 18, 19, 20, 21, 22, 23, 24, 25, 26, 27; there are 9 nose key points, and the corresponding numbers are 28, 29, 30, 31, 32, 33, 34, 35, 36; there are 12 eye key points, and the corresponding numbers are 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48; there are 20 mouth key points, and the corresponding numbers are 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68.
[0062] In this embodiment, the minimum face contour area is expanded by a set multiple, which may be by respectively increasing the length and width of the minimum rectangle by a set multiple, or by expanding the area of the minimum rectangle by a set multiple, wherein the set multiple may be set to any value between 1.2 and 1.5. Figure 3c An example diagram for determining the boundaries of a face mesh.
[0063] In this embodiment, since the image contains multiple faces, when obtaining the face grid boundary of the current face, it is first determined whether the face is the first face to be recognized; if not, it is determined whether the face grid boundary overlaps with the face grid boundaries of other recognized faces; if so, the face grid boundary is reduced until the reduced face grid boundary does not overlap with the face grid boundaries of other recognized faces.
[0064] Among them, the method for judging whether the face grid boundary overlaps with the face grid boundaries of other recognized faces can be based on the coordinates of the four vertices of the face grid boundary. In this embodiment, the overlap is partial overlap. When the face grid boundary is reduced, it can be reduced according to a certain step size. When the face grid boundary is reduced to the minimum face contour area and still overlaps with the face grid boundaries of other recognized faces, the face is abandoned. In this embodiment, if the minimum face contour area still overlaps with the face grid boundaries of other recognized faces, it indicates that most of the face area is blocked by other faces. At this time, there is no need to continue processing the face, which can save power consumption.
[0065] Step 130, constructing a face mesh structure according to the key point information and the face mesh boundary.
[0066] Among them, the mesh represents a single drawable entity, whose vertices include at least key points, that is, the key points are used as part of the vertices of the mesh, and the face is meshed and divided into multiple meshes. The so-called meshing is to divide concave polygons or polygons with intersecting edges into convex polygons, such as triangles, so as to be rendered by APIs such as OpenGL or rendering engines. It should be noted that the meshes are ordered to form a mesh sequence, so as to meet the rendering specifications of APIs such as OpenGL or rendering engines. In this embodiment, the face mesh structure is constructed by triangulation.
[0067] Specifically, a method for constructing a face mesh structure based on key point information and a face mesh boundary may be as follows: determining adjacent key points as first target key points; determining edge points on the face mesh boundary, and determining key points adjacent to the edge points as second target key points; connecting the first target key points with the first target key points as vertices, and connecting the edge points and the second target key points with the edge points and the second target key points as vertices to obtain a face network structure.
[0068] The edge points may be the vertices of the face mesh boundary and the midpoints of the four edges of the face mesh boundary. The vertices of the mesh may include both key points and edge points. Figure 3d is an example diagram of key points and face mesh boundaries. Figure 3d As shown, the corresponding numbers of the edge points are 69, 70, 71, 72, 73, 74, 75 and 76. Specifically, after determining the first target key point, the edge point and the second target key point, the first target key point is connected with the first target key point as the vertex, and the edge point and the second target key point are connected with the edge point and the second target key point as the vertex to obtain the face network structure. For example: (1, 76, 2), (2, 76, 3), (3, 76, 4), (4, 76, 5), etc. can all be connected into a grid. Figure 3e An example diagram of a face network structure constructed for this embodiment, such as Figure 3e As shown, the first target key point, the edge point and the second target key point are connected in sequence to obtain multiple grids, and the multiple grids constitute a face grid structure.
[0069] Step 140: Adjust the face shape of the human face according to the face grid structure.
[0070] Among them, the face shape adjustment may include adjustment type and amplitude. The type may include adjustment of face shape, eyebrows, lips and nose. For example, for the face shape (represented by contour key points), the adjustment type includes adjustment of the shape of the chin, the height of the forehead, the face shape of the mandibular position, the face width, etc. According to the adjustment type and amplitude, the contour key points are adjusted. While keeping the contour key points as the vertices of the mesh, the contour key points can be adjusted together with the mesh to change the face shape in the mesh, thereby achieving the effect of adjusting the face shape.
[0071] In this embodiment, the process of adjusting the face shape of a face according to the face grid structure may be: receiving an adjustment operation acting on the face; adjusting the grid where the key points are located according to the adjustment operation; mapping the adjusted grid with the face image to obtain the face with the adjusted face shape.
[0072] Specifically, the method of adjusting the grid where the key points are located is to adjust the coordinates of the key points constituting the grid, and then map the adjusted grid to the face image through triangle deformation to obtain the face with adjusted face shape.
[0073] In this embodiment, various types of adjustments are described by way of example, such as adjusting the shape of the chin and the width of the face.
[0074] 1. Adjust the shape of the chin
[0075] In one type of adjustment, the adjustment operation is used to adjust the shape of the chin, and the contour keypoints include the chin keypoints of the chin (such as Figure 3d The key points numbered 7, 8, 9, 10, and 11 are shown), and the key points also include the nose tip key points (such as Figure 3d In this type of adjustment, the nose tip key point 31 is determined as a reference point, and the chin key point is moved with the reference point as a target to adjust the grid where the chin key point is located. Further, the chin key point can be moved in the following manner: Resultm = Dstn + A(y)·F(x)(Svcm-Dstn)
[0076] Among them, Resultm is the chin key point after movement, Dstn is the chin key point before movement, Svcm is the reference point represented by the nose tip key point, A(y) is the amplitude, and F(x) is the movement function.
[0077] 2. Wide face
[0078] 2.1. Width of face at the jawline
[0079] In another type of adjustment, the adjustment operation is used to adjust the face width at the jaw position, and the contour key points include the jaw key points of the jaw (such as Figure 3dThe key points are numbered 4, 5, 6, 12, 13, and 14 in the figure), key points include the key points of the nose tip (such as Figure 3d The facial key point numbered 31 in the figure).
[0080] In this type of adjustment, the nose tip keypoint is determined as the reference point; the jaw keypoint is moved with the reference point as the target to adjust the mesh where the jaw keypoint is located. In more detail, the jaw keypoint can be moved in the following ways:
[0081] Resultm=Dstn+A(y)·F(x)(Svcm-Dstn)
[0082] Among them, Resultm is the mandibular key point after the movement, Dstn is the mandibular key point before the movement, Svcm is the reference point, A(y) is the amplitude, and F(x) is the movement function.
[0083] 2.2. Overall face reduction
[0084] In another type of adjustment, the adjustment operation is used to adjust the contour of the face at different positions, and the contour key points include the upper contour key points below the eyebrows and above the nose tip (such as Figure 3d The key points numbered 1, 2, 16, and 17 in the figure), the key points of the middle contour below the nose tip and above the lower lip (such as Figure 3d The key points of the face numbered 3, 4, 5, 6, 12, 13, 14, 15 in the figure), the key points of the lower contour below the lower lip (such as Figure 3d The key points of the face include the key points of the lower lip (such as Figure 3d The key points numbered 49, 55, 56, 57, 58, 57, 58, 59, 60, 61, 68, 67, 66, 65 in the figure), the key points of the upper lip (such as Figure 3d The key points are numbered 49, 50, 51, 52, 53, 54, 55, 65, 64, 43, 62, 61 in the figure). The key points of the face also include the key points of the nose tip (such as Figure 3d The key point numbered 31 in the figure).
[0085] 2.2.1. Key points of upper contour
[0086] In this type of adjustment, the midpoint between the two pupils is determined as the reference point (eg Figure 3d 28 in the figure), move the upper contour key point with the reference point as the target to adjust the mesh where the upper contour key point is located.
[0087] Furthermore, the upper forehead keypoint can be moved as follows:
[0088] Resultm=Dstn+A(y)·F(x)(Svcm-Dstn)
[0089] Among them, Resultm is the upper forehead key point after movement, Dstn is the upper forehead key point before movement, Svcm is the reference point, A(y) is the amplitude, and F(x) is the movement function.
[0090] 2.2.2. Central contour key points
[0091] In this type of adjustment, the nose tip key point is determined as the reference point, and the middle contour key point is moved with the reference point as the target to adjust the grid where the middle contour key point is located. Further, the middle forehead key point can be moved as follows:
[0092] Resultm=Dstn+A(y)·F(x)(Svcm-Dstn)
[0093] Among them, Resultm is the middle forehead key point after movement, Dstn is the middle forehead key point before movement, Svcm is the reference point, A(y) is the amplitude, and F(x) is the movement function.
[0094] 2.2.3. Key points of lower contour
[0095] In this type of adjustment, the lower lip key point near the chin is determined as the reference point (such as Figure 3d Move the lower contour key point with the reference point as the target to adjust the grid where the lower contour key point is located.
[0096] Furthermore, the lower forehead key point can be moved as follows:
[0097] Resultm=Dstn+A(y)·F(x)(Svcm-Dstn)
[0098] Among them, Resultm is the lower forehead key point after movement, Dstn is the lower forehead key point before movement, Svcm is the reference point, A(y) is the amplitude, and F(x) is the movement function.
[0099] The above-mentioned method of adjusting the key points of the contour is only used as an example. When implementing the embodiment of the present invention, other methods of adjusting the key points of the contour can be set according to actual conditions, for example, contour key points located at different positions are selected, and different reference points corresponding to each are specified, and different movement amplitudes can be specified for each contour key point, etc., and the embodiment of the present invention does not limit this. In addition, in addition to the above-mentioned method of adjusting the key points of the contour, those skilled in the art can also adopt other methods of adjusting the key points of the contour according to actual needs, and the embodiment of the present invention does not limit this.
[0100] The technical solution of this embodiment first obtains key point information of multiple faces in the image, then determines the face grid boundary for each face according to the key point information, then constructs a face grid structure according to the key point information and the face grid boundary, and finally adjusts the face shape according to the face grid structure. The multi-face image processing method provided by the embodiment of the present invention constructs a face grid structure for each face according to the key point information, and adjusts the face shape of each face according to the face grid structure, thereby realizing multi-face image processing and improving the image processing effect.
[0101] Embodiment 2
[0102] Figure 4 This is a schematic diagram of the structure of a multi-face image processing device provided by Embodiment 2 of the present invention. Figure 4 As shown, the device includes: a key point information acquisition module 210, a face grid boundary determination module 220, a face grid structure construction module 230 and a face shape adjustment module 240.
[0103] A key point information acquisition module 210 is used to acquire key point information of multiple faces in an image;
[0104] A face grid boundary determination module 220, used to determine the face grid boundary of each face according to key point information;
[0105] A face grid structure building module 230 is used to build a face grid structure according to key point information and face grid boundaries;
[0106] The face shape adjustment module 240 is used to adjust the face shape of the human face according to the face grid structure.
[0107] Optionally, the face grid boundary determination module 220 is further configured to:
[0108] Determine the minimum face contour area based on key point information;
[0109] Expand the minimum face contour area by a set multiple to obtain the face mesh boundary.
[0110] Optionally, the face grid boundary determination module 220 is further configured to:
[0111] Get the minimum rectangle formed by key point information;
[0112] The area formed by the smallest rectangle is determined as the smallest face contour area.
[0113] Optionally, the face grid boundary determination module 220 is further configured to:
[0114] Determine whether the face is the first face to be recognized;
[0115] If not, determine whether the face grid boundary overlaps with the face grid boundary of other recognized faces;
[0116] If they overlap, the face grid boundary is reduced until the reduced face grid boundary does not overlap with the face grid boundaries of other recognized faces.
[0117] Optionally, the face grid boundary determination module 220 is further configured to:
[0118] When the face grid boundary is reduced to the minimum face contour area and still overlaps with the face grid boundaries of other recognized faces, the face is discarded.
[0119] Optionally, the face grid structure building module 230 is further used for:
[0120] Determine the key points with adjacent positions as the first target key points;
[0121] Determine the edge points located on the boundary of the face mesh, and determine the key points adjacent to the edge points as the second target key points;
[0122] The first target key point is connected with the first target key point as a vertex, and the edge point and the second target key point are connected with the edge point and the second target key point as vertices to obtain the face network structure.
[0123] Optionally, the face shape adjustment module 240 is further used for:
[0124] Receiving adjustment operations applied to the face;
[0125] Adjust the grid where the key points are located according to the adjustment operation;
[0126] The adjusted mesh is mapped to the face image to obtain a face with adjusted face shape.
[0127] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not described in detail in this embodiment, please refer to the methods provided by all the above embodiments of the present invention.
[0128] Embodiment 3
[0129] Figure 5 A schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Figure 5 A block diagram of a computer device 312 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The computer device 312 shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention. The device 312 is a typical computing device with multi-face image processing functions.
[0130] like Figure 5 As shown, the computer device 312 is in the form of a general-purpose computing device. The components of the computer device 312 may include, but are not limited to: one or more processors 316, a storage device 328, and a bus 318 that connects various system components (including the storage device 328 and the processor 316).
[0131] Bus 318 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0132] The computer device 312 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 312, including volatile and non-volatile media, removable and non-removable media.
[0133] The storage device 328 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 330 and / or cache memory 332. The computer device 312 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 334 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a read-only optical disk (Compact Disc-Read Only Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 318 via one or more data medium interfaces. The storage device 328 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0134] A program 336 having a set (at least one) of program modules 326 may be stored, for example, in a storage device 328, such program modules 326 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 326 generally perform the functions and / or methods of the embodiments described herein.
[0135] The computer device 312 may also communicate with one or more external devices 314 (e.g., keyboard, pointing device, camera, display 324, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 312, and / or may communicate with any device that enables the computer device 312 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 322. Furthermore, the computer device 312 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) via a network adapter 320. As shown, the network adapter 320 communicates with other modules of the computer device 312 via a bus 318. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computer device 312, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
[0136] The processor 316 executes various functional applications and data processing by running the programs stored in the storage device 328, such as implementing the multi-face image processing method provided in the above embodiment of the present invention.
[0137] Embodiment 4
[0138] Embodiment 4 of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the multi-face image processing method provided in the embodiment of the present invention is implemented.
[0139] Of course, the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention is not limited to the method operations described above, but can also execute related operations in the multi-face image processing method provided by any embodiment of the present invention.
[0140] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0141] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0142] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0143] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0144] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for processing a multi-face image, characterized in that: include: Get key point information of multiple faces in the image; For each face, determining the face grid boundary according to the key point information; Constructing a face grid structure according to the key point information and the face grid boundary; Adjusting the face shape of the human face according to the face grid structure; Constructing a face grid structure according to the key point information and the face grid boundary, including: Determine the key points with adjacent positions as the first target key points; Determine an edge point located on the boundary of the face mesh, and determine a key point adjacent to the edge point as a second target key point; The first target key point is connected with the first target key point as a vertex, and the edge point and the second target key point are connected with the edge point and the second target key point as vertices to obtain a face network structure.
2. The method according to claim 1, characterized in that For each face, the face grid boundary is determined according to the key point information, including: Determine the minimum face contour area according to the key point information; The minimum face contour area is expanded by a set multiple to obtain a face grid boundary.
3. The method according to claim 2, characterized in that Determining the minimum face contour area according to the key point information includes: Obtaining a minimum rectangle formed by the key point information; The area formed by the minimum rectangle is determined as the minimum face contour area.
4. The method according to claim 2, characterized in that: Expanding the minimum face contour area by a set multiple to obtain a face grid boundary includes: Determining whether the face is the first face to be recognized; If not, determining whether the face grid boundary overlaps with the face grid boundaries of other recognized faces; If they overlap, the face grid boundary is reduced until the reduced face grid boundary does not overlap with the face grid boundaries of other recognized faces.
5. The method according to claim 4, characterized in that Shrinking the face mesh boundary includes: If the face grid boundary is reduced to the minimum face contour area and still overlaps with the face grid boundaries of other recognized faces, processing of the face is abandoned.
6. The method according to claim 1, characterized in that Adjusting the face shape of the face according to the face grid structure includes: receiving an adjustment operation applied to the face; Adjust the grid where the key point is located according to the adjustment operation; The adjusted mesh is mapped to the face image to obtain a face with adjusted face shape.
7. A method for processing a multi-face image, characterized in that: include: Get key point information of multiple faces in the image; For each face, determining the face grid boundary according to the key point information; Constructing a face grid structure according to the key point information and the face grid boundary; Adjusting the face shape of the human face according to the face grid structure; For each face, determining the face grid boundary according to the key point information includes: Determine the minimum face contour area according to the key point information; Expand the minimum face contour area by a set multiple to obtain a face grid boundary; The step of expanding the minimum face contour area by a set multiple to obtain a face grid boundary includes: Determining whether the face is the first face to be recognized; If not, determining whether the face grid boundary overlaps with the face grid boundaries of other recognized faces; If they overlap, the face grid boundary is reduced until the reduced face grid boundary does not overlap with the face grid boundaries of other recognized faces.
8. A multi-face image processing device, characterized in that: include: A key point information acquisition module is used to obtain key point information of multiple faces in an image; A face grid boundary determination module, used to determine the face grid boundary of each face according to the key point information; A face grid structure construction module, used to construct a face grid structure according to the key point information and the face grid boundary; A face shape adjustment module, used for adjusting the face shape of the human face according to the face grid structure; The face grid structure building module is also used for: Determine the key points with adjacent positions as the first target key points; Determine the edge points located on the boundary of the face mesh, and determine the key points adjacent to the edge points as the second target key points; The first target key point is connected with the first target key point as a vertex, and the edge point and the second target key point are connected with the edge point and the second target key point as vertices to obtain the face network structure.
9. A multi-face image processing device, characterized in that: include: A key point information acquisition module is used to obtain key point information of multiple faces in an image; A face grid boundary determination module, used to determine the face grid boundary of each face according to the key point information; A face grid structure construction module, used to construct a face grid structure according to the key point information and the face grid boundary; A face shape adjustment module, used for adjusting the face shape of the human face according to the face grid structure; The face grid boundary determination module is further used for: Determine the minimum face contour area based on key point information; Expand the minimum face contour area by a set multiple to obtain the face grid boundary; The face grid boundary determination module is further used for: Determine whether the face is the first face to be recognized; If not, determine whether the face grid boundary overlaps with the face grid boundary of other recognized faces; If they overlap, the face grid boundary is reduced until the reduced face grid boundary does not overlap with the face grid boundaries of other recognized faces.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-face image processing method as described in any one of claims 1-7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the multi-face image processing method as described in any one of claims 1 to 7 is implemented.
