Python language-based point cloud data cutting method

Through the point cloud data cutting method based on the Python language, automatic processing and independent data saving solve the problem of low cutting efficiency in the existing technology that relies on CAD plug-ins, and realize efficient point cloud data cutting and the function of independently selecting the cutting range.

CN118733533AActive Publication Date: 2024-10-01THREE GORGES NEW ENERGY OFFSHORE WIND POWER OPERATION & MAINTENANCE JIANGSU CO LTD

Patent Information

Application Number
CN202410811056.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-01
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

In the existing technology, point cloud data cutting needs to rely on CAD plug-ins, which is time-consuming, labor-intensive, inefficient, and cannot independently select the cutting range.

Method used

The point cloud data cutting method based on Python language is used to automatically cut point cloud data through data file preparation, filtering, cleaning and equal cutting processing, supporting independent selection of the cutting range and independent saving of data.

Benefits of technology

It greatly improves the cutting efficiency, realizes automated cutting, reduces manual intervention, is suitable for a variety of pile foundation construction types, and solves the inefficiency problem of relying on CAD plug-in cutting in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733533A_ABST
    Figure CN118733533A_ABST
Patent Text Reader

Abstract

The invention discloses a point cloud data cutting method based on a python language, and the method comprises the steps: S1, data file preparation: data preparation comprises pile foundation data file preparation and point cloud data file preparation; s2, performing data screening and cleaning; setting a data statistical range, and screening out data which do not accord with the statistical range; the statistical range is no negative value; s3, firstly reading the point cloud data information to be processed, and equally dividing the point cloud data information into specified parts num according to the size of the point cloud data information; carrying out cutting processing on each part of point cloud data information; the method solves the problems that point cloud data cutting in the prior art needs to depend on a CAD plug-in for cutting, time and labor are wasted, and efficiency is low; the method has the advantages that the pile foundation cutting range can be independently selected according to needs, the cut data are independently stored in respective pile foundation naming files, follow-up processing is facilitated, and the cutting efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of point cloud data processing, in particular to a point cloud data cutting method based on Python language. Background Art

[0002] According to relevant standards, offshore wind farm pile foundations must be regularly tested for underwater scour according to different marine environments. The current mainstream method is to use multi-beam equipment to detect pile foundation scour. After data collection is completed, the point cloud data needs to be cut, and point cloud data within a certain range of the pile foundation needs to be selected for analysis. The cutting method currently uses CAD internal plug-ins to manually cut one by one, which is time-consuming, labor-intensive and inefficient. Therefore, it is necessary to design a point cloud data cutting method based on the python language to solve the above problems. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a point cloud data cutting method based on Python language, aiming to solve the problem that the point cloud data cutting in the prior art needs to rely on CAD plug-ins for cutting, which is time-consuming, labor-intensive and inefficient; it has the characteristics of being able to independently select the required cutting pile foundation range according to needs, and independently save the cut data to files named after each pile foundation, which is convenient for subsequent processing and greatly improves the cutting efficiency.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: A point cloud data cutting method based on Python language, comprising: S1, data file preparation: Including pile foundation data file preparation and point cloud data file preparation; S2, data screening and cleaning; Set the data statistical range and filter out the data that does not meet the statistical range; the statistical range is to prevent negative values; S3, first read the point cloud data information to be processed, divide it into a specified number num according to the size of the point cloud data information; and cut each point cloud data information.

[0005] Preferably, in step S1, the pile foundation data file preparation includes: The file is converted to xlsx format, including the pile name and plane coordinates; The preparation of the point cloud data file to be cut includes: The file is converted into xyz format, which contains plane coordinates and elevation information; The above files are placed in the program folder according to the specified format.

[0006] Preferably, in step S3, the cutting process of each point cloud data information includes: S301, read the pile foundation coordinate information and obtain all rows of the information; S302, creating a loop statement 1, traversing the point cloud data to be processed row by row, and separating the plane coordinates 1 and the elevation information of the data by spaces; S303, embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; S304, obtaining the target pile foundation name and creating a character string based on it; S305, creating an if-1 statement in loop statement 2, comparing whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, executing the embedded if-2 statement; S306, in the if-2 statement, a distance formula is used to determine whether the distance between the plane coordinate 1 and the plane coordinate 2 is less than L. The distance formula is as follows: ; Where (x1, y1) and (x2, y2) are the coordinate positions of plane coordinate 1 and plane coordinate 2; If so, it is written in an appended manner into the xyz named file named with the pile foundation.

[0007] Preferably, a point cloud data cutting program based on Python language includes a data reading module for reading the pile foundation coordinate information and obtaining all rows of information; The point cloud data loop traversal execution module is used to create a loop statement 1, traverse the point cloud data to be processed row by row, and separate the plane coordinates 1 and elevation information of the data by spaces; The pile foundation information loop traversal execution module is used to embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain the pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; The string creation module is used to obtain the target pile name and create a string based on it; The judgment execution module is used to create an if-1 statement in loop statement 2, compare whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, execute the embedded if-2 statement; and use the distance formula in the if-2 statement to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than L.

[0008] Preferably, a computer device comprises a memory and a processor, the memory and the processor are communicatively connected to each other, a computer program is stored in the memory, and the processor executes the point cloud data cutting method based on Python language by executing the computer program.

[0009] Preferably, a computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the point cloud data cutting method based on Python language.

[0010] The beneficial effects of the present invention are as follows: The present invention provides a point cloud data cutting method based on Python language, which can be integrated into a computer program for automatic execution. The computer automatically cuts without manual cutting, which greatly improves the working efficiency; and the cutting range can be independently selected, which is suitable for various types of pile foundation construction operations; it solves the problem that the point cloud data cutting in the prior art needs to rely on CAD plug-ins for cutting, which is time-consuming, labor-intensive and inefficient; it has the characteristics of being able to independently select the required cutting pile foundation range according to needs, and independently save the cut data to files named after the respective pile foundations, which is convenient for subsequent processing and greatly improves the cutting efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 is a flow chart of the present invention; Figure 2 This is a flow chart of the present invention for cutting each point cloud data information; Figure 3 It is a schematic diagram of the program execution operation process of the present invention. DETAILED DESCRIPTION

[0012] Embodiment 1: like Figure 1 As shown, a point cloud data cutting method based on Python language includes: S1, data file preparation: Including pile foundation data file preparation and point cloud data file preparation; S2, data screening and cleaning; Set the data statistical range and filter out the data that does not meet the statistical range; the statistical range is to prevent negative values; S3, first read the point cloud data information to be processed, divide it into a specified number num according to the size of the point cloud data information; and cut each point cloud data information.

[0013] Preferably, in step S1, the pile foundation data file preparation includes: The file is converted to xlsx format, including the pile name and plane coordinates; The preparation of the point cloud data file to be cut includes: The file is converted into xyz format, which contains plane coordinates and elevation information; The above files are placed in the program folder according to the specified format.

[0014] like Figure 2 As shown, in step S3, the cutting process of each point cloud data information includes: S301, read the pile foundation coordinate information and obtain all rows of the information; S302, creating a loop statement 1, traversing the point cloud data to be processed row by row, and separating the plane coordinates 1 and the elevation information of the data by spaces; S303, embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; S304, obtaining the target pile foundation name and creating a character string based on it; S305, create an if-1 statement in loop statement 2, compare the absolute value of the difference between plane coordinate 1 and plane coordinate 2 to see if it is within the pile foundation range of 80m, and if so, execute the embedded if-2 statement; S306, in the if-2 statement, a distance formula is used to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than 80m. The distance formula is as follows: ; Where (x1, y1) and (x2, y2) are the coordinate positions of plane coordinate 1 and plane coordinate 2; If so, it is written in an appended manner into the xyz named file named with the pile foundation.

[0015] Embodiment 2: like Figure 3 As shown, the present invention also provides a point cloud data cutting program based on Python language, the program includes a data reading module, which is used to read the pile foundation coordinate information and obtain all rows of information; The point cloud data loop traversal execution module is used to create a loop statement 1, traverse the point cloud data to be processed row by row, and separate the plane coordinates 1 and elevation information of the data by spaces; The pile foundation information loop traversal execution module is used to embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain the pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; The string creation module is used to obtain the target pile name and create a string based on it; The judgment execution module is used to create an if-1 statement in loop statement 2 to compare whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range of 80m. If so, the embedded if-2 statement is executed; and the distance formula is used in the if-2 statement to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than 80m.

[0016] Furthermore, this program is based on Python language, configures Python3.8 environment, imports PyQt6, sys, pandas, and math libraries, and uses PyCharm editing software for design.

[0017] Furthermore, the pile foundation coordinate information is in xlsx format.

[0018] Furthermore, the temporary list is in list format.

[0019] Furthermore, the string is in str format.

[0020] Embodiment three: Preferably, a computer device comprises a memory and a processor, the memory and the processor are communicatively connected to each other, a computer program is stored in the memory, and the processor executes the point cloud data cutting method based on Python language by executing the computer program.

[0021] Preferably, a computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the point cloud data cutting method based on Python language.

[0022] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. A point cloud data cutting method based on Python language, characterized in that: include: S1, data file preparation: Including pile foundation data file preparation and point cloud data file preparation; S2, data screening and cleaning; Set the data statistical range and filter out the data that does not meet the statistical range; the statistical range is to prevent negative values; S3, first read the point cloud data information to be processed, divide it into a specified number num according to the size of the point cloud data information; and cut each point cloud data information.

2. According to a point cloud data cutting method based on Python language according to claim 1, it is characterized in that: In step S1, the pile foundation data file preparation includes: The file is converted to xlsx format, including the pile name and plane coordinates; The preparation of the point cloud data file to be cut includes: The file is converted into xyz format, which contains plane coordinates and elevation information; The above files are placed in the program folder according to the specified format.

3. The point cloud data cutting method based on Python language according to claim 1, characterized in that: In step S3, the cutting process of each point cloud data information includes: S301, read the pile foundation coordinate information and obtain all rows of the information; S302, creating a loop statement 1, traversing the point cloud data to be processed row by row, and separating the plane coordinates 1 and the elevation information of the data by spaces; S303, embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; S304, obtaining the target pile foundation name and creating a character string based on it; S305, creating an if-1 statement in loop statement 2, comparing whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, executing the embedded if-2 statement; S306, in the if-2 statement, a distance formula is used to determine whether the distance between the plane coordinate 1 and the plane coordinate 2 is less than L. The distance formula is as follows: ; Where (x1, y1) and (x2, y2) are the coordinate positions of plane coordinate 1 and plane coordinate 2; If so, it is written in an appended manner into the xyz named file named with the pile foundation.

4. A point cloud data cutting program based on Python language, characterized in that: The program includes a data reading module, which is used to read the pile foundation coordinate information and obtain all rows of information; The point cloud data loop traversal execution module is used to create a loop statement 1, traverse the point cloud data to be processed row by row, and separate the plane coordinates 1 and elevation information of the data by spaces; The pile foundation information loop traversal execution module is used to embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain the pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; The string creation module is used to obtain the target pile name and create a string based on it; The judgment execution module is used to create an if-1 statement in loop statement 2, compare whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, execute the embedded if-2 statement; and use the distance formula in the if-2 statement to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than L.

5. A computer device, characterized in that: It includes a memory and a processor, the memory and the processor are connected to each other for communication, a computer program is stored in the memory, and the processor executes the point cloud data cutting method based on Python language as described in claim 3 by executing the computer program.

6. A computer-readable storage medium, characterized in that: A computer program is stored on the computer-readable storage medium, and the computer program is used to enable a computer to execute the point cloud data cutting method based on Python language described in claim 3.

Citation Information

Patent Citations

  • Indexing method and device for large-scale point cloud data, terminal equipment and medium

    CN110457499A

  • Model manufacturing method, device and equipment based on transformer substation and storage medium

    CN117152399A

  • Front-end point cloud data visual playback method and device

    CN117934680A

  • Multi-target detection and tracking method, system, storage medium and application

    US20220309835A1

Cited By

  • Python language-based calculation method for distance between maximum scouring pit and center position of pile foundation

    CN120849743A

  • A method for calculating the distance from the center of a pile foundation to the maximum scour pit based on Python language

    CN120849743B