Method and device for generating virtual model and storage medium

Through target recognition and three-dimensional reconstruction technology, combined with real-time rendering, it solves the problems of low accuracy and efficiency of virtual model generation in the existing technology, achieves efficient and accurate virtual model generation and virtual experience, and provides users with a realistic virtual environment.

CN118657908APending Publication Date: 2024-09-17CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410796851.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The existing technology has problems of low accuracy and efficiency when generating virtual models, and cannot provide a realistic virtual experience. In particular, the method of obtaining a virtual model based on scanning physical entities is affected by equipment accuracy and software processing, while manual modeling is affected by skill level and Due to the influence of subjective factors, simple physical simulation cannot accurately simulate object behavior and interaction.

Method used

By collecting multiple image data, use the target recognition model to identify the target object to be reconstructed, and mark it. The three-dimensional reconstruction model performs feature extraction and reconstruction, and combines real-time rendering technology to generate a virtual model to reduce invalid feature information and improve efficiency and accuracy. , and interact in real time in the virtual scene.

Benefits of technology

It improves the efficiency and accuracy of generating virtual models, provides a more realistic virtual experience, can interact with users in real time, and enhances the immersion and experience quality of the virtual environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657908A
    Figure CN118657908A
Patent Text Reader

Abstract

The embodiment of the invention provides a method and equipment for generating a virtual model and a storage medium. The method comprises the steps that multiple pieces of image data are collected, the multiple pieces of image data are input into a target recognition model, a target image is obtained, and at least one marked to-be-reconstructed target object exists in the target image; inputting the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked to-be-reconstructed target object; and rendering the three-dimensional model in real time to obtain a virtual model of the at least one target object to be reconstructed. The method is used for achieving the effects of improving the efficiency and accuracy of generating the virtual model and providing more real virtual experience for a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a method, device and storage medium for generating a virtual model. Background Art

[0002] Based on the physical entities in the real world, the technology of generating virtual models in a virtual environment by using technologies such as 3D reconstruction and virtual reality is widely used in various industries such as education, medical treatment, and games. At present, physical entities can be scanned by scanning equipment, and the scanned images can be converted into virtual models. Physical simulation technology can also be used to simulate physical laws and behaviors to present objects in a virtual environment, such as movement, collision, and deformation. In addition, manual modeling technology is still a commonly used method, which requires professional modelers to manually create object models using computer-aided design software.

[0003] However, the method of obtaining virtual models based on scanning physical entities is limited by scanning accuracy and equipment. At the same time, the software that processes the scanned data will also affect the accuracy and efficiency of the generated virtual model. Manual modeling may be affected by the skill level and subjective factors of the modeler, resulting in low accuracy of object presentation. In addition, simple physical simulation cannot accurately simulate the behavior and interaction of objects, resulting in unsatisfactory object presentation in the virtual environment, reducing the user's immersion and experience quality.

[0004] Therefore, in the prior art, the technology of generating virtual models based on physical entities has problems of low accuracy and efficiency, and cannot provide users with a realistic virtual experience. Summary of the invention

[0005] The embodiments of the present application provide a method, device and storage medium for generating a virtual model, so as to improve the efficiency and accuracy of generating a virtual model and provide users with a more realistic virtual experience.

[0006] In a first aspect, an embodiment of the present application provides a method for generating a virtual model, comprising:

[0007] Collecting a plurality of image data and inputting the plurality of image data into a target recognition model to obtain a target image, wherein the target image contains at least one marked target object to be reconstructed;

[0008] Inputting the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked target object to be reconstructed;

[0009] The three-dimensional model is rendered in real time to obtain a virtual model of the at least one target object to be reconstructed.

[0010] In a possible implementation, inputting the plurality of image data into a target recognition model to obtain a target image includes:

[0011] For any image data among the plurality of image data, extract features from the image data, and determine at least one candidate region according to the extracted feature data;

[0012] Identify a target object in the at least one candidate area to obtain target object information, where the target object information is used to indicate a position and a category of the target object;

[0013] Determine the target object corresponding to the target object information having an associated relationship in the plurality of image data as the target object to be reconstructed;

[0014] The target object to be reconstructed is marked to obtain the target image.

[0015] In a possible implementation, inputting the target image into a three-dimensional reconstruction model to obtain the three-dimensional model of the at least one marked target object to be reconstructed includes:

[0016] For at least one marked target object to be reconstructed in the target image, obtaining a depth map of the target object to be reconstructed, and performing multi-scale semantic segmentation on the target object to be reconstructed to obtain a multi-scale semantic segmentation set;

[0017] Determining a target depth map of the target object to be reconstructed according to the semantic segmentation set and the depth map of the target object to be reconstructed;

[0018] Constructing a three-dimensional point cloud of the target object to be reconstructed according to the target depth map;

[0019] The three-dimensional point cloud is preprocessed, and a three-dimensional model of the target object to be reconstructed is generated based on the pre-processed three-dimensional point cloud.

[0020] In a possible implementation, the performing real-time rendering on the three-dimensional model to obtain the virtual model of the at least one target object to be reconstructed includes:

[0021] Receive user interaction instructions;

[0022] Based on the preset interaction rules and interaction methods, generating an interaction response corresponding to the interaction instruction;

[0023] According to the interactive reaction, the three-dimensional model is rendered in real time to obtain a virtual model of the at least one target object to be reconstructed, and the virtual model is used to complete the interactive action corresponding to the interactive reaction.

[0024] In a possible implementation, the performing real-time rendering on the three-dimensional model to obtain the virtual model of the at least one target object to be reconstructed includes:

[0025] Based on the preset virtual scene, set the parameters of the rendering model;

[0026] The three-dimensional model is input into the rendering model, and real-time rendering is performed on the three-dimensional model to obtain the virtual model.

[0027] In a possible implementation, after performing real-time rendering processing on the three-dimensional model to obtain the virtual model, the method further includes:

[0028] The rendering effect of the virtual model is monitored in real time, and the rendering model is optimized according to the rendering effect.

[0029] In a possible implementation, before inputting the plurality of image data into a target recognition model to obtain a target image, wherein at least one marked target object to be reconstructed exists in the target image, the method further includes:

[0030] Acquire an image data set, wherein the image data in the image data set includes multi-view image data, the multi-view image data carries attribute information of a target object to be reconstructed, and the attribute information is used to indicate a position and a category of the target object to be reconstructed;

[0031] Performing data enhancement on the image dataset, and dividing the data enhanced image dataset into a training set and a validation set;

[0032] Using the image data in the training set to train the initial recognition model, and obtaining a recognition result of the target object to be reconstructed;

[0033] Based on the recognition result and the attribute information carried by the image data, the initial recognition model is optimized to obtain an intermediate recognition model;

[0034] The intermediate recognition model is evaluated using the image data in the verification set, and parameters of the intermediate recognition model are adjusted according to the evaluation result to obtain a target recognition model.

[0035] In a second aspect, an embodiment of the present application provides a device for generating a virtual model, including:

[0036] An acquisition module, used for acquiring a plurality of image data;

[0037] A target recognition module, used for inputting the plurality of image data into a target recognition model to obtain a target image;

[0038] A three-dimensional reconstruction module, used for inputting the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked target object to be reconstructed;

[0039] The rendering module is used to perform real-time rendering on the three-dimensional model to obtain a virtual model of the at least one target object to be reconstructed.

[0040] In a possible implementation, the device further includes: a processing module and a determination module;

[0041] The processing module is used to extract features from any image data among the plurality of image data, and determine at least one candidate region according to the extracted feature data;

[0042] The target recognition module is specifically used to recognize the target object in the at least one candidate area to obtain the target object information;

[0043] The determination module is used to determine the target object corresponding to the target object information having an associated relationship in the plurality of image data as the target object to be reconstructed;

[0044] The processing module is further used to perform marking processing on the target object to be reconstructed to obtain the target image.

[0045] In a possible implementation manner, the device further includes: an acquisition module;

[0046] The acquisition module is used to acquire a depth map of the target object to be reconstructed for at least one marked target object to be reconstructed in the target image;

[0047] The processing module is further used to perform multi-scale semantic segmentation on the target object to be reconstructed to obtain a multi-scale semantic segmentation set;

[0048] The determination module is further used to determine a target depth map of the target object to be reconstructed according to the semantic segmentation set and the depth map of the target object to be reconstructed;

[0049] The three-dimensional reconstruction module is specifically used to construct a three-dimensional point cloud of the target object to be reconstructed according to the target depth map;

[0050] The three-dimensional reconstruction model is specifically used to pre-process the three-dimensional point cloud and generate a three-dimensional model of the target object to be reconstructed based on the pre-processed three-dimensional point cloud.

[0051] In a possible implementation manner, the device further includes: a receiving module;

[0052] The receiving module is used to receive the user's interactive instructions;

[0053] The processing module is further used to generate an interaction response corresponding to the interaction instruction based on a preset interaction rule and interaction mode;

[0054] The rendering module is further used to render the three-dimensional model in real time according to the interactive response to obtain a virtual model of the at least one target object to be reconstructed.

[0055] In a possible implementation, the processing module is further used to set parameters for the rendering model based on a preset virtual scene;

[0056] The rendering module is specifically used to input the three-dimensional model into the rendering model, perform real-time rendering processing on the three-dimensional model, and obtain the virtual model.

[0057] In a possible implementation, the rendering module is further used to monitor the rendering effect of the virtual model in real time, and optimize the rendering model according to the rendering effect.

[0058] In a possible implementation, the device further includes: a training module and a verification module;

[0059] The acquisition module is also used to acquire an image data set;

[0060] The processing module is further used to perform data enhancement on the image data set, and divide the image data set after data enhancement into a training set and a verification set;

[0061] The training module is used to train the initial recognition model using the image data in the training set to obtain the recognition result of the target object to be reconstructed;

[0062] The training module is further used to optimize the initial recognition model based on the recognition result and the attribute information carried by the image data to obtain an intermediate recognition model;

[0063] The verification module is used to evaluate the intermediate recognition model using the image data in the verification set, and adjust the parameters of the intermediate recognition model according to the evaluation result to obtain the target recognition model.

[0064] In a third aspect, an embodiment of the present application provides a device for generating a virtual model, including: a memory, a processor;

[0065] The memory stores computer-executable instructions;

[0066] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0068] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0069] The embodiment of the present application provides a method, device and storage medium for generating a virtual model, which collects multiple image data, and uses a target recognition model to identify the target object to be reconstructed in the multiple image data. At the same time, the target image including the target object to be reconstructed is marked, and the three-dimensional reconstruction model extracts features and reconstructs the target object to be reconstructed according to the mark to obtain a three-dimensional model of the target object to be reconstructed. Finally, the three-dimensional model is rendered in real time to obtain a virtual model of the target object to be reconstructed. The method uses the target recognition model to mark the position of the target object to be reconstructed, which greatly reduces the invalid feature information extracted during the three-dimensional reconstruction process and improves the efficiency and accuracy of generating virtual models. In addition, the method uses real-time rendering technology to render the three-dimensional model, which is more conducive to responding to the user's interactive request in a timely manner and providing the user with a more realistic virtual experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0071] Figure 1 A schematic diagram of a method for generating a virtual model provided in this application Figure 1 ;

[0072] Figure 2 A schematic diagram of a method for generating a virtual model provided in this application Figure 2 ;

[0073] Figure 3 A schematic diagram of a method for training a target recognition model provided in this application Figure 1 ;

[0074] Figure 4 A schematic diagram of the structure of a device for generating a virtual model provided by the present application;

[0075] Figure 5 A schematic diagram of the structure of a device for generating a virtual model provided in this application.

[0076] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0077] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0078] Combining 3D reconstruction technology with virtual reality technology, based on physical entities in the real environment, presents a virtual model of the physical entity in the virtual environment, which can provide users with a more realistic virtual experience. At present, virtual models are usually generated in the virtual environment by scanning and capturing the feature information of the object and physical simulation technology. In addition, manual modeling technology is still a common method at this stage.

[0079] Among them, the scanning-based object feature capture technology uses a three-dimensional scanner or camera to scan objects in the real world, and then converts the scanned three-dimensional point cloud and other feature data into a model in a virtual environment. Although this method can provide a more realistic appearance, the accuracy and speed of obtaining the virtual model are still limited by the scanning accuracy of the hardware equipment. Moreover, the software that processes the scanned data may also have problems with accuracy and efficiency. In addition, physical simulation technology presents objects in a virtual environment by simulating physical laws and behaviors, such as motion, collision, and deformation. However, simple physical simulation cannot meet users' requirements for realism and fidelity, especially when complex interactions and deformations are involved. In addition, manual modeling technology requires professional modelers to manually create object models using computer-aided design software. Although a certain degree of refinement can be achieved, it requires a lot of time and manpower, is costly, and cannot fully and accurately capture the details and behaviors of the object.

[0080] Therefore, the existing technology of generating virtual models based on physical entities cannot take into account the accuracy, efficiency and cost of generating virtual models at the same time, which reduces the user's virtual experience.

[0081] In response to the problems existing in the prior art, the present application provides a method for generating a virtual model, by performing target recognition on the collected image data, determining the target object to be reconstructed, and marking the target object to be reconstructed, and then using 3D reconstruction technology to perform three-dimensional reconstruction of the target object to be reconstructed in the image data to obtain a three-dimensional model of the target object to be reconstructed, and finally, rendering the three-dimensional model of the target object to be reconstructed in real time to obtain a virtual model of the target object to be reconstructed. While improving the accuracy and efficiency of generating virtual models, the present application provides users with a more realistic virtual experience through real-time rendering, and the virtual model that can interact with users in real time in the virtual scene.

[0082] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0083] Figure 1 A schematic diagram of a method for generating a virtual model provided in this application Figure 1 ,like Figure 1 As shown, the method includes:

[0084] S101, collecting multiple image data, and inputting the multiple image data into a target recognition model to obtain a target image.

[0085] Among them, there is at least one marked target object to be reconstructed in the target image, and the target recognition model determines the target object to be reconstructed by identifying and classifying each target object in the image. The target recognition model marks the target object to be reconstructed to facilitate the determination of the target object for subsequent three-dimensional reconstruction.

[0086] Optionally, the collected raw image data is first preprocessed to remove image noise points and perform image enhancement to improve the accuracy and stability of subsequent target recognition of the image data. Then, the image data obtained after preprocessing is input into the target recognition model to extract feature information of the image data, and based on the feature information, the target object to be reconstructed is determined from the image data and marked to obtain the target image. The mark of the target object to be reconstructed is used to indicate the position of the target object to be reconstructed in the image data, for example, a bounding box of appropriate size is drawn around the target object to be reconstructed to locate it.

[0087] It should be noted that hardware devices such as sensors and cameras may be used to collect image data, and the image data includes multi-view images.

[0088] S102: Input the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked target object to be reconstructed.

[0089] The target image includes at least one image data carrying a mark of the reconstructed target object.

[0090] Specifically, the 3D reconstruction model determines the feature extraction area according to the mark of the target object to be reconstructed in the target image, processes and fuses the extracted feature information of at least one target object to be reconstructed, determines the 3D shape information of the target object to be reconstructed, and performs operations including but not limited to gridding, surface fitting, texture mapping, etc. on the 3D shape information to obtain the 3D model of the target object to be reconstructed. The 3D reconstruction model in this method only extracts features of the target object in the marked area, avoids the influence of other environmental factors such as background on the 3D reconstruction, and improves the efficiency and accuracy of 3D reconstruction.

[0091] Optionally, the generated 3D model can also be optimized to improve the quality and realism of the 3D model, for example, removing unnecessary details, filling holes, smoothing surfaces, etc.

[0092] S103: Render the three-dimensional model in real time to obtain a virtual model of the at least one target object to be reconstructed.

[0093] Optionally, according to a preset virtual scene, the scene information of the rendering model is set, and then the three-dimensional model is input into the rendering model, and the three-dimensional model is rendered in real time to obtain a virtual model based on the virtual scene. The setting of the scene information includes the setting of environmental effects such as lighting and shadows required for the scene. For example, different types of light sources, such as parallel light, point light sources, spotlights, etc., are added, and dynamic shadow effects are realized to improve the realism of the scene.

[0094] Optionally, a rendering engine may be used to render the 3D model. In addition, during the rendering process, the material and texture of the 3D model may be set to increase the realism of the object. The material setting includes the setting of diffuse reflection, highlight, and normal map, and the texture setting includes image or process-generated texture.

[0095] The method for generating a virtual model provided in an embodiment of the present application is based on the collected multi-angle image data, and multiple image data are identified through a target recognition model to determine the target object to be reconstructed in the target image data, and the target object to be reconstructed is marked to reduce the invalid feature information extracted in the later three-dimensional reconstruction. Then, the image data of the marked target object to be reconstructed is three-dimensionally reconstructed using the three-dimensional reconstruction model to obtain a three-dimensional model, and the three-dimensional model is rendered in real time to present the virtual model of the target object to be reconstructed in the virtual scene. Based on the marking of image data, this method reduces the invalid feature information extracted by three-dimensional reconstruction and improves the efficiency and accuracy of generating virtual models. At the same time, this method adopts real-time rendering technology, combined with a preset virtual scene, to present the virtual model in the virtual scene, so that the generated virtual model is adapted to the virtual scene, providing users with a more realistic virtual experience.

[0096] Figure 2 A schematic diagram of a method for generating a virtual model provided in this application Figure 2 ,like Figure 2 As shown, in this embodiment Figure 1 Based on the embodiment, a method for generating a virtual model is described in detail, the method comprising:

[0097] S201, collecting multiple image data.

[0098] The explanation of step S201 is similar to that of the above step S101 and will not be repeated here.

[0099] S202: For any image data among the multiple image data, perform feature extraction on the image data, and determine at least one candidate region according to the extracted feature data.

[0100] Optionally, multiple image data are input into a target recognition model, feature extraction is performed on the image data, the extracted feature map is analyzed and processed, and at least one candidate region in each image data is determined, the candidate region includes a target object to be determined, and carries coordinates representing its position information, and the category of the target object to be determined in the candidate region, and the candidate region is determined by the matching degree between the category of the target object to be determined in the candidate region and the category of the target object to be reconstructed. For example, when the matching degree between the category of the target object to be determined in a certain region and the category of the target object to be reconstructed is greater than a preset matching degree, the region is determined as a candidate region. In addition, the position information of the candidate region is represented by the coordinates from its upper left corner to the lower right corner. For example, the position information of the candidate region 01 is [(2, 3), (2, 1), (4, 2), (4, 1)], where (2, 3) is the upper left corner coordinate of the candidate region 01, (2, 1) is the lower left corner coordinate of the candidate region 01, (4, 2) is the upper right corner coordinate of the candidate region 01, and (4, 2) is the lower right corner coordinate of the candidate region 01.

[0101] S203: Identify the target object in the at least one candidate area to obtain the target object.

[0102] Optionally, feature data of a target object to be determined in a candidate area is segmented to obtain multiple sub-feature data of the target object, the multiple sub-feature data are identified to obtain a probability that each sub-feature data is a target object to be reconstructed, the probabilities of the multiple sub-feature data are averaged, and based on the average value and a preset average value threshold, a target object to be determined in at least one candidate area is determined as a target object, and the target object carries target object information, and the target object information is used to indicate a position and a category of the target object.

[0103] S204: Determine the target object corresponding to the target object information having an associated relationship in the plurality of image data as the target object to be reconstructed; and perform labeling processing on the target object to be reconstructed to obtain the target image.

[0104] Optionally, target object information corresponding to multiple image data is matched, and target objects whose category relevance in the target information object reaches a preset category relevance are determined as target objects to be reconstructed. For example, the category corresponding to image data 1 is the front of a black van, the category corresponding to image data 2 is the white door, the category corresponding to image data 3 is the body of a black van, and the category corresponding to image data 4 is the rear of a small car. According to the categories carried by the above four image data, the target objects in image data 1 and image data 3 are marked as target objects to be reconstructed, and image data 1 and image data 3 are output as target images.

[0105] Optionally, the target object to be reconstructed is marked according to the position coordinates carried by the target object to be reconstructed. The mark is used to indicate the position of the target object to be reconstructed, so that the three-dimensional reconstruction model only extracts features of the target object to be reconstructed in the marked area, which greatly reduces the invalid feature points extracted during the three-dimensional reconstruction process and improves the efficiency and accuracy of the three-dimensional reconstruction.

[0106] S205 . For at least one marked target object to be reconstructed in the target image, obtain a depth map of the target object to be reconstructed, and perform multi-scale semantic segmentation on the target object to be reconstructed to obtain a multi-scale semantic segmentation set.

[0107] Optionally, based on the marked area in the target image, a semantic segmentation model is used to perform multi-scale sampling on the target object to be reconstructed to obtain multi-scale feature information of the target object to be reconstructed, and based on the association information between image pixels in the multi-scale feature information, the feature information of the target image is classified to establish a semantic label for each pixel of the target object to be reconstructed, and then, an image mask of the target object to be reconstructed is generated based on the semantic label and the multi-scale feature information of the target image. For example, in the target image, adjacent pixels or pixels with similar colors are more likely to belong to the same category. Finally, based on the image mask of the target object to be reconstructed, the target image is segmented to generate a multi-scale semantic segmentation set.

[0108] S206 . Determine a target depth map of the target object to be reconstructed according to the semantic segmentation set and the depth map of the target object to be reconstructed.

[0109] Specifically, based on the correspondence of each target image in the semantic segmentation set, the depth map of the target object to be reconstructed is corrected to obtain a target depth map. Optionally, after extracting the multi-scale features of the target image area to be reconstructed in the target image, multiple key feature points of the target image area to be reconstructed are calculated based on the multi-scale features, and the key feature points contain feature information such as direction, scale and position. Then, the depth information corresponding to the multiple key feature points on the depth map is obtained. At the same time, based on the semantic information of each key feature point obtained, the corresponding points of the above key feature points are determined in other target images. Finally, based on the feature information of the multiple key feature points and their corresponding points in the target image, the depth map of the target object to be reconstructed in the target image is corrected to obtain a target depth map of the target object to be reconstructed. The target depth map contains richer feature information of the target object to be reconstructed based on the multi-scale semantic feature information of the target object to be reconstructed in the semantic segmentation set, which is conducive to increasing the accuracy of the subsequent generation of the three-dimensional model.

[0110] S207: constructing a three-dimensional point cloud of the target object to be reconstructed according to the target depth map.

[0111] Optionally, the three-dimensional coordinates corresponding to each key feature point are calculated based on the target depth map and camera parameters to generate a three-dimensional point cloud. For example, the depth value of each pixel is assigned to the z coordinate, and then the camera parameters are converted into the coordinate form in the pixel coordinate system, and finally the horizontal and vertical coordinates x and y are calculated using the coordinate form in the pixel coordinate system.

[0112] It should be noted that each point in the three-dimensional point cloud includes position information and other optional attribute information such as color.

[0113] S208: pre-process the three-dimensional point cloud, and generate a three-dimensional model of the target object to be reconstructed based on the pre-processed three-dimensional point cloud.

[0114] Optionally, first, the 3D point cloud is preprocessed by denoising, smoothing the surface, and resampling to improve the quality and accuracy of the point cloud data. Then, the 3D point cloud is meshed to obtain an initial 3D model of the target object to be reconstructed. Finally, the initial 3D model is model optimized and post-processed to obtain a 3D model of the target object to be reconstructed.

[0115] It should be noted that the initial 3D model can be optimized by smoothing and filling holes to improve the surface of the initial 3D model. In addition, post-processing methods such as texture mapping and lighting adjustment can be used to increase the realism and stereoscopic effect of the initial 3D model.

[0116] S209, setting parameters for a rendering model based on a preset virtual scene; inputting the three-dimensional model into the rendering model, performing real-time rendering processing on the three-dimensional model, and obtaining the virtual model.

[0117] Specifically, according to preset virtual scene requirements, scene parameters in the rendering model are set, and based on the scene parameters, the three-dimensional model is rendered in real time to obtain a virtual model of the target object to be reconstructed.

[0118] Optionally, after obtaining the virtual model, the rendering effect of the virtual model can be monitored in real time, and the rendering model can be optimized according to the rendering effect. For example, the rendering effect of the virtual model can be debugged and analyzed using the debugging tools and performance analysis tools provided by the rendering engine, the rendering performance bottleneck can be obtained, and targeted optimization can be performed. The rendering effect is used to characterize the rendering performance of the rendering model.

[0119] In a possible implementation, the real-time rendering of the three-dimensional model to obtain a virtual model of the at least one target object to be reconstructed includes: receiving an interaction instruction from a user; generating an interaction response corresponding to the interaction instruction based on preset interaction rules and interaction methods; and according to the interaction response, rendering the three-dimensional model in real time to obtain a virtual model of the at least one target object to be reconstructed, the virtual model being used to complete an interaction action corresponding to the interaction response.

[0120] Specifically, the rules and methods for users to interact with virtual models in a virtual environment are designed. For example, users can interact with virtual objects in real time through gestures, voice, or controllers. The state of the virtual model in the virtual environment is updated according to the user's interactive behavior and preset interactive rules, and real-time rendering is performed after the user's operation is completed, so that the virtual model can make interactive actions corresponding to the user's interactive behavior in a timely manner according to the interactive rules. This method can present the virtual model in a virtual scene in real time according to the user's interactive behavior, providing users with a more realistic virtual experience.

[0121] The method for generating a virtual model provided in an embodiment of the present application determines the target object to be reconstructed in the image data through a target recognition model, and marks the target object to be reconstructed according to the position of the target object to be reconstructed, and then the three-dimensional reconstruction model extracts features and performs three-dimensional reconstruction on the target object to be reconstructed in the marked area to obtain a three-dimensional model of the target object to be reconstructed, and finally, the virtual model is presented in a virtual scene using real-time rendering technology, and the virtual model updates its dynamics in real time according to the user's interactive behavior, providing the user with a more realistic virtual experience. Among them, by marking the target object to be reconstructed through the target recognition model, the invalid feature points extracted during the three-dimensional reconstruction process are reduced, and the efficiency and accuracy of generating the virtual model are improved.

[0122] Figure 3 A flowchart of a method for training a target recognition model provided in this application is shown in FIG. Figure 3 As shown, in this embodiment Figure 1 Based on the embodiment, before the plurality of image data are input into the target recognition model to obtain the target image, a training method for the target recognition model is described in detail, and the method includes:

[0123] S301: Obtain an image dataset.

[0124] The image data in the image data set includes multi-view image data, and the multi-view image data carries attribute information of a target object to be reconstructed, and the attribute information is used to indicate a position and a category of the target object to be reconstructed.

[0125] S302: Perform data enhancement on the image dataset, and divide the data enhanced image dataset into a training set and a validation set.

[0126] Specifically, data augmentation techniques are used to expand the data set to increase data diversity and improve the generalization ability of the model, such as random cropping, scaling, rotation, flipping, etc. Optionally, the image data set after data augmentation is divided into a training set and a validation set according to a preset ratio.

[0127] S303: Use the image data in the training set to train the initial recognition model to obtain a recognition result of the target object to be reconstructed.

[0128] Among them, the recognition result includes the location information and category of the target object to be reconstructed, and the mark of the area where the target object to be reconstructed is located. The initial recognition model is used to identify the target object to be reconstructed, mark the area where the target object to be reconstructed is located, and output the location information and category of the target object to be reconstructed.

[0129] Optionally, the initial recognition model is loaded into a deep learning framework, and the initial recognition model is iteratively trained on the training set so that it can accurately recognize and analyze different types of target objects.

[0130] S304: Optimize the initial recognition model based on the recognition result and the attribute information carried by the image data to obtain an intermediate recognition model.

[0131] Optionally, based on the difference between the position information and category of the target object to be reconstructed in the recognition result and the attribute information carried by the corresponding image data, the parameters of the initial recognition model are updated, and the initial recognition model is iteratively optimized to obtain an intermediate recognition model.

[0132] Optionally, a suitable optimizer and loss function may be selected to optimize the initial recognition model. For example, the initial recognition model may be optimized using optimizers such as SGD and Adam, and loss functions such as cross entropy loss and mean square error loss to obtain an intermediate recognition model.

[0133] S305 , using the image data in the verification set to evaluate the intermediate recognition model, and adjusting parameters of the intermediate recognition model according to the evaluation result to obtain a target recognition model.

[0134] Specifically, the image data in the verification data set is input into the intermediate recognition model, the performance of the intermediate recognition model is evaluated based on the output results of the intermediate recognition model, and the parameters and architecture of the intermediate recognition model are adjusted according to the evaluation results to obtain the target recognition model.

[0135] The method for training a target recognition model provided in an embodiment of the present application performs data enhancement on an image data set to increase the diversity of image data, then divides the image data set that has undergone data enhancement processing into a training set and a verification set, uses the training set to train the initial target model, and optimizes and adjusts the initial target model based on the output result of the initial target model on the training set to obtain an intermediate recognition model. Finally, the performance of the intermediate recognition model is evaluated using the verification set, and based on the evaluation result, the parameters of the intermediate recognition model are adjusted to obtain a target recognition model, thereby improving the recognition accuracy and recognition efficiency of the target recognition model. In addition, the method utilizes data enhancement technology to not only expand the image data set, but also provide more abundant training data for model training, which is conducive to improving the accuracy of the target recognition model.

[0136] Figure 4 A schematic diagram of a device for generating a virtual model provided in this application is shown in FIG. Figure 4 As shown, a device 40 for generating a virtual model provided in this embodiment includes:

[0137] The acquisition module 401 is used to acquire a plurality of image data;

[0138] The target recognition module 402 is used to input the plurality of image data into a target recognition model to obtain a target image;

[0139] A three-dimensional reconstruction module 403 is used to input the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked target object to be reconstructed;

[0140] The rendering module 404 is used to perform real-time rendering on the three-dimensional model to obtain a virtual model of the at least one target object to be reconstructed.

[0141] In a possible implementation, the device further includes: a processing module 405 and a determining module 406;

[0142] The processing module 405 is used to extract features from any image data among the multiple image data, and determine at least one candidate region according to the extracted feature data;

[0143] The target recognition module 402 is specifically configured to recognize a target object in the at least one candidate area to obtain target object information;

[0144] The determination module 406 is used to determine the target object corresponding to the target object information having an associated relationship in the plurality of image data as the target object to be reconstructed;

[0145] The processing module 405 is further used to perform labeling processing on the target object to be reconstructed to obtain the target image.

[0146] In a possible implementation manner, the device further includes: an acquisition module 407;

[0147] The acquisition module 407 is used to acquire a depth map of the target object to be reconstructed for at least one marked target object to be reconstructed in the target image;

[0148] The processing module 405 is further used to perform multi-scale semantic segmentation on the target object to be reconstructed to obtain a multi-scale semantic segmentation set;

[0149] The determination module 406 is further configured to determine a target depth map of the target object to be reconstructed according to the semantic segmentation set and the depth map of the target object to be reconstructed;

[0150] The three-dimensional reconstruction module 403 is specifically used to construct a three-dimensional point cloud of the target object to be reconstructed according to the target depth map;

[0151] The three-dimensional reconstruction model 403 is specifically used to pre-process the three-dimensional point cloud and generate a three-dimensional model of the target object to be reconstructed based on the pre-processed three-dimensional point cloud.

[0152] In a possible implementation, the device further includes: a receiving module 408;

[0153] The receiving module 408 is used to receive the user's interactive instruction;

[0154] The processing module 405 is further used to generate an interactive response corresponding to the interactive instruction based on a preset interactive rule and interactive mode;

[0155] The rendering module 404 is further configured to render the three-dimensional model in real time according to the interactive response to obtain a virtual model of the at least one target object to be reconstructed.

[0156] In a possible implementation, the processing module 405 is further used to set parameters for the rendering model based on a preset virtual scene;

[0157] The rendering module 404 is specifically used to input the three-dimensional model into the rendering model, perform real-time rendering processing on the three-dimensional model, and obtain the virtual model.

[0158] In a possible implementation, the rendering module 404 is further used to monitor the rendering effect of the virtual model in real time, and optimize the rendering model according to the rendering effect.

[0159] In a possible implementation, the device further includes: a training module 409 and a verification module 410;

[0160] The acquisition module 407 is also used to acquire an image data set;

[0161] The processing module 405 is further used to perform data enhancement on the image data set, and divide the image data set after data enhancement into a training set and a verification set;

[0162] The training module 409 is used to train the initial recognition model using the image data in the training set to obtain the recognition result of the target object to be reconstructed;

[0163] The training module 409 is further used to optimize the initial recognition model based on the recognition result and the attribute information carried by the image data to obtain an intermediate recognition model;

[0164] The verification module 410 is used to evaluate the intermediate recognition model using the image data in the verification set, and adjust the parameters of the intermediate recognition model according to the evaluation result to obtain the target recognition model.

[0165] The present embodiment provides a device for generating a virtual model, which can execute the method provided in the above method embodiment. The implementation principle and technical effect are similar, and will not be described in detail in the present embodiment.

[0166] Figure 5 This is a schematic diagram of the structure of a device for generating a virtual model provided by the present application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0167] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0168] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0169] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0170] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0171] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0172] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0173] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0174] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0175] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as ASIC). The processor and the readable storage medium can also exist in the device as discrete components.

[0176] The division of units is only a logical function division, and there may be other divisions 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 an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0177] 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.

[0178] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0179] If the function 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, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0180] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0181] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for generating a virtual model, It is characterized in that include: Collecting a plurality of image data and inputting the plurality of image data into a target recognition model to obtain a target image, wherein the target image contains at least one marked target object to be reconstructed; Inputting the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked target object to be reconstructed; The three-dimensional model is rendered in real time to obtain a virtual model of the at least one target object to be reconstructed.

2. The method according to claim 1, It is characterized in that The step of inputting the plurality of image data into a target recognition model to obtain a target image comprises: For any image data among the plurality of image data, extracting features from the image data, and determining at least one candidate region according to the extracted feature data; Identify a target object in the at least one candidate area to obtain target object information, where the target object information is used to indicate a position and a category of the target object; Determine the target object corresponding to the target object information having an associated relationship in the plurality of image data as the target object to be reconstructed; The target object to be reconstructed is marked to obtain the target image.

3. The method according to claim 1, It is characterized in that The step of inputting the target image into the three-dimensional reconstruction model to obtain the three-dimensional model of the at least one marked target object to be reconstructed comprises: For at least one marked target object to be reconstructed in the target image, obtaining a depth map of the target object to be reconstructed, and performing multi-scale semantic segmentation on the target object to be reconstructed to obtain a multi-scale semantic segmentation set; Determining a target depth map of the target object to be reconstructed according to the semantic segmentation set and the depth map of the target object to be reconstructed; Constructing a three-dimensional point cloud of the target object to be reconstructed according to the target depth map; The three-dimensional point cloud is preprocessed, and a three-dimensional model of the target object to be reconstructed is generated based on the pre-processed three-dimensional point cloud.

4. The method according to claim 1, It is characterized in that The real-time rendering of the three-dimensional model to obtain the virtual model of the at least one target object to be reconstructed includes: Receive user interaction instructions; Based on preset interaction rules and interaction methods, generating an interaction response corresponding to the interaction instruction; According to the interactive reaction, the three-dimensional model is rendered in real time to obtain a virtual model of the at least one target object to be reconstructed, and the virtual model is used to complete the interactive action corresponding to the interactive reaction.

5. The method according to claim 1 or 4, It is characterized in that The real-time rendering of the three-dimensional model to obtain the virtual model of the at least one target object to be reconstructed includes: Based on the preset virtual scene, set the parameters of the rendering model; The three-dimensional model is input into the rendering model, and real-time rendering is performed on the three-dimensional model to obtain the virtual model.

6. The method according to claim 5, It is characterized in that After performing real-time rendering processing on the three-dimensional model to obtain the virtual model, the method further includes: The rendering effect of the virtual model is monitored in real time, and the rendering model is optimized according to the rendering effect.

7. The method according to claim 1, It is characterized in that Before inputting the plurality of image data into a target recognition model to obtain a target image, wherein at least one marked target object to be reconstructed exists in the target image, the method further comprises: Acquire an image data set, wherein the image data in the image data set includes multi-view image data, the multi-view image data carries attribute information of a target object to be reconstructed, and the attribute information is used to indicate a position and a category of the target object to be reconstructed; Performing data enhancement on the image dataset, and dividing the data enhanced image dataset into a training set and a validation set; Using the image data in the training set to train the initial recognition model, and obtaining a recognition result of the target object to be reconstructed; Based on the recognition result and the attribute information carried by the image data, the initial recognition model is optimized to obtain an intermediate recognition model; The intermediate recognition model is evaluated using the image data in the verification set, and parameters of the intermediate recognition model are adjusted according to the evaluation result to obtain a target recognition model.

8. A device for generating a virtual model, It is characterized in that include: An acquisition module, used for acquiring a plurality of image data; A target recognition module, used for inputting the plurality of image data into a target recognition model to obtain a target image; A three-dimensional reconstruction module, used for inputting the target image into a three-dimensional reconstruction model to obtain a three-dimensional model of the at least one marked target object to be reconstructed; A rendering module is used to render the three-dimensional model in real time to obtain a virtual model of the at least one target object to be reconstructed.

9. A device for generating a virtual model, It is characterized in that include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.