A plane extraction method, system and electronic device for three-dimensional line segment model
The plane of the three-dimensional line segment model is extracted through an approximate uniform sampling algorithm and a singular value decomposition method, which solves the problems of noise and high computing costs in the prior art, and realizes efficient plane extraction and data processing.
Patent Information
- Application Number
- CN201911066033.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-04
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2039-11-04
AI Technical Summary
The existing three-dimensional model plane extraction method has noise problems and high computing costs. The method based on RANSAC and Hough transform has infinite iterations or the problem of uneven distribution of Hough space, resulting in limitations.
The approximate uniform sampling algorithm is used to unitize the line segments in the three-dimensional model, generate sampling points on the spherical surface, calculate the perpendicularity of the line segments and the normal vector, and use the singular value decomposition method to perform plane fitting to realize plane extraction of the three-dimensional line segment model.
Effectively reduces the amount of computing, improves processing speed, reduces errors, reduces hardware processing capabilities requirements, and is easy to expand.
Smart Images

Figure CN112785544B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of computer graphics processing, and in particular relates to a plane extraction method, system and electronic equipment for a three-dimensional line segment model. Background Art
[0002] Plane extraction refers to the use of certain methods to express the plane information in a three-dimensional model with an accurate mathematical expression. Plane extraction of three-dimensional models is involved in both robotics and three-dimensional reconstruction, and has therefore been studied and explored by many scholars at home and abroad in recent years. There are currently two research directions for plane extraction of three-dimensional models. One is a method based on a point cloud model, which has large noise and high computational cost. The other is a method based on a line segment model, but the mainstream methods are all based on RANSAC and Hough transform-based extraction methods. The disadvantage of the RANSAC-based method is that there is no upper limit on the number of iterations. Although the Hough transform can solve this problem well, there is a problem of uneven distribution of the Hough space, and both have certain limitations. Summary of the invention
[0003] The present application provides a plane extraction method, system and electronic device for a three-dimensional line segment model, aiming to solve at least one of the above-mentioned technical problems in the prior art to a certain extent.
[0004] In order to solve the above problems, this application provides the following technical solutions:
[0005] A method for extracting a plane from a three-dimensional line segment model comprises the following steps:
[0006] Step a: Load the 3D model file to be extracted through the file loading module;
[0007] Step b: extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm;
[0008] Step c: Write the extracted plane information into the memory for storage and display.
[0009] The technical solution adopted in the embodiment of the present application also includes: in the step a, the loading of the 3D model file to be extracted through the file loading module specifically includes: first obtaining the name of the 3D model file through a dialog box, then classifying and reading the 3D model files according to different data formats, and loading the 3D model files of different formats into a unified data format in the memory.
[0010] The technical solution adopted in the embodiment of the present application also includes: Step a also includes: displaying the three-dimensional model file through the display module, setting the plane extraction algorithm, and setting algorithm-related parameters.
[0011] The technical solution adopted by the embodiment of the present application also includes: in the step b, the use of the approximate uniform sampling algorithm to extract the plane information of the three-dimensional model file specifically includes:
[0012] Step b1: Generate sampling points; first move one end of the line segment in the 3D model to the origin of the space, then normalize all the line segments to get a Gaussian sphere. Each line segment can be represented by a point on the sphere. If it is a line on a plane in space, it must be on the same plane passing through the center of the circle on the Gaussian sphere. Find the normal vector perpendicular to the plane. All line segments on the plane are perpendicular to the normal vector.
[0013] Step b2: line segment extraction; after generating the sampling points, all the line segments and the normal vectors represented by the sampling points are calculated to determine whether the line segment and the normal vector are perpendicular. If the angle between the line segment and the normal vector is greater than a certain threshold, the line segment is considered to be perpendicular to the normal vector; the number of vertical line segments at each sampling point is statistically sorted, and the sampling point with the largest number of vertical line segments is found, and all the line segments passing through the sampling point are extracted for the next step of plane fitting;
[0014] Step b3: plane fitting; first, the intercept of each line segment under the corresponding normal vector is calculated according to the midpoint of the line segment, and the line segments are clustered according to the intercept to find the set of line segments that are most likely to be a plane, and then the singular value decomposition method is used to perform plane fitting on the three-dimensional model.
[0015] The technical solution adopted in the embodiment of the present application also includes: in the step c, writing the extracted plane information into the memory for storage and display specifically includes: saving the extracted data according to the set three-dimensional data format; drawing and displaying the extracted plane information in different colors.
[0016] Another technical solution adopted by the embodiment of the present application is: a plane extraction system for a three-dimensional line segment model, comprising:
[0017] File loading module: used to load the 3D model file to be extracted;
[0018] Plane extraction module: used for extracting plane information of the three-dimensional model file by using an approximate uniform sampling algorithm;
[0019] Data saving module: used to write the extracted plane information into the memory for storage;
[0020] Display module: used to display 3D model files and plane information extraction results.
[0021] The technical solution adopted in the embodiment of the present application also includes: the file loading module loads the three-dimensional model file to be extracted specifically including: first obtaining the name of the three-dimensional model file through a dialog box, then classifying and reading the three-dimensional model files according to different data formats, and loading the three-dimensional model files of different formats into a unified data format in the memory.
[0022] The technical solution adopted in the embodiment of the present application also includes an algorithm setting module, which is used to set the plane extraction algorithm and set algorithm-related parameters.
[0023] The technical solution adopted by the embodiment of the present application also includes: the plane extraction module includes:
[0024] The sampling point generation unit used to generate sampling points: first, move one end of the line segment in the 3D model to the origin of the space, then normalize all the line segments to obtain a Gaussian sphere, and each line segment can be represented by a point on the sphere; if it is a line on a plane in space, it must be on the same plane passing through the center of the circle on the Gaussian sphere, find the normal vector perpendicular to the plane, and all line segments on the plane are perpendicular to the normal vector;
[0025] The line segment extraction unit for extracting line segments: after generating sampling points, all line segments are calculated with the normal vectors represented by the sampling points to determine whether the line segment and the normal vector are perpendicular. If the angle between the line segment and the normal vector is greater than a certain threshold, the line segment is considered to be perpendicular to the normal vector. The number of vertical line segments at each sampling point is statistically sorted to find the sampling point with the largest number of vertical line segments, and all line segments passing through the sampling point are extracted for the next step of plane fitting.
[0026] The plane fitting unit used to fit the plane: first, the intercept of each line segment under the corresponding normal vector is calculated according to the midpoint of the line segment, and the line segments are clustered according to the intercept to find the set of line segments that are most likely to be a plane. Then, the singular value decomposition method is used to fit the plane of the three-dimensional model.
[0027] The technical solution adopted by the embodiment of the present application also includes: the data saving module writes the extracted plane information into the memory for storage, specifically: saving the extracted data according to the set three-dimensional data format;
[0028] The display module displays the plane information extraction result specifically by drawing and displaying the extracted plane information in different colors.
[0029] Another technical solution adopted by the embodiment of the present application is: an electronic device, comprising:
[0030] at least one processor; and
[0031] a memory communicatively connected to the at least one processor; wherein,
[0032] The memory stores instructions that can be executed by the one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the following operations of the above-mentioned plane extraction method of the three-dimensional line segment model:
[0033] Step a: Load the 3D model file to be extracted through the file loading module;
[0034] Step b: extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm;
[0035] Step c: Write the extracted plane information into the memory for storage and display.
[0036] Compared with the prior art, the beneficial effects produced by the embodiments of the present application are as follows: the plane extraction method, system and electronic device of the three-dimensional line segment model of the embodiments of the present application take the three-dimensional line segment model as the object, adopt the three-dimensional model after format processing for calculation, and use the technology of uniform sampling on the spherical surface to find all the line segments in the same plane on the Gaussian sphere, so as to realize the complete processing process from input to output, effectively utilize the advantages of the line segments, effectively reduce the amount of calculation, speed up data processing, greatly reduce the requirements for hardware processing capabilities, and are easy to expand. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of a plane extraction method of a three-dimensional line segment model according to an embodiment of the present application;
[0038] Figure 2 This is a flowchart of the approximate uniform sampling algorithm;
[0039] Figure 3 Extract flow chart for line segments;
[0040] Figure 4 It is the plane fitting flow chart;
[0041] Figure 5 This is a schematic diagram of the data preservation process;
[0042] Figure 6 It is a structural schematic diagram of a plane extraction system of a three-dimensional line segment model according to an embodiment of the present application;
[0043] Figure 7 It is a schematic diagram of the hardware device structure of the plane extraction method of the three-dimensional line segment model provided in the embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] See also Figure 1 , is a flow chart of a plane extraction method of a three-dimensional line segment model of an embodiment of the present application. The plane extraction method of a three-dimensional line segment model of an embodiment of the present application comprises the following steps:
[0046] Step 100: Loading the 3D model file to be extracted through a file loading module;
[0047] In step 100, the loading method of the 3D model file is as follows: the file loading module first obtains the name of the 3D model file through a dialog box, then classifies and reads the 3D model files according to different data formats, and loads the 3D model files of different formats into a unified data format in the memory. Among them, the present application realizes the reading of the 3D model file through the standard file stream in C++.
[0048] Step 200: Determine whether to perform an operation on the 3D model file. If the operation needs to be performed, proceed to step 300; otherwise, proceed to step 400;
[0049] In step 200, the system has certain interactive functions and can perform operations such as scaling, translating, and rotating the three-dimensional model and the extracted plane information. The user can also adjust the color and line thickness of the three-dimensional model or the extracted plane information as needed.
[0050] Step 300: record operation information and modify memory data;
[0051] Step 400: Display the 3D model file through the display module, set the plane extraction algorithm, and set the algorithm related parameters;
[0052] In step 400, a variety of plane extraction algorithms are set in the system, such as the region growing method, the approximate uniform sampling algorithm, etc. The user can select a specific algorithm according to their own needs, and for each algorithm, the user can set specific parameters according to the operation requirements. In the embodiment of the present application, the approximate uniform sampling algorithm is used as an example for specific description. At the same time, the present invention is also designed with an interface to facilitate the expansion of new algorithms.
[0053] Step 500: extracting plane information of the three-dimensional model file using an approximate uniform sampling algorithm;
[0054] In step 500, approximate uniform sampling refers to how to evenly distribute sampling points on the sphere and then cluster the line segments on the same plane according to the characteristics of the line segments. Specifically, starting from one end of the sphere, the sphere is evenly divided by thickness, and descending along the division direction, the sampling points of each layer have a certain angle difference in dimension compared to the previous layer. The error of this method in the weighted case can reduce 40% of the error compared to the ordinary sampling method.
[0055] like Figure 2 As shown, it is a flowchart of the approximate uniform sampling algorithm, which specifically includes the following steps:
[0056] Step 501: Generate sampling points; first move one end of the line segment in the three-dimensional model to the origin of the space, and then normalize all the line segments to obtain a Gaussian sphere, and each line segment can be represented by a point on the sphere. If it is a line on a plane in space, it must be on the same plane passing through the center of the circle on the Gaussian sphere, so it is necessary to find the normal vector perpendicular to the plane, and all line segments on the plane are perpendicular to the normal vector. Since the sphere is a continuous area, it is necessary to discretize the sphere. The present application realizes discrete sampling of the sphere through the Fibonacci grid distribution.
[0057] Step 502: line segment extraction; the line segment extraction process is as follows Figure 3 As shown. After the sampling points are generated, all line segments are calculated with the normal vectors represented by the sampling points to determine whether the line segment is perpendicular to the normal vector. If the angle between the line segment and the normal vector is greater than a certain threshold, the line segment is considered to be perpendicular to the normal vector. The number of vertical line segments at each sampling point is statistically sorted, and the sampling point with the largest number of vertical line segments is found. All line segments passing through the sampling point are extracted for the next step of plane fitting.
[0058] Step 503: plane fitting; since the intercept information is lost when the line segment is moved to the origin of the space, the line segment extracted in step 502 may exist on multiple parallel planes, so it needs to be further fitted. The plane fitting process is as follows: Figure 4 As shown in the figure. First, the intercept of each line segment under the corresponding normal vector is calculated according to the midpoint of the line segment. The line segments are clustered according to the intercept to find the line segment set that is most likely to be a plane. Then, the singular value decomposition method is used to perform plane fitting on the three-dimensional model.
[0059] As an important method in matrix analysis, singular value decomposition has a wide range of applications in finding data features. In a square matrix, singular value decomposition is to find the eigenvector corresponding to the eigenvalue. Since the matrix cannot be guaranteed to be a square matrix, a certain decomposition process is required.
[0060] Assume that M is an m×n matrix, and all its elements belong to the field K, which is the real number field or the complex number field. Then there exists a decomposition in which U is an m×m unitary matrix; Σ is a semi-positive m×n diagonal matrix; and V*, which is the conjugate transpose of V, is an n×n unitary matrix. Such a decomposition is called the singular value decomposition of M. The elements Σi on the diagonal of Σ, where Σi is the singular value of M. A common practice is to arrange the singular values from large to small. In this way, Σ can be uniquely determined by M. This method can more accurately describe the characteristic direction vectors in a bunch of line segments.
[0061] Step 600: writing the extracted plane information into the memory for storage and display;
[0062] In step 600, after the plane information extraction is completed, the extracted data is saved in the selected three-dimensional data format (the system has multiple data saving methods, and the user can choose according to actual needs). The saving process is as follows: Figure 5 The extracted plane information can be checked and displayed in the form of a list, and the extraction results can also be drawn and displayed in different colors to facilitate their use or further processing.
[0063] See also Figure 6 , is a schematic diagram of the structure of the plane extraction system of the three-dimensional line segment model of the embodiment of the present application. The plane extraction system of the three-dimensional line segment model of the embodiment of the present application includes a file loading module, an operation judgment module, a display module, an algorithm setting module, a plane extraction module and a data storage module.
[0064] File loading module: used to load the 3D model file to be extracted; wherein, the loading method of the 3D model file is as follows: the file loading module first obtains the name of the 3D model file through a dialog box, and then classifies and reads the 3D model files according to different data formats, and loads the 3D model files of different formats into a unified data format in the memory. Among them, this application realizes the reading of the 3D model file through the standard file stream in C++.
[0065] Operation judgment module: used to judge whether to perform an operation on the required three-dimensional model file. If the operation needs to be performed, the operation information is recorded and the memory data is modified; otherwise, the three-dimensional model file is displayed through the display module; in the embodiment of the present application, the system has certain interactive functions, and can perform operations such as scaling, translating, and rotating the three-dimensional model and the extracted plane information. The user can also adjust the color and line thickness of the three-dimensional model or the extracted plane information as needed.
[0066] The module display is used to display the loaded 3D model file and the plane information extraction results;
[0067] Algorithm setting module: used to set the plane extraction algorithm and set the algorithm related parameters; wherein, there are multiple plane extraction algorithms set in the system, such as the region growing method, the approximate uniform sampling algorithm, etc., and the user can select a specific algorithm according to their own needs, and for each algorithm, the user can set specific parameters according to the operation requirements. In the embodiment of the present application, the approximate uniform sampling algorithm is used as an example for specific description. At the same time, the present invention is also designed with an interface to facilitate the expansion of new algorithms.
[0068] Plane extraction module: used to extract the plane information of the 3D model file using an approximate uniform sampling algorithm; among them, approximate uniform sampling refers to how to evenly distribute the sampling points on the sphere and then cluster the line segments on the same plane according to the characteristics of the line segments. Specifically: starting from one end of the sphere, divide the sphere evenly according to the thickness, and descend along the division direction. The sampling points of each layer have a certain angle difference in dimension compared to the previous layer. The error of this method in the weighted case can reduce the error by 40% compared to the ordinary sampling method.
[0069] Specifically, the plane extraction module includes:
[0070] Sampling point generation unit for generating sampling points: first move one end of the line segment in the three-dimensional model to the origin of space, and then normalize all line segments to obtain a Gaussian sphere, and each line segment can be represented by a point on the sphere. If it is a line on a plane in space, it must be on the same plane passing through the center of the circle on the Gaussian sphere, so it is necessary to find the normal vector perpendicular to the plane, and all line segments on the plane are perpendicular to the normal vector. Since the sphere is a continuous area, it is necessary to discretize the sphere. This application realizes discrete sampling of the sphere through the Fibonacci grid distribution.
[0071] Line segment extraction unit for extracting line segments: After generating sampling points, all line segments are calculated with the normal vectors represented by the sampling points to determine whether the line segment is perpendicular to the normal vector. If the angle between the line segment and the normal vector is greater than a certain threshold, the line segment is considered to be perpendicular to the normal vector. The number of vertical line segments at each sampling point is statistically sorted, and the sampling point with the largest number of vertical line segments is found. All line segments passing through the sampling point are extracted for the next step of plane fitting.
[0072] Plane fitting unit for fitting planes: Since the intercept information is lost when the line segment is moved to the origin of space, the extracted line segment may exist on multiple parallel planes, so it is necessary to further fit it. First, the intercept of each line segment under the corresponding normal vector is calculated according to the midpoint of the line segment, and the line segments are clustered according to the intercept to find the line segment set that is most likely to be a plane, and then the singular value decomposition method is used to fit the plane of the three-dimensional model.
[0073] As an important method in matrix analysis, singular value decomposition has a wide range of applications in finding data features. In a square matrix, singular value decomposition is to find the eigenvector corresponding to the eigenvalue. Since the matrix cannot be guaranteed to be a square matrix, a certain decomposition process is required.
[0074] Assume that M is an m×n matrix, and all its elements belong to the field K, which is the real number field or the complex number field. Then there exists a decomposition in which U is an m×m unitary matrix; Σ is a semi-positive m×n diagonal matrix; and V*, which is the conjugate transpose of V, is an n×n unitary matrix. Such a decomposition is called the singular value decomposition of M. The elements Σi on the diagonal of Σ, where Σi is the singular value of M. A common practice is to arrange the singular values from large to small. In this way, Σ can be uniquely determined by M. This method can more accurately describe the characteristic direction vectors in a bunch of line segments.
[0075] Data saving module: used to write the extracted plane information into the memory for storage; in the embodiment of the present application, after the plane information extraction is completed, the extracted data is saved in the selected three-dimensional data format (the system has multiple data saving methods, and the user can choose according to actual needs). The extracted plane information can be checked and displayed in the form of a list,
[0076] In the embodiment of the present application, the extraction result of the plane information can also be drawn with different colors and displayed through the display module to facilitate its use or further processing.
[0077] Figure 7 Schematic diagram of the hardware device structure of the plane extraction method of the three-dimensional line segment model provided in the embodiment of the present application. Figure 7 As shown, the device includes one or more processors and a memory. Taking a processor as an example, the device may also include: an input system and an output system.
[0078] The processor, memory, input system and output system can be connected through a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0079] The memory is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules. The processor executes various functional applications and data processing of the electronic device by running the non-transitory software programs, instructions and modules stored in the memory, that is, the processing method of the above method embodiment is implemented.
[0080] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processing system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] The input system can receive input digital or character information and generate signal input. The output system can include display devices such as display screens.
[0082] The one or more modules are stored in the memory, and when executed by the one or more processors, perform the following operations of any of the above method embodiments:
[0083] Step a: Load the 3D model file to be extracted through the file loading module;
[0084] Step b: extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm;
[0085] Step c: Write the extracted plane information into the memory for storage and display.
[0086] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided in the embodiment of the present application.
[0087] The embodiment of the present application provides a non-transitory (non-volatile) computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the following operations:
[0088] Step a: Load the 3D model file to be extracted through the file loading module;
[0089] Step b: extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm;
[0090] Step c: Write the extracted plane information into the memory for storage and display.
[0091] An embodiment of the present application provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer performs the following operations:
[0092] Step a: Load the 3D model file to be extracted through the file loading module;
[0093] Step b: extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm;
[0094] Step c: Write the extracted plane information into the memory for storage and display.
[0095] The plane extraction method, system and electronic device of the three-dimensional line segment model in the embodiment of the present application take the three-dimensional line segment model as the object, use the three-dimensional model after format processing for calculation, and use the technology of uniform sampling on the spherical surface to find all the line segments in the same plane on the Gaussian sphere, so as to realize the complete processing process from input to output, which can effectively utilize the advantages of the line segments, effectively reduce the amount of calculation, speed up data processing, greatly reduce the requirements for hardware processing capabilities, and is easy to expand.
[0096] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined in this application can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the present application, but will conform to the widest range consistent with the principles and novel features disclosed in the present application.
Claims
1. A plane extraction method for a three-dimensional line segment model, characterized in that: The following steps are involved: Step a: Load the 3D model file to be extracted through the file loading module; Step b: extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm; Step c: writing the extracted plane information into the memory for storage and display; In the step b, the extracting the plane information of the three-dimensional model file by using an approximate uniform sampling algorithm specifically includes: Step b1: Generate sampling points; first move one end of the line segment in the 3D model to the origin of the space, then normalize all the line segments to get a Gaussian sphere. Each line segment can be represented by a point on the sphere. If it is a line on a plane in space, it must be on the same plane passing through the center of the circle on the Gaussian sphere. Find the normal vector perpendicular to the plane. All line segments on the plane are perpendicular to the normal vector. Step b2: line segment extraction; after generating the sampling points, all the line segments and the normal vectors represented by the sampling points are calculated to determine whether the line segment and the normal vector are perpendicular. If the angle between the line segment and the normal vector is greater than a certain threshold, the line segment is considered to be perpendicular to the normal vector; the number of vertical line segments at each sampling point is statistically sorted, and the sampling point with the largest number of vertical line segments is found, and all the line segments passing through the sampling point are extracted for the next step of plane fitting; Step b3: plane fitting; first, the intercept of each line segment under the corresponding normal vector is calculated according to the midpoint of the line segment, and the line segments are clustered according to the intercept to find the set of line segments that are most likely to be a plane, and then the singular value decomposition method is used to perform plane fitting on the three-dimensional model.
2. The plane extraction method of a three-dimensional line segment model according to claim 1, characterized in that: In step a, loading the 3D model file to be extracted through the file loading module specifically includes: first obtaining the name of the 3D model file through a dialog box, then classifying and reading the 3D model files according to different data formats, and loading the 3D model files of different formats into a unified data format in the memory.
3. The plane extraction method of a three-dimensional line segment model according to claim 2, characterized in that: The step a also includes: displaying the three-dimensional model file through a display module, setting a plane extraction algorithm, and setting algorithm-related parameters.
4. The plane extraction method of a three-dimensional line segment model according to any one of claims 1 to 3, characterized in that: In the step c, writing the extracted plane information into the memory for storage and display specifically includes: saving the extracted data according to a set three-dimensional data format; and drawing and displaying the extracted plane information according to different colors.
5. A plane extraction system for a three-dimensional line segment model, characterized in that: include: File loading module: used to load the 3D model file to be extracted; Plane extraction module: used for extracting plane information of the three-dimensional model file by using an approximate uniform sampling algorithm; Data saving module: used to write the extracted plane information into the memory for storage; Display module: used to display 3D model files and plane information extraction results; The plane extraction module comprises: The sampling point generation unit used to generate sampling points: first, move one end of the line segment in the 3D model to the origin of the space, then normalize all the line segments to obtain a Gaussian sphere, and each line segment can be represented by a point on the sphere; if it is a line on a plane in space, it must be on the same plane passing through the center of the circle on the Gaussian sphere, find the normal vector perpendicular to the plane, and all line segments on the plane are perpendicular to the normal vector; The line segment extraction unit for extracting line segments: after generating sampling points, all line segments are calculated with the normal vectors represented by the sampling points to determine whether the line segment and the normal vector are perpendicular. If the angle between the line segment and the normal vector is greater than a certain threshold, the line segment is considered to be perpendicular to the normal vector. The number of vertical line segments at each sampling point is statistically sorted to find the sampling point with the largest number of vertical line segments, and all line segments passing through the sampling point are extracted for the next step of plane fitting. The plane fitting unit used to fit the plane: first, the intercept of each line segment under the corresponding normal vector is calculated according to the midpoint of the line segment, and the line segments are clustered according to the intercept to find the set of line segments that are most likely to be a plane. Then, the singular value decomposition method is used to fit the plane of the three-dimensional model.
6. The plane extraction system of a three-dimensional line segment model according to claim 5, characterized in that: The file loading module loads the 3D model file to be extracted specifically including: first obtaining the name of the 3D model file through a dialog box, then classifying and reading the 3D model files according to different data formats, and loading the 3D model files of different formats into a unified data format in the memory.
7. The plane extraction system of a three-dimensional line segment model according to claim 6, characterized in that: It also includes an algorithm setting module, which is used to set the plane extraction algorithm and set algorithm-related parameters.
8. The plane extraction system of a three-dimensional line segment model according to any one of claims 5 to 7, characterized in that: The data saving module writes the extracted plane information into the memory for storage, specifically by: saving the extracted data according to the set three-dimensional data format; The display module displays the plane information extraction result specifically by drawing and displaying the extracted plane information in different colors.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the plane extraction method of the three-dimensional line segment model described in any one of claims 1 to 4 above.
Citation Information
Patent Citations
Assumption plane fitting method based on building three-dimensional line segment model
CN108920765A
