Construction method for automatically generating three-dimensional VR scene based on multi-view two-dimensional drawing
Through the deep vision algorithm combined with the improved bat algorithm and simulated annealing mechanism, the conversion problem of multi-view two-dimensional drawings to three-dimensional VR scenes is solved, efficient, accurate and robust automatic conversion is achieved, and a three-dimensional model with continuous structure and rich details is generated.
Patent Information
- Application Number
- CN202510354389.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to efficiently and accurately convert multi-view two-dimensional drawings into three-dimensional VR scenes, and there are problems such as loss of information, insufficient local details, large matching errors, many manual interventions, and low degree of automation.
The depth vision algorithm combined with the modified bat algorithm and simulated annealing mechanism is adopted to extract edge, corner points and texture information in multi-view two-dimensional drawings through innovative mechanisms such as adaptive inertia factors, local perturbations, temperature regulation and dynamic clustering, and extract edges, corner points and texture information in multi-view two-dimensional drawings, generate global feature point clouds, and perform three-dimensional reconstruction.
It realizes efficient, accurate and robust automatic conversion of two-dimensional drawings to three-dimensional VR scenes, improves the accuracy and stability of three-dimensional reconstruction, and generates three-dimensional models with continuous structure and rich details.
Smart Images

Figure CN120298623A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual reality technology, and particularly to a construction method for automatically generating a three-dimensional VR scene based on multi-view two-dimensional drawings. Background Art
[0002] In the prior art, two-dimensional drawings have always been a widely used graphical expression method in engineering design, architectural planning, and manufacturing. Their intuitiveness and standardization make them an important basis for basic design. However, traditional two-dimensional drawings have obvious deficiencies in expressing complex three-dimensional structures. Especially when it comes to the construction of virtual reality scenes, two-dimensional drawings are often difficult to fully display spatial depth, hierarchical structure, and detailed information. With the rapid development of virtual reality technology, how to efficiently and accurately convert multi-view two-dimensional drawing data into a three-dimensional VR scene with a sense of reality and interactivity has become an urgent technical problem to be solved. The prior art mainly relies on traditional image processing methods, such as edge detection, corner extraction, and texture analysis, to preprocess the two-dimensional drawing data, so as to extract basic structure information. However, due to the perspective limitation of two-dimensional drawings and the noise interference of the image data itself, these traditional methods often have problems such as information loss, insufficient local details, and large matching errors during the feature extraction process, resulting in an unsatisfactory three-dimensional reconstruction effect. At the same time, in the existing two-dimensional to three-dimensional conversion methods, multi-view drawing data often requires manual intervention for manual registration and matching, which is time-consuming and laborious, and it is difficult to ensure the accuracy and consistency of the data, further restricting the automation and efficiency of the construction of three-dimensional VR scenes.
[0003] In addition, some studies have tried to introduce optimization algorithms based on swarm intelligence to improve the process of two-dimensional drawing feature extraction and three-dimensional reconstruction. For example, the bat algorithm is used for global feature extraction. However, when dealing with complex two-dimensional drawing data, the traditional bat algorithm is prone to falling into a local optimal state, resulting in insufficient stability of the solution and global search ability. To address this problem, some technical solutions have begun to explore combining the simulated annealing mechanism with the bat algorithm, attempting to optimize the candidate solution update process of the bat algorithm through local perturbation and energy function evaluation. However, these methods often have two defects: on the one hand, in the traditional simulated annealing strategy when embedding the position update process of the bat algorithm, the perturbation amplitude control is not fine enough, and the temperature regulation strategy is not adaptive enough, failing to fully reflect the dynamic changes of candidate solutions in the energy space; on the other hand, in the existing fusion methods during the feature point matching and global feature point cloud generation process, the registration and fusion of multi-view data do not fully utilize the complementary advantages of edge, corner, and texture information in the drawings, resulting in large deviations in the details and structure of the reconstructed three-dimensional model, making it difficult to meet the requirements of accuracy and robustness in practical engineering applications.
[0004] Most of the 3D reconstruction systems currently applied in the market adopt traditional geometric reconstruction and interpolation methods, such as inverse distance weighted interpolation, mesh reconstruction and other technologies. However, when facing complex drawing data, these methods lack the ability to globally grasp image features and have certain limitations in local detail reconstruction. Traditional mesh reconstruction methods usually adopt fixed mesh spacing and a single smoothing algorithm. When dealing with large-scale and structurally complex 2D drawing data, it is difficult to balance the global and local aspects, often resulting in discontinuous or overly smoothed surfaces of the 3D model. In addition, in the multi-view registration process based on image features, traditional perspective transformation and matching algorithms are sensitive to noise and are easily affected by irregular annotations, drawing errors and illumination changes in the drawings, unable to achieve high-precision feature point matching, thus affecting the overall 3D reconstruction effect.
[0005] Therefore, how to provide a construction method for automatically generating a 3D VR scene based on multi-view 2D drawings is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0006] An object of the present invention is to propose a construction method for automatically generating a 3D VR scene based on multi-view 2D drawings. The present invention makes full use of a depth vision algorithm combining an improved bat algorithm and a simulated annealing mechanism. Through the efficient extraction of edge, corner and texture information in multi-view 2D drawings, the accurate construction of global feature point clouds and the global optimization of candidate solutions, the automatic reconstruction of 2D drawings into 3D virtual reality scenes is realized. This method introduces innovative mechanisms such as adaptive inertia factors, local perturbations, temperature regulation and dynamic clustering on the basis of traditional image processing and 3D reconstruction technologies, which can not only fully capture the scattered and complex feature information in the drawings, but also achieve an effective balance between global search and local refinement, and has the advantages of high efficiency, high precision, strong robustness and high automation.
[0007] The construction method for automatically generating a 3D VR scene based on multi-view 2D drawings according to an embodiment of the present invention includes the following steps:
[0008] S1. Collect multi-view 2D drawing data and preprocess the multi-view 2D drawing data;
[0009] S2. Use the bat algorithm to perform global feature extraction on the preprocessed multi-view 2D drawing data, extract edge, corner and texture information in the multi-view 2D drawing data, and generate a spatial distribution feature vector;
[0010] S3. Based on the registration technology of multi-view drawings, establish the feature point matching relationship between different views, fuse the spatial distribution feature vector, optimize the feature point coordinates by perspective transformation, and generate a global feature point cloud;
[0011] S4. Based on the geometric mapping and spatial interpolation methods, construct a preliminary three-dimensional point cloud model using the preliminary feature point cloud;
[0012] S5. Embed the simulated annealing mechanism during the candidate position update process of the bat algorithm, perform local perturbation on the candidate positions, and calculate the energy function values;
[0013] S6. According to the energy function values and the temperature control strategy, perform iterative updates on the candidate positions after local perturbation until the global optimal feature point set is obtained;
[0014] S7. Refine the preliminary three-dimensional point cloud model using the global optimal feature point set, and load the refined preliminary three-dimensional point cloud model onto the virtual reality platform to generate a three-dimensional virtual reality scene.
[0015] Optionally, the S2 specifically includes:
[0016] S21. Initialize the parameters of the bat algorithm for the preprocessed multi-view two-dimensional drawing data. The current position of the i-th bat at the iteration time t is The speed is The frequency is The adaptive inertia factor is w t And the local perturbation coefficient is ∈, where i = 1, 2,..., N, and N is the total number of bats;
[0017] S22. Use the random number β uniformly distributed in the interval [0, 1] i To update the frequency of each bat:
[0018]
[0019] Where, f min Is the minimum frequency, f max Is the maximum frequency, Represents the frequency of the i-th bat at the iteration time t;
[0020] S23. According to the difference between the current bat position and the global best position, and combined with the adaptive inertia factor w t Update the speed of each bat:
[0021]
[0022] Where, Is the global best position at the iteration time t, rand is a random number uniformly distributed in the range [0, 1], Represents the speed of the i-th bat at the iteration time t + 1;
[0023] S24. On the basis of updating the speed, use the temperature control factor to update the position of the bat:
[0024]
[0025] Among them, δ is the position update perturbation coefficient, T t is the current temperature, and rand ′ is a random number uniformly distributed in the range [0, 1]. represents the candidate position of the i-th bat at the iteration time t + 1;
[0026] S25. Update the adaptive inertia factor w t based on the energy change between the current and the previous iteration step:
[0027]
[0028] Among them, γ is the preset attenuation coefficient, λ is the learning rate parameter, and are the energy values of the i-th bat at the iteration times t and t + 1 respectively, and w t+1 is the updated adaptive inertia factor;
[0029] S26. Map the candidate position to the preprocessed multi-view two-dimensional drawing data, and extract the edge, corner point and texture information in the multi-view two-dimensional drawing data to generate the corresponding spatial distribution feature vector F i .
[0030] Optionally, the S3 specifically includes:
[0031] S31. Perform normalization processing on the spatial distribution feature vectors F i generated under each view;
[0032] S32. Update the coordinates of each feature point in the normalized spatial distribution feature vector by using adaptive perspective transformation:
[0033] x′ i =(1 - λ i )·H i ·x i + λ i ·x i ;
[0034] Among them, x i represents the homogeneous coordinate of the feature point under the i-th view, H i represents the corresponding adaptive perspective transformation matrix, λ i is the adaptive adjustment coefficient, and x′ i represents the coordinate of the transformed feature point;
[0035] S33. Calculate the matching weights between the transformed feature points under different views:
[0036]
[0037] Among them, w ij represents the matching weight between the corresponding feature points under the i-th and j-th perspectives, τ is a preset smoothing parameter, η is a weight adjustment factor, and respectively represent the normalized feature vectors, exp() is the exponential function, x′ i and x′ j respectively represent the updated feature point coordinates under the i-th and j-th perspectives;
[0038] S34. Screen the feature points according to the preset matching weight threshold w th to generate a set of temporary feature points:
[0039]
[0040] Among them, P′ represents the set of temporary feature points, M represents the number of perspectives, w th represents the preset matching weight threshold, and max is the operation of finding the maximum value;
[0041] S35. Perform dynamic clustering and fusion on the set of temporary feature points P ′ to generate a global feature point cloud P:
[0042]
[0043] Among them, C k represents the k-th cluster in the set of temporary feature points P ′ , |C k | represents the number of elements in the cluster, K represents the total number of clusters, and x represents the coordinate vector.
[0044] Optionally, the specific content of S4 includes:
[0045] S41. Expand each two-dimensional feature point in the global feature point cloud P using homogeneous coordinates:
[0046]
[0047] Among them, p i represents the homogeneous coordinates of the i-th feature point, u i and v i are the corresponding two-dimensional coordinates respectively;
[0048] S42. Map the homogeneous coordinates p i to preliminary three-dimensional coordinates based on the preset geometric mapping matrix M;
[0049] S43. Use the inverse distance weighted interpolation method to construct a continuous three-dimensional point cloud from the preliminary three-dimensional coordinates:
[0050]
[0051] Among them, Q represents the continuous three-dimensional point cloud obtained after interpolation, q0 is the reference coordinate, p is the interpolation exponent, n is the number of points in the neighborhood, and q i is the preliminary three-dimensional coordinate;
[0052] S44. Use the adaptive octree grid reconstruction method to perform regional division and local surface fitting on the interpolation result Q to generate a structured preliminary three-dimensional point cloud:
[0053]
[0054] Among them, Q grid represents the structured preliminary three-dimensional point cloud, N oct represents the number of octree segmentation regions, Q i is the set of points in the i-th region, Δ i is the adaptive grid spacing, κ is the curvature threshold for local surface fitting, and Fit() represents the local surface fitting function;
[0055] S45. Use a hybrid smoothing method that combines the Laplace operator with local geometric smoothing enhancement to perform global smoothing and local refinement on the structured preliminary three-dimensional point cloud Q grid to generate a preliminary three-dimensional point cloud model:
[0056] Q smooth = Q grid -μ·L(Q grid )+ν·Φ(Q grid ),
[0057] Among them, Q smooth represents the preliminary three-dimensional point cloud model after smoothing processing, L(Q grid ) is the application of the discrete Laplace operator on Q grid , and Φ(Q grid ) is the local geometric smoothing enhancement function, μ is the global smoothing factor, and ν is the local smoothing enhancement factor.
[0058] Optionally, the specific steps of S5 include:
[0059] S51. Perform local perturbation on each candidate position to generate a locally perturbed candidate position:
[0060]
[0061] Among them, Denote the candidate position after local perturbation, where θ is the perturbation coefficient, T t is the current temperature, rand2 is a random number uniformly distributed in the range [0, 1], ξ is the candidate solution diversity factor, and ln is the logarithmic function;
[0062] S52. Calculate the energy change ΔE corresponding to the candidate position before and after perturbation according to the candidate position after local perturbation i :
[0063]
[0064] where E() is the energy function, is the gradient of the energy function at , and κ ′ is the sensitivity adjustment coefficient;
[0065] S53. Calculate the acceptance probability P of the i-th candidate position according to the energy change ΔE of the candidate position i , i :
[0066]
[0067] where T t is the current temperature, ζ is the dynamic adjustment exponent, exp() is the exponential function, and ∈1 is a small constant to prevent division by zero;
[0068] S54. Make an acceptance judgment on the i-th bat position based on the uniform random number r:
[0069]
[0070] where r is a random number uniformly distributed in the range [0, 1];
[0071] S55. Adaptively update the temperature according to the energy statistical information of all current bat positions:
[0072]
[0073] where T t+1 represents the temperature of the next iteration step, α is the basic cooling coefficient, β is the adaptive cooling parameter, σ E is the standard deviation of the energy of the current candidate position, is the average value of the energy of the current candidate position.
[0074] Optionally, the specific steps of S6 include:
[0075] S61. Calculate the energy values corresponding to all current candidate positions and construct a global energy distribution to evaluate the quality of candidate positions;
[0076] S62. Determine the temperature parameter for this round of iteration according to the temperature control strategy, and adjust the search range in combination with the energy difference of the candidate positions;
[0077] S63. For candidate positions whose energy values exceed the threshold, execute the multi-scale perturbation mechanism to explore better solutions, and at the same time make small adjustments to candidate positions whose energy values are lower than the threshold;
[0078] S64. According to the set acceptance criterion, select whether to accept the perturbed candidate position. If the energy decreases, accept the new position. If the energy increases, accept it with a certain probability;
[0079] S65. According to the energy change trend of candidate positions during the iteration process, adjust the temperature parameter and gradually reduce the exploration range;
[0080] S66. Repeat S61 to S65 until the energy change of the candidate position tends to be stable or reaches the set termination condition, and finally obtain the global optimal feature point set.
[0081] The beneficial effects of the present invention are as follows:
[0082] Through the deep integration of the improved bat algorithm and the simulated annealing mechanism, the present invention significantly improves the accuracy and robustness of extracting edge, corner and texture information from multi-view two-dimensional drawings, and ensures the precise registration of the global feature point cloud construction. By introducing the adaptive inertia factor, local perturbation and temperature control strategy, the present invention effectively avoids the common local optimum problem in traditional methods during the update process of candidate solutions (i.e., the current position of the bat), realizes the organic combination of global search and local optimization, and thus greatly improves the accuracy and stability of 3D reconstruction.
[0083] In addition, during the generation of the global feature point cloud and the construction of the 3D point cloud model, the present invention effectively integrates the two-dimensional drawing data from different perspectives through adaptive perspective transformation, matching weight calculation and dynamic clustering fusion, and generates a 3D model with continuous structure and rich details. Thus, not only the automatic conversion from two-dimensional drawings to 3D virtual reality scenes is realized, but also the efficiency and interactive experience of the 3D virtual reality scene construction are greatly improved, making the 3D model both realistic and credible and convenient for subsequent visualization and operation.
[0084] In summary, while fully solving the key technical problems such as information loss, local optimum and matching error in the traditional 3D model reconstruction from 2D drawings, the present invention realizes efficient, accurate, robust and automatic 2D to 3D conversion, and provides an advanced technical solution with practical application value for fields such as engineering design, architectural planning and manufacturing. Description of the Drawings
[0085] The accompanying drawings are used to provide a further understanding of the present invention and form a part of the specification. They are used together with the embodiments of the present invention to explain the present invention and do not constitute a limitation to the present invention. In the accompanying drawings:
[0086] Figure 1 is a flowchart of the construction method for automatically generating a three-dimensional VR scene based on multi-view two-dimensional drawings proposed by the present invention;
[0087] Figure 2 is a schematic diagram of embedding a simulated annealing mechanism in the candidate solution position update process of the construction method for automatically generating a three-dimensional VR scene based on multi-view two-dimensional drawings proposed by the present invention. Detailed implementation manners
[0088] Now, the present invention will be further described in detail with reference to the accompanying drawings. These drawings are all simplified schematic diagrams, only illustrating the basic structure of the present invention in a schematic way, so they only show the components related to the present invention.
[0089] Referring to Figure 1 and Figure 2 , the construction method for automatically generating a three-dimensional VR scene based on multi-view two-dimensional drawings includes the following steps:
[0090] S1. Collect multi-view two-dimensional drawing data and preprocess the multi-view two-dimensional drawing data;
[0091] S2. Use the bat algorithm to extract global features from the preprocessed multi-view two-dimensional drawing data, extract edge, corner point and texture information in the multi-view two-dimensional drawing data, and generate a spatial distribution feature vector;
[0092] S3. Based on the registration technology of multi-view drawings, establish the feature point matching relationship between different views, fuse the spatial distribution feature vector, optimize the feature point coordinates by perspective transformation, and generate a global feature point cloud;
[0093] S4. Based on the geometric mapping and spatial interpolation method, use the preliminary feature point cloud to construct a preliminary three-dimensional point cloud model;
[0094] S5. Embed a simulated annealing mechanism in the candidate position update process of the bat algorithm, perform local perturbation on the candidate position and calculate the energy function value;
[0095] S6. According to the energy function value and the temperature control strategy, perform iterative update on the candidate position after local perturbation until a global optimal feature point set is obtained;
[0096] S7. Use the global optimal feature point set to refine the preliminary three-dimensional point cloud model, and load the refined preliminary three-dimensional point cloud model onto the virtual reality platform to generate a three-dimensional virtual reality scene.
[0097] In this embodiment, S2 specifically includes:
[0098] S21. Initialize the parameters of the bat algorithm for the preprocessed multi-view two-dimensional drawing data. The current position of the i-th bat at the iteration time t is The speed is The frequency is The adaptive inertia factor is w t And the local perturbation coefficient is ∈, where i = 1, 2,..., N, and N is the total number of bats;
[0099] S22. Use the random number β uniformly distributed in the interval [0, 1] i To update the frequency of each bat:
[0100]
[0101] Where f min Is the minimum frequency, f max Is the maximum frequency, Represents the frequency of the i-th bat at the iteration time t;
[0102] S23. Based on the difference between the current bat position and the global best position, and combined with the adaptive inertia factor w t To update the speed of each bat:
[0103]
[0104] Where Is the global best position at the iteration time t, rand is a random number uniformly distributed in the range [0, 1], Represents the speed of the i-th bat at the iteration time t + 1;
[0105] S24. On the basis of updating the speed, use the temperature control factor to update the position of the bat:
[0106]
[0107] Where δ is the position update perturbation coefficient, T t Is the current temperature, rand ′ Is a random number uniformly distributed in the range [0, 1], Represents the candidate position of the i-th bat at the iteration time t + 1;
[0108] S25. Update the adaptive inertia factor w t Based on the energy change between the current and the previous iteration step:
[0109]
[0110] where γ is a preset attenuation coefficient, and λ is a learning rate parameter. and are the energy values of the i-th bat at iteration times t and t + 1 respectively, and w t+1 is the updated adaptive inertia factor;
[0111] S26. Map the candidate position to the preprocessed multi-view two-dimensional drawing data, and extract the edge, corner point, and texture information in the multi-view two-dimensional drawing data to generate a corresponding spatial distribution feature vector F i .
[0112] In this embodiment, the specific steps of S3 are as follows:
[0113] S31. Perform normalization processing on the spatial distribution feature vector F i generated under each view;
[0114] S32. Update the coordinates of each feature point in the normalized spatial distribution feature vector using adaptive perspective transformation:
[0115] x' i = (1 - λ i )·H i ·x i + λ i ·x i ;
[0116] where x i represents the homogeneous coordinates of the feature point under the i-th view, H i represents the corresponding adaptive perspective transformation matrix, λ i is the adaptive adjustment coefficient, and x' i represents the coordinates of the transformed feature point;
[0117] S33. Calculate the matching weights between the transformed feature points under different views:
[0118]
[0119] where w ij represents the matching weight between the corresponding feature points under the i-th and j-th views, τ is a preset smoothing parameter, η is a weight adjustment factor, and respectively represent the normalized feature vectors, exp() is the exponential function, x' i and x' j respectively represent the updated feature point coordinates under the i-th and j-th views;
[0120] S34. According to the preset matching weight threshold w thScreen feature points to generate a set of temporary feature points:
[0121]
[0122] Among them, P ′ represents the set of temporary feature points, M represents the number of perspectives, w th represents the preset matching weight threshold, and max is the operation of finding the maximum value;
[0123] S35. Perform dynamic clustering and fusion on the set of temporary feature points P ′ to generate a global feature point cloud P:
[0124]
[0125] Among them, C k represents the k-th cluster in the set of temporary feature points P ′ , |C k | represents the number of elements in the cluster, K represents the total number of clusters, and x represents the coordinate vector.
[0126] In this embodiment, the specific steps of S4 are as follows:
[0127] S41. Expand each two-dimensional feature point in the global feature point cloud P using homogeneous coordinates:
[0128]
[0129] Among them, p i represents the homogeneous coordinates of the i-th feature point, u i and v i are the corresponding two-dimensional coordinates respectively;
[0130] S42. Map the homogeneous coordinates p i to preliminary three-dimensional coordinates based on the preset geometric mapping matrix M;
[0131] S43. Use the inverse distance weighted interpolation method to construct a continuous three-dimensional point cloud for the preliminary three-dimensional coordinates:
[0132]
[0133] Among them, Q represents the continuous three-dimensional point cloud obtained after interpolation, q0 is the reference coordinate, p is the interpolation exponent, n is the number of points in the neighborhood, and q i is the preliminary three-dimensional coordinate;
[0134] S44. Use the adaptive octree grid reconstruction method to perform regional division and local surface fitting on the interpolation result Q to generate a structured preliminary three-dimensional point cloud:
[0135]
[0136] Among them, Q grid represents the structured preliminary three-dimensional point cloud, N oct represents the number of octree segmentation regions, Q i is the set of points in the i-th region, Δ i is the adaptive grid spacing, κ is the curvature threshold for local surface fitting, and Fit() represents the local surface fitting function;
[0137] S45. A hybrid smoothing method combining the Laplacian operator and local geometric smoothing enhancement is used to globally smooth and locally refine the structured preliminary three-dimensional point cloud Q grid to generate a preliminary three-dimensional point cloud model:
[0138] Q smooth = Q grid -μ·L(Q grid ) + ν·Φ(Q grid ),
[0139] Among them, Q smooth represents the preliminary three-dimensional point cloud model after smoothing processing, L(Q grid ) is the application of the discrete Laplacian operator on Q grid , and Φ(Q grid ) is the local geometric smoothing enhancement function, μ is the global smoothing factor, and ν is the local smoothing enhancement factor.
[0140] In this embodiment, S5 specifically includes:
[0141] S51. Perform local perturbation on each candidate position to generate a locally perturbed candidate position:
[0142]
[0143] Among them, represents the locally perturbed candidate position, θ is the perturbation coefficient, T t is the current temperature, rand2 is a random number uniformly distributed in the range [0,1], ξ is the candidate solution diversity factor, and ln is the logarithmic function;
[0144] S52. According to the locally perturbed candidate position, calculate the corresponding energy change ΔE i :
[0145]
[0146] Among them, E() is the energy function, is the gradient of the energy function at , and κ ′ is the sensitivity adjustment coefficient;
[0147] S53. Calculate the acceptance probability P of the i-th candidate position according to the energy change ΔE of the candidate position i : i
[0148]
[0149] where T t is the current temperature, ζ is the dynamic adjustment exponent, exp() is the exponential function, and ∈1 is a small constant to prevent division by zero;
[0150] S54. Make an acceptance judgment on the i-th bat position according to the uniform random number r:
[0151]
[0152] where r is a random number uniformly distributed in the range [0, 1];
[0153] S55. Adaptively update the temperature according to the energy statistical information of all current bat positions:
[0154]
[0155] where T t+1 represents the temperature of the next iteration step, α is the basic cooling coefficient, β is the adaptive cooling parameter, and σ E is the standard deviation of the energy of the current candidate position, is the average value of the energy of the current candidate position.
[0156] In this embodiment, S6 specifically includes:
[0157] S61. Calculate the energy values corresponding to all current candidate positions and construct a global energy distribution to evaluate the quality of the candidate positions;
[0158] S62. Determine the temperature parameters of this round of iteration according to the temperature control strategy, and adjust the search range in combination with the energy difference of the candidate positions;
[0159] S63. For candidate positions whose energy values exceed the threshold, execute a multi-scale perturbation mechanism to explore better solutions, and at the same time make small adjustments to candidate positions whose energy values are lower than the threshold;
[0160] S64. According to the set acceptance criterion, select whether to accept the perturbed candidate position. If the energy decreases, accept the new position. If the energy increases, accept it with a certain probability;
[0161] S65. Adjust the temperature parameters according to the energy change trend of the candidate positions during the iteration process, and gradually reduce the exploration range;
[0162] S66. Repeat the execution of S61 to S65 until the energy change at the candidate position tends to be stable or the set termination condition is reached, and finally obtain the globally optimal feature point set.
[0163] Example 1:
[0164] To verify the feasibility of the present invention in implementation, the present invention is applied to a certain architectural design project. This project belongs to a well-known architectural design institute, with a medium project scale and involves key technical links such as data acquisition, image preprocessing, multi-view feature extraction, feature matching and registration, 3D point cloud construction, and global optimization of candidate solutions.
[0165] In practical applications, first, professional equipment is used to collect two-dimensional drawings of each elevation, plan, and section of the building, and a total of 12-view high-resolution image data is collected. The resolution of each image reaches 4000×3000 pixels. After preprocessing, the noise in the drawings is removed, and the basic structural information of each drawing is obtained through edge detection, corner extraction, and texture analysis techniques. Subsequently, the present invention uses an improved bat algorithm to perform global feature extraction on the preprocessed two-dimensional drawing data to generate a spatial distribution feature vector. Through mechanisms such as an adaptive inertia factor, local perturbation, and temperature regulation, it is ensured that the update of the candidate solution (i.e., the current position of the bat) can both globally search and take into account local optimization, thus avoiding the defect that traditional methods are prone to falling into local optima.
[0166] In the feature matching stage, using the registration technology of multi-view drawings, the feature vectors under each view are successfully standardized and adaptively perspective-transformed, and then a dynamic clustering algorithm is used to fuse the registered features to generate a global feature point cloud. After this process, the finally obtained global feature point cloud accurately reflects the spatial structure of the building in the reconstructed 3D point cloud model. In the actual operation of this method, the total processing time is about 6.8 minutes, which is greatly shortened compared with the traditional manual registration method (with an average time consumption of about 45 minutes). At the same time, the error in the 3D model reconstruction accuracy is controlled within ±2 mm, while the error of the traditional method is generally about ±10 mm. This method realizes the automatic two-dimensional to three-dimensional conversion, significantly improves the work efficiency and reconstruction accuracy, and provides strong support for the real-time preview and adjustment of architectural design schemes.
[0167] During the project implementation, multiple iterative tests were also conducted on the temperature adaptive update strategy and the energy function evaluation mechanism. The actual data shows that during the temperature update process, by dynamically adjusting the parameters, when the initial temperature is 300K, it drops to about 28K after 50 iterations, and the energy standard deviation of the candidate solutions decreases from the initial 12.5 to 2.3, indicating that the global optimization process has good convergence and stability. In addition, during the local perturbation process, the diversity factor of the candidate solutions plays a key role, enabling the acceptance probability after each perturbation to remain within a reasonable range, thus effectively avoiding the problem of local optimal solutions. According to statistics, in a complete iteration, about 85% of the candidate solutions have a reduced energy after perturbation and are accepted by the system, while for the remaining 15% of the candidate solutions, although their energy slightly increases, a part of the high-energy solutions are retained through the random acceptance strategy to ensure search diversity.
[0168] Table 1 Key Data Statistical Table for Reconstructing 3D VR Scenes from Multi-view 2D Drawings
[0169]
[0170] As can be seen from the key data statistical table for reconstructing 3D VR scenes from multi-view 2D drawings, the present invention shows significant optimization effects in data collection, preprocessing, feature extraction, and the final 3D modeling effect. During the experiment, high-resolution 2D drawing data from 12 different views were collected, and the resolution of each image reached the 4000×3000 pixel level, which ensures sufficient detail information during the feature extraction process and can accurately capture edge, corner, and texture features in the drawings.
[0171] In the data processing stage, the average preprocessing time is between 44 - 47 seconds, indicating that the preprocessing process of the present invention can effectively remove noise, enhance key features, and provide a high-quality data basis for subsequent feature extraction. Compared with the preprocessing time of 80 - 100 seconds of traditional methods, the method of the present invention achieves more efficient processing without sacrificing information quality. In addition, in terms of the feature extraction time, the average time consumption is about 118 - 122 seconds, indicating that the improved bat algorithm for global feature extraction has high efficiency and can complete high-precision feature point calculations within a reasonable time. Compared with the traditional method based on manual feature matching (about 200 - 300 seconds), the efficiency is improved by at least more than 40%.
[0172] The average energy of the candidate solutions is between 14.9 and 15.3, indicating that the energy change is stable. This shows that under the action of the simulated annealing mechanism of the present invention, the stability of the candidate solutions can be maintained during the optimization process, and the situation of local optimum can be effectively avoided. At the same time, the temperature control strategy can gradually decrease according to the set cooling rule after each iteration. The initial temperature is 300K, and after 50 rounds of iteration, the final temperature drops to between 27 and 30K. This indicates that the simulated annealing algorithm can effectively reduce the system temperature during the process of gradual convergence, and adjust the search space within an appropriate range, further enhancing the global nature of the optimization.
[0173] The error of the finally reconstructed three-dimensional model is between ±1.8mm and ±2.1mm, which is significantly better than the traditional two-dimensional drawing modeling method (the error is generally between ±8mm and ±12mm). The present invention uses adaptive perspective transformation, matching weight calculation and dynamic clustering fusion to make the conversion from two-dimensional drawings to three-dimensional feature point clouds more accurate, thereby improving the accuracy of the finally three-dimensional model and ensuring the true restoration of building details. In addition, the total time-consuming of the entire automated processing flow is 6.5 - 6.8 minutes, which is more than 85% shorter than the traditional method (more than 45 minutes), greatly improving the work efficiency of three-dimensional reconstruction.
[0174] Generally speaking, the high-resolution data acquisition of the present invention, the efficient feature extraction of the improved bat algorithm, and the global optimization of the simulated annealing mechanism together constitute an efficient, accurate and automated multi-view two-dimensional drawing to three-dimensional VR scene conversion scheme. Experimental data verify that this method not only improves the calculation efficiency, but also significantly reduces the error and improves the quality of three-dimensional modeling, and is applicable to multiple application scenarios such as architectural design, engineering planning, virtual reality display, etc.
[0175] As mentioned above, it is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its inventive concept, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.
Claims
1. A construction method for automatically generating a 3D VR scene based on multi-view 2D drawings, characterized in that, It includes the following steps: S1. Collect multi-view 2D drawing data and preprocess the multi-view 2D drawing data; S2. Use the bat algorithm to extract global features from the preprocessed multi-view 2D drawing data, extract edge, corner and texture information in the multi-view 2D drawing data, and generate a spatial distribution feature vector; S3. Based on the registration technology of multi-view drawings, establish the matching relationship of feature points between different views, fuse the spatial distribution feature vectors, and optimize the feature point coordinates using perspective transformation to generate a global feature point cloud; S4. Based on the geometric mapping and spatial interpolation method, use the preliminary feature point cloud to construct a preliminary 3D point cloud model; S5. Embed the simulated annealing mechanism in the candidate position update process of the bat algorithm, perform local perturbation on the candidate position and calculate the energy function value; S6. According to the energy function value and the temperature control strategy, perform iterative update on the candidate position after local perturbation until a global optimal feature point set is obtained; S7. Refine the preliminary 3D point cloud model using the global optimal feature point set, and load the refined preliminary 3D point cloud model into the virtual reality platform to generate a 3D virtual reality scene.
2. The construction method for automatically generating a three-dimensional VR scene based on multi-perspective two-dimensional drawings according to claim 1, wherein The specific content of S2 includes: S21. Initialize the parameters of the bat algorithm for the preprocessed multi-view 2D drawing data. The current position of the $i$-th bat at iteration time $t$ is The speed is The frequency is The adaptive inertia factor is $w$ t and the local perturbation coefficient is $\epsilon$, where $i = 1, 2, \ldots, N$ and $N$ is the total number of bats; S22. Use a random number β uniformly distributed in the interval [0, 1] i Update the frequency of each bat: where f min is the minimum frequency, and f max is the maximum frequency, denotes the frequency of the i-th bat at iteration time t; S23. Update the velocity of each bat according to the difference between the current bat position and the global best position, and in combination with the adaptive inertia factor w t Update the velocity of each bat: Among them, is the global best position at iteration time t, rand is a random number uniformly distributed in the range [0, 1], represents the velocity of the i-th bat at iteration time t + 1; S24. Based on the update speed, use the temperature control factor to update the position of the bat: where δ is the position update perturbation coefficient, T t is the current temperature, rand′ is a random number uniformly distributed in the range [0, 1], represents the candidate position of the i-th bat at the iteration time t + 1; S25. Update the adaptive inertia factor w based on the energy change between the current and the previous iteration step t as follows: where γ is a preset attenuation coefficient, and λ is a learning rate parameter, and are the energy values of the i-th bat at iteration times t and t + 1 respectively, and w t+1 is the updated adaptive inertia factor; S26. Map the candidate position to the preprocessed multi-view two-dimensional drawing data, extract the edge, corner, and texture information in the multi-view two-dimensional drawing data, and generate the corresponding spatial distribution feature vector F i .
3. The construction method for automatically generating a 3D VR scene based on multi-view 2D drawings according to claim 1, characterized in that The specific content of S3 includes: S31. Standardize the spatial distribution feature vectors F generated from each perspective i ; S32. Update the coordinates of each feature point in the standardized spatial distribution feature vector using adaptive perspective transformation; x′ i =(1 - λ i )·H i ·x i + λ i ·x i ; Among them, x i represents the homogeneous coordinates of the feature points in the i-th perspective, and H i represents the corresponding adaptive perspective transformation matrix, λ i is the adaptive adjustment coefficient, and x′ i represents the coordinates of the transformed feature points; S33. Calculate the matching weights between the transformed feature points under different views; where, w ij represents the matching weight between the corresponding feature points under the i-th and j-th perspectives, τ is a preset smoothing parameter, η is a weight adjustment factor, and respectively represent the normalized feature vectors, exp() is the exponential function, x′ i and x′ j respectively represent the updated feature point coordinates under the i-th and j-th perspectives; S34. Filter the feature points according to the preset matching weight threshold w th to generate a set of temporary feature points: where P′ represents the set of temporary feature points, M represents the number of perspectives, w th represents the preset matching weight threshold, and max is the operation of finding the maximum value; S35. Perform dynamic clustering fusion on the temporary feature point set P′ to generate a global feature point cloud P; Among them, C k represents the k-th cluster in the set of temporary feature points P', |C k | represents the number of elements in the cluster, K represents the total number of clusters, and x represents the coordinate vector.
4. The construction method for automatically generating a 3D VR scene based on multi-view 2D drawings according to claim 1, wherein The specific content of S4 includes: S41. Expand each 2D feature point in the global feature point cloud P using homogeneous coordinates; Among them, p i represents the homogeneous coordinates of the i-th feature point, u i and v i are the corresponding two-dimensional coordinates respectively; S42. Map the homogeneous coordinate p to a preliminary three-dimensional coordinate based on a preset geometric mapping matrix M i ; S43. Use the inverse distance weighted interpolation method to construct a continuous 3D point cloud for the preliminary 3D coordinates; Among them, Q represents the continuous three-dimensional point cloud obtained after interpolation, q0 is the reference coordinate, p is the interpolation index, n is the number of points in the neighborhood, and q i is the preliminary three-dimensional coordinate; S44. Use the adaptive octree grid reconstruction method to perform regional division and local surface fitting on the interpolation result Q to generate a structured preliminary 3D point cloud; Among them, Q grid represents the structured preliminary three-dimensional point cloud, N oct represents the number of octree segmentation regions, Q i is the set of points in the i-th region, Δ i is the adaptive grid spacing, κ is the curvature threshold for local surface fitting, and Fit() represents the local surface fitting function; S45. A hybrid smoothing method combining the Laplace operator and local geometric smoothing enhancement is used to globally smooth and locally refine the structured preliminary three-dimensional point cloud Q grid to generate a preliminary three-dimensional point cloud model: Q smooth = Q grid - μ·L(Q grid ) + ν·Φ(Q grid ), Among them, Q smooth represents the preliminary three-dimensional point cloud model after smoothing, and L(Q grid ) is the application of the discrete Laplace operator on Q grid , Φ(Q grid ) is the local geometric smoothing enhancement function, μ is the global smoothing factor, and ν is the local smoothing enhancement factor.
5. The construction method for automatically generating a 3D VR scene based on multi-view 2D drawings according to claim 1, wherein The specific content of S5 includes: S51. For each candidate position perform local perturbation to generate a candidate position after local perturbation: Among them, represents the candidate position after local perturbation, θ is the perturbation coefficient, T t is the current temperature, rand2 is a random number uniformly distributed in the range [0, 1], ξ is the candidate solution diversity factor, and ln is the logarithmic function; S52. Calculate the energy change ΔE corresponding to before and after perturbation based on the candidate position after local perturbation i : where E() is the energy function, is the gradient of the energy function at , and κ′ is the sensitivity adjustment coefficient; S53. Calculate the acceptance probability P of the i-th candidate position according to the energy change ΔE of the candidate position i , i as follows: where T t is the current temperature, ζ is the dynamic adjustment exponent, exp() is the exponential function, and ∈1 is a small constant to prevent division by zero; S54. Make an acceptance judgment on the position of the i-th bat according to the uniformly random number r: where r is a random number uniformly distributed in the range of [0,1]; S55. Adaptively update the temperature according to the energy statistical information of all current bat positions; Among them, T t+1 represents the temperature of the next iteration step, α is the basic cooling coefficient, β is the adaptive cooling parameter, and σ E is the standard deviation of the energy at the current candidate position, and is the average value of the energy at the current candidate position.
6. The construction method for automatically generating a 3D VR scene based on multi-perspective 2D drawings according to claim 1, wherein The specific content of S6 includes: S61. Calculate the energy values corresponding to all current candidate positions and construct a global energy distribution to evaluate the quality of candidate positions; S62. According to the temperature control strategy, determine the temperature parameter of this round of iteration, and adjust the search range in combination with the energy difference of candidate positions; S63. For candidate positions whose energy values exceed the threshold, execute the multi-scale perturbation mechanism to explore better solutions, and at the same time make small adjustments to candidate positions whose energy values are lower than the threshold; S64. According to the set acceptance criterion, select whether to accept the perturbed candidate position. If the energy decreases, accept the new position. If the energy increases, accept it with a certain probability; S65. Adjust the temperature parameter according to the energy change trend of candidate positions during the iteration process, and gradually reduce the exploration range; Repeat the execution of S61 to S65 until the energy change at the candidate position tends to be stable or the set termination condition is reached, and finally obtain the globally optimal feature point set.