Methods, apparatus and electronic devices for generating 3D models
Extract structured data through user input information, match and deform the initial model in the 3D model library, solve the problem of personalized needs of 3D models in immersive teaching, and achieve efficient and beautiful 3D model generation, suitable for a variety of applications scene.
Patent Information
- Application Number
- CN202110099561.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-25
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-01-25
AI Technical Summary
Existing technology is difficult to meet the personalized needs of three-dimensional models in immersive teaching. Professional modeling software has high requirements on users' professional abilities and is unfriendly in interaction methods, resulting in low modeling efficiency.
Obtain 2D images through user input information, perform feature extraction to obtain structured data, match the initial model in the candidate 3D model library, and perform deformation processing to generate a personalized target 3D model, supporting multi-modal input and texture mapping.
It realizes the generation of personalized 3D models according to user needs, improves the user experience and the aesthetics of the 3D model, and is suitable for a variety of application scenarios such as augmented reality and virtual reality education.
Smart Images

Figure CN112785712B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and more specifically, to a method, device and electronic device for generating a three-dimensional model. Background Art
[0002] In immersive teaching application scenarios, a large number of animals or other types of 3D models are needed for demonstration to improve the vividness of the teaching scene and the learning experience of students. Among them, the 3D models can include different types of model data such as those existing in nature and cartoons.
[0003] At present, for the demand for three-dimensional models in this teaching application scenario, one way is to perform retrieval queries based on a large-scale model library, but this method is difficult to meet the personalized requirements of different users. Another way is to use professional modeling software to model the three-dimensional model, but this method has high requirements on the user's professional ability, the user interaction method is not friendly, and the modeling efficiency is low.
[0004] Therefore, how to create a method for generating a three-dimensional model that can meet the personalized needs of users is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The embodiments of the present application provide a method, device and electronic device for generating a three-dimensional model, which can meet the personalized needs of users and improve the user experience.
[0006] In a first aspect, a method for generating a three-dimensional model is provided, comprising: acquiring a two-dimensional image of a target object based on user input information; performing feature extraction on the two-dimensional image to obtain first structured data of the two-dimensional image, wherein the first structured data includes a skeleton line of the target object; according to the first structured data, obtaining an initial three-dimensional model by matching in a candidate three-dimensional model library; and performing deformation processing on the initial three-dimensional model to obtain a target three-dimensional model of the target object.
[0007] Through the technical solution of the embodiment of the present application, a method for generating a target three-dimensional model of a target object corresponding to the target object is provided according to the user input information, which can meet the personalized needs of the user. In addition, in the embodiment of the present application, a unified first structured data of the target object can be obtained according to the multimodal input information of the user, and the first structured data includes the skeleton line of the target object, which can more accurately reflect the structural characteristics of the skeleton of the target object, and further, can be used to characterize the structural characteristics of the joint level in the skeleton. Therefore, the initial three-dimensional model obtained by matching the first structured data has the same structural characteristics as the target object in the user input information, and has a high degree of matching with the user input information. Further, by deforming the initial three-dimensional model, a target three-dimensional model is obtained, which has more personalized features, has a high degree of matching with the user input information, and can further improve the aesthetics of the three-dimensional model, thereby improving the user's experience.
[0008] In combination with the first aspect, in a first implementation method of the first aspect, the initial three-dimensional model is matched in a candidate three-dimensional model library based on the first structured data, including: obtaining second structured data corresponding to the candidate three-dimensional model in the candidate three-dimensional model library; matching the initial three-dimensional model based on an optimization result of an energy equation corresponding to the first structured data and the second structured data.
[0009] Based on the technical solution of the embodiment of the present application, a candidate three-dimensional model library is established, and the candidate three-dimensional models in the candidate three-dimensional model library are matched and reconstructed according to the first structured data determined by the user input information to obtain an initial three-dimensional model, so that the structured information of the initial three-dimensional model matches the user input information.
[0010] In combination with the first implementation method of the first aspect, in the second implementation method of the first aspect, the candidate three-dimensional model includes multiple blocks, and obtaining the second structured data corresponding to the candidate three-dimensional model in the candidate three-dimensional model library includes: obtaining the structured data corresponding to each block in the multiple blocks to obtain the second structured data, wherein the structured data corresponding to each block includes at least one of the following parameters: position parameters, rotation parameters, shape parameters and posture parameters.
[0011] In combination with the first aspect and the above-mentioned implementation manner, in a third implementation manner of the first aspect, the candidate three-dimensional models in the candidate three-dimensional model library include: a topological structure of a joint level, and the topological structure of the joint level includes a skeleton line.
[0012] In an embodiment of the present application, the topological structure of the joint level of the candidate three-dimensional model can be used to support the change processing of the three-dimensional model at the joint level, forming a three-dimensional animation at the joint level, making the three-dimensional model animation more vivid and improving the user experience.
[0013] In combination with the third implementation of the first aspect, in the fourth implementation of the first aspect, the candidate three-dimensional model also includes: a topological structure of texture mapping, and the topological structure of texture mapping includes texture mapping coordinates of each vertex in the mesh of the candidate three-dimensional model.
[0014] In the embodiment of the present application, the topological structure of the texture mapping of the candidate three-dimensional model can be used to support texture mapping of the three-dimensional model and improve the aesthetics of the three-dimensional model.
[0015] In combination with the first aspect and its above-mentioned implementation methods, in a fifth implementation method of the first aspect, the candidate three-dimensional models in the candidate three-dimensional model library include quadruped three-dimensional models and / or biped three-dimensional models; and / or, the candidate three-dimensional models in the candidate three-dimensional model library include global three-dimensional models and / or local three-dimensional models.
[0016] Based on the technical solutions of the embodiments of the present application, the candidate three-dimensional models are not limited to quadruped three-dimensional models, but can also include biped three-dimensional models, or be extended to more types of three-dimensional models. In addition, the candidate three-dimensional models are not limited to global three-dimensional models, but can also include local three-dimensional models, such as only local three-dimensional models such as the head, thereby improving the universality of the three-dimensional model generation method in the embodiments of the present application.
[0017] In combination with the first aspect and its above-mentioned implementation methods, in a sixth implementation method of the first aspect, the initial three-dimensional model is deformed to obtain a target three-dimensional model of the target object, including: performing model conversion on the initial three-dimensional model to obtain an intermediate three-dimensional model; and deforming the intermediate three-dimensional model according to key points in the two-dimensional image to obtain the target three-dimensional model.
[0018] Based on the technical solution of the embodiment of the present application, the three-dimensional model can be further deformed according to the two-dimensional image of the user input information to obtain a three-dimensional model with more personalized features, thereby further improving the vividness of the three-dimensional model.
[0019] In combination with the sixth implementation method of the first aspect, in the seventh implementation method of the first aspect, the initial three-dimensional model is converted to obtain an intermediate three-dimensional model, including: normalizing the posture of the initial three-dimensional model; using a principal component analysis algorithm to process the initial three-dimensional model after posture normalization to obtain the intermediate three-dimensional model.
[0020] In combination with the sixth or seventh implementation method of the first aspect, in the eighth implementation method of the first aspect, the intermediate three-dimensional model is deformed according to the key points in the two-dimensional image to obtain the target three-dimensional model, including: energy optimization of the energy equation corresponding to the intermediate three-dimensional model and the two-dimensional image to deform the intermediate three-dimensional model to obtain the target three-dimensional model, wherein the energy equation includes energy equation terms of the key points in the two-dimensional image and the feature points in the intermediate three-dimensional model corresponding to the key points.
[0021] In combination with the first aspect and its above-mentioned implementation methods, in the ninth implementation method of the first aspect, before the initial three-dimensional model is deformed to obtain the target three-dimensional model, the generation method also includes: obtaining the color and / or texture of the target object based on the user input information; mapping the color and / or texture of the target object to the initial three-dimensional model.
[0022] In combination with the ninth implementation method of the first aspect, in the tenth implementation method of the first aspect, mapping the color and / or texture of the target object to the initial three-dimensional model includes: mapping the color and / or texture of the target object to the initial three-dimensional model according to the topological structure of the texture mapping of the initial three-dimensional model.
[0023] In combination with the first aspect and its above-mentioned implementation methods, in an eleventh implementation method of the first aspect, the user input information includes voice and / or text; the obtaining of a two-dimensional image of the target object based on the user input information includes: performing semantic recognition on the user input information to obtain first semantic information in the user input information, the first semantic information including information of the target object; and according to the first semantic information, matching in an image library to obtain the two-dimensional image of the target object.
[0024] In combination with the first aspect and its above-mentioned implementation methods, in the twelfth implementation method of the first aspect, the user input information includes: an image; obtaining a two-dimensional image of the target object based on the user input information includes: obtaining contour information in the image; and matching the two-dimensional image of the target object in an image library based on the contour information.
[0025] Through the technical solution of the embodiment of the present application, a two-dimensional image of the target object can be obtained under user input information in different modalities, and then a unified first structured data can be obtained. The unified first structured data is convenient for matching with candidate three-dimensional models in the subsequent process, thereby further generating a three-dimensional model consistent with the user input information.
[0026] In combination with the first aspect and the above-mentioned implementation manners, in the thirteenth implementation manner of the first aspect, the generation method also includes: adding the target three-dimensional model to the candidate three-dimensional model library as a candidate three-dimensional model in the candidate three-dimensional model library.
[0027] Based on the technical solution of the embodiment of the present application, the target three-dimensional model after deformation can be added to the candidate three-dimensional model library as one of the candidate three-dimensional models. Compared with the candidate three-dimensional model or the initial three-dimensional model, the target three-dimensional model after deformation may be a new species category. Therefore, adding the deformed target three-dimensional model to the candidate three-dimensional model library can gradually improve the species category in the candidate three-dimensional model library. In the subsequent three-dimensional model generation process, if the species category of the target object in the user input information is the same as the species category of the candidate three-dimensional model in the candidate three-dimensional model library, the candidate three-dimensional model can be directly output to the user as the target three-dimensional model, and the subsequent deformation process can be omitted, thereby improving the generation efficiency of the target three-dimensional model.
[0028] In combination with the first aspect and the above-mentioned implementation manners, in the fourteenth implementation manner of the first aspect, the method is applied to educational scenarios of augmented reality AR and / or virtual reality VR.
[0029] In a second aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, it is used to implement the method for generating a three-dimensional model in the first aspect or any implementation of the first aspect.
[0030] In a third aspect, a three-dimensional model generation device is provided, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call the computer program to execute the three-dimensional model generation method in the above-mentioned first aspect or any one of the implementations of the first aspect.
[0031] In a fourth aspect, an electronic device is provided, comprising: a three-dimensional model generating device as in the third aspect.
[0032] In combination with the fourth aspect, in some implementations of the fourth aspect, the electronic device further includes: an input device, the input device including at least one of the following devices: a voice input device, a text input device, and an image input device. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a logical structure block diagram of a processing system provided according to an embodiment of the present application.
[0034] Figure 2 It is a schematic flowchart of a method for generating a three-dimensional model provided according to an embodiment of the present application.
[0035] Figure 3 It is a schematic diagram of searching for a two-dimensional image of a target object in an image library based on a sketch input by a user.
[0036] Figure 4 It is a schematic diagram of a binary image and its skeleton line provided according to an embodiment of the present application.
[0037] Figure 5 According to the embodiment of the present application, a method corresponding to Figure 2 Schematic diagram of the process of generating a three-dimensional model of the method shown.
[0038] Figure 6 It is a schematic flowchart of another method for generating a three-dimensional model provided according to an embodiment of the present application.
[0039] Figure 7 It is a schematic diagram of a GLoSS model provided according to an embodiment of the present application.
[0040] Figure 8 It is a schematic flowchart of another method for generating a three-dimensional model provided according to an embodiment of the present application.
[0041] Fig. 9 It is a schematic flowchart of another method for generating a three-dimensional model provided according to an embodiment of the present application.
[0042] Fig.10 It is a schematic diagram of forming a target three-dimensional model by fusing an initial three-dimensional model with a color / texture image fragment according to an embodiment of the present application.
[0043] Fig.11 It is a schematic structural block diagram of a three-dimensional model generation device provided according to an embodiment of the present application.
[0044] Fig.12 It is a schematic structural block diagram of another three-dimensional model generation device provided according to an embodiment of the present application.
[0045] Fig.13 It is a schematic structural block diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0047] It should be understood that the specific examples in this article are only intended to help those skilled in the art better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application.
[0048] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0049] It should also be understood that the various implementation methods described in this specification can be implemented individually or in combination, and the embodiments of the present application are not limited to this.
[0050] Unless otherwise stated, all technical and scientific terms used in the embodiments of the present application have the same meaning as those generally understood by those skilled in the art of the present application. The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit the scope of this application. The term "and / or" used in this application includes any and all combinations of one or more related listed items.
[0051] First, a logical structure diagram of a processing system 10 provided by the present application is introduced.
[0052] like Figure 1 As shown, the hardware layer of the processing system 10 includes a central processing unit (CPU) and / or a graphics processing unit (GPU), etc.
[0053] Optionally, the hardware layer of the processing system 10 may also include storage, input / output devices, memory, memory controller, network interface, etc.
[0054] Among them, the input device may include a device for detecting user operations and generating user operation information for indicating the user operations. As an example but not limitation, the input device may include a keyboard, a mouse, a touch screen, a microphone, a handwriting tablet, etc.
[0055] The output device can be used to present visual information such as a user interface, an image or a video. As an example and not limitation, the output device may include a display device such as a liquid crystal display (LCD), a cathode ray tube (Cathode Ray Tube) display, a holographic display or a projector.
[0056] Operating systems (such as Windows, Linux, Android, etc.) and some applications can run on the hardware layer. The core library layer is the core part of the operating system, including input / output services (I / OService), kernel services (Kernel Service), graphics device interface, and graphics engines (Graphics Engine) that implement CPU and GPU graphics processing. The graphics engine may include a 2D engine, a 3D engine, a synthesizer (Composition), a frame buffer (Frame Buffer), etc. In addition, the processing system 10 also includes a driver layer, a framework layer, and an application layer. The driver layer may include a CPU driver, a GPU driver, a display controller driver, etc. The framework layer may include a graphics service (Graphic Service), a system service (System service), a web service (Web Service), and a customer service (Customer Service); in the graphics service, it may include widgets (Widget), canvas (Canvas), views (Views), rendering scripts (RenderScript), etc. The application layer may include a desktop (Launcher), a media player (Media Player), a browser (Browser), etc.
[0057] by Figure 1 For example, the method for generating a three-dimensional model provided in an embodiment of the present application is applied to the above-mentioned processing system 10, and the processing system 10 includes but is not limited to at least one electronic device, and the electronic device includes but is not limited to a terminal device and / or a server, etc., wherein the terminal device can be, for example, a computer, a mobile phone, a wearable mobile device, etc., and the present application does not make specific limitations on this.
[0058] In the related technologies, there are two main technical routes for generating 3D models, namely component splicing technology and model deformation technology. Component splicing technology generates more 3D models from a small number of 3D model samples by splitting and reorganizing the model components. Constraints are imposed through the structured representation of components to control the overall consistency after the components are spliced. Model deformation technology is to perform local and global deformation on a model, and realize personalized feature editing under the premise of model topology constraints, thereby obtaining a new 3D model.
[0059] The method for generating three-dimensional models based on component splicing technology has structural constraints on the components, but there is no more accurate and unified representation of the components themselves, and it relies on the accuracy of component segmentation. For the non-rigid deformation, motion migration and local editing of the model itself, component splicing lacks effective control and optimization, so the aesthetics of the obtained three-dimensional model is poor. In addition, the component splicing technology is mainly used on rigid models. For non-rigid models, such as animals and humans, the model information of the model obtained through component editing will be destroyed, making the versatility of the model worse, which increases the difficulty of feature reconstruction for the user's personalized needs.
[0060] The method for generating three-dimensional models based on model deformation technology needs to establish a personalized model by learning certain topological constraint rules under the premise that the models to be generated have the same structure. Due to the reliance on topological rules, this type of method is suitable for personalized editing of a certain type of specific models with the same structure, and it is difficult to obtain large deformation features to obtain a new three-dimensional model. Therefore, this method also has certain limitations and is difficult to meet the various personalized needs of users.
[0061] Based on the above problems, the present application provides a new method for generating a three-dimensional model, which can generate a three-dimensional model that meets the user's needs, has a beautiful appearance and is universal according to the user's personalized needs.
[0062] The three-dimensional model can be applied to various computer technologies, for example, it can be applied to application computer technologies such as augmented reality (AR) and / or virtual reality (VR). In addition, the three-dimensional model can also be applied to a variety of different scenarios to meet the different needs of different types of customers. In some embodiments, the three-dimensional model can be applied to teaching application scenarios, which can meet the needs of three-dimensional models in teaching application scenarios. Further, the three-dimensional model can be applied to educational scenarios of AR and / or VR, and the generated three-dimensional model can bring a good visual experience to teachers and students.
[0063] Figure 2 FIG. 1 is a schematic flow chart of a method 100 for generating a three-dimensional model provided in an embodiment of the present application. Optionally, the method 100 may be Figure 1 The processing system 10 shown is executed as an execution subject. As an example, the processing system may include a server and / or a terminal, and the method 100 may be executed by the server and / or the terminal.
[0064] like Figure 2 As shown, the method 100 for generating a three-dimensional model may include the following steps.
[0065] S110: Acquire a two-dimensional image of the target object according to user input information.
[0066] S120: Extract features from the two-dimensional image to obtain first structured data of the two-dimensional image, wherein the first structured data includes a skeleton line of the target object.
[0067] S130: According to the first structured data, an initial three-dimensional model is obtained by matching in a candidate three-dimensional model library.
[0068] S140: Perform deformation processing on the initial three-dimensional model to obtain a target three-dimensional model of the target object.
[0069] Specifically, in step S110, the user input information is multimodal information, including but not limited to one or more forms of input information including voice, text, lines, and pictures.
[0070] As an example, if the user input information is voice or text, semantic recognition can be performed on the voice or text to obtain semantic information (Semantic Information) in the voice or text. Specifically, after semantic recognition, the content of the voice or text can be decomposed into interpretable nouns, verbs, adjectives and other corpora, and based on the corpus after word segmentation, the voice or text input by the user is decomposed into first semantic information and second semantic information, wherein the first semantic information includes: relevant information of the target object in the voice or text input by the user, and the second semantic information includes: relevant information of the feature description of the target object.
[0071] The relevant information of the target object includes the type of the 3D model to be generated, and the relevant information of the feature description of the target object may include the posture, color or texture of the target object, etc. For example, if the user inputs "a running white horse", after semantic recognition, the decomposed target object is "horse", and the feature description is "one", "running" and "white".
[0072] Optionally, in some embodiments, the two-dimensional image of the target object can be matched in the image library according to the first semantic information. As an example, in an image library with tags, a two-dimensional image including the target object can be matched in the image library through tag semantic analysis. Optionally, in other embodiments, the two-dimensional image including the target object and satisfying or nearly satisfying the feature description can also be matched in the image library according to both the first semantic information and the second semantic information.
[0073] As another example, if the user input information is an image, such as a picture, including a color picture or a black and white picture, in some embodiments, the picture can be directly used as a two-dimensional image of the target object. In other embodiments, image recognition can also be performed on the picture input by the user to obtain the target object in the picture and related feature descriptions, and the two-dimensional image of the target object is searched in the image library based on the target object and the feature description.
[0074] As another example, if the user input information is a line drawing, for example, the line represents a sketch outline of a target object, then in some embodiments, the sketch outline drawn by the user can be analyzed and the image library can be searched for an image that is closest to the sketch outline as a two-dimensional image of the target object. Alternatively, in other embodiments, the sketch outline drawn by the user can be directly used as the two-dimensional image of the target object. Figure 3 A schematic diagram is shown of searching for a two-dimensional image of a target object in an image library according to a sketch input by a user in this example.
[0075] In the above examples, after processing the voice, text, picture and sketch outline formed by the lines of the user's input information, a two-dimensional image of the target object can be obtained. It can be understood that the target object is used to indicate the type of three-dimensional model required by the user, for example, different animal categories (bipeds, quadrupeds, etc., any category of animals), etc. The target object can be any object that grows naturally, is artificially created, or is artificially imagined in nature or even in the non-natural world. The embodiment of the present application does not specifically limit the target object.
[0076] Optionally, the user input information may include only information of a single mode, such as only voice, text, picture or line sketch, etc. Optionally, the user input information may also include multi-modal information, such as simultaneously including voice and picture, or text and sketch, etc. The specific form of the user input information is not specifically limited in the embodiments of the present application.
[0077] In addition, in the above examples, methods such as speech recognition, image recognition, and image retrieval based on sketches can refer to specific solutions in related technologies. For example, a natural language processing (NLP) algorithm can be used for semantic recognition, a deep learning algorithm can be used for image recognition, and a matching algorithm can be used for image retrieval. Of course, in addition to the algorithm solutions illustrated above, other methods of related technical methods can also be used for implementation. The embodiments of this application do not limit the specific method and will not be repeated here.
[0078] In step S120 , feature extraction is performed on the two-dimensional image of the target object obtained according to the user input information in step S110 to obtain first structured data of the two-dimensional image.
[0079] Specifically, the first structured data of the two-dimensional image can be used to characterize the structural features of the target object. For example, if the target object is an animal or a human, the first structured data can be used to characterize the structural features of its bones, and further, can be used to characterize the structural features of the joint level in the bones.
[0080] In some embodiments, the first structured data may include the skeleton of the target object. The skeleton refers to an object representation that uses a thin curve that is consistent with the connectivity and topological structure of the original shape as an ideal expression. Simply put, it is a simplified graphic located inside the object that can reflect its shape characteristics. It has a branch part that describes the protrusion of the shape and a ring part that describes the internal cavity of the shape. For example, if the target object is an animal, its skeleton can represent the topological structure of the joint level of the animal.
[0081] Specifically, skeleton lines are an important topological description of the geometric form of an image, which consists of some thin lines that show the general shape of an object. Using skeleton lines to represent the original image can reduce redundant information in the image while maintaining the important topological features of the image.
[0082] Optionally, a variety of related technologies can be used to extract features from the two-dimensional image of the target object to obtain first structured data of the two-dimensional image. For example, a thinning algorithm can be used to extract skeleton lines from a binary image corresponding to the two-dimensional image to obtain first structured data.
[0083] As an example, an implementation of the detailed calculation algorithm is described below:
[0084] First, the two-dimensional image is binarized to obtain a binary image;
[0085] Then, the binary image is scanned, and when a pixel with a pixel value of 1 is encountered, the following template is used to process the pixel as follows:
[0086] P9 P2 P3 P8 P1 P4 P7 P6 P5
[0087] The pixel point is used as P1 in the template, that is, the central pixel point. If the pixel point meets the following four conditions at the same time, the pixel value of the pixel point P1 is set to 0, that is, the pixel point P1 is deleted, or the pixel point P1 is eroded.
[0088] Condition (a): 2≤B(P1)≤6;
[0089] Condition (b): A(P1) = 1;
[0090] Condition (c): P2*P4*P6=0;
[0091] Condition (d): P4*P6*P8=0;
[0092] Among them, A(P1) is the number of times two adjacent pixels change from 0 to 1 when the order is P2, P3, ..., P9 (clockwise); B(P1) is the number of non-zero pixels (i.e., the pixel value is 1) in P2, P3, ..., P9.
[0093] The above method is repeated iteratively to continuously erode the pixels in the binary image. The binary image will become thinner and thinner until no new pixels are eroded in the binary image after the last erosion in this iteration. At this time, the iteration ends and the skeleton line of the binary image is obtained.
[0094] As an example, Figure 4 A schematic diagram of a binary image and its skeleton line is shown. The target object in the binary image is a "horse", and the skeleton line of the binary image obtained is the skeleton line of the horse, which contains the structural features of the horse's joint level.
[0095] It is understandable that the above embodiment is only one implementation of a variety of thinning algorithms. Other implementations of thinning algorithms in related technologies, or other skeleton line extraction methods other than thinning algorithms can also be adopted. The embodiments of the present application do not make specific limitations on this.
[0096] Through the above technical solution, a unified first structured data of the target object can be obtained under different modal user input information, and the unified first structured data is convenient for matching with the candidate three-dimensional model in the subsequent process. In addition, in addition to the skeleton line of the target object, the first structured data can also include the contour or cell cavity information corresponding to the skeleton line, or can also include other structured data for characterizing the structural information of the target object.
[0097] Specifically, in step S130, according to the first structured data obtained in step S120 above, an initial three-dimensional model is obtained by matching in a candidate three-dimensional model library.
[0098] In an embodiment of the present application, a candidate 3D model library including at least one candidate 3D model is also provided. After obtaining the unified first structured data of the target object, the first structured data and the second structured data of the candidate 3D model are matched, and the corresponding energy equation is optimized, so as to obtain an initial 3D model by matching in the candidate 3D model library. Optionally, the skeleton line of the initial 3D model is consistent or nearly consistent with the skeleton line of the target object to be created.
[0099] Optionally, in some embodiments, at least one candidate three-dimensional model in the candidate three-dimensional model library has a unified representation form. For example, the at least one candidate three-dimensional model can be a global / local stitched shape (GLoSS) representation form (or in other words, at least one candidate three-dimensional model is a GLoSS model). Through the GLoSS representation form, a template three-dimensional model with excellent topological structure and rich posture information can be obtained, and model transformation is performed based on the template three-dimensional model, with good transformation processing effect.
[0100] Furthermore, in an embodiment of the present application, the at least one candidate three-dimensional model includes but is not limited to a three-dimensional model of a quadruped topological structure or a three-dimensional model of a biped topological structure, and may also be a three-dimensional model of multiple other topological structures to meet the needs of different categories of model changes in more scenarios, thereby making the three-dimensional model generation method provided in the embodiment of the present application more widely applicable.
[0101] Specifically, in step S140, based on the initial three-dimensional model obtained by matching according to the user input information, the initial three-dimensional model is deformed to obtain a target three-dimensional model of the target object.
[0102] Furthermore, in this step, the initial three-dimensional model is deformed to generate a number of personalized deformable models, including the fusion of local and global geometric features, so as to obtain three-dimensional models of various shapes that meet user needs.
[0103] In order to facilitate understanding of the technical solution of this application, Figure 5 FIG. 1 shows a schematic diagram of a process for generating a target three-dimensional model corresponding to the above method 100. Figure 5 As shown in Figure (a) in Figure 2, user input can be in multiple modal input modes. As an example, Figure 5 In Figure (a), the user input information includes relevant information about "horse", and "horse" is the target object corresponding to the user input information. Figure 5 As shown in FIG. (b) in FIG. 1 , the first structured data of the “horse” can be obtained based on the two-dimensional image of the “horse”, such as the skeleton line of the “horse” shown in the figure. Figure 5As shown in Figure (c), based on the skeleton line of the "horse" shown in Figure (b), an initial 3D model with the same structural features of the "horse" can be matched in the 3D model library. Figure 5 As shown in Figure (d), the initial three-dimensional model of the "horse" can be deformed to obtain the optimized target three-dimensional model of the "horse".
[0104] Through the technical solution of the embodiment of the present application, a method for generating a target three-dimensional model of a target object corresponding to the target object is provided according to the user input information, which can meet the personalized needs of the user. In addition, in the embodiment of the present application, a unified first structured data of the target object can be obtained according to the multimodal input information of the user, and the first structured data includes the skeleton line of the target object, which can more accurately reflect the structural characteristics of the skeleton of the target object, and further, can be used to characterize the structural characteristics of the joint level in the skeleton. Therefore, the initial three-dimensional model obtained by matching the first structured data has the same structural characteristics as the target object in the user input information, and has a high degree of matching with the user input information. Further, by deforming the initial three-dimensional model, a target three-dimensional model is obtained, which has more personalized features, has a high degree of matching with the user input information, and can further improve the aesthetics of the three-dimensional model, thereby improving the user's experience.
[0105] Combination of the above Figures 2 to 5 In this application, how to obtain unified first structured data (i.e. Figure 2 Steps S110 and S120 shown in FIG. Figures 6 to 8 , in this application, how to generate a target three-dimensional model of a target object according to the first structured data (ie Figure 2 Step S130 and step S140 shown in FIG. 1 are further explained.
[0106] Figure 6 A schematic flowchart of another three-dimensional model generation method 100 provided in an embodiment of the present application is shown.
[0107] like Figure 6 As shown, the above step S130 may include the following steps.
[0108] S131: Acquire second structured data corresponding to the three-dimensional model in the candidate three-dimensional model library.
[0109] S132: Establishing an energy equation corresponding to the three-dimensional model of the first structured model data and the second structured data.
[0110] S133: According to the optimization result of the energy equation, an initial three-dimensional model is obtained by matching.
[0111] Optionally, the candidate 3D model in the candidate 3D model library in the embodiment of the present application is a GLoSS model. Specifically, the GLoSS model is a 3D articulated model in which the body shape deformation of each component is locally definable. As an example, Figure 7 A schematic diagram of a GLoSS model is shown.
[0112] Optionally, the GLoSS model includes multiple blocks, each of which includes standard data in four dimensions: position parameters, rotation parameters, shape parameters, and posture parameters. For example, the standard data of the i-th block in the multiple blocks are respectively expressed as: position parameter I i , rotation parameter r i , shape parameter s i And the attitude parameter d i In this way, the global geometric information of each block in the GLoSS model can be expressed as:
[0113]
[0114] Among them, π represents the set of standard data in four dimensions, that is, π i = {I i ,r i ,s i ,d i}. p i represents the local coordinates of the i-th block, which can be specifically expressed as:
[0115] vec(p i ) = t i +m p,i +B s,i s i +B p,i d i ;
[0116] Among them, the parameter t i is the block template, m p,i is the vector of the model in the average pose, B s,i represents the shape space matrix, B p,i Represents the attitude space matrix.
[0117] The posture space is obtained by training a set of standard models with different posture data. Through the principal components analysis (PCA) algorithm, an average posture vector m is obtained in the local coordinate system. p,i and the attitude space matrix B containing the offset data p,i .
[0118] The shape space is derived from the definition of each part. The space contains seven deformations of the block template, including overall scale, x-axis scale, y-axis scale, z-axis scale, and stretching along the three axes. Stretching can be converted into a combination of scale changes, such as stretching in the x-axis means equal scale changes in the y-axis and z-axis at the same time.
[0119] In an embodiment of the present application, the structured data of each block in the above-mentioned GLoSS model includes at least one of the standard data of the above-mentioned four dimensions. In the candidate three-dimensional model library, the structured data of multiple blocks in the candidate GLoSS model is the second structured data of the candidate GLoSS model.
[0120] Furthermore, after obtaining the second structured data of the candidate GLoSS model, it is energy optimized with the first structured data obtained according to the user input information to match and obtain an initial three-dimensional model, which is the initial GLoSS model after the candidate GLoSS model is energy optimized.
[0121] Specifically, the energy equation of the second structured data and the first structured data can be expressed as:
[0122] E(Π)=E m (d,s)+E stitch (Π)+E curv (Π)+E data (Π)+E pose (r);
[0123] The energy equation can be understood as the matching and reconstruction process of each block in the candidate GLoSS model for the first structured data, and each term in the equation corresponds to each optimization target. m represents the model shape optimization energy, E stitch Represents the distance of the points inside the associated block, E curv represents the curvature similarity energy, E data represents the sum of the distances from the block to the first structured data point and the sum of the distances from the key points, E pose Indicates the tail posture in the posture action.
[0124] The specific calculation method for each energy is:
[0125]
[0126] Among them, E m (d,s) is the model term, E sm It is a shape-enforced constraint for symmetrical parts, which helps to make the parts of the torso have similar lengths. s Expressed as the Mahalanobis distance of the shape distribution, E drepresents the L2 norm distance. Parameter k sm , k s , k d And k st , k c , k kp , k m2s and k s2m Parameters such as are preset parameters, which may be relevant parameters obtained through data training.
[0127]
[0128] Among them, C ij is the point-to-point correspondence from the i-th block to the j-th block. C represents the correspondence between the blocks.
[0129]
[0130] E data (Π)=k kp E kp (Π)+k m2s E m2s (Π)+k s2m E s2m (Π);
[0131]
[0132]
[0133] Among them, E m2s (Π) is the distance between the second structured data and the first structured data in the candidate GLoSS model, E s2m (Π) is the distance between the first structured data and the second structured data in the candidate GLoSS model, S represents the vertex of the first structured data, and the function ρ is the Geman-McClure robust error equation. kp (Π) is used to match the key points on the candidate GLoSS model with the key points on the first structured data. The calculation method of this item is the sum of the squares of the distances between the corresponding key points.
[0134] Through the above optimization of the energy equation, the candidate GLoSS model can be reconstructed to obtain an initial three-dimensional model matching the first structured data.
[0135] Optionally, in an embodiment of the present application, the candidate 3D models in the candidate 3D model library may include a global 3D model and / or a local 3D model. Optionally, in an embodiment of the present application, the candidate 3D models in the candidate 3D model library may include a quadruped 3D model and / or a biped 3D model.
[0136] It should be noted that, since in the embodiment of the present application, the initial three-dimensional model is reconstructed from the candidate three-dimensional model, optionally, the initial three-dimensional model may also include a global three-dimensional model and / or a local three-dimensional model; optionally, the initial three-dimensional model may also include a quadruped three-dimensional model and / or a biped three-dimensional model.
[0137] Specifically, in the embodiments of the present application, the candidate three-dimensional models and the initial three-dimensional models are not limited to quadruped three-dimensional models, but may also include biped three-dimensional models, or be extended to more types of three-dimensional models. In addition, the candidate three-dimensional models and the initial three-dimensional models are not limited to global three-dimensional models, but may also include local three-dimensional models, such as only local three-dimensional models such as the head, thereby improving the universality of the three-dimensional model generation method in the embodiments of the present application.
[0138] Compared to the three-dimensional model in the related art, the candidate three-dimensional model and the initial three-dimensional model in the embodiment of the present application may include at least one of the following topological structures: the topological structure of the vertex mesh, the topological structure of the texture mapping, and the topological structure of the joint level. Specifically, the topological structure of the vertex mesh includes the arrangement and / or connection relationship of each vertex in the mesh, the topological structure of the texture mapping includes the texture mapping coordinates of each vertex in the mesh, and the topological structure of the joint level includes the skeleton line.
[0139] Specifically, in the embodiment of the present application, in addition to representing the contour information of the candidate 3D model and the initial 3D model through the topological structure of the vertex mesh of the above-mentioned candidate 3D model and the initial 3D model, the topological structure of the joint level of the candidate 3D model and the initial 3D model can also be used to support the change processing of the 3D model at the joint level, forming a 3D animation at the joint level, making the 3D model animation more vivid and improving the user experience. In addition, the topological structure of the texture mapping of the candidate 3D model and the initial 3D model can also be used to support the texture mapping of the 3D model and improve the aesthetics of the 3D model.
[0140] Therefore, based on the technical solution of the embodiment of the present application, by establishing a candidate 3D model library, and according to the first structured data determined by the user input information, matching and reconstructing the candidate 3D models in the candidate 3D model library, an initial 3D model is obtained, so that the structured information of the initial 3D model matches the user input information. Further, the candidate 3D model and the initial 3D model after matching and reconstructing may include a variety of topological structures, based on which a variety of topological structures may support a variety of processing such as joint hierarchy and texture mapping of the 3D model, thereby improving the editability and overall aesthetics of the 3D model.
[0141] Specifically, after the initial three-dimensional model is obtained in the above step S130, the structural information of the initial three-dimensional model is consistent with or close to the user input information. However, the initial three-dimensional model cannot be output to the user as the final three-dimensional model because the personalized feature matching in the model is not further reflected when protecting the structural constraints and optimizing. Therefore, it is necessary to further deform the initial three-dimensional model to further reflect the personalized features so as to obtain the target three-dimensional model that is finally output to the user.
[0142] Figure 8 A schematic flowchart of another three-dimensional model generation method 100 provided in an embodiment of the present application is shown.
[0143] like Figure 8 As shown, the above step S140 may include the following steps.
[0144] S141: Performing model conversion on the initial three-dimensional model to obtain an intermediate three-dimensional model.
[0145] S142: deforming the intermediate three-dimensional model according to the key points in the two-dimensional image to obtain a target three-dimensional model.
[0146] Specifically, in the embodiment of the present application, in order to facilitate deformation processing of the initial three-dimensional model according to the personalized features in the two-dimensional image, so as to mix the initial three-dimensional model with the personalized features, such as posture features, to obtain the target three-dimensional model, the initial three-dimensional model can be firstly transformed to obtain an intermediate three-dimensional model. Specifically, a low-dimensional feature vector can be used to drive the intermediate three-dimensional model to cause it to deform.
[0147] Optionally, the intermediate three-dimensional model may be a skinned multi-animal linear model (SMAL) model, or in other words, the intermediate three-dimensional model adopts a SMAL representation form.
[0148] As an example, if the initial 3D model is a GLoSS model and the intermediate 3D model is a SMAL model, the following method can be used to convert the GLoSS model into a SMAL model:
[0149] First, the GLoSS model is normalized to eliminate the influence of nonlinear factors of each vertex in the GLoSS model block. For example, a linear blending skinning (LBS) algorithm can be used to normalize the GLoSS model. After the posture is eliminated, the shape differences between different models can be measured in Euclidean space.
[0150] Then, by using the principal component analysis algorithm on the posture-normalized GLoSS model, an average three-dimensional model and a corresponding shape offset matrix are obtained. Based on the shape offset matrix and related parameters in the GLoSS model, the energy equation of the SMAL model is optimized to obtain the SMAL model corresponding to the GLoSS model.
[0151] Specifically, the SMAL model can be expressed as a function M(β,θ,γ) of shape parameter β, attitude parameter θ and displacement parameter γ, where the shape parameter β corresponds to the low-dimensional eigenvector of the shape offset matrix, the attitude parameter θ is used to record the rotation angle of each block in the GLoSS model, and the displacement parameter γ is used to record the global displacement of each node in the GLoSS model relative to the root node.
[0152] The energy equation for the registration of the GLoSS model and the SMAL model can be expressed as follows:
[0153] E(β,θ,γ)=E pose (θ)+E s (β)+E data (β,θ,γ);
[0154] Among them, E pose (θ) and E s (β) is the square of the Mahalanobis distance between the SMAL model and the GLoSS model calculated for the posture parameter θ and shape parameter β, respectively. data The calculation method of (β,θ,γ) can refer to E above. data (Π) calculation method.
[0155] By minimizing the above energy equation, the secondary reconstruction result of the GLoSS model can be obtained, that is, the SMAL model. The SMAL model can be used to facilitate subsequent deformation processing to obtain the target three-dimensional model expected by the user.
[0156] After obtaining the intermediate 3D model, namely the SMAL model, the SMAL model is further matched and reconstructed with the 2D image. By optimizing the energy of specific set information, the SMAL model is deformed to obtain the target 3D model expected by the user.
[0157] Specifically, in order to match the SMAL model with the two-dimensional image, the following equation can be minimized:
[0158] E(θ)=E kp (Θ,x)+E silh (Θ,S)+E β (β)+E θ (θ)+E lim (θ);
[0159] The parameter Θ represents a set of parameters to be optimized, which consists of {β,θ,γ,f}, where f represents the focal length. In order to adapt the SMAL model to the object in the two-dimensional image, it is necessary to optimize the energy of the parameters in the Θ set to obtain the optimal match between the SMAL model and the two-dimensional image.
[0160] The first term of the energy equation, E kp is the key point corresponding energy matching, and its expression is as follows:
[0161]
[0162] The parameter ρ represents the Geman-McClure error equation, the label x represents the position of the key point (also called feature point) calibrated on the two-dimensional image, and V kj Indicates the position of the corresponding feature point on the SMAL model. In order to prevent inaccurate calibration, for each feature point in the two-dimensional image, the corresponding relationship with the feature point on the SMAL model is not one-to-one, but one-to-many, that is, one x point corresponds to one three-dimensional point set, k m is the number of key points in a 3D point set. By averaging the set, the influence of key point calibration error can be reduced.
[0163] The second term of the energy equation, Esilh, is the contour optimization, and its expression is as follows:
[0164]
[0165] Among them, parameter S is the true contour, Ds is its distance field, and if x is inside the contour, Ds(x)=0.
[0166] The third and fourth terms of the energy equation correspond to shape and posture optimization, which is consistent with the previous SMAL model establishment.
[0167] In order to prevent abnormal posture, it is necessary to introduce the restricted energy of posture into the above energy equation, that is, the fifth term E of the energy equation lim :
[0168] E lim (θ) = max(θ - θ max ,0)+max(θ min -θ,0);
[0169] Parameter θ max and θ min The maximum and minimum values corresponding to each dimension of θ are the preset rotation angle values.
[0170] Next, we will optimize the energy equation. First, we use the key points to initialize the depth coordinates of γ, and then use the key points to determine the rotation angle θ of each block. i and γ, based on E kp This completes the initialization, so that without optimizing E silh Under the premise of the term, the parameters in the entire Θ set have been determined.
[0171] Then, a hierarchical method can be used to determine the shape and posture parameters to avoid falling into the local optimum. The specific method can refer to the method for determining the shape and posture parameters in the relevant technology, which will not be described in detail here.
[0172] Finally, the energy term E is introduced silh , determining the focal length is very important, and the algorithm forces γ to be close to the original estimate by planning f to all optimization items.
[0173] At this point, through the optimization process of the above energy equation, the deformation processing of the SMAL model based on the feature points in the two-dimensional image can be completed, thereby obtaining the target three-dimensional model expected by the user.
[0174] Based on the technical solution of the embodiment of the present application, the three-dimensional model can be further deformed according to the two-dimensional image of the user input information to obtain a three-dimensional model with more personalized features, thereby further improving the vividness of the three-dimensional model. In the embodiment of the present application, the initial GLoSS model is first converted into an intermediate SMAL model, which has a good matching function with the two-dimensional image, and then the SMAL model is deformed according to the two-dimensional image, so that the deformation processing is efficient and has excellent performance.
[0175] Fig. 9 A schematic flowchart of another three-dimensional model generation method 100 provided in an embodiment of the present application is shown.
[0176] like Fig. 9 As shown, before the above step S140, the method 100 for generating a three-dimensional model according to the embodiment of the present application may further include the following steps.
[0177] S150: Acquire the color and / or texture of the target object according to the user input information.
[0178] S160: Mapping color and / or texture to the initial three-dimensional model.
[0179] See above Figure 1In the description of step S110, in some examples, if the user input information is voice or text, the color information and / or texture information of the target object can be obtained by obtaining the second semantic information, that is, the relevant information including the feature description of the target object, and the corresponding image fragment can be matched in the image library based on the color information and / or texture information. Alternatively, if a two-dimensional image including color and / or texture is directly matched in the image library based on the first semantic information and the second semantic information, the image fragment including color and / or texture can be directly obtained based on the two-dimensional image in the above text.
[0180] In other examples, if the user input information is an image, for example, if it is a color picture, the color and / or texture therein can be directly extracted, or image recognition can be performed on it to obtain the color information and / or texture information of the target object in the picture, and the corresponding image fragment can be matched in the image library based on the color information and / or texture information.
[0181] In other examples, if the user input information is a line drawing, a two-dimensional image of the target object is obtained based on the line drawing, and the color information and / or texture information of the target object can be obtained based on the relevant information in the two-dimensional image, so as to match the corresponding image fragment in the image library based on the color information and / or texture information.
[0182] Furthermore, the image fragments including the color and / or texture of the target object are fused with the initial three-dimensional model to obtain an initial three-dimensional model fused with color and / or texture. Optionally, the initial three-dimensional model includes a topological structure of texture mapping, and the topological structure of texture mapping includes texture mapping coordinates of each vertex in the grid. According to the texture mapping coordinates, the image fragments including the color and / or texture of the target object are mapped to the initial three-dimensional model, and then the initial three-dimensional model with color and / or texture is deformed to obtain a final target three-dimensional model with personalized features and more vivid color and / or texture, thereby further improving the user experience.
[0183] As an example, Fig.10 A schematic diagram is shown of fusing an initial three-dimensional model with a color / texture image fragment to form a target three-dimensional model, where the target three-dimensional model has a better visual effect.
[0184] In an embodiment of the present application, the initial three-dimensional model has a unified representation form, for example, it is a GLoSS representation form, that is, the initial three-dimensional model is a GLoSS model, and the GLoSS model includes a topological structure of texture mapping, so as to facilitate the fusion of color and / or texture into the GLoSS model, and also facilitate subsequent deformation processing based on the GLoSS model fused with color and / or texture, thereby improving the generation efficiency of the target three-dimensional model while ensuring the quality of the target three-dimensional model.
[0185] Optionally, in some embodiments of the present application, the above-mentioned deformed target three-dimensional model can be added to the candidate three-dimensional model library as one of the candidate three-dimensional models. The deformed target three-dimensional model may be a new species category compared to the candidate three-dimensional model or the initial three-dimensional model. Therefore, adding the deformed target three-dimensional model to the candidate three-dimensional model library can gradually improve the species categories in the candidate three-dimensional model library. In the subsequent three-dimensional model generation process, if the species category of the target object in the user input information is the same as the species category of the candidate three-dimensional model in the candidate three-dimensional model library, the candidate three-dimensional model can be directly output to the user as the target three-dimensional model, and the subsequent deformation process is omitted, thereby improving the generation efficiency of the target three-dimensional model.
[0186] In the above, combined Figures 2 to 10 The embodiment of the method for generating a three-dimensional model provided by the present application is described below. Fig.11 and Fig.12 , illustrating an embodiment of the three-dimensional model generation device provided in the present application. It can be understood that the three-dimensional model generation device of the following application embodiment may correspond to the execution subject of the three-dimensional model generation method of the above application embodiment, and the operation and / or function of each unit in the three-dimensional model generation device are respectively for realizing the corresponding process of each of the aforementioned methods. For the sake of brevity, no further details will be given below.
[0187] Fig.11 A schematic structural block diagram of a three-dimensional model generation device 200 provided in an embodiment of the present application is shown.
[0188] like Fig.11 As shown, the three-dimensional model generating device 200 may include:
[0189] The acquisition unit 210 is used to acquire user input information;
[0190] The processing unit 220 is used to obtain a two-dimensional image of the target object according to the user input information, and perform feature extraction on the two-dimensional image to obtain first structured data of the two-dimensional image, wherein the first structured data includes a skeleton line of the target object;
[0191] The generating unit 230 is used to obtain an initial three-dimensional model by matching in a candidate three-dimensional model library according to the first structured data, and to perform deformation processing on the initial three-dimensional model to obtain a target three-dimensional model of the target object.
[0192] In some embodiments, the generation unit 230 is used to: obtain second structured data corresponding to the candidate three-dimensional model in the candidate three-dimensional model library; and match the initial three-dimensional model according to the optimization result of the energy equation corresponding to the first structured data and the second structured data.
[0193] In some embodiments, the generation unit 230 is used to obtain structured data corresponding to each block in multiple blocks to obtain second structured data, wherein the structured data corresponding to each block includes at least one of the following parameters: position parameter, rotation parameter, shape parameter and posture parameter.
[0194] Optionally, the candidate three-dimensional models in the candidate three-dimensional model library include: a topological structure at a joint level, and the topological structure at a joint level includes skeleton lines.
[0195] Optionally, the candidate three-dimensional model further includes: a topological structure of texture mapping, and the topological structure of texture mapping includes texture mapping coordinates of each vertex in the mesh of the candidate three-dimensional model.
[0196] Optionally, the candidate three-dimensional models in the above-mentioned candidate three-dimensional model library include quadruped three-dimensional models and / or biped three-dimensional models; and / or, the candidate three-dimensional models in the candidate three-dimensional model library include global three-dimensional models and / or local three-dimensional models.
[0197] In some implementations, the generation unit 230 is used to: perform model conversion on the initial three-dimensional model to obtain an intermediate three-dimensional model; and deform the intermediate three-dimensional model according to key points in the two-dimensional image to obtain a target three-dimensional model.
[0198] In some implementations, the generation unit 230 is used to: perform posture normalization on the initial three-dimensional model; and process the posture-normalized initial three-dimensional model using a principal component analysis algorithm to obtain an intermediate three-dimensional model.
[0199] In some embodiments, the generation unit 230 is used to: perform energy optimization on the energy equation corresponding to the intermediate three-dimensional model and the two-dimensional image to deform the intermediate three-dimensional model to obtain a target three-dimensional model, wherein the energy equation includes energy equation terms of key points in the two-dimensional image and feature points in the intermediate three-dimensional model corresponding to the key points.
[0200] In some embodiments, the generation unit 230 is further configured to: obtain the color and / or texture of the target object according to user input information; and map the color and / or texture to the initial three-dimensional model.
[0201] In some embodiments, the generating unit 230 is configured to map color and / or texture to the initial three-dimensional model according to a topological structure of texture mapping of the initial three-dimensional model.
[0202] In some embodiments, the user input information includes voice and / or text; the processing unit 220 is used to: perform semantic recognition on the user input information to obtain first semantic information in the user input information, where the first semantic information includes information of the target object; and match a two-dimensional image of the target object in the image library based on the first semantic information.
[0203] In some implementations, the user input information includes: an image; the processing unit 220 is used to: obtain contour information in the image; and obtain a two-dimensional image of the target object by matching in an image library according to the contour information.
[0204] In some implementations, the generating unit 230 is further configured to: add the target three-dimensional model to the candidate three-dimensional model library as a candidate three-dimensional model in the candidate three-dimensional model library.
[0205] In some embodiments, the generating device 200 is applied to educational scenarios of augmented reality AR and / or virtual reality VR.
[0206] Fig.12 A schematic structural block diagram of another three-dimensional model generating device 200 provided in an embodiment of the present application is shown.
[0207] like Fig.12 As shown, the generating device 200 may include a processor 201 and may further include a memory 202 .
[0208] It should be understood that the memory 202 is used to store computer executable instructions.
[0209] The memory 202 may be various types of memories, for example, may include high-speed random access memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory, which is not limited in the embodiments of the present application.
[0210] The processor 201 is used to access the memory 202 and execute the computer executable instructions to perform the operations in the method for generating a three-dimensional model in the above-mentioned embodiment of the present application. The processor 201 may include a microprocessor, a field programmable gate array (Field Programmable Gate Array, FPGA), a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), etc., and the embodiment of the present application is not limited to this.
[0211] Optionally, in some implementations, the processor 201 may include the above Fig.11 The acquisition unit 210, the processing unit 220 and the generation unit 230 therein.
[0212] Fig.13 A schematic structural block diagram of an electronic device provided by the present application is shown.
[0213] like Fig.13 As shown, the electronic device 20 may include: a device 200 for generating the above-mentioned three-dimensional model.
[0214] Optionally, the electronic device 20 may further include: an input device 300. As an example, the input device 300 includes but is not limited to: a voice input device, a text input device and an image input device.
[0215] An embodiment of the present application also provides a computer storage medium on which a computer program is stored, and the computer program is used to execute the method of the above method embodiment.
[0216] The embodiment of the present application also provides a computer program product including a computer program, where the computer program is used to execute the method of the above method embodiment.
[0217] Specifically, in the above two application embodiments, when the computer program is executed by the processor of the electronic device, the electronic device executes the method of the above method embodiment.
[0218] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0219] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0220] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, 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, such as 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 devices or units, which can be electrical, mechanical or other forms.
[0221] 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.
[0222] In addition, each functional unit in each embodiment of the present application 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.
[0223] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating a three-dimensional model, It is characterized in that include: Acquire a two-dimensional image of the target object according to user input information, wherein the user input information includes: input information in one or more forms of voice, text, line, and picture; Performing feature extraction on the two-dimensional image to obtain first structured data of the two-dimensional image, wherein the first structured data includes a skeleton line of the target object; According to the first structured data, an initial three-dimensional model is obtained by matching in a candidate three-dimensional model library, wherein the candidate three-dimensional models in the candidate three-dimensional model library include: a topological structure at a joint level and a topological structure of a texture mapping, the topological structure at the joint level includes a skeleton line, and the topological structure of the texture mapping includes texture mapping coordinates of each vertex in a mesh of the candidate three-dimensional model; Performing deformation processing on the initial three-dimensional model to obtain a target three-dimensional model of the target object; The step of obtaining an initial three-dimensional model by matching the candidate three-dimensional model library according to the first structured data includes: Acquire second structured data corresponding to the candidate three-dimensional model in the candidate three-dimensional model library; According to the optimization result of the energy equation corresponding to the first structured data and the second structured data, matching and obtaining the initial three-dimensional model; The candidate three-dimensional model includes a plurality of blocks, and the obtaining of second structured data corresponding to the candidate three-dimensional model in the candidate three-dimensional model library includes: Acquire structured data corresponding to each of the multiple blocks to acquire the second structured data, wherein the structured data corresponding to each block includes at least one of the following parameters: position parameter, rotation parameter, shape parameter and posture parameter; The candidate three-dimensional models in the candidate three-dimensional model library include quadruped three-dimensional models and / or biped three-dimensional models; The step of performing deformation processing on the initial three-dimensional model to obtain a target three-dimensional model of the target object includes: Performing model conversion on the initial three-dimensional model to obtain an intermediate three-dimensional model; Deforming the intermediate three-dimensional model according to the key points in the two-dimensional image to obtain the target three-dimensional model; The step of converting the initial three-dimensional model to obtain an intermediate three-dimensional model includes: Normalizing the initial three-dimensional model; Using a principal component analysis algorithm to process the initial three-dimensional model after posture normalization to obtain the intermediate three-dimensional model; The step of deforming the intermediate three-dimensional model according to the key points in the two-dimensional image to obtain the target three-dimensional model includes: Energy optimization is performed on the energy equation corresponding to the intermediate three-dimensional model and the two-dimensional image to deform the intermediate three-dimensional model to obtain the target three-dimensional model, wherein the energy equation includes energy equation terms of key points in the two-dimensional image and feature points in the intermediate three-dimensional model corresponding to the key points.
2. The generation method according to claim 1, It is characterized in that The candidate three-dimensional models in the candidate three-dimensional model library also include global three-dimensional models and / or local three-dimensional models.
3. The generation method according to claim 1 or 2, It is characterized in that Before deforming the initial three-dimensional model to obtain the target three-dimensional model, the generation method further includes: Acquire the color and / or texture of the target object according to the user input information; The color and / or texture of the target object is mapped to the initial three-dimensional model.
4. The generation method according to claim 3, It is characterized in that Mapping the color and / or texture of the target object to the initial three-dimensional model includes: The color and / or texture of the target object is mapped to the initial three-dimensional model according to the topological structure of the texture mapping of the initial three-dimensional model.
5. The generation method according to claim 1 or 2, It is characterized in that The user input information includes voice and / or text; The step of acquiring a two-dimensional image of the target object according to user input information includes: Performing semantic recognition on the user input information to obtain first semantic information in the user input information, where the first semantic information includes information of the target object; The two-dimensional image of the target object is obtained by matching in an image library according to the first semantic information.
6. The generation method according to claim 1 or 2, It is characterized in that The user input information includes: images; The step of acquiring a two-dimensional image of the target object according to user input information includes: Acquire contour information in the image; The two-dimensional image of the target object is obtained by matching in an image library according to the contour information.
7. The generation method according to claim 1 or 2, It is characterized in that The generating method further comprises: The target three-dimensional model is added to the candidate three-dimensional model library as a candidate three-dimensional model in the candidate three-dimensional model library.
8. The generation method according to claim 1 or 2, It is characterized in that The generation method is applied to educational scenarios of augmented reality AR and / or virtual reality VR.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for generating a three-dimensional model according to any one of claims 1 to 8 is implemented.
10. A device for generating a three-dimensional model, It is characterized in that include: The method comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the method for generating a three-dimensional model as claimed in any one of claims 1 to 8.
11. An electronic device, It is characterized in that include: The three-dimensional model generating device as claimed in claim 10; as well as The input device includes at least one of the following devices: a voice input device, a text input device, and an image input device.
