Method, apparatus, storage medium, and electronic device for obtaining a target object texture map
By obtaining the posture information in the face image, adjusting the posture of the three-dimensional target object model, generating material pictures and processing them, it solves the material stretching and drifting caused by inaccurate stickers in smart beauty products, and improves product performance and user experience.
Patent Information
- Application Number
- CN202111144643.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-09-28
AI Technical Summary
Among existing smart beauty products, due to inaccurate matching of facial map points, two-dimensional materials are stretched and drifted, affecting product performance and user experience.
By obtaining the target object pose information in the target object image, the three-dimensional target object model of the initial pose is adjusted based on the information, the corresponding material map is generated, and the mapping process is performed to obtain the target object map.
Improve the accuracy of map point matching, avoid material stretching and drifting problems, and improve the performance and user experience of smart beauty products.
Smart Images

Figure CN114067090B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to a method, apparatus, storage medium, and electronic device for obtaining a target object texture map. Background Art
[0002] Currently, in related technologies, based on two-dimensional face materials and key points, face texture map effects in intelligent beauty makeup products such as intelligent beauty makeup APPs are realized. However, in fact, since real human faces are three-dimensional, there are situations such as inaccurate texture map points, stretching, and drifting due to different angles of the human face, which affect the product performance and user experience of intelligent beauty makeup products.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of the present invention provide a method, apparatus, storage medium, and electronic device for obtaining a target object texture map, so as to at least solve the technical problems of stretching of two-dimensional materials and drifting of materials caused by inaccurate matching of texture map points in related technologies.
[0005] According to one aspect of the embodiments of the present invention, a method for obtaining a target object texture map is provided, including: obtaining target object pose information in a target object image; adjusting the pose of a first model based on the target object pose information to obtain a material map corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose; performing texture map processing on the material map to obtain a target object texture map.
[0006] According to another aspect of the embodiments of the present invention, a method for obtaining a target object texture map is further provided, including: receiving a target object image from a client; obtaining target object pose information in the target object image, adjusting the pose of a first model based on the target object pose information to obtain a material map corresponding to the target object image, and performing texture map processing on the material map to obtain a target object texture map, where the first model is a three-dimensional target object model in an initial pose; sending the target object texture map to the client.
[0007] According to another aspect of the embodiments of the present invention, an apparatus for obtaining a target object texture map is further provided, including: an obtaining module, configured to obtain target object pose information in a target object image; an adjusting module, configured to adjust the pose of a first model based on the target object pose information to obtain a material map corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose; a processing module, configured to perform texture map processing on the material map to obtain a target object texture map.
[0008] According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium. The computer-readable storage medium includes a stored program. When the program runs, it controls the device where the computer-readable storage medium is located to execute the method for obtaining the target object map according to any one of the above.
[0009] According to another aspect of the embodiments of the present invention, there is also provided a processor. The processor is used to run a program. When the program runs, it executes the method for obtaining the target object map according to any one of the above.
[0010] According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory connected to the processor for providing instructions for the processor to perform the following processing steps: obtaining target object pose information in a target object image; adjusting the pose of a first model based on the target object pose information to obtain a material map corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose; performing map processing on the material map to obtain a target object map.
[0011] In the embodiments of the present invention, by obtaining the target object pose information in the target object image; adjusting the pose of the first model based on the target object pose information to obtain a material map corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose; performing map processing on the material map to obtain a target object map.
[0012] It is easy to note that the embodiments of the present invention adopt a standard three-dimensional target object model and various makeup materials matching the standard three-dimensional target object model. In practical applications, according to the target object pose information obtained in the target object image, the pose of the standard three-dimensional target object model is adjusted, and then the adjusted three-dimensional target object model is projected onto a two-dimensional plane to obtain a two-dimensional material map, which can more efficiently and accurately match the material points in the two-dimensional material map and the key points of the target object. Then, by performing map processing on the two-dimensional material map, a target object map is obtained.
[0013] Thus, the embodiments of the present application achieve the purpose of more efficiently and accurately matching the material points in the two-dimensional material map and the key points of the target object, improve the accuracy of map point matching, avoid problems such as stretching and drifting of two-dimensional materials, thereby realizing the technical effect of improving the product performance and user experience of intelligent beauty products, and further solving the technical problem of stretching and drifting of two-dimensional materials caused by inaccurate map point matching in the target object map processing method in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings described herein are used to provide a further understanding of the present invention and form a part of this application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:
[0015] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for obtaining a target object map is shown;
[0016] Figure 2 A flowchart of a method for obtaining a target object map according to an embodiment of the present invention;
[0017] Figure 3 A flowchart of an alternative method for obtaining a target object map according to an embodiment of the present invention;
[0018] Figure 4 A schematic diagram of a scenario for obtaining a face map according to an embodiment of the present invention;
[0019] Figure 5 A schematic diagram of a scenario for obtaining a face map according to an embodiment of the present invention;
[0020] Figure 6 A flowchart of another method for obtaining a target object map according to an embodiment of the present invention;
[0021] Figure 7 A schematic structural diagram of an apparatus for obtaining a target object map according to an embodiment of the present invention;
[0022] Figure 8 A block diagram of a computer terminal according to an embodiment of the present invention. Detailed implementation manners
[0023] In order to enable those skilled in the art of this technology to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances 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 "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0025] First, some nouns or terms that appear during the description of the embodiments of the present application are applicable to the following explanations:
[0026] Two-dimensional target object key points: refer to the key points of the target object on the two-dimensional image. The number of them is generally dozens to hundreds. The coordinates of each point are composed of two dimensions, x and y. Each point represents a specific position on the target object. Taking the two-dimensional face key points as an example of the two-dimensional target object key points, the two-dimensional face key points may include: contour points such as face frames, left and right eyebrows, left and right eye sockets, and lips.
[0027] Target object texture mapping: Using image algorithms to paste various material images on the target object picture to achieve effects such as beauty enhancement, makeup, and stickers.
[0028] In the related art, there are mainly two solutions for face texture mapping based on two-dimensional face key points and two-dimensional materials and face texture mapping solutions based on three-dimensional face alignment models and three-dimensional materials, where:
[0029] 1) The solution for face texture mapping based on two-dimensional face key points and two-dimensional materials is to directly paste the two-dimensional materials onto the face according to the two-dimensional face key points. The two-dimensional face materials are generally made based on the frontal face, so the effect is the best when the face is frontal. For the side face or the situation of looking up or down, due to the mismatch between the points on the material and the detected key points, there are obvious stretching and drifting problems in the texture mapping effect, which affects the user experience.
[0030] However, the face texture mapping effect of the above solution is not good, and there are stretching and drifting problems because it does not consider the influence of the face pose on the key points. Its materials Figure 1 are generally frontal two-dimensional face materials. When the actual face is not frontal, such as the side face, the relative positions of the left and right contour points of the face and the contour points of the eyes, nose and mouth are quite different from those in the frontal face. When using the frontal face material for texture mapping, it is difficult to avoid the stretching and drifting problems caused by inaccurate point positions.
[0031] 2) The face texturing solution based on a 3D face alignment model and 3D materials directly outputs a 3D face mesh from the 3D face alignment model, pastes the 3D materials onto the 3D face mesh, and finally renders it into a 2D image according to the pose of the face. In terms of the effect, the points of the 3D face mesh correspond one by one to the points of the 3D materials, which better solves the stretching and drifting problems caused by non-corresponding texturing points.
[0032] However, since it is necessary to be based on a 3D face alignment model, the computational complexity of this model is generally significantly higher than that of a 2D face alignment model. For users, on devices with limited computing resources such as mobile terminals, the running speed and power consumption are significantly inferior to those of the 2D face alignment model. For developers, due to the high requirements for the dataset of the 3D face alignment model, mainly relying on the 3D face alignment model, the development difficulty is high, the requirements for device performance are also high, the application scope is relatively narrow and it is difficult to cover general application scenarios; its development and maintenance costs are also significantly higher than those of the 2D face alignment model.
[0033] For the above reasons, currently on the market, the 2D face alignment model is still the mainstream. Therefore, the embodiments of the present application will hereinafter give a schematic illustration of the technical solution for realizing the 3D face texturing effect based on 2D face key points. However, the solution of the present application is not limited to being applied to the 2D face alignment model, and can also be applied to the 3D face alignment model to realize the 3D face texturing effect based on 3D face key points.
[0034] Embodiment 1
[0035] According to an embodiment of the present invention, an embodiment of a method for obtaining a target object texture is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0036] The method embodiment provided by Embodiment 1 of the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing the method for obtaining a target object texture is shown. As Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ……, 102n in the figure) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than those Figure 1 shown in, or have a different configuration from those Figure 1 shown.
[0037] It should be noted that the above one or more processors 102 and / or other data processing circuits can generally be referred to as "data processing circuits" in this article. The data processing circuit may be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit is a kind of processor control (such as the selection of a variable resistance terminal path connected to an interface).
[0038] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for obtaining the target object map in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizes the above-mentioned acquisition of the target object map. The memory 104 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 memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0039] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0040] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0041] Under the above operating environment, the present invention provides a method for obtaining a target object map as shown in Figure 2 shown, Figure 2 is a flowchart of a method for obtaining a target object map according to an embodiment of the present invention. As shown in Figure 2 shown, the method for obtaining the target object map includes:
[0042] Step S202, obtaining the target object pose information in the target object image;
[0043] Step S204, performing pose adjustment on the first model based on the above-mentioned target object pose information to obtain a material map corresponding to the target object image;
[0044] Step S206, performing map pasting processing on the above-mentioned material map to obtain a target object map.
[0045] Optionally, the above-mentioned target object can be flexibly set according to the actual application scenario. The above-mentioned target object can be applied to both human life scenarios and animal life scenarios. In human life scenarios, the target object can be either a specific part of a human being itself, for example: the target object, or a specific accessory worn by a human being, for example: a hairpin. In animal life scenarios, the target object can be either a specific part of an animal itself, for example: a cat face, or a specific accessory worn by an animal, for example: a collar.
[0046] Optionally, the above-mentioned target object image refers to an image containing the target object obtained by shooting the target object with a smart terminal (such as a smart phone, a smart robot, a smart watch, a camera, an iPad, etc.). For example, it can be an image including a human face obtained by shooting a person. Specifically, the image type of the target image can be a color image, a black and white image, a photo image, a video image, etc.
[0047] Optionally, the above-mentioned target object pose information includes, but is not limited to: side face, head shaking, eyes closing, head raising, head lowering and other pose information; the above-mentioned first model is a three-dimensional target object model in the initial pose, and the three-dimensional target object model in the initial pose is the standard three-dimensional target object model.
[0048] Optionally, the above-mentioned material image can be a two-dimensional material image, for example, a two-dimensional plane material image, such as, can be any type of material image such as cute cartoon cat whiskers, sassy cartoon eyes, pouting cartoon mouths, emoticons, dynamic patterns, etc.
[0049] Optionally, the above-mentioned target object texture mapping refers to using an image algorithm to paste various material images on the target object image to achieve texture mapping effects such as beauty enhancement, makeup, stickers, and decoration.
[0050] It should be noted that the execution subject of the method for obtaining the target object texture mapping provided in the embodiments of the present application can be a SaaS client. By using a standard three-dimensional target object model, the target object pose information in the actual target object image is applied to the standard three-dimensional target object model to generate a two-dimensional plane material image, and then texture mapping processing is performed to obtain the target object texture mapping, that is, first, the corresponding two-dimensional plane material image is processed according to the actual target object pose information, and then texture mapping processing is performed to obtain the target object texture mapping, rather than ignoring the actual situation and directly using the two-dimensional material image of the front face of the person in the target object image for texture mapping, avoiding the technical problems of material stretching and drifting caused by the inaccurate material point positions in the material image and the key point positions of the target object in the target object image due to different target object pose information.
[0051] That is, the embodiments of the present invention adopt a standard three-dimensional target object model and various makeup materials matching the standard three-dimensional target object model. In actual application, according to the target object pose information obtained in the target object image, the pose of the standard three-dimensional target object model is adjusted, and then the adjusted three-dimensional target object model is projected onto a two-dimensional plane to obtain a two-dimensional material image, which can more efficiently and accurately match the material point positions in the two-dimensional material image and the key point positions of the target object, and then through texture mapping processing of the two-dimensional material image, the target object texture mapping is obtained.
[0052] Thus, the embodiments of the present application achieve the purpose of more efficiently and accurately matching the material point positions in the two-dimensional material image and the key point positions of the target object, improve the accuracy of texture mapping point matching, avoid the problems of two-dimensional material stretching and material drifting, thereby realizing the technical effect of improving the product performance and user experience of intelligent beauty products, and further solving the technical problems of two-dimensional material stretching and material drifting caused by inaccurate texture mapping point matching in the target object texture mapping processing method in the related art.
[0053] As an optional embodiment, such asFigure 3 As shown, obtaining the above-mentioned target object posture information in the above-mentioned target object image includes:
[0054] Step S302, using a third model to detect and obtain a plurality of first key points from the target object image;
[0055] Step S304: performing posture estimation using the plurality of first key points to obtain the target object posture information.
[0056] Optionally, the third model is a two-dimensional target object alignment model, and the multiple first key points are target object key points in the target object image, for example, two-dimensional target object key points, that is, target object key points on the two-dimensional image. It should be noted that the number of two-dimensional target object key points is generally tens to hundreds, and the coordinates of each target object key point are composed of two dimensions, x and y, and each point represents a specific position on the target object, such as a face frame, left and right eyebrows, left and right eye sockets, lips and other contour points. In the present application, 280 two-dimensional target object key points can be used, but not limited to, for posture estimation to obtain the above-mentioned target object posture information.
[0057] As an optional embodiment, Figure 3 As shown, the posture of the first model is adjusted based on the posture information of the target object, and the material image obtained includes:
[0058] Step S402, adjusting the posture of the first model based on the posture information of the target object to obtain a second model, wherein the second model is a three-dimensional target object model of the target posture;
[0059] Step S404: Determine a two-dimensional material image corresponding to the target object image using the second model.
[0060] Optionally, the second model is a three-dimensional target object model of a target posture, for example, a three-dimensional target object model of a head-up posture, a three-dimensional target object model of a head-down posture, and so on.
[0061] In the above optional embodiments, since the target object posture information in the target object image changes in real time in the actual application scenario, the current target object posture information is used to adjust the posture of the first model to obtain a three-dimensional target object model of the target posture, that is, a three-dimensional target object model of the final posture (that is, the adjusted three-dimensional model), and the two-dimensional material image corresponding to the target object image is determined based on the three-dimensional target object model of the final posture.
[0062] Taking the target object image as a face image and the target object posture information as face posture information as an example, when the face in the face image is rotated at a large angle, the eye bags effect based entirely on the key points of the two-dimensional face will produce the following Figure 4 The obvious drift stretching phenomenon shown is due to the use of Figure 4 If the standard image material pointed by the arrow is used for face mapping, there will be a problem that the material points in the two-dimensional material image are not inaccurate with the facial key points in the face image. However, the technical solution of three-dimensional portrait mapping provided by the embodiment of the present application can achieve the following. Figure 5 The face mapping effect is due to applying the face posture information to the standard 3D face model and projecting it onto a 2D plane to obtain an adjusted 2D material image. Figure 5 The adjusted two-dimensional material image pointed by the arrow is used for face mapping, which effectively avoids the technical problems of material stretching and drifting caused by the inaccuracy between the material points in the two-dimensional material image and the facial key points in the face image due to different facial posture information.
[0063] As an optional embodiment, performing posture adjustment on the first model based on the target object posture information to obtain the second model includes:
[0064] Step S502, obtaining a plurality of second key points from the first model, wherein the plurality of second key points are the target object key points in the three-dimensional target object model of the initial posture;
[0065] Step S504: adjusting the three-dimensional coordinates of the plurality of second key points based on the target object posture information to obtain the second model.
[0066] Optionally, the above-mentioned multiple second key points are target object key points in the three-dimensional target object model of the above-mentioned initial posture, for example, two-dimensional target object key points, the coordinates of each target object key point are composed of two dimensions of x and y, and each point represents a specific position on the target object, such as contour points such as face frame, left and right eyebrows, left and right eye sockets, lips, etc. In the embodiment of the present application, the three-dimensional coordinates of the above-mentioned multiple second key points are adjusted by posture by using the target object posture information in the actual target object image to obtain the above-mentioned second model, that is, the three-dimensional target object model of the target posture.
[0067] As an optional embodiment, using the second model to determine the two-dimensional material image corresponding to the target object image includes:
[0068] Step S602: projecting the second model onto a preset two-dimensional plane to obtain the two-dimensional material image.
[0069] In the above optional embodiments, a two-dimensional material map and corresponding standard target object key points can be obtained by projecting the second model onto a preset two-dimensional plane. According to the two-dimensional target object key points output by the target object alignment model (the key points correspond one-to-one with the standard target object key points), the two-dimensional material can be accurately pasted onto the image, and then the target object map can be obtained.
[0070] As an optional embodiment, still as Figure 3 shown, performing a pasting process on the above material map to obtain the above target object map includes:
[0071] Step S702, obtaining a plurality of third key points from the above material map, where the plurality of third key points are target object key points in the above material map;
[0072] Step S704, using the correspondence between the plurality of first key points and the plurality of third key points, pasting the above material map onto the above target object image to obtain the above target object map.
[0073] The solution of this application uses a standard target object three-dimensional model material and various makeup material maps matching the standard target object model. In actual application, according to the target object pose information output by the target object alignment model, the pose of the standard target object model is adjusted, and then the adjusted three-dimensional model is projected onto a preset two-dimensional plane to obtain a two-dimensional material map and corresponding multiple standard target object key points; multiple two-dimensional target object key points are obtained from the material map through the target object alignment model, and using the correspondence between the multiple two-dimensional target object key points and the multiple two-dimensional target object key points, the above material map is pasted onto the above target object image to obtain the above target object map. The solution of this application can effectively avoid problems such as material stretching and drifting caused by inaccurate point positions when pasting standard two-dimensional target object materials.
[0074] As another optional embodiment, for the target object map based on the three-dimensional target object mesh and three-dimensional material, the target object map acquisition method provided by the solution of this application also uses a standard target object three-dimensional model material and various makeup materials matching the standard target object model. The difference is that this target object map acquisition solution relies on a three-dimensional target object alignment model to output a three-dimensional target object mesh or a three-dimensional target object, directly paste the three-dimensional target object material on the three-dimensional target object, and then project it onto a preset two-dimensional plane for rendering. However, it should be noted that generally, the development difficulty and computational complexity of the three-dimensional target object alignment model are significantly higher than those of the two-dimensional target object alignment model. Especially on mobile devices, the three-dimensional target object alignment model has not been popularized yet, and the two-dimensional target object alignment model has a wider application.
[0075] This application also provides asFigure 6 The method for obtaining the target object texture map shown Figure 6 is a flowchart of another method for obtaining the target object texture map according to an embodiment of the present invention. As Figure 6 shown, the method for obtaining the target object texture map includes:
[0076] Step S802, receiving a target object image from a client;
[0077] Step S804, obtaining the target object pose information in the above target object image, adjusting the pose of the first model based on the above target object pose information to obtain a material map corresponding to the above target object image, and performing texture mapping processing on the above material map to obtain a target object texture map, where the above first model is a three-dimensional target object model in an initial pose;
[0078] Step S806, sending the above target object texture map to the above client.
[0079] It should be noted that the execution subject of the method for obtaining the target object texture map provided by the embodiments of the present application can be a SaaS server. By receiving a target object image from a client, using a standard three-dimensional target object model, applying the target object pose information in the actual target object image to the standard three-dimensional target object model, generating a two-dimensional plane material map, and then performing texture mapping processing to obtain a target object texture map and sending it to the SaaS client, that is, first processing according to the actual target object pose information to obtain a corresponding two-dimensional plane material map, and then performing texture mapping processing to obtain a target object texture map, rather than ignoring the actual situation and directly using the two-dimensional material map of the front face of the person in the target object image for texture mapping, avoiding the technical problems of material stretching and drifting caused by inaccurate material point positions in the material map and the key point positions of the target object in the target object image due to different target object pose information.
[0080] Optionally, the above target object can be flexibly set according to the actual application scenario. The above target object can be applied to both human life scenarios and animal life scenarios. In human life scenarios, the target object can be either a specific part of a human being itself, for example: the target object, or a specific accessory worn by a human being, for example: a hair hoop. In animal life scenarios, the target object can be either a specific part of an animal itself, for example: a cat face, or a specific accessory worn by an animal, for example: a collar.
[0081] Optionally, the above-mentioned target object image refers to an image containing the target object obtained by shooting the target object through an intelligent terminal (such as a smart phone, a smart robot, a smart watch, a camera, an iPad, etc.). For example, it can be an image including a human face obtained by shooting a person. Specifically, the image type of the target image can be a color image, a black-and-white image, a photo image, a video image, etc.
[0082] Optionally, the above-mentioned target object pose information includes but is not limited to: side face, head shaking, eye closing, head raising, head lowering and other pose information; the above-mentioned first model is a three-dimensional target object model in the initial pose, and the three-dimensional target object model in the initial pose is the standard three-dimensional target object model.
[0083] Optionally, the above-mentioned material image can be a two-dimensional material image, such as a two-dimensional plane material image. For example, it can be any type of material image such as cute comic cat whiskers, sassy comic eyes, pouting comic mouths, emoticons, dynamic patterns, etc.
[0084] Optionally, the above-mentioned target object sticker refers to using an image algorithm to paste various material images on the target object image to achieve sticker effects such as beauty enhancement, makeup, stickers, and decoration.
[0085] In the embodiment of the present invention, a standard three-dimensional target object model and various makeup materials matching the standard three-dimensional target object model are adopted. In actual application, according to the target object pose information in the obtained target object image, the pose of the standard three-dimensional target object model is adjusted, and then the adjusted three-dimensional target object model is projected onto a two-dimensional plane to obtain a two-dimensional material image, which can more efficiently and accurately match the material points in the two-dimensional material image and the key points of the target object. Then, by performing sticker processing on the two-dimensional material image, a target object sticker is obtained.
[0086] Thus, the embodiment of the present application achieves the purpose of more efficiently and accurately matching the material points in the two-dimensional material image and the key points of the target object, improves the accuracy of sticker point matching, and avoids problems such as two-dimensional material stretching and material drift. Therefore, the technical effect of improving the product performance and user experience of intelligent beauty products is achieved, and further solves the technical problem of two-dimensional material stretching and material drift caused by inaccurate sticker point matching in the related art.
[0087] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, 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 essential to the present invention.
[0088] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0089] Embodiment 2
[0090] According to an embodiment of the present invention, there is also provided an apparatus embodiment for implementing the method for obtaining a target object texture map described above. Figure 7 As shown in FIG. 5, a schematic structural diagram of an apparatus for obtaining a target object texture map according to an embodiment of the present invention includes: an acquisition module 500, an adjustment module 502, and a processing module 504, where:
[0091] The acquisition module 500 is configured to acquire the target object pose information in the target object image; the adjustment module 502 is configured to perform pose adjustment on the first model based on the target object pose information to obtain a material map corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose; the processing module 504 is configured to perform texture mapping processing on the material map to obtain a target object texture map.
[0092] It is easy to note that the embodiments of the present invention adopt a standard three-dimensional target object model and various makeup materials matching the standard three-dimensional target object model. In practical applications, according to the target object pose information obtained in the target object image, the pose of the standard three-dimensional target object model is adjusted, and then the adjusted three-dimensional target object model is projected onto a two-dimensional plane to obtain a two-dimensional material map, which can more efficiently and accurately match the material points in the two-dimensional material map and the key points of the target object. Then, by performing texture mapping processing on the two-dimensional material map, a target object texture map is obtained.
[0093] Thus, the embodiments of the present application achieve the purpose of more efficiently and accurately matching the material points in the two-dimensional material map and the key points of the target object, improve the accuracy of texture mapping point matching, avoid problems such as stretching and drifting of two-dimensional materials, and thus achieve the technical effect of improving the product performance and user experience of intelligent beauty products, and further solve the technical problems of stretching and drifting of two-dimensional materials caused by inaccurate texture mapping point matching in the related art.
[0094] It should be noted here that the above acquisition module 500, adjustment module 502, and processing module 504 correspond to steps S202 to S206 in Embodiment 1. The instances and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the content disclosed in the above Embodiment 1. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.
[0095] It should be noted that the preferred implementation manner of this embodiment can refer to the relevant description in Embodiment 1, and will not be elaborated here.
[0096] Embodiment 3
[0097] According to an embodiment of the present invention, an embodiment of an electronic device is further provided. The electronic device can be any one of the computing devices in a computing device cluster. The electronic device includes: a processor and a memory, wherein:
[0098] a processor; and a memory connected to the above processor for providing instructions for the above processor to process the following processing steps: Step 1, obtaining the pose information of the target object in the target object image; Step 2, adjusting the pose of the first model based on the above pose information of the target object to obtain a material map corresponding to the above target object image, wherein the above first model is a three-dimensional target object model with an initial pose; Step 3, performing texture mapping processing on the above material map to obtain a target object texture map.
[0099] It is easy to notice that the embodiment of the present invention uses a standard three-dimensional target object model and various makeup materials matching the standard three-dimensional target object model. In actual application, according to the pose information of the target object in the obtained target object image, the pose of the standard three-dimensional target object model is adjusted, and then the adjusted three-dimensional target object model is projected onto a two-dimensional plane to obtain a two-dimensional material map, which can more efficiently and accurately match the material points in the two-dimensional material map and the key points of the target object. Then, by performing texture mapping processing on the two-dimensional material map, a target object texture map is obtained.
[0100] Thus, the embodiment of the present application achieves the purpose of more efficiently and accurately matching the material points in the two-dimensional material map and the key points of the target object, improves the accuracy of texture mapping point matching, avoids problems such as stretching and drifting of two-dimensional materials, thereby realizing the technical effect of improving the product performance and user experience of intelligent beauty products, and further solving the technical problem of stretching and drifting of two-dimensional materials caused by inaccurate texture mapping point matching in the related art.
[0101] It should be noted that the preferred implementation manner of this embodiment can refer to the relevant description in Embodiment 1, and will not be elaborated here.
[0102] Example 4
[0103] According to an embodiment of the present invention, an embodiment of a computer terminal can also be provided. The computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above computer terminal can also be replaced with a terminal device such as a mobile terminal.
[0104] Optionally, in this embodiment, the above computer terminal can be located in at least one of multiple network devices in a computer network.
[0105] In this embodiment, the above computer terminal can execute the program code of the following steps in the method for obtaining a target object texture map: obtaining target object pose information in a target object image; performing pose adjustment on a first model based on the above target object pose information to obtain a material map corresponding to the above target object image, where the above first model is a three-dimensional target object model in an initial pose; performing texture mapping processing on the above material map to obtain a target object texture map.
[0106] Optionally, Figure 8 is a structural block diagram of a computer terminal according to an embodiment of the present invention. As Figure 8 shown, the computer terminal can include: one or more (only one is shown in the figure) processors 602, a memory 604, and a peripheral interface 606.
[0107] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the acquisition and device of the target object texture map in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizes the acquisition of the above target object texture map. The memory can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory can further include a memory remotely set relative to the processor, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0108] The processor can call the information and application programs stored in the memory through a transmission device to execute the following steps: obtaining target object pose information in a target object image; performing pose adjustment on a first model based on the above target object pose information to obtain a material map corresponding to the above target object image, where the above first model is a three-dimensional target object model in an initial pose; performing texture mapping processing on the above material map to obtain a target object texture map.
[0109] Optionally, the above-mentioned processor may also execute the program code of the following steps: detecting a plurality of first key points from the above-mentioned target object image by using a third model, where the third model is a two-dimensional target object alignment model, and the plurality of first key points are target object key points in the above-mentioned target object image; performing pose estimation by using the plurality of first key points to obtain the above-mentioned target object pose information.
[0110] Optionally, the above-mentioned processor may also execute the program code of the following steps: performing pose adjustment on the first model based on the above-mentioned target object pose information to obtain a second model, where the second model is a three-dimensional target object model in the target pose; determining the two-dimensional material map corresponding to the above-mentioned target object image by using the second model.
[0111] Optionally, the above-mentioned processor may also execute the program code of the following steps: obtaining a plurality of second key points from the first model, where the plurality of second key points are target object key points in the three-dimensional target object model in the above-mentioned initial pose; performing pose adjustment on the three-dimensional coordinates of the plurality of second key points based on the above-mentioned target object pose information to obtain the second model.
[0112] Optionally, the above-mentioned processor may also execute the program code of the following steps: projecting the second model onto a preset two-dimensional plane to obtain the two-dimensional material map.
[0113] Optionally, the above-mentioned processor may also execute the program code of the following steps: obtaining a plurality of third key points from the above-mentioned material map, where the plurality of third key points are target object key points in the above-mentioned material map; pasting the above-mentioned material map onto the above-mentioned target object image by using the corresponding relationship between the plurality of first key points and the plurality of third key points to obtain the above-mentioned target object sticker.
[0114] Optionally, the above-mentioned processor may also execute the program code of the following steps: receiving the target object image from the client; obtaining the target object pose information in the above-mentioned target object image, performing pose adjustment on the first model based on the above-mentioned target object pose information to obtain the material map corresponding to the above-mentioned target object image, and performing sticker processing on the above-mentioned material map to obtain the target object sticker, where the first model is a three-dimensional target object model in the initial pose; sending the above-mentioned target object sticker to the client.
[0115] An embodiment of the present invention provides a solution for obtaining a target object texture map. It is easy to notice that the embodiment of the present invention adopts a standard three-dimensional target object model and various makeup materials that match the standard three-dimensional target object model. In practical applications, according to the target object pose information in the obtained target object image, the pose of the standard three-dimensional target object model is adjusted, and then the adjusted three-dimensional target object model is projected onto a two-dimensional plane to obtain a two-dimensional material map, which can more efficiently and accurately match the material points in the two-dimensional material map and the key points of the target object. Then, by performing texture mapping on the two-dimensional material map, a target object texture map is obtained.
[0116] Thus, the embodiment of the present application achieves the purpose of more efficiently and accurately matching the material points in the two-dimensional material map and the key points of the target object, improves the accuracy of texture mapping point matching, and avoids problems such as stretching and drifting of two-dimensional materials, thereby achieving the technical effect of improving the product performance and user experience of intelligent beauty products, and further solving the technical problem of stretching and drifting of two-dimensional materials caused by inaccurate texture mapping point matching in the related art.
[0117] Those of ordinary skill in the art can understand that Figure 8 the structure shown is only for illustration, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 8 It does not limit the structure of the above electronic device. For example, the computer terminal may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 8 or have a different configuration from that shown in Figure 8 shown.
[0118] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0119] Embodiment 5
[0120] According to an embodiment of the present invention, an embodiment of a computer-readable storage medium is further provided. Optionally, in this embodiment, the above computer-readable storage medium can be used to save the program code executed by the method for obtaining a target object texture map provided in the above Embodiment 1.
[0121] Optionally, in this embodiment, the above computer-readable storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0122] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: obtaining target object pose information in a target object image; performing pose adjustment on a first model based on the above target object pose information to obtain a material map corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose; performing texture mapping on the above material map to obtain a target object texture map.
[0123] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: detecting a plurality of first key points from the above target object image by using a third model, where the third model is a two-dimensional target object alignment model, and the plurality of first key points are target object key points in the above target object image; performing pose estimation by using the above plurality of first key points to obtain the above target object pose information.
[0124] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: performing pose adjustment on a first model based on the above target object pose information to obtain a second model, where the second model is a three-dimensional target object model in a target pose; using the above second model to determine a two-dimensional material map corresponding to the above target object image.
[0125] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: obtaining a plurality of second key points from the above first model, where the plurality of second key points are target object key points in the three-dimensional target object model in the above initial pose; performing pose adjustment on the three-dimensional coordinates of the above plurality of second key points based on the above target object pose information to obtain the above second model.
[0126] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: projecting the above second model onto a preset two-dimensional plane to obtain the above two-dimensional material map.
[0127] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: obtaining a plurality of third key points from the above-mentioned material image, where the plurality of third key points are key points of the target object in the material image; using the correspondence between the plurality of first key points and the plurality of third key points, pasting the material image onto the target object image to obtain the target object sticker.
[0128] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: receiving a target object image from a client; obtaining target object pose information in the target object image, adjusting the pose of a first model based on the target object pose information to obtain a material image corresponding to the target object image, and performing a pasting process on the material image to obtain a target object sticker, where the first model is a three-dimensional target object model in an initial pose; sending the target object sticker to the client.
[0129] The serial numbers of the embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0130] In the above embodiments of the present invention, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0131] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the above-mentioned unit division is only a logical function division. In actual implementation, there may be other division methods. 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 displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0132] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, in each embodiment of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0134] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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. This computer software product is stored in a computer-readable storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.
[0135] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for obtaining a target object texture map, characterized in that Including: Obtaining target object pose information in a target object image; Performing pose adjustment on a first model based on the target object pose information to obtain a material image corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose, the material image is obtained by projecting a second model onto a preset two-dimensional plane, and the second model is obtained by performing pose adjustment on the first model; Performing texture mapping on the material image to obtain a target object texture map, where the target object texture map is determined according to the correspondence between a plurality of first key points and a plurality of third key points, the plurality of first key points are target object key points in the target object image, and the plurality of third key points are target object key points in the material image.
2. The method for obtaining the target object texture mapping according to claim 1, wherein Obtaining the target object pose information in the target object image includes: Detecting the plurality of first key points from the target object image by using a third model, where the third model is a two-dimensional target object alignment model; Performing pose estimation by using the plurality of first key points to obtain the target object pose information.
3. The method for obtaining the target object texture mapping according to claim 1, wherein Performing pose adjustment on the first model based on the target object pose information to obtain the material image includes: Performing pose adjustment on the first model based on the target object pose information to obtain the second model, where the second model is a three-dimensional target object model in a target pose; Using the second model to determine a two-dimensional material image corresponding to the target object image.
4. The method for obtaining the target object texture mapping according to claim 3, wherein Performing pose adjustment on the first model based on the target object pose information to obtain the second model includes: Obtaining a plurality of second key points from the first model, where the plurality of second key points are target object key points in the three-dimensional target object model in the initial pose; Performing pose adjustment on the three-dimensional coordinates of the plurality of second key points based on the target object pose information to obtain the second model.
5. The method for obtaining the target object texture map according to claim 3, wherein Using the second model to determine the two-dimensional material image corresponding to the target object image includes: Projecting the second model onto a preset two-dimensional plane to obtain the two-dimensional material image.
6. The method for obtaining the target object texture mapping according to claim 1, wherein Performing texture mapping on the material image to obtain the target object texture map includes: Obtaining the plurality of third key points from the material image; Using the correspondence between the plurality of first key points and the plurality of third key points to map the material image onto the target object image to obtain the target object texture map.
7. A method for obtaining a target object map, characterized in that, Including: Receiving a target object image from a client; Obtain the pose information of the target object in the target object image, adjust the pose of the first model based on the pose information of the target object to obtain a material image corresponding to the target object image, and perform texture mapping on the material image to obtain a target object texture map, where the first model is a three-dimensional target object model in an initial pose, the material image is obtained by projecting a second model onto a preset two-dimensional plane, the second model is obtained by adjusting the pose of the first model, the target object texture map is determined according to the correspondence between a plurality of first key points and a plurality of third key points, the plurality of first key points are the key points of the target object in the target object image, and the plurality of third key points are the key points of the target object in the material image; Send the target object texture map to the client.
8. An apparatus for obtaining a target object map, characterized in that, Comprising: An obtaining module, configured to obtain the pose information of the target object in the target object image; An adjusting module, configured to adjust the pose of the first model based on the pose information of the target object to obtain a material image corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose, the material image is obtained by projecting a second model onto a preset two-dimensional plane, and the second model is obtained by adjusting the pose of the first model; A processing module, configured to perform texture mapping on the material image to obtain a target object texture map, where the target object texture map is determined according to the correspondence between a plurality of first key points and a plurality of third key points, the plurality of first key points are the key points of the target object in the target object image, and the plurality of third key points are the key points of the target object in the material image.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute the method for obtaining a target object texture map according to any one of claims 1 to 7.
10. A processor, characterized in that, The processor is used to run a program, wherein when the program runs, it executes the method for obtaining a target object texture map according to any one of claims 1 to 7.
11. An electronic device, characterized in that, Comprising: A processor; And A memory, connected to the processor, for providing instructions for the processor to perform the following processing steps: Step 1, obtain the pose information of the target object in the target object image; Step 2, adjust the pose of the first model based on the pose information of the target object to obtain a material image corresponding to the target object image, where the first model is a three-dimensional target object model in an initial pose, the material image is obtained by projecting a second model onto a preset two-dimensional plane, and the second model is obtained by adjusting the pose of the first model; Step 3, perform texture mapping on the material image to obtain a target object texture map, where the target object texture map is determined according to the correspondence between a plurality of first key points and a plurality of third key points, the plurality of first key points are the key points of the target object in the target object image, and the plurality of third key points are the key points of the target object in the material image.
Citation Information
Patent Citations
Face three-dimensional reconstruction method and device, electronic device and storage medium
CN109767487A
Image mapping processing method and device, readable medium and electronic equipment
CN111402122A
Face recognition method and device, terminal equipment and storage medium
CN111695431A