3D model data recognition and matching method, system, device, medium and program
Through the method of pattern and vertex feature matching, the problem of low data matching efficiency based on model identifiers in traditional 3D printing is solved, and more efficient and accurate model data recognition matching is achieved.
Patent Information
- Application Number
- CN202411197563.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-29
AI Technical Summary
In traditional 3D printing, the data matching method based on model identifiers is inefficient, and the user needs to know the identifier of the object model in advance, and the virtual environment does not provide identifier display, resulting in low matching efficiency of model data recognition.
The method of pattern matching and storage feature matching is used for preliminary identification and positioning, and the model data range is reduced through vertex feature matching, so as to achieve accurate matching of model data and improve matching efficiency. The specific steps include: pre-rendering the virtual environment, obtaining calibration model data, performing model positioning, pattern filtering, storage feature filtering, vertex structure feature extraction and face-by-face detail matching.
Through pattern and vertex feature matching, the query workload of model data matching is reduced, the matching efficiency and accuracy are improved, and more accurate model data recognition is achieved.
Smart Images

Figure CN118710942B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data matching, and in particular to a method, system, device, medium and program for identifying and matching 3D model data. Background Art
[0002] 3D printing is an advanced manufacturing technology, also known as additive manufacturing (AM). One application scenario of 3D printing is to print object models in a virtual environment. To do this, it is necessary to match the model data of the object model to be printed from storage space such as memory or cache.
[0003] Traditional data matching technology is a matching method based on model identifiers, that is, matching the corresponding model data from the storage space according to the unique identifier of each object model. In practical applications, the matching method based on model identifiers requires the user to know the model identifier of the selected object model in advance and requires platform support. However, the virtual environment generally does not provide a display of model identifiers for each object model. Therefore, it is necessary to search from the storage space by itself, which may lead to low efficiency in identifying and matching model data. Summary of the invention
[0004] The present disclosure provides a 3D model data recognition and matching method, system, device, medium and program, which perform preliminary recognition and positioning by pattern matching and storage feature matching, further reduce the scope of matching model data by vertex feature matching, and achieve accurate matching of model data by face-by-face detail matching, thereby saving model matching time and improving the efficiency of model data matching.
[0005] In a first aspect, the present disclosure provides a method for identifying and matching 3D model data, comprising: sending a pre-rendered virtual environment to a client, and obtaining calibration model data returned by the client for the virtual environment; obtaining a storage component corresponding to the virtual environment, performing model positioning on the storage component, and obtaining a positioning model file; performing pattern model screening and storage feature screening on the positioning model file to obtain a primary model data group; performing vertex structural feature extraction on the calibration model data to obtain calibration model features, and performing structural feature matching on the primary model data group according to the calibration model features to obtain a secondary model data group; performing facet-by-face detail matching on the secondary model data group according to the calibration model data to obtain matching model data.
[0006] In some embodiments, the model positioning of the storage component to obtain a positioning model file includes: performing directory parsing on the storage component to obtain a storage directory and directory attributes corresponding to the storage directory; extracting a primary model file from the storage directory using a model keyword matching method; extracting a file attribute feature set from the directory attributes, and performing model attribute screening on the file attribute feature set to obtain a model attribute feature group; aggregating files corresponding to the model attribute feature group in the storage directory into a secondary model file; performing tree structure mapping on the storage directory using a recursive traversal method to obtain a file index tree; performing associated file matching on the file index tree according to the primary model file and the secondary model file to obtain an index model file; and generating a positioning model file based on the primary model file, the secondary model file, and the index model file.
[0007] In some embodiments, the pattern model screening and storage feature screening of the positioning model file to obtain a primary model data group includes: performing identifier pattern matching on the positioning model file to obtain an identifier model data group; performing structure pattern matching on the positioning model file to obtain a structure model data group; extracting a file metadata data set from the positioning model file, and encoding the file metadata data set features into a file meta feature set; performing model feature screening on the file meta feature set to obtain a model feature group; screening a metadata model data group from the positioning model file according to the model feature group; and generating a primary model data group according to the identifier model data group, the structure model data group, and the metadata model data group.
[0008] In some embodiments, the extracting vertex structural features of the calibration model data to obtain calibration model features includes: extracting a calibration type from the calibration model data; performing type parsing on the calibration model data according to the calibration type to obtain parsed model data; respectively counting calibration vertex data, calibration normal data, and calibration triangle data from the parsed model data; and performing structural feature encoding on the calibration vertex data, the calibration normal data, and the calibration triangle data to obtain calibration model features.
[0009] In some embodiments, performing face-by-face detail matching on the secondary model data group according to the calibration model data to obtain matching model data includes: extracting a calibration coordinate system from the calibration model data, and performing coordinate system correction on the calibration model data according to the calibration coordinate system to obtain corrected calibration model data; selecting the secondary model data in the secondary model data group as target secondary model data one by one, and performing face-by-face detail matching on the corrected calibration model data and the target secondary model data to obtain a detail deviation value; judging whether the detail deviation value is less than a preset detail deviation threshold; if not, returning to the step of selecting the secondary model data in the secondary model data group as the target secondary model data one by one; if yes, adding the detail deviation value to the preset detail deviation value group, until the target secondary model data is the last secondary model data in the secondary model data group, and then taking the detail deviation value with the smallest value in the detail deviation value group as the matching detail deviation value; and taking the secondary model data corresponding to the matching detail deviation value as the matching model data.
[0010] In some embodiments, the corrected calibration model data and the target secondary model data are matched face by face in detail to obtain detail deviation values, including: selecting triangular faces in the corrected calibration model data as target calibration triangular faces one by one in order from near to far from the coordinate origin, and using the normals of the target calibration triangular faces as target calibration normals; selecting triangular faces in the target secondary model data as target secondary triangular faces one by one in order from near to far from the coordinate origin, and using the normals of the target secondary triangular faces as target secondary normals; calculating the edge ratio deviation value between the target calibration triangular faces and the target secondary triangular faces; calculating the normal slope deviation value between the target calibration normal and the target secondary normal; and generating detail deviation values according to all edge ratio deviation values and all normal slope deviation values.
[0011] In some embodiments, performing structural feature matching on the primary model data group according to the calibration model features to obtain a secondary model data group includes: selecting primary model data in the primary model data group one by one as target primary model data, performing vertex structural feature extraction on the target primary model data to obtain target primary model features; calculating a feature deviation value between the target primary model features and the calibration model features; determining whether the feature deviation value is greater than a preset deviation threshold; if so, returning to the step of selecting primary model data in the primary model data group one by one as target primary model data; if not, adding the target primary model data as secondary model data to the preset secondary model data group.
[0012] In a second aspect, the present disclosure provides a 3D model data recognition and matching system, comprising: a model calibration module, used to send a pre-rendered virtual environment to a client, and obtain calibration model data returned by the client for the virtual environment; a data positioning module, used to obtain a storage component corresponding to the virtual environment, perform model positioning on the storage component, and obtain a positioning model file; a primary screening module, used to perform pattern model screening and storage feature screening on the positioning model file, and obtain a primary model data group; a secondary screening module, used to perform vertex structural feature extraction on the calibration model data, and obtain calibration model features, and perform structural feature matching on the primary model data group according to the calibration model features to obtain a secondary model data group; a detail matching module, used to perform face-by-face detail matching on the secondary model data group according to the calibration model data, and obtain matching model data.
[0013] In a third aspect, the present disclosure provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of a 3D model data recognition and matching method described in the above aspect.
[0014] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a 3D model data recognition and matching method described in the above aspect.
[0015] In a fifth aspect, the present disclosure provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements the steps of a 3D model data recognition and matching method described in the above aspects.
[0016] The present disclosure provides a 3D model data recognition and matching method, system, device, medium and program. By acquiring the calibration model data, the calibration model data of the model to be matched can be obtained, thereby facilitating model matching. By performing model positioning, the folder where the model data is located in the storage component can be matched, thereby achieving preliminary model data positioning, reducing the query workload of model data matching, and improving the matching efficiency of model data.
[0017] By performing pattern model screening and storage feature screening, it is possible to perform preliminary screening of the data in the positioning model file, and to filter out data other than model data in the positioning model file, thereby improving the efficiency of model data matching; by performing vertex structure feature extraction and structure feature matching, it is possible to achieve preliminary model data matching based on the structural features of the calibration model data, thereby reducing the amount of model data that needs to be matched subsequently and further improving the accuracy of model data matching.
[0018] By performing face-by-face detail matching, further matching can be achieved by combining the deviations of the various triangular faces of the model data and the corresponding normals, thereby improving the accuracy of model data recognition and matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The present disclosure will be described in more detail below based on embodiments and with reference to the accompanying drawings:
[0020] Figure 1 A schematic flow chart of a method for identifying and matching 3D model data according to a first embodiment of the present disclosure is shown.
[0021] Figure 2 A schematic diagram of the process of screening out the primary model data group in the first embodiment of the present disclosure is shown.
[0022] Figure 3 A schematic diagram of the process of calculating detail deviation values in the first embodiment of the present disclosure is shown.
[0023] Figure 4 A flow chart of a method for identifying and matching 3D model data according to a second embodiment of the present disclosure is shown.
[0024] Figure 5 A functional module diagram of a 3D model data recognition and matching system according to a third embodiment of the present disclosure is shown.
[0025] In the drawings, the same reference numerals are used for the same components, and the drawings are not drawn to scale. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, and to fully understand and implement how the present disclosure applies technical means to solve technical problems and achieve the corresponding technical effects, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the present disclosure, not all of the embodiments. The embodiments of the present disclosure and the various features in the embodiments can be combined with each other without conflict, and the technical solutions formed are all within the scope of protection of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0028] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Embodiment 1
[0030] Figure 1 The following is a flow chart of a method for identifying and matching 3D model data provided by an embodiment of the present disclosure. Figure 1 As shown, a method for identifying and matching 3D model data includes:
[0031] S1. Send a pre-rendered virtual environment to a client, and obtain calibration model data returned by the client for the virtual environment.
[0032] In detail, the virtual environment can be rendered using rendering engines such as Unity, Unreal Engine or Blender. The virtual environment refers to a digital space created by computer technology, in which users can interact and experience through vision, hearing and even touch. The virtual environment can be a virtual space in a game or virtual reality.
[0033] Specifically, the client refers to a terminal used by a client to interact with the virtual environment. The client may be a device such as a smart phone or a computer. The calibration model data refers to data obtained by a user of the client using gesture recognition technology such as a mouse, keyboard, handle or head-mounted display (HMD) to calibrate the object model to be printed. The calibration model data calibrates the coordinates of multiple vertices, edges or planes of the object model.
[0034] In the disclosed embodiment, by acquiring the calibration model data, the calibration model data of the model to be matched can be obtained, thereby facilitating model matching.
[0035] S2. Obtain a storage component corresponding to the virtual environment, perform model positioning on the storage component, and obtain a positioning model file.
[0036] In detail, the storage component refers to a storage medium for storing data related to the virtual environment, and the storage component may be a memory or a cache. The positioning model file refers to a folder in the storage component that stores model resources of all object models in the virtual environment.
[0037] In the disclosed embodiment, the storage component is model-located to obtain a location model file, including: performing directory parsing on the storage component to obtain a storage directory and directory attributes corresponding to the storage directory; extracting a primary model file from the storage directory using a model keyword matching method; extracting a file attribute feature set from the directory attributes, and performing model attribute screening on the file attribute feature set to obtain a model attribute feature group; aggregating files corresponding to the model attribute feature group in the storage directory into a secondary model file; performing tree structure mapping on the storage directory using a recursive traversal method to obtain a file index tree; performing associated file matching on the file index tree according to the primary model file and the secondary model file to obtain an index model file; and generating a location model file according to the primary model file, the secondary model file, and the index model file.
[0038] Specifically, Python's os or os.path module can be used for directory parsing, the storage directory refers to the list directory of each folder stored in the storage component, the directory attributes refer to the attributes of each folder in the storage directory, and the attributes include information such as the size, creator, and software version of the folder.
[0039] In detail, the model keyword matching refers to using preset model keywords to match the corresponding folders from the storage directory as primary model files. Regular expressions can be used for model keyword matching. The model keywords can be "NameDode", "Hive" or "Minio" and the like.
[0040] Specifically, each file attribute feature in the file attribute feature set corresponds to an attribute feature of each folder in the directory attribute, and the attribute feature refers to a feature vector obtained by vectorizing the attributes of the folder in a fixed format.
[0041] In detail, the model attribute screening refers to using a pre-trained support vector machine or convolutional neural network to identify the type of each file attribute feature in the file attribute feature set, and aggregating the file attribute features of the model type obtained after identification into a model attribute feature group as model attribute features.
[0042] Specifically, the tree structure mapping can be performed using the command line tool tree, the command line tool find or the anytree library, wherein the file index tree is the storage directory represented by a tree structure, and the parent-child folder relationship of each folder in the storage directory is recorded in the file index tree.
[0043] In detail, the pyexiv2 library or the pillow library can be used for associated file matching, and the associated file matching refers to using the associated folder as the index model file according to the structural relationship between the primary model file and the secondary model file in the file index tree, and the positioning model file is composed of the primary model file, the secondary model file and the index model file.
[0044] In the disclosed embodiment, by performing model positioning, the folder where the model data is located in the storage component can be matched, thereby achieving preliminary model data positioning, reducing the query workload of model data matching, and improving the matching efficiency of model data.
[0045] S3. Performing pattern model screening and storage feature screening on the positioning model file to obtain a primary model data set.
[0046] In detail, in addition to the model data, the positioning model file also contains irrelevant data such as audio data of the object model and script data. In order to further realize the recognition and matching of the model data, the positioning model file needs to be screened to obtain a primary model data group that only contains the model data.
[0047] Specifically, the primary model data group refers to a combination of model data corresponding to all 3D models screened out according to data format and features related to model data storage, and each primary model data in the primary model data group corresponds to model data of an object model in the virtual environment.
[0048] In the present disclosure, refer to Figure 2 As shown, the positioning model file is subjected to mode model screening and storage feature screening to obtain a primary model data group, including:
[0049] S21, performing identifier pattern matching on the positioning model file to obtain an identifier model data group;
[0050] S22, performing structural pattern matching on the positioning model file to obtain a structural model data group;
[0051] S23, extracting a file metadata set from the positioning model file, and encoding features of the file metadata set into a file metadata feature set;
[0052] S24, performing model feature screening on the file meta-feature set to obtain a model feature group;
[0053] S25, filtering out a metadata model data group from the positioning model file according to the model feature group;
[0054] S26. Generate a primary model data group according to the identifier model data group, the structure model data group and the metadata model data group.
[0055] In detail, the identifier pattern matching refers to matching the suffix names of each file in the positioning model file, and aggregating the model data corresponding to the suffix names belonging to the 3D model format into an identifier model data group. The suffix names belonging to the 3D model format can be obj, fbx, 3ds, gltf, etc., and regular expressions can be used for identifier pattern matching.
[0056] Specifically, the structural pattern matching refers to matching the file headers of each file in the positioning model file, and aggregating the model data corresponding to the file headers belonging to the 3D model structure format into a structural model data group. Structural pattern matching can be performed using parsing libraries such as PyWavefront or PyFBX.
[0057] In detail, the file metadata set refers to a collection of metadata of each data in the positioning model file. The metadata is also called intermediate data or relay data. It is data that describes the data, mainly information that describes the attributes of the data, and is used to support functions such as indicating the creator of the file, the software version, and the model name.
[0058] Specifically, feature encoding can be performed using the encoder module of a pre-trained variational autoencoder or transformer model, and the model feature screening refers to performing feature decoding on the file meta-feature set using the decoder module of a pre-trained variational autoencoder or transformer model to obtain a file meta-type set, filtering out file meta-types corresponding to model data from the file meta-type set and gathering them into model file tuples, and gathering file meta-features corresponding to the model file tuples in the file meta-feature set into a model feature group.
[0059] In detail, generating a primary model data group according to the identifier model data group, the structure model data group and the metadata model data group means collecting all data corresponding to the identifier model data group, the structure model data group and the metadata model data group as primary model data into a primary model data group.
[0060] In the disclosed embodiment, by performing pattern model screening and storage feature screening, preliminary screening of data in the positioning model file can be achieved, and data other than model data in the positioning model file can be screened out, thereby improving the efficiency of model data matching.
[0061] S4. Extract vertex structural features from the calibration model data to obtain calibration model features, and perform structural feature matching on the primary model data set according to the calibration model features to obtain a secondary model data set.
[0062] In detail, the calibration model features refer to features such as model vertices and model structures corresponding to the calibration model data, and the secondary model data group is a combination of model data obtained after further matching and screening the primary model data group.
[0063] In the disclosed embodiment, the extracting of vertex structural features from the calibration model data to obtain calibration model features includes: extracting a calibration type from the calibration model data; performing type parsing on the calibration model data according to the calibration type to obtain parsed model data; respectively counting calibration vertex data, calibration normal data, and calibration triangle data from the parsed model data; and performing structural feature encoding on the calibration vertex data, the calibration normal data, and the calibration triangle data to obtain calibration model features.
[0064] Specifically, the calibration type refers to the data type of the calibration model data, and the calibration type may be OBJ, FBX or STL type. The calibration vertex data refers to the number of vertices in the calibration model data. The calibration normal data refers to the number of normals in the calibration model data. The calibration triangle data refers to the number of triangles in the calibration model data.
[0065] In detail, the calibration model data is parsed according to the calibration type. For example, when the calibration type is OBJ type, the calibration vertex data can be obtained by counting the number of rows starting with "v", the calibration triangle data can be obtained by counting the number of rows starting with "f", and the calibration normal data can be obtained by counting the number of rows starting with "vn".
[0066] In detail, the structural feature matching of the primary model data group according to the calibration model features to obtain the secondary model data group includes: selecting the primary model data in the primary model data group one by one as the target primary model data, extracting the vertex structural features of the target primary model data to obtain the target primary model features; calculating the feature deviation value between the target primary model features and the calibration model features; judging whether the feature deviation value is greater than a preset deviation threshold; if so, returning to the step of selecting the primary model data in the primary model data group one by one as the target primary model data; if not, adding the target primary model data as the secondary model data to the preset secondary model data group.
[0067] Specifically, the method for extracting vertex structure features is consistent with the above-mentioned method for extracting vertex structure features on the calibration model data. The feature deviation value can be calculated using a cosine feature distance algorithm, a Euclidean feature distance algorithm or a Manhattan feature distance algorithm. The feature deviation value refers to the difference between the target primary model feature and the calibration model feature.
[0068] In the disclosed embodiment, by performing vertex structural feature extraction and structural feature matching, preliminary model data matching can be achieved based on the structural features of the calibration model data, thereby reducing the amount of model data that needs to be matched subsequently and further improving the accuracy of model data matching.
[0069] S5. Perform face-by-face detail matching on the secondary model data set according to the calibration model data to obtain matching model data.
[0070] In detail, the secondary model data group may contain model data with similar number of vertices, triangles and normals to the model data to be matched. In order to achieve accurate matching, further matching is required based on the detailed features of the calibration model data. The matching model data refers to the matched model data of the object model to be printed.
[0071] In the disclosed embodiment, the step of performing face-by-face detail matching on the secondary model data group according to the calibration model data to obtain matching model data includes: extracting a calibration coordinate system from the calibration model data, and performing coordinate system correction on the calibration model data according to the calibration coordinate system to obtain corrected calibration model data; selecting the secondary model data in the secondary model data group as target secondary model data one by one, and performing face-by-face detail matching on the corrected calibration model data and the target secondary model data to obtain a detail deviation value; judging whether the detail deviation value is less than a preset detail deviation threshold; if not, returning to the step of selecting the secondary model data in the secondary model data group as target secondary model data one by one; if yes, adding the detail deviation value to a preset detail deviation value group until the target secondary model data is the last secondary model data in the secondary model data group, and then using the detail deviation value with the smallest value in the detail deviation value group as the matching detail deviation value; and using the secondary model data corresponding to the matching detail deviation value as the matching model data.
[0072] In detail, the calibration coordinate system refers to the screen coordinate system, projection coordinate system and view coordinate system corresponding to the calibration model data. The calibration model data is model data obtained by the user directly calibrating the screen. Therefore, the calibration model data needs to be converted into data in the local coordinate system corresponding to each secondary model data in the secondary model data group for matching.
[0073] Specifically, the coordinate system correction of the calibration model data according to the calibration coordinate system to obtain the corrected calibration model data includes: performing screen coordinate projection on the calibration model data according to the calibration coordinate system to obtain projection calibration model data; performing view coordinate transformation on the projection calibration model data according to the calibration coordinate system to obtain view calibration model data; performing world coordinate transformation on the view calibration model data according to the calibration coordinate system to obtain world calibration model data; calculating the model midpoint from the world calibration model data, and performing local coordinate transformation on the world calibration model data according to the model midpoint to obtain the corrected calibration model data.
[0074] In detail, the screen coordinate projection refers to converting the calibration model data of the screen coordinate system into projection calibration model data of the projection coordinate system, the view coordinate conversion refers to converting the projection calibration model data of the projection coordinate system into view calibration model data of the view coordinate system, the world coordinate conversion refers to converting the view calibration model data of the view coordinate system into world calibration model data of the world coordinate system, the model midpoint refers to the center position coordinates of the model corresponding to the world calibration model data, and the local coordinate conversion refers to converting the world calibration model data of the world coordinate system into correction calibration model data of a local coordinate system with the model midpoint as the coordinate origin.
[0075] For details, refer to Figure 3 As shown, the step of performing face-by-face detail matching on the corrected calibration model data and the target secondary model data to obtain a detail deviation value includes:
[0076] S31, selecting triangular faces in the correction calibration model data one by one in order from near to far from the coordinate origin as target calibration triangular faces, and using the normal of the target calibration triangular faces as the target calibration normal;
[0077] S32, selecting triangular faces in the target secondary model data one by one in order from near to far from the coordinate origin as target secondary triangular faces, and using normals of the target secondary triangular faces as target secondary normals;
[0078] S33, calculating the edge ratio deviation value between the target calibration triangle and the target secondary triangle;
[0079] S34, calculating a normal slope deviation value between the target calibration normal line and the target secondary normal line;
[0080] S35. Generate detail deviation values according to all edge ratio deviation values and all normal slope deviation values.
[0081] In detail, the edge ratio deviation value refers to the standard deviation of the ratio between the three groups of edges corresponding to the target calibration triangle and the target secondary triangle. For example, the edges of the target calibration triangle can be sorted into "AB", "BC", and "AC" according to the length of the edges, and the edges of the target secondary triangle can be sorted into "DE", "EF", and "DF". The ratios between the three groups of edges are:
[0082]
[0083] Then the side ratio deviation value refers to , as well as The standard deviation of .
[0084] Specifically, the normal slope deviation value refers to the vector distance between the normal vector of the target calibration normal and the normal vector of the target set normal, and the detail deviation value is the weighted average of all edge ratio deviation values and all normal slope deviation values.
[0085] In the disclosed embodiment, by performing face-by-face detail matching, further matching can be achieved by combining the deviations of the various triangular faces of the model data and the corresponding normals, thereby improving the accuracy of model data recognition and matching.
[0086] The present disclosure provides a method for identifying and matching 3D model data. By acquiring the calibration model data, the calibration model data of the model to be matched can be obtained, thereby facilitating model matching. By performing model positioning, the folder where the model data is located in the storage component can be matched, thereby achieving preliminary model data positioning, reducing the query workload of model data matching, and improving the matching efficiency of model data.
[0087] By performing pattern model screening and storage feature screening, it is possible to perform preliminary screening of the data in the positioning model file, and to filter out data other than model data in the positioning model file, thereby improving the efficiency of model data matching; by performing vertex structure feature extraction and structure feature matching, it is possible to achieve preliminary model data matching based on the structural features of the calibration model data, thereby reducing the amount of model data that needs to be matched subsequently and further improving the accuracy of model data matching.
[0088] By performing face-by-face detail matching, further matching can be achieved by combining the deviations of the various triangular faces of the model data and the corresponding normals, thereby improving the accuracy of model data recognition and matching.
[0089] Embodiment 2
[0090] On the basis of the above embodiments, in order to more clearly understand the present disclosure, refer to Figure 4 As shown, a second embodiment is used below to further explain the situation when the matching efficiency needs to be improved according to the first embodiment of the present disclosure.
[0091] S41, sending the pre-rendered virtual environment to the client, and obtaining calibration model data returned by the client for the virtual environment.
[0092] S42: Acquire a storage component corresponding to the virtual environment, perform model positioning on the storage component, and obtain a positioning model file.
[0093] S43, performing pattern model screening and storage feature screening on the positioning model file to obtain a primary model data set.
[0094] S44, extracting vertex structural features from the calibration model data to obtain calibration model features, and performing structural feature matching on the primary model data set according to the calibration model features to obtain a secondary model data set.
[0095] S45 . Perform face-by-face feature matching on the secondary model data set according to the calibration model data to obtain matching model data.
[0096] In detail, the secondary model data group may contain model data with similar number of vertices, triangles and normals to the model data to be matched. In order to achieve accurate matching, further matching is required based on the detailed features of the calibration model data. The matching model data refers to the matched model data of the object model to be printed.
[0097] In the disclosed embodiment, the step of performing face-by-face feature matching on the secondary model data group according to the calibration model data to obtain matching model data includes: extracting a calibration coordinate system from the calibration model data, and performing coordinate system correction on the calibration model data according to the calibration coordinate system to obtain corrected calibration model data; selecting secondary model data in the secondary model data group as target secondary model data one by one, and performing face-by-face feature matching on the corrected calibration model data and the target secondary model data to obtain a standard face feature deviation value; judging whether the standard face feature deviation value is less than a preset face feature deviation threshold; if not, returning to the step of selecting secondary model data in the secondary model data group as target secondary model data one by one; if yes, adding the standard face feature deviation value to a preset face feature deviation value group until the target secondary model data is the last secondary model data in the secondary model data group, and then using the standard face feature deviation value with the smallest value in the face feature deviation value group as the matching face feature deviation value; and using the secondary model data corresponding to the matching face feature deviation value as the matching model data.
[0098] In detail, the correction calibration model data and the target secondary model data are matched face by face to obtain a standard face feature deviation value, including: selecting triangular faces in the correction calibration model data as target calibration triangular faces one by one in order from near to far from the coordinate origin; selecting triangular faces in the target secondary model data as target secondary triangular faces one by one in order from near to far from the coordinate origin; performing dimensionality reduction feature convolution on the target calibration triangular faces to obtain target calibration face features; performing dimensionality reduction feature convolution on the target secondary triangular faces to obtain target secondary face features; calculating the face feature deviation value between the target calibration face features and the target secondary face features; and generating a standard face feature deviation value based on all face feature deviation values.
[0099] Embodiment 3
[0100] Based on the above embodiments, Figure 5 This is a functional module diagram of a 3D model data recognition and matching system provided by an embodiment of the present disclosure. Figure 5 As shown, a 3D model data recognition and matching system includes:
[0101] The 3D model data recognition and matching system 500 described in this embodiment can be installed in an electronic device. According to the functions implemented, the 3D model data recognition and matching system 500 may include a model calibration module 501, a data positioning module 502, a primary screening module 503, a secondary screening module 504 and a detail matching module 505. The module described in the present disclosure may also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0102] In this embodiment, the functions of each module / unit are as follows:
[0103] The model calibration module 501 is used to send the pre-rendered virtual environment to the client and obtain the calibration model data returned by the client for the virtual environment;
[0104] The data positioning module 502 is used to obtain the storage component corresponding to the virtual environment, perform model positioning on the storage component, and obtain a positioning model file;
[0105] The primary screening module 503 is used to perform mode model screening and storage feature screening on the positioning model file to obtain a primary model data group;
[0106] The secondary screening module 504 is used to extract vertex structural features from the calibration model data to obtain calibration model features, and perform structural feature matching on the primary model data set according to the calibration model features to obtain a secondary model data set;
[0107] The detail matching module 505 is used to perform face-by-face detail matching on the secondary model data set according to the calibration model data to obtain matching model data.
[0108] In detail, each module described in the 3D model data recognition and matching system 500 described in the embodiment of the present disclosure adopts the same technical means as the 3D model data recognition and matching method described in Example 1 when used, and can produce the same technical effects, which will not be repeated here.
[0109] Embodiment 4
[0110] On the basis of the above embodiments, this embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the above embodiments.
[0111] In some implementations of this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the above embodiment are implemented.
[0112] In some implementations of this embodiment, a computer program product is provided, including a computer program / instructions, and when the computer program is executed by a processor, the steps of the method described in the above embodiment are implemented.
[0113] The processor may include, but is not limited to, one or more processors or microprocessors, etc. Each processor may be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components to execute the methods in the above embodiments.
[0114] The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, and the computer-readable storage medium may include but is not limited to, for example, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, computer storage media (e.g., hard disk, floppy disk, solid-state drive, removable disk, CD ROM, DVD ROM, Blu-ray disc, etc.).
[0115] The computer-readable storage medium may also store at least one computer executable program / instruction, which may be, for example, a computer-readable instruction. The computer-readable storage medium includes, but is not limited to, for example, a volatile memory and / or a non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The computer-readable storage medium may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device runs the computer-readable instructions stored on the computer-readable storage medium, the various methods described above may be performed.
[0116] In addition, the computer device may also include (but not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (eg, keyboard, mouse, speaker, etc.), etc.
[0117] The processor may communicate with external devices via an I / O bus via a wired or wireless network.
[0118] In one embodiment, the at least one computer executable instruction may also be compiled into or constitute a software product / computer program product, wherein one or more computer executable instructions are executed by a processor to perform the various functions and / or method steps in the embodiments described in the present technology.
[0119] In the embodiments provided in the present disclosure, it should be understood that the disclosed systems and methods can also be implemented in other ways. The system embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to the multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0120] It should be noted that in the present disclosure, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element limited by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0121] Although the embodiments disclosed in the present disclosure are as above, the above contents are only embodiments adopted for facilitating the understanding of the present disclosure and are not intended to limit the present disclosure. Any technician in the technical field to which the present disclosure belongs can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in the present disclosure, but the scope of patent protection of the present disclosure shall still be subject to the scope defined in the attached claims.
Claims
1. A method for identifying and matching 3D model data, characterized in that: include: Sending the pre-rendered virtual environment to the client, and obtaining calibration model data returned by the client for the virtual environment, wherein the calibration model data refers to data obtained by a user of the client calibrating an object model to be printed, and the calibration model data calibrates the coordinates of multiple vertices, edges or planes of the object model; Acquire a storage component corresponding to the virtual environment, perform model positioning on the storage component, and obtain a positioning model file; Performing mode model screening and storage feature screening on the positioning model file to obtain a primary model data group; Extracting vertex structural features from the calibration model data to obtain calibration model features, and performing structural feature matching on the primary model data set according to the calibration model features to obtain a secondary model data set; Performing face-by-face detail matching on the secondary model data set according to the calibration model data to obtain matching model data; The step of performing model positioning on the storage component to obtain a positioning model file includes: Performing directory parsing on the storage component to obtain a storage directory and a directory attribute corresponding to the storage directory; Extracting the primary model file from the storage directory using a model keyword matching method; Extracting a file attribute feature set from the directory attributes, performing model attribute screening on the file attribute feature set to obtain a model attribute feature group; Gather the files corresponding to the model attribute feature group in the storage directory into a secondary model file; Mapping the storage directory to a tree structure by recursive traversal to obtain a file index tree; Performing associated file matching on the file index tree according to the primary model file and the secondary model file to obtain an index model file; Generate a positioning model file according to the primary model file, the secondary model file and the index model file; The method of performing mode model screening and storage feature screening on the positioning model file to obtain a primary model data group includes: Performing identifier pattern matching on the positioning model file to obtain an identifier model data group; Performing structural pattern matching on the positioning model file to obtain a structural model data group; Extracting a file metadata set from the positioning model file, and encoding features of the file metadata set into a file metadata feature set; Performing model feature screening on the file meta-feature set to obtain a model feature group; Filtering out a metadata model data group from the positioning model file according to the model feature group; A primary model data set is generated based on the identifier model data set, the structure model data set and the metadata model data set.
2. The 3D model data recognition and matching method according to claim 1, characterized in that: The step of extracting vertex structure features from the calibration model data to obtain calibration model features includes: Extracting a calibration type from the calibration model data; Performing type parsing on the calibration model data according to the calibration type to obtain parsed model data; Counting calibration vertex data, calibration normal data and calibration triangle surface data from the analytical model data respectively; Structural feature encoding is performed on the calibration vertex data, the calibration normal data, and the calibration triangle surface data to obtain calibration model features.
3. The 3D model data recognition and matching method according to claim 1, characterized in that: The performing face-by-face detail matching on the secondary model data set according to the calibration model data to obtain matching model data includes: Extracting a calibration coordinate system from the calibration model data, and performing coordinate system correction on the calibration model data according to the calibration coordinate system to obtain corrected calibration model data; Selecting the secondary model data in the secondary model data group one by one as the target secondary model data, performing face-by-face detail matching on the corrected calibration model data and the target secondary model data to obtain a detail deviation value; Determine whether the detail deviation value is less than a preset detail deviation threshold; If not, returning to the step of selecting the secondary model data in the secondary model data group one by one as the target secondary model data; If yes, then the detail deviation value is added to a preset detail deviation value group, until the target secondary model data is the last secondary model data in the secondary model data group, and the detail deviation value with the smallest value in the detail deviation value group is used as the matching detail deviation value; The secondary model data corresponding to the matching detail deviation value is used as matching model data.
4. The 3D model data recognition and matching method according to claim 3, characterized in that: The step of performing face-by-face detail matching on the corrected calibration model data and the target secondary model data to obtain a detail deviation value includes: Selecting triangular faces in the correction calibration model data one by one in the order from near to far from the coordinate origin as target calibration triangular faces, and using the normal of the target calibration triangular faces as the target calibration normal; Selecting triangular faces in the target secondary model data one by one in order from near to far from the coordinate origin as target secondary triangular faces, and using normals of the target secondary triangular faces as target secondary normals; Calculating an edge ratio deviation value between the target calibration triangle and the target secondary triangle; Calculating a normal slope deviation value between the target calibration normal and the target secondary normal; Generates a detail bias value based on all edge scale bias values and all normal slope bias values.
5. A 3D model data recognition and matching system, characterized in that: The method for identifying and matching 3D model data according to any one of claims 1 to 4 comprises: A model calibration module, used to send the pre-rendered virtual environment to the client, and obtain calibration model data returned by the client for the virtual environment; A data positioning module, used for acquiring a storage component corresponding to the virtual environment, performing model positioning on the storage component, and obtaining a positioning model file; A primary screening module, used for performing mode model screening and storage feature screening on the positioning model file to obtain a primary model data group; A secondary screening module is used to extract vertex structural features from the calibration model data to obtain calibration model features, and to perform structural feature matching on the primary model data group according to the calibration model features to obtain a secondary model data group; The detail matching module is used to perform face-by-face detail matching on the secondary model data set according to the calibration model data to obtain matching model data.
6. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the 3D model data recognition and matching method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the 3D model data recognition and matching method described in any one of claims 1 to 4 are implemented.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program is executed by a processor, the steps of the 3D model data recognition and matching method described in any one of claims 1 to 4 are implemented.
