Three-dimensional point cloud cutting method and device

By building a clipping instruction sequence and updating the result mapping table, the problem of cumbersome and inefficient three-dimensional point cloud cutting operations in the existing technology is solved, and more efficient and accurate cutting effects are achieved, and hardware and environment requirements are reduced.

CN120219680APending Publication Date: 2025-06-27GUANGDONG KENUO SURVEYING ENG CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510204374.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the 3D point cloud data processing, the cutting operation is cumbersome, low efficiency, low accuracy, and depends on the C++ library interface. The user interface program needs to install software such as Visual C++ distribution package or QT, and the hardware configuration and environment requirements are high and the cost is high.

Method used

Provide a three-dimensional point cloud cropping method. By reading the original point cloud file, building a crop instruction sequence, initializing the result mapping table, selecting the crop instructions, calculating the value of the number of points in the reserved spatial polygon, generating a point cloud sequential index array, updating the result mapping table, generating a result point cloud index array, and finally generating a three-dimensional point cloud cropping result.

Benefits of technology

It improves the efficiency and accuracy of three-dimensional point cloud cutting, reduces hardware and environment requirements, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219680A_ABST
    Figure CN120219680A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional point cloud cutting method and device. The method comprises the following steps: reading an original point cloud file; constructing a cutting instruction sequence according to the original point cloud file; initializing a result mapping table according to the original point cloud file; selecting one cutting instruction from the cutting instruction sequence as a target instruction; calculating the value of a time indicator of the inner points of the reserved space polygon according to the reserved inner and outer point flag bits of the target instruction; generating a point cloud sequence index array according to the original point cloud file and the three-dimensional space polygon of the target instruction; updating a result mapping table according to the point cloud sequence index array; generating a result point cloud index array according to the value of the time indicator of the points in the reserved space polygon and the updated result mapping table; and generating a three-dimensional point cloud cutting result according to the original point cloud file and the result point cloud index array. According to the invention, three-dimensional point cloud cutting is realized, the efficiency and the accuracy are improved, and the cost is reduced. The method can be widely applied to the technical field of computer graphics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics technology, and in particular, to a three-dimensional point cloud clipping method and apparatus. Background Art

[0002] In the field of 3D point cloud data processing, the spatial polygon clipping of 3D point clouds is usually implemented using a C++ library. Traditional point cloud clipping methods can perform clipping from one angle. However, when users perform point cloud clipping, they will perform one or more clipping operations from different angles (such as front view, side view, bottom view, or other views), resulting in the need to repeat clipping, with cumbersome operations, low efficiency, and prone to misoperations and low accuracy. Moreover, during clipping, a C++ library interface needs to be called for each clipping operation. The user interface program depends on the C++ runtime environment and requires software such as Visual C++ redistribution package or QT to be installed, which has high requirements for the hardware configuration and environment of the user side and high costs.

[0003] In summary, the technical problems existing in the related art need to be improved. Summary of the Invention

[0004] Embodiments of the present invention provide a three-dimensional point cloud clipping method and apparatus, which effectively improve efficiency and accuracy and reduce costs.

[0005] On the one hand, embodiments of the present invention provide a three-dimensional point cloud clipping method, including the following steps:

[0006] Read the original point cloud file;

[0007] Construct a clipping instruction sequence according to the original point cloud file;

[0008] Initialize a result mapping table according to the original point cloud file;

[0009] Select a clipping instruction from the clipping instruction sequence as the target instruction;

[0010] Calculate the value of the number indicator for retaining the inner points of the retaining spatial polygon according to the retaining inner / outer point flag bit of the target instruction;

[0011] Generate a point cloud sequential index array according to the original point cloud file and the three-dimensional spatial polygon of the target instruction;

[0012] Update the result mapping table according to the point cloud sequential index array;

[0013] Generate a result point cloud index array according to the value of the number indicator for retaining the inner points of the retaining spatial polygon and the updated result mapping table;

[0014] Generate a 3D point cloud clipping result based on the original point cloud file and the result point cloud index array.

[0015] In some embodiments, constructing a clipping instruction sequence based on the original point cloud file includes:

[0016] Draw an initial 3D space polygon according to the original point cloud file;

[0017] Construct a clipping instruction according to the clipping type attribute value and the initial 3D space polygon, where the clipping type attribute value includes the flag bit for retaining inner and outer points;

[0018] Combine multiple of the clipping instructions to obtain the clipping instruction sequence.

[0019] In some embodiments, calculating the value of the number indicator for retaining inner points in the retaining space polygon according to the flag bit for retaining inner and outer points of the target instruction includes:

[0020] Initialize the number indicator for retaining inner points in the retaining space polygon;

[0021] If the flag bit for retaining inner and outer points is for retaining inner points, increment the value of the number indicator for retaining inner points in the retaining space polygon by 1.

[0022] In some embodiments, generating a point cloud sequential index array according to the original point cloud file and the 3D space polygon of the target instruction includes:

[0023] Construct an initial space polygon point cloud object;

[0024] Add multiple space points of the 3D space polygon of the target instruction to the initial space polygon point cloud object to obtain a target space polygon point cloud object;

[0025] Create a normal estimation object and a normal object according to the target space polygon point cloud object;

[0026] Calculate the normal according to the normal estimation object and the normal object;

[0027] Calculate the plane coefficients of the normal plane according to the normal, where the plane coefficients of the normal plane include the coefficients in the X, Y, and Z coordinate axes directions in 3D space;

[0028] Perform projection processing according to the plane coefficients of the normal plane to obtain the projected original point cloud and the projected clipped polygon point cloud;

[0029] Generate the point cloud sequential index array according to the projected original point cloud and the projected clipped polygon point cloud.

[0030] In some embodiments, performing projection processing according to the plane coefficients of the normal plane to obtain the projected original point cloud and the projected cropped polygon point cloud includes:

[0031] Create an original point cloud object, which is obtained by reading the original point cloud file;

[0032] Construct a model coefficient parameter object according to the plane coefficients of the normal plane;

[0033] Perform a first projection filter according to the model coefficient parameter object, the original point cloud object, and the parameters for projecting onto a plane, where the first projection filter is used to project the original point cloud object onto the normal plane to obtain the projected original point cloud;

[0034] Perform a second projection filter according to the model coefficient parameter object, the target space polygon point cloud object, and the parameters for projecting onto a plane, where the second projection filter is used to project the target space polygon point cloud object onto the normal plane to obtain the projected cropped polygon point cloud.

[0035] In some embodiments, generating the point cloud sequential index array according to the projected original point cloud and the projected cropped polygon point cloud includes:

[0036] Construct a convex hull filter object;

[0037] Construct a convex hull object according to the projected cropped polygon point cloud and the convex hull parameters;

[0038] Calculate the convex hull polygon coordinate vector and the spatial convex hull point cloud object according to the convex hull object;

[0039] Use the convex hull polygon coordinate vector, the spatial convex hull point cloud object, the two-dimensional plane filter mode, and the projected original point cloud as filter parameters according to the convex hull filter object;

[0040] Perform convex hull filtering according to the convex hull filter object to obtain the point cloud sequential index array, where the point cloud sequential index array is an array of the sequence numbers of the points in the projected original point cloud within the two-dimensional plane where the convex hull object is located, and the sequence numbers in the point cloud sequential index array uniquely identify the data index positions of the corresponding points in the original point cloud file.

[0041] In some embodiments, updating the result mapping table according to the point cloud sequential index array includes:

[0042] Select an index from the point cloud sequential index array as the target index;

[0043] Extract the value corresponding to the target index from the result mapping table as the first flag bit;

[0044] If the retained inner and outer point flag bit is to retain inner points, increment the first flag bit by 1 and update the result mapping table;

[0045] If the retained inner and outer point flag bit is to retain outer points, decrement the first flag bit by 1 and update the result mapping table.

[0046] In some embodiments, generating a result point cloud index array according to the value of the number indicator of the retained inner points of the spatial polygon and the updated result mapping table includes:

[0047] Initialize the result point cloud index array;

[0048] Select a sequential index from the original point cloud file as the target point cloud point;

[0049] Extract the value corresponding to the target point cloud point from the updated result mapping table as the second flag bit;

[0050] If the value of the number indicator of the retained inner points of the spatial polygon is 0, determine whether the second flag bit is equal to 0;

[0051] If the second flag bit is 0, add the index corresponding to the second flag bit to the result point cloud index array;

[0052] If the value of the number indicator of the retained inner points of the spatial polygon is greater than 0, determine whether the second flag bit is equal to the value of the number indicator of the retained inner points of the spatial polygon;

[0053] If the second flag bit is equal to the value of the number indicator of the retained inner points of the spatial polygon, add the index corresponding to the second flag bit to the result point cloud index array.

[0054] In some embodiments, generating a three-dimensional point cloud clipping result according to the original point cloud file and the result point cloud index array includes:

[0055] According to the original point cloud file and the result point cloud index array, read the point cloud data at the corresponding index positions and output it to the target point cloud file in text form or binary form to obtain the three-dimensional point cloud clipping result.

[0056] On the other hand, an embodiment of the present invention provides a three-dimensional point cloud clipping device, including:

[0057] A first module for reading an original point cloud file;

[0058] The second module is used to construct a clipping instruction sequence according to the original point cloud file;

[0059] The third module is used to initialize a result mapping table according to the original point cloud file;

[0060] The fourth module is used to select a clipping instruction from the clipping instruction sequence as the target instruction;

[0061] The fifth module is used to calculate the value of the in-point counter of the reserved space polygon according to the in-out point flag bit of the target instruction;

[0062] The sixth module is used to generate a point cloud sequence index array according to the original point cloud file and the three-dimensional space polygon of the target instruction;

[0063] The seventh module is used to update the result mapping table according to the point cloud sequence index array;

[0064] The eighth module is used to generate a result point cloud index array according to the value of the in-point counter of the reserved space polygon and the updated result mapping table;

[0065] The ninth module is used to generate a three-dimensional point cloud clipping result according to the original point cloud file and the result point cloud index array.

[0066] The beneficial effects of the present invention are as follows:

[0067] In the embodiment of the present invention, the original point cloud file is first read, a clipping instruction sequence is constructed according to the original point cloud file, and a result mapping table is initialized according to the original point cloud file. Then, a clipping instruction is selected from the clipping instruction sequence as the target instruction, the value of the in-point counter of the reserved space polygon is calculated according to the in-out point flag bit of the target instruction, a point cloud sequence index array is generated according to the original point cloud file and the three-dimensional space polygon of the target instruction, the result mapping table is updated according to the point cloud sequence index array, a result point cloud index array is generated according to the value of the in-point counter of the reserved space polygon and the updated result mapping table, and finally, a three-dimensional point cloud clipping result is generated according to the original point cloud file and the result point cloud index array, thereby realizing the three-dimensional point cloud clipping, improving the efficiency and accuracy, and reducing the cost.

[0068] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the specification and the drawings. Description of the Drawings

[0069] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0070] Figure 1 It is a flowchart of a three-dimensional point cloud cropping method according to an embodiment of the present invention;

[0071] Figure 2 It is a schematic diagram of drawing a three-dimensional space polygon according to an embodiment of the present invention;

[0072] Figure 3 It is a schematic diagram of the cropping result after single cropping according to an embodiment of the present invention;

[0073] Figure 4 It is a schematic diagram of the three-dimensional point cloud cropping result according to an embodiment of the present invention;

[0074] Figure 5 It is a schematic diagram of the overall process of cropping and generating a point cloud point file according to an embodiment of the present invention;

[0075] Figure 6 It is a schematic diagram of the structure of a three-dimensional point cloud cropping device according to an embodiment of the present invention. Detailed implementation manners

[0076] In order to make the purpose, technical solutions and advantages of the present application clearer, the following further details the present application in combination 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. When the following description involves the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application detailed in the appended claims.

[0077] It can be understood that the terms "first", "second", etc. used in the present application can be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information can also be called the second information, and similarly, the second information can also be called the first information. Depending on the context, the words "if", "when" as used herein can be interpreted as "when...", "when...", or "in response to a determination".

[0078] The terms "at least one", "a plurality", "each", "any one", etc. used in this application, "at least one" includes one, two or more than two, "a plurality" includes two or more than two, "each" refers to each of the corresponding plurality, and "any one" refers to any one of the plurality.

[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0080] Before elaborating on the embodiments of this application in detail, some nouns and terms involved in the embodiments of this application are first explained, and the nouns and terms involved in the embodiments of this application are subject to the following explanations.

[0081] Point cloud data: refers to a set of vectors in a three-dimensional coordinate system.

[0082] In the related art, there are the following two mainstream C++ libraries available for developers in the field of 3D point cloud data processing: Point Cloud Library and Open3D. Both have implemented the function of spatial polygon clipping for 3D point clouds. The 3D spatial polygon of the clipping range can be obtained in the following way. For example, use the Three.js and Javascript libraries to load the point cloud data. The Three.js library will display the 3D point cloud data on the computer screen. The positive direction of the X-axis of the spatial three-dimensional coordinate system is parallel to the horizontal direction of the computer screen to the right, the positive direction of the Y-axis is parallel to the vertical direction of the computer screen upward, and the positive direction of the Z-axis is perpendicular to the computer screen outward. A point in space can be represented by (x, y, z). When the 3D scene camera is in the perspective projection mode, its default position is (0, 0, 0), the lens is facing (0, 0, -1), the near clipping plane distance is 0.1, and the far clipping plane distance is 2000. At this time, without modifying the camera view angle, the computer screen is parallel to the near and far clipping planes. The user frames a polygon on the computer screen, and the 3D coordinates therein are the coordinates of the intersection points of the rays emitted from the camera and the screen plane. This coordinate can be represented as the computer screen coordinate or the coordinate in the 3D point cloud coordinate system. The clipping of Point Cloud Library is implemented by the CropHull filter function, which can implement the clipping of 3D point clouds within a two-dimensional plane polygon range, and can also implement the clipping function of 3D point clouds on a 3D polygon surface. The 3D points within or outside the polygon can be retained. Open3D, on the other hand, is implemented by the CropPointCloud function. It collects the 3D viewport camera parameters during clipping, transforms all 3D point clouds to the section of the viewport and the computer screen through a spatial matrix, and then determines whether the transformed 3D point clouds are within the clipping polygon to achieve the clipping of point cloud data within the spatial polygon range. Open3D can only clip out the point clouds within the spatial polygon range. Both methods can implement the function of clipping point cloud data using a spatial polygon once. However, for 3D point cloud clipping, when users perform point cloud clipping, they will perform one to multiple clipping operations from different angles. Neither of the two development libraries has the function of batch clipping by passing in multiple spatial polygons at once to obtain the final point cloud data, resulting in the need to repeat the clipping, with cumbersome operations, low efficiency, and prone to misoperations and low accuracy.

[0083] In view of this, in this embodiment, by cropping a sequence of spatial polygons and an original point cloud file, constructing a cropping instruction sequence, initializing a result mapping table, selecting a cropping instruction from the cropping instruction sequence as a target instruction, calculating the value of the number indicator of the points within the remaining spatial polygon, generating a point cloud sequence index array, updating the result mapping table, generating a result point cloud index array, and generating a three-dimensional point cloud cropping result, three-dimensional point cloud cropping is achieved, thereby improving efficiency and accuracy. This embodiment enables a user to obtain the required 3D point cloud data at one time after obtaining spatial polygon cropping steps one to multiple times on a front-end interface such as a Web browser interface or a desktop application interface. The user does not need to perform repeated cropping at fixed angles (front view, side view, bottom view).

[0084] A three-dimensional point cloud cropping method provided by an embodiment of the present application relates to the field of computer graphics technology. The three-dimensional point cloud cropping method provided by an embodiment of the present application can be applied to a terminal, can also be applied to a server, or can also be software running on a terminal or a server. In some embodiments, the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto; the server side can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application implementing a three-dimensional point cloud cropping method, etc., but is not limited to the above forms.

[0085] The present application can be used in many general or specific computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet-type devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0086] The following specifically explains the embodiments of the present application with reference to the accompanying drawings:

[0087] Figure 1 It is an optional flowchart of a three-dimensional point cloud clipping method provided by an embodiment of the present application. Figure 1 The method in it may include but is not limited to steps S101 to S109.

[0088] Step S101: Read the original point cloud file;

[0089] Step S102: Construct a clipping instruction sequence according to the original point cloud file;

[0090] Step S103: Initialize the result mapping table according to the original point cloud file;

[0091] Step S104: Select a clipping instruction from the clipping instruction sequence as the target instruction;

[0092] Step S105: Calculate the value of the inlier count indicator for the points inside the retention space polygon according to the inlier / outlier flag of the target instruction;

[0093] Step S106: Generate a point cloud sequential index array according to the original point cloud file and the three-dimensional space polygon of the target instruction;

[0094] Step S107: Update the result mapping table according to the point cloud sequential index array;

[0095] Step S108: Generate a result point cloud index array according to the value of the inlier count indicator for the points inside the retention space polygon and the updated result mapping table;

[0096] Step S109: Generate a three-dimensional point cloud clipping result according to the original point cloud file and the result point cloud index array.

[0097] Steps S101 to S109 illustrated in the embodiments of the present application achieve three-dimensional point cloud clipping, improve efficiency and accuracy, and reduce costs.

[0098] In step S101 of some embodiments, the original point cloud file can be read from the model database. It can also be read in other ways, not limited to this.

[0099] In some embodiments, in step S102, constructing a clipping instruction sequence according to the original point cloud file may include but is not limited to the following steps:

[0100] Draw an initial three-dimensional space polygon according to the original point cloud file;

[0101] Construct a clipping instruction according to the clipping type attribute value and the initial three-dimensional space polygon, and the clipping type attribute value includes the inlier / outlier flag;

[0102] Combine multiple clipping instructions to obtain a clipping instruction sequence.

[0103] In some embodiments, the interface for constructing the clipping instruction sequence may include, but is not limited to, a Web browser or a desktop application, etc. The acquisition method may include, but is not limited to, an HTTP request method or drawing between SDK development library interfaces, etc. First, an initial three-dimensional space polygon may be drawn according to the original point cloud file. Exemplarily, in the perspective of a 3D camera, a 3D (three-dimensional) space polygon may be drawn on a computer screen. The drawing tools include, but are not limited to, WebGL, Three.js, Potree and other Web-side tools, or Qt and other desktop-side tools. The drawing can be performed from any 3D camera perspective, including but not limited to standard perspectives such as the front perspective, side perspective or bottom perspective. The drawn three-dimensional space polygon is as Figure 2 shown. The drawn clipping selection graphics may include, but are not limited to, triangles, squares, rectangles or polygons, etc. The clipping result after a single clipping is as Figure 3As shown. Then, according to the clipping type attribute value and the initial three-dimensional spatial polygon, a clipping instruction is constructed. It can be understood that the clipping type attribute value includes a flag for retaining inner and outer points. The clipping type attribute value (ClipType) is used to record whether to retain the points inside the 3D spatial polygon or the points outside the 3D spatial polygon. ClipType takes values of 0 or 1. When the ClipType value is 0, it means to retain the points inside the clipped graph. When the ClipType value is 1, it means to retain the points outside the clipped graph (or discard the points inside the clipped graph). Finally, multiple clipping instructions are combined to obtain a clipping instruction sequence. Exemplarily, the clipping instruction sequence contains a 3D polygon and a flag for the points to be included inside or outside, and its format includes but is not limited to formats such as JSON, XML, or Yaml, etc.The clipping instruction sequence can be represented as a JSON string: {"steps": [{"ClipType": 0, "polygon": [{"x": 201146.77792743265, "y": 2488376.0667338474, "z": 257.6004469558181}, {"x": 201216.01054112884, "y": 2488355.2928754976, "z": 255.53697639059766}, {"x": 201168.94736163938, "y": 2488209.8427423327, "z": 201.96928051747543}, {"x": 201085.2156851653, "y": 2488254.3182609966, "z": 211.1310898270541}, {"x": 201147.069811476, "y": 2488376.244004501, "z": 257.68298577842694}]}, {"ClipType": 1, "polygon": [{"x": 201113.48550045915, "y": 2488484.2823817646, "z": 190.53654743629278}, {"x": 201091.4067861979, "y": 2488403.8610067, "z": 201.70192495821556}, {"x": 201034.52728157534, "y": 2488411.9093756536, "z": 151.7076972481136}, {"x": 201065.37059937385, "y": 2488502.5793731166, "z": 144.04191566589796}, {"x": 201113.75449784528, "y": 2488484.435034568, "z": 190.70319486199315}]}]}]. Among them, the "steps" attribute is an array of clipping instruction sequences. Each item in the array is a specific clipping instruction. The clipping instruction consists of two parts. "polygon" represents an array of coordinates in the coordinate system of all 3D point clouds for drawing the clipping graph on the computer screen. ClipType indicates whether to retain the points inside or outside the clipping graph. When the value is 0, it means to retain the points inside the clipping graph, and 1 means to retain the points outside the clipping graph (or discard the points inside the clipping graph).

[0104] In some embodiments, in steps S103 - S104, the result mapping table can be initialized according to the original point cloud file. Exemplarily, all points can be read from the original point cloud file, and a result mapping table Point_Clip_KV can be created, with a size equal to the number of points in the original point cloud file (i.e., the total number of point cloud points). The key is the sequence number of the 3D point cloud point, and the value is initialized to 0. It can be understood that in this embodiment, the PCL library is used as an example and accompanied by pseudo - code for illustration. This embodiment can be implemented independently of the PCL library, and the PCL library is just one of its implementation methods. The program code can be expressed as:

[0105] map<int, int> Point_Clip_KV; / / Create the mapping table;

[0106] for (int p = 0; p < the total number of points in the original point cloud file; p++) { Point_Clip_KV[p] = 0;} / / Initialize the mapping table.

[0107] A simple example of the data stored in the mapping table Point_Clip_KV is as follows:

[0108] Point_Clip_KV[0] = 0;

[0109] Point_Clip_KV[1] = 0;

[0110] Point_Clip_KV[2] = 0; ......;

[0112] Point_Clip_KV[N] = 0;

[0113] Where N = the total number of point cloud points - 1.

[0114] Then, a clipping instruction is selected from the clipping instruction sequence as the target instruction. It can be understood that by traversing each clipping instruction in the clipping instruction sequence and executing steps S105 - S107, the Point_Clip_KV result mapping table can be updated. After all the clipping instructions are executed, finally, according to steps S108 - S109, the three - dimensional point cloud clipping result is generated.

[0115] In some embodiments, in step S105, according to the in - out point flag of the target instruction, calculating the value of the in - point count indicator of the reserved space polygon can include but is not limited to the following steps:

[0116] Initialize the in - point count indicator of the reserved space polygon;

[0117] If the flag bit for retaining internal and external points is set to retain internal points, increment the value of the counter for the number of internal points retained in the spatial polygon by 1.

[0118] In some embodiments, the counter for the number of internal points retained in the spatial polygon, plusIndicator, can be initialized first, and the value of the counter for the number of internal points retained in the spatial polygon can be set to 0. The method for receiving the target instruction in this embodiment includes, but is not limited to, interface calls such as HTTP requests and C++ SDKs. Then, the flag bit for retaining internal and external points, ClipType, is extracted from the target instruction. If the flag bit for retaining internal and external points is set to retain internal points, i.e., ClipType == 0, increment the value of the counter for the number of internal points retained in the spatial polygon by 1. The program code can be expressed as:

[0119] if(ClipType == 0){plusIndicator++;}

[0120] In some embodiments, in step S106, generating the point cloud sequence index array based on the original point cloud file and the three-dimensional spatial polygon of the target instruction may include, but is not limited to, the following steps:

[0121] Construct an initial spatial polygon point cloud object;

[0122] Add multiple spatial points of the three-dimensional spatial polygon of the target instruction to the initial spatial polygon point cloud object to obtain the target spatial polygon point cloud object;

[0123] Create a normal estimation object and a normal object based on the target spatial polygon point cloud object;

[0124] Calculate the normal based on the normal estimation object and the normal object;

[0125] Calculate the plane coefficients of the normal plane based on the normal. The plane coefficients of the normal plane include the coefficients in the X, Y, and Z coordinate directions of the three-dimensional space of the normal plane;

[0126] Perform projection processing based on the plane coefficients of the normal plane to obtain the projected original point cloud and the projected clipped polygon point cloud;

[0127] Generate the point cloud sequence index array based on the projected original point cloud and the projected clipped polygon point cloud.

[0128] In some embodiments, an initial spatial polygon point cloud object can be constructed first, and multiple spatial points of the three-dimensional spatial polygon of the target instruction can be added to the initial spatial polygon point cloud object to obtain the target spatial polygon point cloud object. The program code can be expressed as:

[0129]

[0130] Then, based on the target spatial polygon point cloud object, a normal estimation object and a normal object are created. According to the normal estimation object and the normal object, the normal is calculated, and based on the normal, the plane coefficients of the normal plane are calculated. Among them, the plane coefficients of the normal plane can include the coefficients of the normal plane in the three coordinate axis directions of X, Y, and Z in the three-dimensional space. The program code can be expressed as:

[0131] NormalEstimation<PointXYZ,Normal> normalEstimation;

[0132] normalEstimation.setInputCloud(boundingbox_ptr);

[0133] PointCloud <normal>::Ptr normals(new PointCloud <normal>);

[0134] normalEstimation.compute(*normals); / / Compute the normals and store the results in normals.

[0135] Then, based on the plane coefficients of the normal plane, perform projection processing to obtain the projected original point cloud and the projected cropped polygon point cloud. Finally, generate a point cloud sequence index array based on the projected original point cloud and the projected cropped polygon point cloud.

[0136] In some embodiments, performing projection processing based on the plane coefficients of the normal plane to obtain the projected original point cloud and the projected cropped polygon point cloud includes:

[0137] Create an original point cloud object, which is obtained by reading the original point cloud file;

[0138] Construct a model coefficient parameter object based on the plane coefficients of the normal plane;

[0139] Execute the first projection filter according to the model coefficient parameter object, the original point cloud object, and the parameters for projection onto the plane. The first projection filter is used to project the original point cloud object onto the normal plane to obtain the projected original point cloud;

[0140] Execute the second projection filter according to the model coefficient parameter object, the target space polygon point cloud object, and the parameters for projection onto the plane. The second projection filter is used to project the target space polygon point cloud object onto the normal plane to obtain the projected cropped polygon point cloud.

[0141] In some embodiments, an original point cloud object (the first input point cloud) can be created first. The original point cloud object is obtained by reading the original point cloud file, and the program code can be expressed as:

[0142] PointCloud <pointxyz>::Ptr cloud_projected(new PointCloud <pointxyz>);

[0143] PointCloud <pointxyz>::Ptr cloud_projected_box(new PointCloud <pointxyz>)。

[0144] Then, set the projection filtering object, the parameters for projecting onto a plane, and the object for model coefficient parameters. The program code can be expressed as:

[0145] ProjectInliers <pointxyz>proj; / / Create a projection filter object;

[0146] proj.setModelType(SACMODEL_PLANE); / / Set the parameters for projection onto a plane;

[0147] proj.setModelCoefficients(coefficients); / / Set the model coefficient parameter object;

[0148] proj.setInputCloud(pclPointCloudI) or proj.setInputCloud(boundingbox_ptr); / / Set the original point cloud.

[0149] It can be understood that when setting the original point cloud, the input parameters of the original point cloud object and the target space polygon point cloud object are different. Then, according to the plane coefficients of the normal plane, a model coefficient parameter object is constructed. Exemplarily, the components in the X, Y, and Z directions of the projection plane can be obtained, and a ModelCoefficients (model coefficient) parameter object is constructed. The program code can be expressed as:

[0150] ModelCoefficients::Ptr coefficients(new ModelCoefficients());

[0151] coefficients->values.resize(4);

[0152] coefficients->values[0] = normals->points[0].normal_x;

[0153] coefficients->values[1] = normals->points[0].normal_y;

[0154] coefficients->values[2] = normals->points[0].normal_z;

[0155] coefficients->values[3] = 0;

[0156] According to the model coefficient parameter object, the original point cloud object, and the parameters for projection onto a plane, perform the first projection filtering, where the first projection filtering is used to project the original point cloud object onto the normal plane to obtain the projected original point cloud (the first output point cloud). The program code can be expressed as:

[0157] proj.filter(*cloud_projected); / / Perform the first projection filtering and store the result in cloud_projected.

[0158] Finally, according to the model coefficient parameter object, the target space polygon point cloud object, and the parameter projected onto the plane, perform the second projection filtering. The second projection filtering is used to project the target space polygon point cloud object onto the normal plane to obtain the projected clipped polygon point cloud (the second output point cloud). The program code can be expressed as:

[0159] proj.filter(*cloud_projected_box); / / Perform the second projection filtering and store the result in cloud_projected.

[0160] In some embodiments, generate a point cloud sequence index array based on the projected original point cloud and the projected clipped polygon point cloud, including:

[0161] Construct a convex hull filtering object;

[0162] Construct a convex hull object according to the projected clipped polygon point cloud and the convex hull parameters;

[0163] Calculate the convex hull polygon coordinate vector and the spatial convex hull point cloud object according to the convex hull object;

[0164] According to the convex hull filtering object, use the convex hull polygon coordinate vector, the spatial convex hull point cloud object, the two-dimensional plane filtering mode, and the projected original point cloud as filter parameters;

[0165] Perform convex hull filtering according to the convex hull filtering object to obtain a point cloud sequence index array. The point cloud sequence index array is an array of the serial numbers of the points in the projected original point cloud within the two-dimensional plane where the convex hull object is located. The serial numbers in the point cloud sequence index array uniquely identify the data index positions of the corresponding points in the original point cloud file.

[0166] In some embodiments, first construct a convex hull object according to the projected clipped polygon point cloud and the convex hull parameters, and calculate the convex hull polygon coordinate vector and the spatial convex hull point cloud object according to the convex hull object. The program code can be expressed as:

[0167] ConvexHull <pointxyz>hull; / / Create a convex hull object;

[0168] hull.setInputCloud(cloud_projected_box); / / Set the point cloud of the projected clipped polygon;

[0169] hull.setDimension(2); / / Set the 2D convex hull parameters;

[0170] std::vector <vertices>polygons; / / Create a vector of convex hull polygon coordinates;

[0171] PointCloud <pointxyz>::Ptr surface_hull(new PointCloud <pointxyz>); / / Create a spatial convex hull

[0172] Point cloud object;

[0173] hull.reconstruct(*surface_hull, polygons); / / Calculate the convex hull result and store it in surface_hull and polygons.

[0174] Then construct a convex hull filtering object, and use the convex hull polygon coordinate vector, spatial convex hull point cloud object, two-dimensional plane filtering mode, and the projected original point cloud as filter parameters according to the convex hull filtering object. The program code can be expressed as:

[0175] CropHull <pointxyz>bb_filter; / / Create a convex hull filtering object;

[0176] bb_filter.setDim(2); / / Set to 2D plane filtering mode;

[0177] bb_filter.setInputCloud(cloud_projected); / / Intend to filter the projected original point cloud file;

[0178] bb_filter.setHullIndices(polygons);

[0179] bb_filter.setHullCloud(surface_hull); / / Set the calculated convex hull parameters (convex hull polygon coordinate vector) into the filter.

[0180] Then, based on the convex hull filtering object, perform convex hull filtering to obtain an array of point cloud sequential indices. Among them, the array of point cloud sequential indices is an array of the serial numbers of the points in the projected original point cloud within the two-dimensional plane where the convex hull object is located. The serial numbers in the array of point cloud sequential indices uniquely identify the data index positions of the corresponding points in the original point cloud file. The program code can be expressed as:

[0181] std::vector <int>indices;

[0182] bb_filter.filter(indices); / / Perform convex hull filtering to select points within the projected spatial polygon, and store the results in indices.

[0183] In some embodiments, in step S107, according to the point cloud sequential index array, updating the result mapping table may include, but is not limited to, the following steps:

[0184] Select an index from the point cloud sequential index array as the target index;

[0185] Extract the value corresponding to the target index from the result mapping table as the first flag bit;

[0186] If the keep inner and outer points flag bit is to keep inner points, increment the first flag bit by 1 and update the result mapping table;

[0187] If the keep inner and outer points flag bit is to keep outer points, decrement the first flag bit by 1 and update the result mapping table.

[0188] In some embodiments, a target index can be first selected from the point cloud sequential index array, and the value corresponding to the target index is extracted from the result mapping table as the first flag bit. If the keep inner and outer points flag bit is to keep inner points, that is, ClipType is 0, increment the first flag bit Point_Clip_KV[idx] by 1 and update the result mapping table; if the keep inner and outer points flag bit is to keep outer points, that is, ClipType is 1, decrement the first flag bit Point_Clip_KV[idx] by 1 and update the result mapping table. The program code can be expressed as:

[0189]

[0190]

[0191] It can be understood that the point cloud sequential index array can be traversed, and the above judgment is performed on each index in the point cloud sequential index array to update and obtain the result mapping table. Further, it can be determined whether all clipping instructions have been traversed. If not all clipping instructions have been traversed, continue to extract the next clipping instruction.

[0192] In some embodiments, in step S108, according to the value of the number indicator for keeping points within the spatial polygon and the updated result mapping table, generating the result point cloud index array may include, but is not limited to, the following steps:

[0193] Initialize the result point cloud index array;

[0194] Select a sequential index from the original point cloud file as the target point cloud point;

[0195] Extract the value corresponding to the target point cloud point from the updated result mapping table as the second flag bit;

[0196] If the value of the number-of-times indicator for the points inside the reserved spatial polygon is 0, determine whether the second flag bit is equal to 0;

[0197] If the second flag bit is 0, add the index corresponding to the second flag bit to the result point cloud index array;

[0198] If the value of the number-of-times indicator for the points inside the reserved spatial polygon is greater than 0, determine whether the second flag bit is equal to the value of the number-of-times indicator for the points inside the reserved spatial polygon;

[0199] If the second flag bit is equal to the value of the number-of-times indicator for the points inside the reserved spatial polygon, add the index corresponding to the second flag bit to the result point cloud index array.

[0200] In some embodiments, the point clouds in all the original point cloud files can be traversed, and it can be determined whether each point should be retained or discarded according to the corresponding Point_Clip_KV count and the plusIndicator. The result point cloud index array can be initialized first. A sequential index is selected from the original point cloud file as the target point cloud point, and the value corresponding to the target point cloud point is extracted from the updated result mapping table as the second flag bit. If the value of the times indicator for retaining points inside the spatial polygon is 0, that is, the plusIndicator is equal to 0, it means that the clipping instructions do not include any points inside the polygon, that is, the ClipType is 1 each time. It is judged whether the second flag bit is for retaining interior points, that is, equal to 0. If the second flag bit is for retaining interior points, that is, Point_Clip_KV[idx] is equal to 0, it indicates that this point is among the retained points and should be retained, and the index corresponding to the second flag bit is added to the result point cloud index array (RetainPointIndices). Further, when Point_Clip_KV[idx] is less than 0, it indicates that this point is outside the clipping polygon at least once and should be discarded. If the value of the times indicator for retaining points inside the spatial polygon is greater than 0, that is, the plusIndicator is greater than 0, it means that there is one or more points inside the polygon in the clipping instructions. It is judged whether the second flag bit is equal to the value of the times indicator for retaining points inside the spatial polygon. If the second flag bit is equal to the value of the times indicator for retaining points inside the spatial polygon, that is, Point_Clip_KV[idx] is equal to the plusIndicator, it indicates that this point is always within the retained range, and the index corresponding to the second flag bit is added to the result point cloud index array (RetainPointIndices). Further, when Point_Clip_KV[idx] is not equal to the plusIndicator, it indicates that this point is not among the points to be retained in a certain clipping, and this point should ultimately be discarded. The program code for generating the result point cloud index array can be expressed as:

[0201]

[0202] In some embodiments, in step S109, according to the original point cloud file and the result point cloud index array, generating the three-dimensional point cloud clipping result may include, but is not limited to, the following steps:

[0203] According to the original point cloud file and the result point cloud index array, by reading the point cloud data at the corresponding index positions, it is output to the target point cloud file in text form or binary form to obtain the three-dimensional point cloud clipping result.

[0204] In some embodiments, according to the original point cloud file and the result point cloud index array, by reading the point cloud data at the corresponding index positions, it can be output in text form or binary form to the target point cloud file to obtain the 3D point cloud clipping result. Exemplarily, according to the original point cloud file, in combination with the retained result point cloud index array (RetainPointIndices), by reading the point cloud data at the corresponding index positions, the retained point cloud can be filtered out and output in text form or binary form to the target point cloud file to obtain the 3D point cloud clipping result as shown in Figure 4 the following.

[0205] In some embodiments, the overall process of clipping and generating the point cloud point file is as shown in Figure 5 the following. First, the clipping instruction sequence can be obtained, and then each clipping instruction is traversed. The number of times plusIndicator within the retained polygon for the shear type is counted. When traversing each clipping instruction, the point cloud points therein are filtered out through the spatial polygon in the clipping instruction; when traversing each clipping instruction, according to the retention type of the clipping instruction, the corresponding count point_Clip_KV of the filtered point cloud points is incremented by 1 or decremented by 1. Then, all the point clouds in the original point cloud file are traversed, and it is determined whether each point should be retained or discarded according to its corresponding point_Clip_KV count and plusIndicator. Finally, the retained point cloud points are saved as a new point cloud point file.

[0206] In some embodiments, the plusIndicator in this embodiment is a counter. When the 3D point cloud within the spatial polygon is clipped out in the clipping instruction step (at this time ClipType is 0), plusIndicator is incremented by 1. If the points within the spatial polygon are discarded in the clipping instruction step (at this time the ClipType value is 1), then no numerical modification is made to plusIndicator. The relationship between plusIndicator and the clipping instruction step S is as follows:

[0207] (1) When the clipping steps in the clipping instruction sequence always retain the points within the spatial polygon, i.e., plusIndicator = S, for example, the user always reduces the clipped 3D point cloud set by drawing a spatial polygon for clipping. As long as the user keeps 3D point clouds within the clipping spatial polygon, a small part of 3D point cloud points that meet the user's requirements will eventually be clipped. On the other hand, although the user always keeps selecting to retain the points within the clipping spatial polygon, during a certain clipping process, if the number of 3D point clouds enclosed within the spatial polygon is 0, then this clipping has no substantial meaning for subsequent continued clipping and retaining the points within the spatial polygon because the number of clipped points has dropped to 0. Let k represent the serial number of a certain point cloud point in the 3D point cloud source file. Then the value of Point_Clip_KV[k] can range from 0 to S. As long as point k is always within the clipping range, its value is the same as plusIndicator; if different, its value must be less than plusIndicator.

[0208] (2) When the clipping instruction sequence always discards the points within the spatial polygon, it is equivalent to the user continuously discarding the points outside the 3D point cloud or continuously digging holes (penetrating the 3D point cloud) in the 3D point cloud. At this time, plusIndicator = 0. Since the value of Point_Clip_KV[k] can range from 0 to (-S), when the value is 0, it indicates that this point has never been framed (filtered out) by the spatial polygon during previous clippings, so it has always remained unchanged from the initial value. At this time, this point should ultimately be retained. If it is a negative integer (-1 to -S), it means that this point has been framed by the clipping polygon once or multiple times, and this point should be discarded in the target point cloud index array of the final result.

[0209] (3) When both the steps of retaining the points within the spatial polygon and discarding the points within the spatial polygon exist in the clipping instruction sequence, at this time, the value of plusIndicator is an integer within the range of 0 to S, excluding 0 and S. The specific value is the number of times when ClipType in the clipping instruction is equal to 0. The value of Point_Clip_KV[k] needs to be judged. During a certain clipping step, if this point is framed by the clipping polygon, for example, if the instruction selects to retain the points within the spatial polygon this time, its value is incremented by 1; if the instruction selects to discard the points within the spatial polygon this time, its value is decremented by 1. In this way, when point k is within the clipping spatial polygon range, its Point_Clip_KV[k] value may be incremented by 1 or decremented by 1; when k is not within the clipping spatial polygon range, its Point_Clip_KV[k] will not change.

[0210] In some embodiments, specific examples are used for illustration. (1) When the ClipType in the clipping instruction sequence is 1, 0, 0, 1 respectively, the situation of the range of the spatial point k inside the polygon is: "not in, in, in, in", then the change situation of plusIndicator is: "remain unchanged, increment by 1, increment by 1, remain unchanged", and the final value is 2. The change situation of Point_Clip_KV[k] is: "remain unchanged, increment by 1, increment by 1, decrement by 1", and the final value is 1. Finally, the value of Point_Clip_KV[k] is different from that of plusIndicator, and this point should be discarded. (2) When the ClipType in the clipping instruction sequence is 0, 0, 0, 1 respectively, the situation of the range of the spatial point k inside the polygon is: "in, in, in, not in", then the change situation of plusIndicator is: "increment by 1, increment by 1, increment by 1, remain unchanged", and the final value is 3. The change situation of Point_Clip_KV[k] is: "increment by 1, increment by 1, increment by 1, remain unchanged", and the final value is 3. Finally, the value of Point_Clip_KV[k] is the same as that of plusIndicator, and this point should be output to the clipping result file.

[0211] In some embodiments, this embodiment can separate the drawing of the point cloud clipping step from the clipping algorithm and implement the point cloud clipping on different terminal interfaces. This embodiment does not depend on existing development frameworks such as Point Cloud Library or Open3D, and any programming language can implement this algorithm. This embodiment can achieve the clipping and output of the point cloud set that the user finally needs at one time.

[0212] The beneficial effects of implementing the embodiments of the present invention include: The embodiments of the present invention first read the original point cloud file, construct a clipping instruction sequence according to the original point cloud file, and initialize the result mapping table according to the original point cloud file. Then, a clipping instruction is selected from the clipping instruction sequence as the target instruction, and the value of the count indicator for retaining the points inside the spatial polygon is calculated according to the in-out point flag of the target instruction. Next, a point cloud sequence index array is generated according to the original point cloud file and the three-dimensional spatial polygon of the target instruction. The result mapping table is updated according to the point cloud sequence index array. A result point cloud index array is generated according to the value of the count indicator for retaining the points inside the spatial polygon and the updated result mapping table. Finally, a three-dimensional point cloud clipping result is generated according to the original point cloud file and the result point cloud index array, thereby realizing the three-dimensional point cloud clipping, improving the efficiency and accuracy, and reducing the cost.

[0213] As Figure 6 shown, the embodiments of the present invention also provide a three-dimensional point cloud clipping device, including:

[0214] The first module 801 is used to read the original point cloud file;

[0215] The second module 802 is used to construct a clipping instruction sequence according to the original point cloud file;

[0216] The third module 803 is used to initialize the result mapping table according to the original point cloud file;

[0217] The fourth module 804 is used to select a clipping instruction from the clipping instruction sequence as the target instruction;

[0218] The fifth module 805 is used to calculate the value of the in-point count indicator of the reserved space polygon according to the in-out point flag bit of the target instruction;

[0219] The sixth module 806 is used to generate a point cloud sequence index array according to the original point cloud file and the three-dimensional space polygon of the target instruction;

[0220] The seventh module 807 is used to update the result mapping table according to the point cloud sequence index array;

[0221] The eighth module 808 is used to generate a result point cloud index array according to the value of the in-point count indicator of the reserved space polygon and the updated result mapping table;

[0222] The ninth module 809 is used to generate a three-dimensional point cloud clipping result according to the original point cloud file and the result point cloud index array.

[0223] The content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented in the device embodiments of the present application are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.

[0224] In some embodiments, the first module and the second module can be separately run on two computers from the subsequent modules. For example, the first module and the second module run in the Chrome browser of the user's computer, and the third module to the ninth module run on the server in sequence.

[0225] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings. However, this does not limit the scope of the rights of the embodiments of the present application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall fall within the scope of the rights of the embodiments of the present application.< / int> < / pointxyz> < / pointxyz> < / pointxyz> < / vertices> < / pointxyz> < / pointxyz> < / pointxyz> < / pointxyz> < / pointxyz> < / pointxyz> < / normal> < / normal>

Claims

1. A three-dimensional point cloud clipping method, characterized in that: The following steps are involved: Read the original point cloud file; Constructing a cropping instruction sequence according to the original point cloud file; Initializing a result mapping table according to the original point cloud file; Selecting a cutting instruction from the cutting instruction sequence as a target instruction; Calculate the value of the number of times the inner point of the spatial polygon is retained according to the retained inner and outer point flag of the target instruction; Generate a point cloud sequential index array according to the original point cloud file and the three-dimensional space polygon of the target instruction; Update the result mapping table according to the point cloud sequential index array; Generate a result point cloud index array according to the value of the number indicator of the retained spatial polygon interior point and the updated result mapping table; A three-dimensional point cloud clipping result is generated according to the original point cloud file and the result point cloud index array.

2. The method according to claim 1, characterized in that The step of constructing a clipping instruction sequence according to the original point cloud file includes: Drawing an initial three-dimensional space polygon according to the original point cloud file; Constructing a clipping instruction according to a clipping type attribute value and the initial three-dimensional space polygon, wherein the clipping type attribute value includes the retaining internal and external point flag; A plurality of the cropping instructions are combined to obtain the cropping instruction sequence.

3. The method according to claim 1, characterized in that The step of calculating the value of the number of times the inner point of the spatial polygon is retained according to the retained inner and outer point flag of the target instruction comprises: Initialize the indicator of the number of times points inside the spatial polygon are retained; If the reserved internal and external point flag is a reserved internal point, the value of the number of times the internal point of the reserved spatial polygon is indicated is incremented by 1.

4. The method according to claim 1, characterized in that: The step of generating a point cloud sequential index array according to the original point cloud file and the three-dimensional space polygon of the target instruction comprises: Construct an initial spatial polygon point cloud object; Adding multiple spatial points of the three-dimensional spatial polygon of the target instruction to the initial spatial polygon point cloud object to obtain a target spatial polygon point cloud object; Creating a normal estimation object and a normal object according to the target space polygonal point cloud object; Calculating a normal according to the normal estimation object and the normal object; Calculate the plane coefficient of the normal plane according to the normal line, wherein the plane coefficient of the normal plane includes the coefficients of the normal plane in the directions of three coordinate axes X, Y, and Z in the three-dimensional space; Performing projection processing according to the plane coefficient of the normal plane to obtain a projected original point cloud and a projected clipped polygon point cloud; The point cloud sequential index array is generated according to the projected original point cloud and the projected clipped polygon point cloud.

5. The method according to claim 4, characterized in that The projecting process is performed according to the plane coefficient of the normal plane to obtain the original point cloud after projection and the clipped polygon point cloud after projection, including: Creating an original point cloud object, wherein the original point cloud object is obtained by reading the original point cloud file; Constructing a model coefficient parameter object according to the plane coefficient of the normal plane; Performing a first projection filter according to the model coefficient parameter object, the original point cloud object and the projection to plane parameter, wherein the first projection filter is used to project the original point cloud object to the normal plane to obtain the projected original point cloud; A second projection filter is performed according to the model coefficient parameter object, the target space polygonal point cloud object and the projection to plane parameters. The second projection filter is used to project the target space polygonal point cloud object to the normal plane to obtain the projected clipped polygonal point cloud.

6. The method according to claim 4, characterized in that The step of generating the point cloud sequential index array according to the projected original point cloud and the projected clipped polygon point cloud comprises: Construct a convex hull filter object; Constructing a convex hull object according to the projected clipped polygon point cloud and convex hull parameters; According to the convex hull object, calculating the convex hull polygon coordinate vector and the spatial convex hull point cloud object; According to the convex hull filtering object, the convex hull polygon coordinate vector, the spatial convex hull point cloud object, the two-dimensional plane filtering mode and the projected original point cloud are used as filter parameters; According to the convex hull filtering object, convex hull filtering is performed to obtain the point cloud sequential index array, which is an array of serial numbers of points of the projected original point cloud in the two-dimensional plane where the convex hull object is located. The serial numbers in the point cloud sequential index array uniquely indicate the data index position of the corresponding point in the original point cloud file.

7. The method according to claim 1, characterized in that The updating of the result mapping table according to the point cloud sequential index array comprises: Select an index from the point cloud sequential index array as a target index; Extract the value corresponding to the target index from the result mapping table as the first flag bit; If the reserved internal and external point flag is a reserved internal point, the first flag is incremented by 1, and the result mapping table is updated; If the reserved internal and external point flag is a reserved external point, the first flag is decremented by 1 and the result mapping table is updated.

8. The method according to claim 1, characterized in that The step of generating a result point cloud index array according to the value of the number indicator of the reserved spatial polygon interior point and the updated result mapping table comprises: Initialize the result point cloud index array; Select a sequential index from the original point cloud file as a target point cloud point; Extracting the value corresponding to the target point cloud point from the updated result mapping table as the second flag bit; If the value of the indicator of the number of times the inner point of the reserved spatial polygon is 0, determining whether the second flag bit is equal to 0; If the second flag bit is 0, the index corresponding to the second flag bit is added to the result point cloud index array; If the value of the number indicator of the reserved space polygon interior point is greater than 0, determining whether the second flag bit is equal to the value of the number indicator of the reserved space polygon interior point; If the second flag bit is equal to the value of the number of times the point inside the retained spatial polygon is indicated, the index corresponding to the second flag bit is added to the result point cloud index array.

9. The method according to claim 1, characterized in that: The step of generating a three-dimensional point cloud clipping result according to the original point cloud file and the result point cloud index array includes: According to the original point cloud file and the result point cloud index array, the point cloud data at the corresponding index position is read and output to the target point cloud file in text form or binary form to obtain the three-dimensional point cloud clipping result.

10. A three-dimensional point cloud cutting device, characterized in that: include: The first module is used to read the original point cloud file; The second module is used to construct a cropping instruction sequence according to the original point cloud file; The third module is used to initialize the result mapping table according to the original point cloud file; A fourth module is used to select a cropping instruction from the cropping instruction sequence as a target instruction; A fifth module is used to calculate the value of the number of times the inner point of the spatial polygon is retained according to the retained inner and outer point flag of the target instruction; A sixth module is used to generate a point cloud sequential index array according to the original point cloud file and the three-dimensional space polygon of the target instruction; A seventh module is used to update the result mapping table according to the point cloud sequential index array; An eighth module is used to generate a result point cloud index array according to the value of the number indicator of the points in the retained spatial polygon and the updated result mapping table; The ninth module is used to generate a three-dimensional point cloud cropping result based on the original point cloud file and the result point cloud index array.