Intelligent graphic search and positioning method for CAD viewing software
By cropping drawings in CAD viewing software and using twin networks for hierarchical similarity comparison and multipath disparity calculation, the problems of low accuracy and efficiency in graphic search and positioning are solved, achieving more efficient graphic matching.
Patent Information
- Application Number
- CN202510796330.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-06-16
AI Technical Summary
Existing CAD viewing software has low accuracy and efficiency in graphic search and positioning, especially when dealing with complex 3D graphics, it is difficult to meet high requirements.
By cutting CAD drawings based on 3D dimensional information, using twin networks for hierarchical similarity comparison, and optimizing the matching process through multi-path disparity calculation, the positioning result of the graphic to be searched is determined.
It improves the accuracy and efficiency of image search and positioning, enabling more accurate matching of complex 3D graphics.
Smart Images

Figure CN120316294B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to an intelligent graphic search and positioning method for CAD viewing software. Background Technology
[0002] In CAD viewing software, graphic search and positioning suffers from low accuracy and inefficiency, especially when dealing with complex 3D graphics. Traditional graphic search methods rely on simple geometric shape matching or static image comparison, which cannot effectively handle the complexity and diversity of 3D graphics. When drawings contain a large amount of detail or complex structures, the positioning process is often not precise enough, leading to mismatches or failure to accurately match the target graphic. Furthermore, traditional methods neglect the 3D spatial relationships between graphics, failing to fully consider the spatial position and shape characteristics of different graphics, resulting in insufficient accuracy and processing speed for graphic searches in practical engineering applications. Summary of the Invention
[0003] This application provides an intelligent graphic search and positioning method for CAD viewing software, which aims to address the technical problem of low accuracy and efficiency of graphic search and positioning in existing CAD viewing software.
[0004] In view of the above problems, this application provides an intelligent graphic search and positioning method for CAD viewing software.
[0005] This application provides an intelligent graphic search and location method for CAD viewing software, the method comprising:
[0006] Based on the 3D dimension information of the image to be searched, the CAD 3D drawing is cropped according to a preset interval step size to determine several 3D feature models. Using a Siamese network, hierarchical similarity comparisons are performed on the image to be searched and the several 3D feature models to determine multiple candidate 3D feature models that meet a preset threshold, as well as the similarity of multiple candidate models. According to a preset penalty function, using the image to be searched as a reference, multipath disparity calculations are performed on the pixel values of the multiple candidate 3D feature models to output multiple penalty values. Multiple matching degrees are calculated based on the similarity of the multiple candidate models and the multiple penalty values, and the candidate 3D feature model with the highest matching degree is taken as the localization result of the image to be searched.
[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0008] This application, based on the 3D dimension information of the image to be searched, cuts the CAD 3D drawing according to a preset interval step size to determine several 3D feature models; using a twin network, it performs hierarchical similarity comparison on the image to be searched and the several 3D feature models respectively, determining multiple candidate 3D feature models that meet a preset threshold, as well as multiple candidate model similarities; according to a preset penalty function, using the image to be searched as a reference, it performs multi-path disparity calculation on the pixel values of the multiple candidate 3D feature models respectively, outputting multiple penalty values; based on the multiple candidate model similarities and multiple penalty values, it calculates multiple matching degrees, and takes the candidate 3D feature model with the highest matching degree as the positioning result of the image to be searched. This invention solves the technical problem of low accuracy and efficiency in image search and positioning in existing CAD viewing software by using 3D dimension information to cut the drawing, using a twin network for hierarchical similarity comparison, and optimizing the matching process through multi-path disparity calculation, thereby achieving the technical effect of improving the accuracy and efficiency of image search and positioning. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A schematic flowchart of an intelligent graphic search and positioning method for CAD viewing software provided in an embodiment of this application;
[0011] Figure 2 This is a flowchart illustrating the process of outputting multiple penalty values in the intelligent graphic search and positioning method for CAD viewing software provided in this application embodiment. Detailed Implementation
[0012] This application provides an intelligent graphic search and positioning method for CAD viewing software, which addresses the technical problem of low accuracy and efficiency in graphic search and positioning in existing CAD viewing software. By using three-dimensional dimension information to cut drawings, using twin networks for hierarchical similarity comparison, and optimizing the matching process through multi-path disparity calculation, the method achieves the technical effect of improving the accuracy and efficiency of graphic search and positioning.
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0014] It should be noted that any variation of the terms "comprising" and "having" is intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such processes, methods, products, or devices.
[0015] Examples, such as Figure 1 As shown, this application provides an intelligent graphic search and location method for CAD viewing software, the method comprising:
[0016] Step S100: Based on the three-dimensional dimension information of the graphic to be searched, the CAD three-dimensional drawing is cut according to the preset interval step size to determine several three-dimensional feature models.
[0017] In this embodiment, the spatial dimensions and three-dimensional shape data of the graphic to be searched are first obtained using geometric modeling methods of CAD drawings, based on the three-dimensional dimension information of the graphic to be searched. By parsing this three-dimensional dimension information, the position and range of the graphic to be searched in three-dimensional space are determined. Then, a cropping operation is performed according to a preset interval step size, for example, setting the interval step size to 0.1 mm, and extracting local three-dimensional fragments from the drawing according to this step size. During the cropping process, a segmentation algorithm is used to spatially divide the CAD three-dimensional drawing according to the preset step size rules, dividing the original image into multiple small regions. Each small region represents a part of the graphic's details. After cropping, these small regions generate several three-dimensional feature models.
[0018] Step S200: Using a twin network, perform hierarchical similarity comparisons on the image to be searched and several 3D feature models respectively, and determine multiple candidate 3D feature models that meet the preset threshold, as well as the similarity of multiple candidate models.
[0019] In this embodiment, a 3D model comparator is first constructed using a Siamese network. This comparator contains P model comparison plugins, where P is an integer greater than 5. These model comparison plugins, through a shared network structure, are able to perform similarity comparisons between the search image and several 3D feature models. Specifically, one of these P model comparison plugins is randomly selected for preliminary similarity comparison, multiple first similarities are calculated, and 3D feature models with similarities exceeding the first similarity threshold are selected as preliminary candidate models.
[0020] The similarity scores of the selected similar models are then averaged, and this average is used to determine the selection quantity Q, where Q is between 1 and P. Next, Q plugins are randomly selected from the P model comparison plugins, and a second round of similarity comparison is performed between the search image and the multiple similar 3D feature models. Multiple secondary similarity scores are obtained, and candidate 3D feature models with similarity scores exceeding a second similarity threshold are selected, where the second similarity threshold is greater than the first similarity threshold.
[0021] After two rounds of comparison and screening, several candidate 3D feature models that meet the preset similarity threshold and their corresponding similarity scores were determined.
[0022] Furthermore, the method provided in the application embodiment, which utilizes a Siamese network to perform hierarchical similarity comparisons on the image to be searched and several three-dimensional feature models, further includes:
[0023] A 3D model comparison device is constructed using a Siamese network. The 3D model comparison device includes P model comparison plugins, where P is an integer greater than 5. Any one of the P model comparison plugins is randomly selected to perform a first similarity comparison on the image to be searched and several 3D feature models, outputting multiple similar 3D feature models that meet a first similarity threshold, and multiple first similarities. The mean of the multiple first similarities is calculated, and the number of adaptation selections Q is set according to the mean of the first similarities, where Q is greater than or equal to 1 and less than or equal to P. Q model comparison plugins are randomly selected from the P model comparison plugins to perform a second similarity comparison on the image to be searched and the multiple similar 3D feature models, obtaining multiple second-order similarities which are set as multiple candidate model similarities. Multiple candidate 3D feature models that meet a second similarity threshold are output, where the second similarity threshold is greater than the first similarity threshold.
[0024] In this embodiment, a 3D model aligner is first constructed using a Siamese network. This process begins by building two convolutional neural networks with shared weights as feature extraction layers, combined with an alignment output layer to create model alignment plugins. These plugins are trained using shared weights to extract features from 3D models and perform similarity comparisons. Next, multiple sample 3D model groups are collected, and each group is assigned similarity based on its 3D attribute information, generating multiple sample similarities. These sample 3D model groups and their similarities are then used as training data, divided into P equal parts, with P training sets selected with replacement each time. These training sets are used for supervised training of the alignment plugins until a preset convergence condition is met. Finally, through this training process, P model alignment plugins are obtained, and a 3D model aligner is constructed.
[0025] Next, from these P comparison plugins, one plugin is randomly selected for the initial similarity comparison. Each plugin performs a similarity comparison between the search image and multiple 3D feature models, calculating the similarity between each pair of images. The similarity is calculated using Euclidean distance, cosine similarity, or other metrics to quantitatively evaluate the similarity between images. After the comparison is complete, multiple first similarity values are output, and multiple similar 3D feature models that meet the first similarity threshold are selected. The first similarity threshold is preset by technical experts.
[0026] Next, the mean of all obtained first similarities is calculated, and the average of all similarities is obtained as the first similarity mean. At the same time, the historical maximum similarity within the preset time range is calculated, and the ratio between the two is obtained. This ratio is called the dynamic adjustment coefficient. Then, the dynamic adjustment coefficient is multiplied by the P value and rounded up to obtain the final number of fit selections Q.
[0027] Subsequently, Q model comparison plugins are randomly selected from P model comparison plugins for secondary similarity comparison. Each selected comparison plugin compares the image to be searched with multiple similar 3D feature models again, calculating multiple secondary similarity scores, which are then set as multiple candidate model similarity scores. These secondary similarity scores are then compared with a preset second similarity threshold, and candidate 3D feature models that are greater than or equal to the second similarity threshold are output, resulting in multiple candidate 3D feature models. The second similarity threshold, which is greater than the first similarity threshold, is preset by technical experts.
[0028] Furthermore, the method provided in the application embodiments, which utilizes a Siamese network to construct a 3D model comparator, further includes:
[0029] Based on Siamese networks, two weight-sharing convolutional neural networks are used as feature extraction layers, and a model comparison plugin is built by combining them with an alignment output layer. Multiple sample 3D model groups are collected, and the similarity of each sample 3D model group is calculated and labeled according to the 3D attribute information to obtain multiple sample similarities. The multiple sample 3D model groups and multiple sample similarities are used as training data, and are divided into P equal parts. The first training set is constructed by selecting P times with replacement, and the selection is continued to be iterated P times with replacement to obtain P training sets. The model comparison plugin is supervised and trained using the P training sets to obtain P model comparison plugins that meet the preset convergence conditions, and a 3D model comparison device is constructed.
[0030] In this embodiment, a 3D model comparison device is first constructed based on a Siamese network. The Siamese network uses two convolutional neural networks (CNNs) with shared weights as feature extraction layers. The CNNs extract features from the input 3D graphics through multiple convolutional layers. These convolutional layers can capture local features of the graphics, such as edges, textures, and shapes, and progressively build more complex global features across multiple layers. By sharing weights, the two neural networks extract common features between the search graphic and the 3D feature model, and then calculate the similarity between the graphics. The comparison output layer calculates the similarity between features, using methods such as Euclidean distance or cosine similarity to quantify the matching degree of the graphics, thereby determining whether the graphics are similar. Through this process, a model comparison plugin is finally constructed, which is used to perform similarity comparisons on 3D models.
[0031] Next, multiple sets of sample 3D models are collected, containing 3D models of different types or features. For example, a model set may include various geometric shapes such as spheres, cubes, and cylinders. Based on the 3D attribute information of these models, such as size, volume, surface curvature, and geometry, similarity is calculated. Methods for calculating similarity include Euclidean distance and cosine similarity, quantifying the geometric differences between models. Each 3D model is labeled according to its similarity to other models; for example, similarity values are used as labels to represent the degree of similarity between models. These labeled 3D models and their corresponding similarities will serve as training data for supervised learning.
[0032] Then, these labeled sample 3D model sets and corresponding similarity data are used as training data and divided into P equal parts, where P is an integer greater than 5, indicating that the data is divided into multiple subsets. Each training subset contains a certain number of sample data, which will be used to train different alignment plugins. Using a selection method with replacement, training sets are repeatedly and randomly drawn from these sample data, with P samples drawn each time to form a new training set. Through iterative selection with replacement, the composition of the training dataset is continuously adjusted to ensure the diversity of each training set. This process ultimately generates P different training sets, each containing different combinations of samples to avoid overfitting the model to certain specific samples.
[0033] Next, these P training sets are used to perform supervised training on the model comparison plugin. During training, each plugin learns using its corresponding training set, optimizing network weights by calculating the error between the predicted similarity and the actual labeled similarity. The optimization process uses the backpropagation algorithm to gradually adjust network parameters until the error reaches a preset minimum value. The goal of supervised training is to enable the comparison plugin to accurately calculate the similarity between images. When the error reaches a certain threshold during training, the training process is considered complete, meeting the preset convergence conditions.
[0034] Ultimately, through these steps, P model alignment plugins are obtained, and these trained plugins are combined to construct a 3D model alignment tool.
[0035] Furthermore, in the method provided in the application embodiments, setting the number of adaptation selections Q according to the first similarity mean further includes:
[0036] Calculate the ratio of the first similarity mean to the historical maximum similarity within a preset time range, and set it as the dynamic adjustment coefficient; multiply the dynamic adjustment coefficient by P and round it down, and use the product of the two as the number of adaptation selections Q.
[0037] In this embodiment, the ratio of the first average similarity to the historical maximum similarity within a preset time range is first calculated. The historical maximum similarity refers to the maximum similarity obtained from the best matching result selected from previous comparison tasks within the preset time range of system operation. Specifically, the similarity of all comparison results is recorded over a past period, and then the maximum value is identified as the historical maximum similarity. This time range is a fixed period (e.g., the past week, month, etc.).
[0038] The dynamic adjustment coefficient is obtained by calculating the ratio of the first similarity mean to the historical maximum similarity. This dynamic adjustment coefficient is then multiplied by P and rounded up to obtain the number of fits selected, Q.
[0039] Step S300: According to the preset penalty function, based on the image to be searched, perform multipath disparity calculation on the pixel values of the multiple candidate 3D feature models respectively, and output multiple penalty values.
[0040] In this embodiment, a comparison is first performed using the image to be searched as a benchmark according to a preset penalty function. The preset penalty function is used to penalize matching errors that may occur during the comparison process, ensuring a more accurate match of image details. Then, each of the multiple candidate 3D feature models is compared with the image to be searched. In this step, one model is first randomly selected from the multiple candidate 3D feature models as the first candidate 3D feature model.
[0041] Next, multiple pixel extension paths are configured, each extending at different angles and directions. These extension paths are used to analyze the similarity between the searched graphic and the first candidate 3D feature model from multiple perspectives, performing comprehensive disparity calculations.
[0042] The disparity calculation process uses multi-path disparity computation, which determines the matching degree of the graphics in 3D space by calculating the pixel differences between the graphics on each extension path. Specifically, the disparity value is calculated by comparing the pixel differences between the search graphic and the first candidate 3D feature model on each extension path. The disparity value on each path represents the matching error for that path. Then, the calculated multiple disparity values are output as multiple penalty values.
[0043] Further, such as Figure 2 As shown, the method provided in the application embodiment includes, according to a preset penalty function, multipath disparity calculation is performed on the pixel values of the plurality of candidate 3D feature models based on the image to be searched, and multiple penalty values are output. It also includes:
[0044] A first candidate 3D feature model is randomly selected from the plurality of candidate 3D feature models; multiple pixel extension paths are configured, wherein the angle and direction of each extension path are different; according to a preset penalty function, multi-path disparity calculation is performed on the image to be searched and the first candidate 3D feature model based on the plurality of pixel extension paths, and a first penalty value is output and added to the plurality of penalty values.
[0045] In this embodiment, a model is first randomly selected from multiple candidate 3D feature models as the first candidate 3D feature model. Then, multiple pixel extension paths are configured, with different angles and directions. By configuring extension paths with different directions and angles, a comprehensive evaluation of the match between the search graphic and the first candidate 3D feature model is ensured in multiple directions. For example, paths include horizontal (left-right), vertical (up-down), and diagonal (e.g., from upper left to lower right), covering various directions of the graphic and providing multi-angle matching analysis.
[0046] Then, based on multiple pixel extension paths, multi-path disparity calculation is performed on the image according to a preset penalty function. In this process, grayscale processing is first performed, converting the image to be searched and the first candidate 3D feature model into grayscale images, thus simplifying subsequent calculations. Next, a pixel is randomly selected from the image to be searched, and the pixel in the first candidate 3D feature model with the smallest difference in grayscale value from that pixel is found. At this point, disparity calculation is used to measure the degree of matching between the two, calculating the pixel offset between the images, and using this as a basis for subsequent matching.
[0047] In disparity calculation, the pixel disparity range is set to an 8×8 pixel area. This setting processes pixel information within a certain range around each pixel. Then, according to the set disparity range, the first graphic pixel and the first model pixel are expanded respectively to obtain their respective regions (first graphic region and first model region).
[0048] The matching cost, i.e., the matching error between the two, is calculated based on these regions. A preset penalty function penalizes the process based on the comparison of matching errors, ensuring that the more accurate the matching of the image, the lower the cost, and vice versa. Through the calculation of multiple extension paths, a first penalty result is finally obtained, which reflects the matching error between the image to be searched and the first candidate 3D feature model.
[0049] Through iterative analysis, the pixels of all the images to be searched are calculated multiple times, and the matching cost of each pixel is summed to obtain the first penalty value. Finally, these calculated penalty values are added to the multiple penalty values.
[0050] Furthermore, in the method provided in the application embodiment, multi-path disparity calculation is performed on the image to be searched and the first candidate 3D feature model based on the multiple pixel extension paths according to a preset penalty function, and further includes:
[0051] Configure a pixel disparity range, wherein the pixel disparity range is an 8x8 pixel region; perform grayscale processing on the image to be searched and the first candidate 3D feature model to obtain a grayscale image to be searched and a first grayscale 3D feature model; randomly select a first image pixel in the grayscale image to be searched, and match it to obtain a first model pixel of the first grayscale 3D feature model, wherein the first model pixel is the pixel in the first grayscale 3D feature model with the smallest grayscale value deviation from the first image pixel; expand the first image pixel and the first model pixel according to the pixel disparity range to obtain a first image region and a first model region; based on the multiple pixel extension paths, calculate the matching cost of the first image region and the first model region according to a preset penalty function to obtain a first penalty result; perform iterative analysis to obtain multiple penalty results for all pixels of the image to be searched, and sum them to obtain the first penalty value.
[0052] In this embodiment, the pixel disparity range is first configured, which is set to an 8×8 pixel area. The range of disparity calculation is limited by defining a fixed-size window.
[0053] Next, grayscale processing is performed on the image to be searched and the first candidate 3D feature model. The purpose of grayscale processing is to convert a color image into a grayscale image, simplifying the image data by converting RGB values into single grayscale values. This processing step uses a grayscale conversion formula to simplify the color information of the image into brightness information, reducing computational complexity and improving processing efficiency. After grayscale processing, the grayscale image to be searched and the first grayscale 3D feature model are obtained.
[0054] After processing, a first graphic pixel is randomly selected from the grayscale image to be searched, and a first model pixel is found in the first grayscale 3D feature model. Here, the first model pixel is the pixel with the smallest grayscale value difference from the first graphic pixel. This process selects the best match by calculating the grayscale value deviation of pixels in the image. The method used is to calculate the Euclidean distance or Manhattan distance between pixels, and the pixel pair with the smallest difference is the best matching pixel. In this way, the first model pixel that best matches the image pixel to be searched is obtained.
[0055] Next, the first graphic pixels and the first model pixels are expanded according to the pixel disparity range to obtain the first graphic region and the first model region. The expansion operation is performed using a sliding window technique, which expands the comparison range of each pixel within the disparity range to consider the contextual information surrounding each pixel. This expansion method ensures that the comparison is not limited to a single pixel but considers the matching of the entire pixel region, avoiding matching errors caused by differences in a single pixel, thereby improving the accuracy of the comparison results. Through this step, the first graphic region and the first model region are obtained.
[0056] After region expansion, disparity calculation is performed using multiple pixel extension paths. These paths represent disparity calculations from multiple directions (e.g., horizontal, vertical, diagonal), ensuring a comprehensive evaluation of the match between the searched graphic and the first candidate 3D feature model from different angles. A matching cost is calculated for each path, and a preset penalty function is used to penalize the matching error. The matching cost represents the matching error between graphic regions; a lower cost indicates a more accurate match. The preset penalty function ensures that regions with larger errors are appropriately penalized, thereby optimizing the matching process. The first penalty result is calculated, reflecting the matching quality between the first graphic region and the first model region, representing the error in the graphic matching process.
[0057] Finally, iterative analysis is performed, comparing all pixels of the image to be searched multiple times. Each comparison generates a penalty result, reflecting the matching error of different pixels. Through multiple iterative analyses, all calculated penalty results are summed to obtain the first penalty value.
[0058] Furthermore, in the method provided in the application embodiment, based on the multiple pixel extension paths, the matching cost between the first graphic region and the first model region is calculated according to a preset penalty function to obtain a first penalty result, and the method further includes:
[0059] Based on the multiple pixel extension paths, the first graphic region and the first model region are divided to obtain multiple first mapping region groups; the mean square error of the pixel grayscale values in the multiple first mapping region groups is calculated to obtain multiple path cost values; and a first penalty result is calculated based on the multiple path cost values using a preset penalty function.
[0060] In this embodiment, the first graphic region and the first model region are first divided based on multiple pixel extension paths to obtain multiple first mapping region groups. Specifically, the graphic region is divided into multiple sub-regions using a sliding window algorithm. This algorithm uses a fixed-size window (8×8 pixels in this example) and slides the window along different extension paths, including horizontal, vertical, and diagonal directions. Each time the window slides, a new region is formed, and each region represents a local area of the graphic. In this way, multiple first mapping region groups are ultimately obtained.
[0061] Next, the mean squared error (MSE) of the pixel grayscale values in each of these multiple first mapping region groups is calculated to obtain multiple path cost values. In this process, the mean squared error is used to measure the difference between image regions. Specifically, the pixel grayscale values in each mapping region are compared, the difference between the pixel of the image to be searched and the pixel of the first model is calculated, these differences are squared, and then the average is taken to obtain the error measure for that region. The calculated path cost value reflects the matching accuracy between two regions on that path; the smaller the cost value, the better the match. Through this calculation, multiple path cost values are obtained.
[0062] Finally, a preset penalty function is used to calculate the first penalty result based on the calculated cost values of multiple paths.
[0063] Furthermore, in the method provided in the application embodiment, the expression of the preset penalty function is:
[0064] ;
[0065] ;
[0066] in, The penalty result is M, where M is the number of pixel extension paths. The weights representing the extension path of the m-th pixel. The penalty weight is the path cost value of the extended path of the m-th pixel. Let K be the path cost of the extended path of the m-th pixel, where K is a constant.
[0067] In this embodiment of the application, the expression of the preset penalty function is: ;in, The penalty result is M, where M is the number of pixel extension paths. The weight represents the extension path of the m-th pixel, and each extension path of the pixel has the same weight. The penalty weight for the path cost value of the extended path of the m-th pixel is determined by... Perform calculations. K is the path cost of the m-th pixel extension path, where K is a constant and is preset by technical experts.
[0068] By pre-setting a penalty function, the penalty result can be adjusted according to the cost of each path, the weight of the path, and constants, ultimately yielding a comprehensive penalty result.
[0069] Step S400: Calculate multiple matching degrees based on the similarity of the multiple candidate models and multiple penalty values, and take the candidate 3D feature model with the maximum matching degree as the localization result of the image to be searched.
[0070] In this embodiment, when calculating multiple matching degrees based on the similarity of multiple candidate models and multiple penalty values, a first weight and a second weight are first configured. The first weight controls the similarity weight, with a value less than or equal to 0.2, indicating that similarity has a relatively small impact on the final matching result. The second weight controls the disparity weight, i.e., the impact of the penalty value on the matching degree, with a value greater than or equal to 0.8, indicating that disparity is more important in the matching degree calculation. Next, based on the first and second weights, the similarity and the reciprocal of the penalty value are weighted and combined to obtain the final matching degree for each candidate model. Multiple matching degrees are obtained through this process.
[0071] Finally, the candidate 3D feature model with the highest matching degree among multiple matching degrees is selected as the localization result of the image to be searched. That is, among all the calculated matching degrees, the candidate 3D feature model with the highest matching degree is selected as the most accurate matching model and determined as the final localization result.
[0072] Furthermore, the method provided in the application embodiment, which calculates multiple matching degrees based on the multiple candidate model similarities and multiple penalty values, further includes:
[0073] Configure a first weight and a second weight, wherein the first weight is a similarity weight with a value less than or equal to 0.2, and the second weight is a disparity weight with a value greater than or equal to 0.8; based on the first weight and the second weight, calculate multiple matching degrees according to the similarity of the multiple candidate models and multiple penalty values.
[0074] In this embodiment, a first weight and a second weight are first configured. The first weight is used to control the influence of the similarity weight, and its value is less than or equal to 0.2. The final weight is set by a technical expert. The second weight is used to control the disparity weight, and its value is greater than or equal to 0.8. The final weight is also set by a technical expert.
[0075] Next, based on the first and second weights, the similarity of multiple candidate models and multiple penalty values are calculated by weighting to obtain the matching degree of each model. Specifically, firstly, the multiple penalty values are normalized to obtain multiple standard penalty values. Then, based on the first and second weights, the similarity of multiple candidate models and the reciprocals of multiple standard penalty values are weighted and summed to obtain multiple matching degrees.
[0076] Furthermore, the method provided in the application embodiment, which calculates multiple matching degrees based on the multiple candidate model similarities and multiple penalty values, further includes:
[0077] The multiple penalty values are normalized to obtain multiple standard penalty values; based on the first weight and the second weight, the multiple candidate model similarities and the reciprocals of the multiple standard penalty values are weighted and summed to output multiple matching degrees.
[0078] In this embodiment, multiple penalty values are first normalized using a minimum-maximum normalization method. By subtracting the minimum value from each penalty value and dividing by the difference between the maximum and minimum values, all penalty values are ensured to be within a uniform scale, resulting in multiple standard penalty values.
[0079] Next, based on the first and second weights, the similarity scores of multiple candidate models and the inverses of multiple standard penalty values are weighted and summed to obtain multiple matching degrees.
[0080] In summary, the embodiments of this application have at least the following technical effects:
[0081] This application, based on the 3D dimension information of the image to be searched, cuts the CAD 3D drawing according to a preset interval step size to determine several 3D feature models; using a twin network, it performs hierarchical similarity comparison on the image to be searched and the several 3D feature models respectively, determining multiple candidate 3D feature models that meet a preset threshold, as well as multiple candidate model similarities; according to a preset penalty function, using the image to be searched as a reference, it performs multi-path disparity calculation on the pixel values of the multiple candidate 3D feature models respectively, outputting multiple penalty values; based on the multiple candidate model similarities and multiple penalty values, it calculates multiple matching degrees, and takes the candidate 3D feature model with the highest matching degree as the positioning result of the image to be searched. This invention solves the technical problem of low accuracy and efficiency in image search and positioning in existing CAD viewing software by using 3D dimension information to cut the drawing, using a twin network for hierarchical similarity comparison, and optimizing the matching process through multi-path disparity calculation, thereby achieving the technical effect of improving the accuracy and efficiency of image search and positioning.
[0082] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0083] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0084] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.
Claims
1. An intelligent graphic search and positioning method for CAD viewing software, characterized in that, The methods include: Based on the three-dimensional size information of the graphic to be searched, the CAD three-dimensional drawing is cut according to a preset interval step size to determine several three-dimensional feature models. Using a twin network, hierarchical similarity comparisons are performed on the image to be searched and several 3D feature models to determine multiple candidate 3D feature models that meet a preset threshold, as well as the similarity of multiple candidate models. According to the preset penalty function, based on the image to be searched, multipath disparity calculation is performed on the pixel values of the multiple candidate 3D feature models, and multiple penalty values are output. Multiple matching degrees are calculated based on the similarity of the multiple candidate models and multiple penalty values, and the candidate 3D feature model with the highest matching degree is used as the localization result of the image to be searched.
2. The intelligent graphic search and positioning method for CAD viewing software according to claim 1, characterized in that, Using a Siamese network, hierarchical similarity comparisons are performed on the image to be searched and several 3D feature models, including: A 3D model aligner is constructed using a Siamese network, wherein the 3D model aligner includes P model alignment plugins, where P is an integer greater than 5; Randomly select any model comparison plugin from the P model comparison plugins, and perform a similarity comparison on the image to be searched and several three-dimensional feature models respectively, and output multiple similar three-dimensional feature models that meet the first similarity threshold, as well as multiple first similarity scores; The mean of the multiple first similarities is calculated, and the number of adaptation selections Q is set according to the mean of the first similarities, where Q is greater than or equal to 1 and less than or equal to P; Q model comparison plugins are randomly selected from the P model comparison plugins to perform secondary similarity comparisons on the image to be searched and multiple similar 3D feature models respectively, and the resulting secondary comparison similarities are set as multiple candidate model similarities. Multiple candidate 3D feature models that meet the second similarity threshold are output, wherein the second similarity threshold is greater than the first similarity threshold.
3. The intelligent graphic search and positioning method for CAD viewing software according to claim 2, characterized in that, Constructing a 3D model comparator using Siamese networks includes: Based on Siamese networks, two convolutional neural networks with shared weights are used as feature extraction layers, and a model comparison plugin is built by combining the comparison output layer. Collect multiple sets of 3D model samples, and calculate and label the similarity of each set of 3D model samples according to the 3D attribute information to obtain the similarity of multiple samples; The multiple sample 3D model groups and multiple sample similarities are used as training data and divided into P equal parts. The first training set is constructed by selecting P times with replacement. The first training set is then constructed by iteratively selecting P times with replacement to obtain P training sets. Using the P training sets, supervised training is performed on the model comparison plugins to obtain P model comparison plugins that meet the preset convergence conditions, and a three-dimensional model comparison device is constructed.
4. The intelligent graphic search and positioning method for CAD viewing software according to claim 2, characterized in that, The number of fits selected, Q, is set according to the mean of the first similarity, including: Calculate the ratio of the first average similarity to the historical maximum similarity within a preset time range, and set it as the dynamic adjustment coefficient; Multiply the dynamic adjustment coefficient by P and round it down. Use the product of the two as the number of adaptation selections Q.
5. The intelligent graphic search and positioning method for CAD viewing software according to claim 1, wherein, based on the graphic to be searched, multipath disparity calculation is performed on the pixel values of the plurality of candidate 3D feature models according to a preset penalty function, and multiple penalty values are output, including: Randomly select a first candidate three-dimensional feature model from the plurality of candidate three-dimensional feature models; Configure multiple pixel extension paths, each with a different angle and direction; According to the preset penalty function, based on the multiple pixel extension paths, multi-path disparity calculation is performed on the image to be searched and the first candidate 3D feature model, and a first penalty value is output and added to the multiple penalty values.
6. The intelligent graphic search and positioning method for CAD viewing software according to claim 5, wherein, based on the multiple pixel extension paths according to a preset penalty function, multi-path disparity calculation is performed on the graphic to be searched and the first candidate 3D feature model, including: Configure the pixel parallax range, where the pixel parallax range is an 8x8 pixel area; The image to be searched and the first candidate three-dimensional feature model are subjected to grayscale processing to obtain the grayscale image to be searched and the first grayscale three-dimensional feature model. Randomly select a first graphic pixel in the grayscale image to be searched, and match it to obtain the first model pixel of the first grayscale three-dimensional feature model, wherein the first model pixel is the pixel with the smallest grayscale value deviation from the first graphic pixel in the first grayscale three-dimensional feature model. According to the pixel disparity range, the first graphic pixel and the first model pixel are expanded respectively to obtain the first graphic region and the first model region; Based on the multiple pixel extension paths, the matching cost between the first graphic region and the first model region is calculated according to a preset penalty function to obtain the first penalty result; Perform iterative analysis to obtain multiple penalty results for all pixels of the image to be searched, and sum them to obtain the first penalty value.
7. The intelligent graphic search and positioning method for CAD viewing software according to claim 6, based on the multiple pixel extension paths, calculates the matching cost between the first graphic region and the first model region according to a preset penalty function to obtain a first penalty result, including: Based on the multiple pixel extension paths, the first graphic region and the first model region are divided respectively to obtain multiple first mapping region groups; Calculate the mean square error of pixel grayscale values in the multiple first mapping region groups respectively to obtain multiple path cost values; The first penalty result is calculated based on the cost of the multiple paths using a preset penalty function.
8. The intelligent graphic search and positioning method for CAD viewing software according to claim 7, characterized in that, The expression for the preset penalty function is: ; ; in, The penalty result is M, where M is the number of pixel extension paths. The weights representing the extension path of the m-th pixel. The penalty weight is the path cost value of the extended path of the m-th pixel. Let K be the path cost of the extended path of the m-th pixel, where K is a constant.
9. The intelligent graphic search and positioning method for CAD viewing software according to claim 1, characterized in that, Multiple matching degrees are calculated based on the similarity of the multiple candidate models and multiple penalty values, including: Configure a first weight and a second weight, wherein the first weight is a similarity weight with a value less than or equal to 0.2, and the second weight is a disparity weight with a value greater than or equal to 0.8; Based on the first weight and the second weight, multiple matching degrees are calculated according to the similarity of the multiple candidate models and multiple penalty values.
10. The intelligent graphic search and positioning method for CAD viewing software according to claim 9, characterized in that, Multiple matching degrees are calculated based on the similarity of the multiple candidate models and multiple penalty values, including: The multiple penalty values are normalized to obtain multiple standard penalty values; Based on the first weight and the second weight, the reciprocals of the similarity of the multiple candidate models and the multiple standard penalty values are weighted and summed to output multiple matching degrees.
Citation Information
Patent Citations
Heterogenous image matching and positioning method and system based on twin network and supervised training
CN114022729A
Method for sketch retrieval of three-dimensional model based on anti-noise network
CN118227821A