Human face material fusion method and device, storage medium and electronic device

By performing grayscale processing and texture feature extraction on face images, sketch features are generated and superimposed, which solves the problem of incompatibility when fusing faces and image materials, and achieves a more coordinated and realistic image fusion effect.

CN113837925BActive Publication Date: 2024-09-06GUANGZHOU FANXING ENTERTAINMENT INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111028826.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-02
Publication Date
2024-09-06
Estimated Expiration
2041-09-02

AI Technical Summary

Technical Problem

When merging faces and image materials, the existing technology usually uses simple superposition processing, resulting in uncoordinated images, and lacks effective solutions.

Method used

By obtaining a facial image that is consistent with the material image, perform grayscale processing and extract texture features, generate sketch features, and superimpose them on the candidate image to achieve coordinated fusion with the material image.

Benefits of technology

It achieves the coordinated fusion of facial images and material images, improves the rationality and authenticity of the images, and solves the problem of image disharmony caused by simple superposition processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113837925B
    Figure CN113837925B
Patent Text Reader

Abstract

The present invention discloses a method and device for fusing human face materials, a storage medium and an electronic device. The method comprises: obtaining a facial image of a target object after determining a material image, wherein the image angle of the facial image is consistent with the image fusion angle indicated by the material image; grayscale processing is performed on the regional image corresponding to the target region in the facial image to obtain a candidate image; texture features of the facial image in the target region are extracted to generate sketch features corresponding to the texture features; the sketch features are superimposed on the candidate image to obtain a target facial image; and the target facial image is fused with the material image according to the image fusion angle. The present invention solves the technical problem of image incoordination caused by simple superposition processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a method and device for fusing face materials, a storage medium and an electronic device. Background Art

[0002] Currently, many instant messaging clients and clients with live broadcast capabilities have the function of fusing face and image materials to generate images such as expressions that contain user facial features, in order to increase the diversity of users in instant interaction.

[0003] However, currently, when a face is fused with an image material, the face image is usually directly superimposed on the image material. For example, when a face is fused with a cartoon material, the face image is directly grayscale-adjusted and then superimposed, so that the fused image is not harmonious.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for fusing face materials, a storage medium and an electronic device, so as to at least solve the technical problem that simple superposition processing leads to image incoordination.

[0006] According to one aspect of an embodiment of the present invention, a method for fusing facial materials is provided, comprising: obtaining a facial image of a target object when a material image is determined, wherein an image angle of the facial image is consistent with an image fusion angle indicated by the material image; performing grayscale processing on an area image corresponding to a target area in the facial image to obtain a candidate image; extracting texture features of the facial image in the target area to generate sketch features corresponding to the texture features; superimposing the sketch features on the candidate image to obtain a target facial image; and fusing the target facial image with the material image at the image fusion angle.

[0007] According to another aspect of an embodiment of the present invention, a face material fusion device is also provided, including: an acquisition unit, used to acquire a face image of a target object when a material image is determined, wherein the image angle of the face image is consistent with the image fusion angle indicated by the material image; a grayscale unit, used to perform grayscale color gradation processing on a region image corresponding to a target region in the face image to obtain a candidate image; a generation unit, used to extract texture features of the face image in the target region to generate sketch features corresponding to the texture features; a superposition unit, used to superimpose the sketch features on the candidate image to obtain a target face image; and a fusion unit, used to fuse the target face image with the material image according to the image fusion angle.

[0008] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned face material fusion method when running.

[0009] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the facial material fusion method through the computer program.

[0010] In an embodiment of the present invention, a facial image having an image fusion angle consistent with that of a material image is obtained, and sketch features are generated from texture features in a target area of ​​the facial image and superimposed on a candidate image obtained by grayscale processing of the facial image to obtain a target facial image, thereby fusing the target facial image with the material image according to the image fusion angle, performing grayscale processing on the facial image, and superimposing sketch features from texture features in the target area, thereby achieving the purpose of sketching texture features on the facial image while grayscale processing the facial image, so that the grayscale of the target facial image is more reasonable and realistic, thereby achieving the technical effect of more coordinated fusion of the target facial image and the material image, and further solving the technical problem of image incoordination caused by simple superposition processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0012] Figure 1 is a schematic diagram of an application environment of an optional face material fusion method according to an embodiment of the present invention;

[0013] Figure 2 is a flowchart of an optional method for fusing face materials according to an embodiment of the present invention;

[0014] Figure 3 is a flowchart of an optional method for fusing face materials according to an embodiment of the present invention;

[0015] Figure 4 is a schematic diagram of a triangulation diagram according to an optional method for fusing face materials according to an embodiment of the present invention;

[0016] Figure 5 is a flowchart of an optional method for fusing face materials according to an embodiment of the present invention;

[0017] Figure 6 is a schematic diagram of candidate images of an optional face material fusion method according to an embodiment of the present invention;

[0018] Figure 7 is a schematic diagram of image fusion of an optional face material fusion method according to an embodiment of the present invention;

[0019] Figure 8 is a schematic structural diagram of an optional face material fusion device according to an embodiment of the present invention;

[0020] Fig. 9 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] According to one aspect of an embodiment of the present invention, a method for fusing face materials is provided. Optionally, the method for fusing face materials can be applied to, but is not limited to, Figure 1In the environment shown. The terminal device 102 is not limited to running a client. The user initiates an image fusion request based on the client to fuse the facial image and the material image. The fusion request is sent to the server 112 through the network 110. The server 112 runs a database 114 and a processing engine 116. The database 114 is used to store the facial image and the material image, and the processing engine 116 is used to process the facial image and the material image to obtain a fused image. The fused image obtained by the server 112 is returned to the terminal device 102 through the network 110, and the fused image is displayed in the client of the terminal device 102.

[0024] The server 112 generates a fused image, which is not limited to being implemented by the processing engine 116 by sequentially executing S102 to S110. Obtain a facial image of the target object. When the material image is determined, obtain a facial image of the target object, and the image angle of the facial image is consistent with the image fusion angle indicated by the material image. Obtain a candidate image. Perform grayscale processing on the area image corresponding to the target area in the facial image to obtain a candidate image. Generate sketch features. Extract the texture features of the facial image in the target area, and generate sketch features corresponding to the texture features. Obtain a target facial image. Superimpose the sketch features on the candidate image to obtain a target facial image. Fuse the target facial image with the material image. Fuse the target facial image with the material image according to the image fusion angle to obtain a fused image.

[0025] Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an IOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be an audio client, a video client, an instant messaging client, a browser client, an education client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.

[0026] As an optional implementation, Figure 2 As shown, the above-mentioned face material fusion method includes:

[0027] S202, when the material image is determined, obtaining a facial image of the target object, wherein an image angle of the facial image is consistent with an image fusion angle indicated by the material image;

[0028] S204, performing grayscale processing on the area image corresponding to the target area in the facial image to obtain a candidate image;

[0029] S206, extracting texture features of the facial image in the target area, and generating sketch features corresponding to the texture features;

[0030] S208, superimposing the sketch feature on the candidate image to obtain a target facial image;

[0031] S210: Fusing the target facial image with the material image according to an image fusion angle.

[0032] Optionally, the material image is not limited to being a material image determined from a plurality of candidate materials included in the material library. The material image is a basic image used to carry a facial image. Each material image is not limited to being provided with a material area used to carry a facial image. The facial image is fused into the material area of ​​the material image to achieve fusion of the facial image and the material image. The material image can be, but is not limited to, a cartoon material image with a black and white stick figure.

[0033] Optionally, the image fusion angle of the material image is determined according to the material content in the material image, and the image fusion angle is not limited to the image angle indicating the facial image. The image angle of the facial image is the facial shooting angle contained in the facial image, for example, the front face, the left face, and the right face. A facial image with a consistent image fusion angle is determined according to the material image. For example, when the material image indicates a front face, the facial image of the front face of the target object is determined so that the fused image obtained by fusion remains consistent in image content.

[0034] Optionally, the target area of ​​the facial image is not limited to one or more areas in which texture features are concentrated in the facial image, such as an eye area, a nose area, a chin area, and a forehead area.

[0035] In an embodiment of the present application, a facial image having an image fusion angle consistent with that of a material image is obtained, and sketch features are generated from texture features in a target area of ​​the facial image and superimposed on a candidate image obtained by grayscale processing of the facial image to obtain a target facial image, thereby fusing the target facial image with the material image according to the image fusion angle, performing grayscale processing on the facial image, and generating sketch features from texture features in the target area and superimposing them, thereby achieving the purpose of performing grayscale processing on the facial image while sketching the texture features on the facial image to make the grayscale of the target facial image more reasonable and realistic, thereby achieving the technical effect of more coordinated fusion of the target facial image and the material image, and further solving the technical problem of image incoordination caused by simple superposition processing.

[0036] As an optional implementation, Figure 3 As shown, before grayscale processing is performed on the area image corresponding to the target area in the facial image to obtain the candidate image, the method further includes:

[0037] S302, generating a facial point map corresponding to the facial image according to the target key points;

[0038] S304, constructing a triangulation graph corresponding to the target area according to the facial point map, wherein the target area includes a plurality of target key points;

[0039] S306: extracting a region image corresponding to the target region from the facial image according to the triangulation graph.

[0040] Optionally, the facial point map is not limited to a facial contour map composed of multiple target key points in a facial image, and each facial part in the facial image is outlined by multiple points to generate a facial point map corresponding to the facial image.

[0041] Optionally, constructing a triangulation map corresponding to the target area based on the facial point map is not limited to constructing a triangulation map based on the facial features in the facial point map, extracting the target area where the facial features are located from the entire facial image, thereby generating a triangulation map matching the target area where the facial features are located. Figure 4 shown. Figure 4 (1) is the facial point map, Figure 4 (2) is the triangulation graph.

[0042] Optionally, extracting a regional image corresponding to a target area from a facial image according to a triangulation graph is not limited to segmenting the target area corresponding to the triangulation graph from the facial image. When a regional image is obtained, it is not limited to filling the unextracted area of ​​the facial image with a preset color so that the regional image and the facial image are consistent in size.

[0043] In the embodiment of the present application, a triangulation map is obtained through a facial point map, so as to extract a regional image of a target area from a facial image, making the extraction of the regional image of the target area more reasonable and coordinated than direct segmentation.

[0044] As an optional implementation, Figure 5 As shown, the grayscale processing is performed on the area image corresponding to the target area in the facial image to obtain the candidate images including:

[0045] S502, obtaining an initial pixel value of each pixel contained in the regional image;

[0046] S504, determining contrast thresholds, contrast parameters and brightness thresholds of all pixels in the regional image;

[0047] S506, performing contrast mapping on the initial pixel value according to the contrast threshold to obtain a contrast pixel value;

[0048] S508, adjusting the contrast pixel value according to the contrast parameter to obtain an intermediate pixel value;

[0049] S510, performing brightness mapping on the intermediate pixel value according to the brightness threshold to obtain a candidate pixel value;

[0050] S512, adjusting the initial pixel value of each pixel in the regional image to a candidate pixel value to obtain a candidate image.

[0051] Optionally, the initial pixel value of each pixel included in the regional image is determined, and the contrast threshold, contrast parameter and brightness threshold of the regional image are not limited to being determined based on the initial pixel value of each pixel in the statistical regional image. The contrast threshold is not limited to including the contrast black field threshold and the contrast white field threshold, and the brightness threshold is not limited to including the brightness black field threshold and the brightness white field threshold. The contrast parameter is not limited to being determined based on the contrast black field threshold and the contrast white field threshold.

[0052] Optionally, the processing of the facial image to the candidate image mainly includes three processes, input tone mapping, midtone adjustment and output tone mapping. The input tone mapping is not limited to being implemented according to formula (1) and formula (2).

[0053]

[0054]

[0055] Among them, Vin is the initial pixel value, inShadows is the contrast black field threshold, and inHighlights is the contrast white field threshold.

[0056] Optionally, the black field contrast threshold is not limited to the lowest initial pixel value in the regional image, that is, the darkest pixel value, and the white field contrast threshold is not limited to the highest initial pixel value in the image, that is, the brightest pixel value.

[0057] Optionally, Vout obtained by formula (2) is input as a comparison pixel value into formula (3) to obtain an intermediate pixel value.

[0058]

[0059] Wherein, Vin is Vout in formula (2), and midtone is the contrast parameter.

[0060] Optionally, Vout obtained by formula (3) is used as an intermediate pixel value and input into formula (4) to obtain a candidate pixel value.

[0061]

[0062]

[0063] Wherein, Vin is Vout in formula (3), outShadows is the brightness black field threshold, and ioutHighlights is the brightness white field threshold.

[0064] Optionally, outShadows and ioutHighlights are not limited to being obtained by adjusting specific parameter values. The candidate images are not limited to Figure 6 As shown in the figure, the grayscale image within the black border is the candidate image.

[0065] In the embodiment of the present application, the regional image is adjusted to a grayscale candidate image by grayscale level adjustment, thereby achieving adjustment of the regional image in the facial image to a grayscale candidate image.

[0066] As an optional implementation manner, the above-mentioned extraction of texture features of the facial image in the target area and generation of sketch features corresponding to the texture features includes:

[0067] S1, input the facial image into the generative adversarial network to obtain a sketch image generated by the generative adversarial network;

[0068] S2, extracting sketch features corresponding to texture features of the face image in the target area in the sketch image.

[0069] Optionally, the generative adversarial network is used to generate a corresponding sketch image according to the facial image. The generated object network is not limited to a GAN network, and the sketch image is generated by using the facial image through the generative network, and the generated sketch image is discriminated by the discriminative network until the sketch image passes the discrimination of the discriminative network, and then the sketch image is output.

[0070] Optionally, in the case where the sketch image is an image of sketch features corresponding to the facial image, the sketch features corresponding to the texture features in the target area are extracted from the sketch image. The texture features are not limited to the lines contained in the facial image, such as wrinkle lines, nose bridge lines, etc.

[0071] In the embodiment of the present application, by extracting sketch features corresponding to texture features in the sketch image, texture sketching in the facial image is achieved, making facial image processing more reasonable and detailed.

[0072] As an optional implementation, the step of superimposing the sketch feature on the candidate image to obtain the target facial image includes:

[0073] S1, determining a target key area containing texture features in a target area of ​​a facial image;

[0074] S2, in the sketch image, intercepting the sketch area image corresponding to the target key area;

[0075] S3, superimposing the sketch area image on the target key area of ​​the candidate image.

[0076] Optionally, superimposing the sketch features extracted from the sketch image on the candidate image is to superimpose the sketch area image where the sketch features are located on the target key area of ​​the candidate image. By superimposing the images of the key area, the sketch features are superimposed on the candidate image after grayscale processing to obtain the target facial image for fusion.

[0077] As an optional implementation manner, the above-mentioned fusing the target facial image with the material image according to the image fusion angle includes:

[0078] S1, determining an image fusion parameter indicated by a fusion area in a material image;

[0079] S2, performing image adjustment on the target facial image according to the image fusion parameters;

[0080] S3, superimposing the target facial image after image adjustment on the fusion area in the material image.

[0081] Optionally, the image fusion parameter is not limited to indicating the area size of the material area in the material image, so as to adjust the size of the target facial image according to the image fusion parameter, so that the fused image obtained by fusing the target facial image and the material image is more coordinated.

[0082] The fusion of the target face image and the source image is not limited to Figure 7 shown. Figure 7 (1) is the determined material image, in which the circular area of ​​the face is the material area. Figure 7 (2) is a fused image formed by superimposing the target face image on the source image.

[0083] In an embodiment of the present application, a target facial image obtained by facial image processing is fused into a material area of ​​a material image to obtain a fused image fused with the material image. A sketch feature indicating texture is included on the target facial image, so that the grayscale of the target facial image is more reasonable and realistic, thereby achieving a technical effect of more harmoniously fusing the target facial image with the material image.

[0084] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0085] According to another aspect of the embodiments of the present invention, a face material fusion device for implementing the face material fusion method is also provided. Figure 8 As shown, the device comprises:

[0086] The acquisition unit 802 is used to acquire a facial image of the target object when the material image is determined, wherein the image angle of the facial image is consistent with the image fusion angle indicated by the material image;

[0087] Grayscale unit 804, used to perform grayscale processing on the area image corresponding to the target area in the face image to obtain a candidate image;

[0088] A generating unit 806, configured to extract texture features of the facial image in the target area and generate sketch features corresponding to the texture features;

[0089] The superposition unit 808 is used to superimpose the sketch feature on the candidate image to obtain a target facial image;

[0090] The fusion unit 810 is used to fuse the target facial image with the material image according to an image fusion angle.

[0091] Optionally, the above-mentioned face material fusion device also includes an extraction unit, which is used to generate a facial point map corresponding to the facial image according to the target key points before performing grayscale processing on the regional image corresponding to the target area in the facial image to obtain a candidate image; construct a triangulation map corresponding to the target area according to the facial point map, wherein the target area includes multiple target key points; and extract the regional image corresponding to the target area from the facial image according to the triangulation map.

[0092] Optionally, the grayscale unit 804 is further used to obtain an initial pixel value of each pixel contained in the regional image; determine a contrast threshold, a contrast parameter and a brightness threshold of all pixels in the regional image; perform contrast mapping on the initial pixel value according to the contrast threshold to obtain a contrast pixel value; adjust the contrast pixel value according to the contrast parameter to obtain an intermediate pixel value; perform brightness mapping on the intermediate pixel value according to the brightness threshold to obtain a candidate pixel value; and adjust the initial pixel value of each pixel in the regional image to a candidate pixel value to obtain a candidate image.

[0093] Optionally, the above-mentioned generation unit 806 is also used to input the facial image into a generative adversarial network to obtain a sketch image generated by the generative adversarial network; and extract sketch features in the sketch image that correspond to texture features of the facial image in the target area.

[0094] Optionally, the above-mentioned superposition unit 808 is also used to determine a target key area containing texture features in the target area of ​​the facial image; in the sketch image, intercept the sketch area image corresponding to the target key area; and superimpose the sketch area image on the target key area of ​​the candidate image.

[0095] Optionally, the fusion unit 810 is further configured to determine an image fusion parameter indicated by a fusion region in the material image; perform image adjustment on the target facial image according to the image fusion parameter; and superimpose the target facial image after image adjustment on the fusion region in the material image.

[0096] In an embodiment of the present application, a facial image having an image fusion angle consistent with that of a material image is obtained, and sketch features are generated from texture features in a target area of ​​the facial image and superimposed on a candidate image obtained by grayscale processing of the facial image to obtain a target facial image, thereby fusing the target facial image with the material image according to the image fusion angle, performing grayscale processing on the facial image, and generating sketch features from texture features in the target area and superimposing them, thereby achieving the purpose of performing grayscale processing on the facial image while sketching the texture features on the facial image to make the grayscale of the target facial image more reasonable and realistic, thereby achieving the technical effect of more coordinated fusion of the target facial image and the material image, and further solving the technical problem of image incoordination caused by simple superposition processing.

[0097] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above-mentioned face material fusion method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a server as an example. Fig. 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any of the above method embodiments through the computer program.

[0098] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0099] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0100] S1, when a material image is determined, obtaining a facial image of a target object, wherein an image angle of the facial image is consistent with an image fusion angle indicated by the material image;

[0101] S2, performing grayscale processing on the area image corresponding to the target area in the facial image to obtain a candidate image;

[0102] S3, extracting texture features of the facial image in the target area and generating sketch features corresponding to the texture features;

[0103] S4, superimposing the sketch features on the candidate image to obtain the target face image;

[0104] S5, fusing the target facial image with the material image according to an image fusion angle.

[0105] Alternatively, a person skilled in the art may understand that: Fig. 9 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig. 9 The structure of the electronic device is not limited. Fig. 9 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig. 9 Different configurations are shown.

[0106] Among them, the memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the face material fusion method and device in the embodiment of the present invention. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, to implement the above-mentioned face material fusion method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely arranged relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. Among them, the memory 902 can be specifically but not limited to being used to store material images, facial images, target facial images and other information. As an example, if Fig. 9As shown, the memory 902 may include, but is not limited to, the acquisition unit 802, grayscale unit 804, generation unit 806, superposition unit 808, and fusion unit 810 in the face material fusion device. In addition, it may also include, but is not limited to, other module units in the face material fusion device, which will not be repeated in this example.

[0107] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0108] In addition, the electronic device further includes: a display 908 for displaying the material image and the facial image; and a connection bus 910 for connecting the various module components in the electronic device.

[0109] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.

[0110] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the methods provided in various optional implementations of the above-mentioned face material fusion. The computer program is configured to execute the steps of any of the above-mentioned method embodiments when it is run.

[0111] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0112] S1, when a material image is determined, obtaining a facial image of a target object, wherein an image angle of the facial image is consistent with an image fusion angle indicated by the material image;

[0113] S2, performing grayscale processing on the area image corresponding to the target area in the facial image to obtain a candidate image;

[0114] S3, extracting texture features of the facial image in the target area and generating sketch features corresponding to the texture features;

[0115] S4, superimposing the sketch features on the candidate image to obtain the target face image;

[0116] S5, fusing the target facial image with the material image according to an image fusion angle.

[0117] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0118] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0119] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.

[0120] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0121] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0124] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for fusing face materials, characterized in that: include: When the material image is determined, acquiring a facial image of the target object, wherein an image angle of the facial image is consistent with an image fusion angle indicated by the material image; Performing grayscale processing on the area image corresponding to the target area in the facial image to obtain a candidate image; Inputting the facial image into a generative adversarial network, obtaining a sketch image generated by the generative adversarial network, extracting texture features of the facial image in the target area, and extracting sketch features corresponding to the texture features in the sketch image; superimposing the sketch feature on the candidate image to obtain a target facial image; The target facial image is fused with the material image according to the image fusion angle, wherein the image fusion angle includes a shooting angle of the facial image.

2. The method according to claim 1, characterized in that Before performing grayscale processing on the area image corresponding to the target area in the facial image to obtain the candidate image, the method further includes: Generating a facial point map corresponding to the facial image according to the target key points; Constructing a triangulation graph corresponding to the target area according to the facial point map, wherein the target area includes a plurality of the target key points; The region image corresponding to the target region is extracted from the facial image according to the triangulation graph.

3. The method according to claim 1, characterized in that: The step of performing grayscale processing on the area image corresponding to the target area in the facial image to obtain the candidate image comprises: Obtaining an initial pixel value of each pixel contained in the regional image; Determining contrast thresholds, contrast parameters, and brightness thresholds for all pixels in the regional image; Performing contrast mapping on the initial pixel value according to the contrast threshold to obtain a contrast pixel value; Adjusting the contrast pixel value according to the contrast parameter to obtain an intermediate pixel value; Performing brightness mapping on the intermediate pixel value according to the brightness threshold to obtain a candidate pixel value; The initial pixel value of each pixel in the region image is adjusted to the candidate pixel value to obtain the candidate image.

4. The method according to claim 1, characterized in that The step of superimposing the sketch feature on the candidate image to obtain a target facial image comprises: determining, in the target area of ​​the facial image, a target key area containing the texture feature; In the sketch image, a sketch area image corresponding to the target key area is intercepted; and the sketch area image is superimposed on the target key area of ​​the candidate image.

5. The method according to claim 1, characterized in that The step of fusing the target facial image with the material image according to the image fusion angle includes: Determining an image fusion parameter indicated by a fusion area in the material image; Performing image adjustment on the target facial image according to the image fusion parameters; The target facial image after image adjustment is superimposed on the fusion area in the material image.

6. A face material fusion device, characterized in that: include: an acquisition unit, configured to acquire a facial image of a target object when a material image is determined, wherein an image angle of the facial image is consistent with an image fusion angle indicated by the material image; A grayscale unit, used for performing grayscale processing on the area image corresponding to the target area in the facial image to obtain a candidate image; A generating unit, configured to input the facial image into a generative adversarial network, obtain a sketch image generated by the generative adversarial network, and extract sketch features corresponding to texture features in the sketch image; A superimposing unit, used for superimposing the sketch feature on the candidate image to obtain a target facial image; A fusion unit is used to fuse the target facial image with the material image according to the image fusion angle, wherein the image fusion angle includes a shooting angle of the facial image.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 5 when executed.

8. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 5 through the computer program.