A method for fast reading and writing point cloud text format

By constructing a table lookup method and using the table lookup method to process floating point coordinates, the problem of slow reading and writing speed of point cloud text formats is solved, and efficient massive point cloud data processing is achieved.

CN114296801BActive Publication Date: 2024-11-26CHONGQING INST OF SURVEYING & MAPPING SCI & TECH (CHONGQING MAP COMPILATION CENT)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111560450.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2024-11-26
Estimated Expiration
2041-12-20

Smart Images

  • Figure CN114296801B_ABST
    Figure CN114296801B_ABST
Patent Text Reader

Abstract

The present invention provides a method for fast reading and writing point cloud text format. The point cloud text format reading method uses a pre-built reading comparison table, scans each floating point string in the text file, and accumulates the integer part and the decimal part of the floating point number one by one for reading; the method for writing point cloud into a text file uses a pre-built writing comparison table, and directly converts any 4-digit number into a string for writing; the present invention adopts a table lookup method, and the present invention can solve the technical problems of slow reading and writing speed and low efficiency for massive point cloud text format data in the prior art; it avoids a large number of library function surveys, and can realize fast conversion between massive point clouds and text formats. Under the same computer hardware environment, it is about 10 times faster than using system functions for conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of laser point cloud data processing, and in particular to a method for quickly reading and writing point cloud text format. Background Art

[0002] With the continuous development of large-scale 3D data acquisition technology, 3D laser scanning equipment has been widely used. It can collect complete point cloud coordinates of the target scene, automatically scan in 3D space with high precision, truly describe the overall structure and morphological characteristics of the target scene, and quickly obtain point cloud data of the target scene. Point cloud data is a data form that uses massive discrete point coordinates to express the geometric characteristics of spatial objects, and is characterized by huge data volume.

[0003] At present, various point cloud data processing tools and software usually use point cloud text format for data exchange. Point cloud text formats mainly include xyz files, pts files, ptx files, etc. These text formats contain the coordinates of each point (x, y, z coordinates). However, due to the inefficiency of reading floating-point library functions in text format, the speed is slow and the efficiency is low when reading or writing massive point cloud data. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention proposes a method for quickly reading and writing point cloud text format to solve the technical problems of slow reading and writing speed and low efficiency for massive point cloud text format data in the prior art.

[0005] The technical solution adopted in the present invention is as follows

[0006] In a first aspect, a method for reading a point cloud text format is provided, comprising the following steps:

[0007] S1-1, construct a reading comparison table;

[0008] S1-2, mapping the point cloud text format to the memory to obtain a floating point string, as well as the first address of the point cloud text format in the memory and the number of bytes occupied;

[0009] S1-3, set the character pointer to point to the first address, determine the tail address of the point cloud text format in the memory according to the first address of the point cloud text format and the number of bytes occupied, and set the initial value of the floating point coordinate number;

[0010] S1-4, establish an empty set of floating point coordinates;

[0011] S1-5, scanning the floating point number string, distinguishing the positive and negative signs, the integer part and the decimal part of the floating point number string;

[0012] S1-6, according to the positive and negative identification, integer part and decimal part of the floating point number string, combined with reading the comparison table, look up and add the results to obtain the floating point number coordinate calculation value;

[0013] S1-7, put the floating point coordinate calculation value into an empty set, and point the character pointer to the next floating point string;

[0014] S1-8, repeat steps S1-5, S1-6, and S1-7 until the character pointer points to the tail address, and obtain a floating-point coordinate calculation value set;

[0015] S1-9. Obtain a point cloud set based on a set of floating-point coordinate calculation values.

[0016] It can be seen from the above technical scheme that the beneficial technical effects of the present invention are as follows: the text reading of point cloud coordinate floating-point numbers is quickly processed by using a table lookup to obtain corresponding values. In the process of scanning the point cloud text file byte by byte, the integer part and the decimal part of the floating-point number are accumulated, and the value of the floating-point number is quickly calculated to complete the reading of the point cloud text format; the whole process mainly performs addition operations and there are no function calls, which can reduce the memory resources required for runtime and greatly improve the reading efficiency of massive point cloud data.

[0017] Furthermore, the read comparison table is 10 rows and 12 columns, and each element in the table is denoted by M r,c , M r,c =(r-1)×10 c-1 , where r represents the row and c represents the column.

[0018] Furthermore, the integer part is added by looking up the table, as follows:

[0019]

[0020] The decimal part is added by looking up the table, as follows:

[0021]

[0022] The floating point coordinate calculation values ​​are as follows:

[0023] T=sign×(T1+T2 / 10 12 )

[0024] in, To read an element in the lookup table, n represents the number of digits in the integer part, m represents the number of digits in the decimal part, and sign represents the positive or negative sign.

[0025] In a second aspect, a method for writing a point cloud text format is provided, comprising the following steps:

[0026] S2-1, construct a write comparison table;

[0027] S2-2, set the initial value of the number of point clouds to be written and open the text file;

[0028] S2-3, read a floating point cloud from the point cloud set, and convert any one of the three coordinates of the floating point cloud into an integer coordinate;

[0029] S2-4, identify the positive and negative signs of the integer coordinates, and take the absolute value of the integer coordinates;

[0030] S2-5, performing a piecewise integer division operation on the absolute value of the integer coordinate to obtain quotients after multiple piecewise integer division operations;

[0031] S2-6, writing the quotients after the multiple segmented integer division operations into a comparison table for table lookup, and writing the character string into a text file according to the positive and negative marks of the integer point cloud;

[0032] S2-7, convert the other two coordinates of the three coordinates of the floating point cloud into integer coordinates respectively, and repeat steps S2-4, S2-5, and S2-6;

[0033] S2-8. Write a line break character to the text file and repeat steps S2-3 to S2-7.

[0034] It can be seen from the above technical scheme that the beneficial technical effects of the present invention are as follows: a floating-point number of a point cloud coordinate can be converted into an integer, and decomposed into four 4-digit numbers according to 4-digit numbers, and the last 4-digit number is the decimal part; then, any 4-digit number can be quickly converted into a string through a table lookup method and written into a text file; the whole process mainly performs division operations and there is no function call, which can reduce the memory resources required during operation and greatly improve the writing efficiency of massive point cloud data.

[0035] Furthermore, the write comparison table includes a character string padded with 0 and a character string not padded with 0.

[0036] Furthermore, step S2-5 specifically includes:

[0037] Suppose the first segment d0 corresponds to the 16th to 13th digits of the integer coordinates, the second segment d1 corresponds to the 12th to 9th digits of the integer coordinates, the third segment d2 corresponds to the 8th to 5th digits of the integer coordinates, and the fourth segment d3 corresponds to the 4th to 1st digits of the integer coordinates;

[0038] Divide the absolute value of each segment by d and 10 12 Perform integer division to obtain the first quotient and the first remainder of the first segment d0, and add the first remainder to 10 8 Perform integer division to obtain the second quotient and second remainder of the second segment d1, and add the second remainder to 10. 4Perform integer division to obtain the third quotient and third remainder of the third segment d2, and add the third remainder to 10. 4 An integer division operation is performed to obtain a fourth quotient and a fourth remainder of the third segment d3.

[0039] Furthermore, step S2-6 specifically includes:

[0040] First, if the sign of the integer coordinate is negative, a negative sign string is written to the text file;

[0041] Then, if d0≠0, according to the digits of the quotients of d0, d1, d2, and d3 after being divided by integers, the corresponding character string is searched in the write comparison table, and then the character strings corresponding to the first quotient, the second quotient, and the third quotient are written into the text file in turn, and then the decimal point character string is written into the text file, and finally the character string corresponding to the fourth quotient is written into the text file; when d0=0, write the character string of 0 into the file;

[0042] If d1≠0, write the character strings corresponding to the second and third quotients into the text file in turn, then write the decimal point character string into the text file, and finally write the character string corresponding to the fourth quotient into the text file; when d1=0, write the character string of 0 into the file;

[0043] If d2≠0, write the string corresponding to the third quotient into the text file, then write the decimal point string into the text file, and finally write the string corresponding to the fourth quotient into the text file; when d2=0, write the string of 0 into the file;

[0044] If d3≠0, write the decimal point string into the text file, and then write the string corresponding to the fourth quotient into the text file; when d3=0, write the 0 string into the file.

[0045] In a third aspect, an electronic device is provided, including:

[0046] one or more processors;

[0047] A storage device for storing one or more programs;

[0048] When one or more programs are executed by one or more processors, the one or more processors implement the point cloud text format reading method provided in the first aspect.

[0049] In a fourth aspect, an electronic device is provided, including:

[0050] one or more processors;

[0051] A storage device for storing one or more programs;

[0052] When one or more programs are executed by one or more processors, the one or more processors implement the point cloud text format writing method provided in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the prior art description. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0054] Figure 1 The figure is a schematic diagram of a method flow of an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following embodiments of the technical solution of the present invention are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and are therefore only used as examples, and cannot be used to limit the protection scope of the present invention.

[0056] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the invention belongs.

[0057] Example 1

[0058] This embodiment relates to how to quickly read massive point cloud data in text format, and provides a method for reading point cloud text format, which is as follows:

[0059] When reading point cloud text format, the input format is a coordinate string expressed as a character string, each line is a coordinate, and each coordinate component is separated by a separator, such as "123.1,23.4,12.5". The output format is a floating point coordinate, using P n (x, y, z) represents, where n is the coordinate number, and x, y, and z are the coordinate values ​​in three directions in the three-dimensional space coordinate system.

[0060] The point cloud text format reading method includes the following steps:

[0061] S1-1. Constructing a reading comparison table

[0062] In a specific implementation, combined with the current point cloud data, the read comparison table is defined as 10 rows and 12 columns, and the read comparison table is denoted as M. 10×12 , each element in the table is denoted by M r,c , M r,c =(r-1)×10 c-1 , where r represents the row and c represents the column. The reading comparison table is shown in Table 1 below:

[0063] Table 1 Reading comparison table

[0064]

[0065]

[0066] S1-2. Map the point cloud text format to the memory to obtain a floating point string, as well as the first address of the point cloud text format in the memory and the number of bytes occupied

[0067] In a specific implementation, the existing memory mapping technology is used to map the point cloud text format to the computer's memory, and the first address of the point cloud text format in the memory obtained after mapping is recorded as pSrc, and the number of bytes occupied by the point cloud text format in the memory is N. The mapped point cloud text format is temporarily stored in the memory in the form of a floating point string.

[0068] S1-3. Set the character pointer to point to the first address, determine the tail address of the point cloud text format in the memory according to the first address of the point cloud text format and the number of bytes occupied, and set the initial value of the floating point coordinate number.

[0069] In a specific implementation:

[0070] Define the character pointer as c and set c=pSrc.

[0071] The tail address of the point cloud text format in the memory is determined according to the first address of the point cloud text format and the number of bytes occupied. The tail address is recorded as pLast, and pLast = pSrc + N.

[0072] Set the initial value of the floating point coordinate quantity m, let m=1.

[0073] S1-4. Create an empty set of floating point coordinates

[0074] An empty set F of floating-point coordinates is established so that the floating-point coordinates obtained by subsequent calculations can be stored in the empty set.

[0075] S1-5. Scan the floating point string and distinguish the positive and negative signs, integer part and decimal part of the floating point string

[0076] In a specific implementation, an example is given for scanning a floating point number string:

[0077] Suppose a floating point string is S, S = 'sdndn-1...d1.x1x2...xm'; wherein the positive and negative flag 's' is empty or a positive and negative sign, 'd1d2...dn' is the integer part, 'x1x2...xm' is the decimal part, and the integer part and the decimal part are separated by a decimal point.

[0078] S1-6. According to the positive / negative identifier, integer part, and decimal part of the floating-point string, look up the table and perform addition calculation in combination with the read look-up table to obtain the calculated value of the floating-point coordinate.

[0079] In a specific implementation, calculating the floating-point coordinate includes:

[0080] When the positive / negative identifier's' is empty or a plus sign, let sign = 1; when the positive / negative identifier's' is a minus sign, let sign = -1.

[0081] In combination with the values of each element M in the read look-up table, look up the table and add the integer part and decimal part of the floating-point string. Among them:

[0082] The integer part T1 is:

[0083]

[0084] The decimal part T2 is:

[0085]

[0086] The calculated value T of the floating-point coordinate is:

[0087] T = sign × (T1 + T2 / 10 12 )

[0088] Among them, is a certain element in the read look-up table, n represents the number of digits of the integer part, m represents the number of digits of the decimal part, and sign represents the positive / negative sign.

[0089] In this step, the parsing of the floating-point string is converted into a method of looking up the table digit by digit and adding. When calculating the decimal part, it is necessary to divide by 10. 12 .

[0090] S1-7. Put the calculated value of the floating-point coordinate into an empty set, and point the character pointer to the next floating-point string.

[0091] In a specific implementation, when putting the floating-point coordinate T into the empty set F, append it to the end of the empty set F; then point the character pointer c to the next floating-point string after the floating-point coordinate S.

[0092] S1-8. Repeat steps S1-5, S1-6, and S1-7 until the character pointer points to the tail address to obtain the set of calculated values of the floating-point coordinates.

[0093] When the character pointer does not point to the tail address, in a specific implementation, when c < pLast, that is, when the character pointer does not point to the tail address, it indicates that the point cloud text format has not been completely read at this time, and steps S1-5, S1-6, and S1-7 need to be repeated at this time.

[0094] For the floating point coordinate calculation value set, since the floating point coordinate contains three directions of x, y, and z, the obtained floating point coordinate calculation value T set F is also divided into three, including F1, F2, and F3, corresponding to the three directions of x, y, and z respectively. n =(F1, F2, F3), n is the coordinate number.

[0095] S1-9. Obtain a point cloud set based on a set of floating point coordinate calculation values

[0096] In a specific implementation, the set {P1, P2, P3 . . . P n-1} is the point cloud set after the text format is converted, thus completing the reading of the point cloud text format.

[0097] By adopting the technical solution of this embodiment, the text reading of the floating-point numbers of the point cloud coordinates is quickly processed by using a table lookup to obtain the corresponding values. In the process of scanning the point cloud text file byte by byte, the integer part and the decimal part of the floating-point number are accumulated, and the value of the floating-point number is quickly calculated to complete the reading of the point cloud text format. The whole process mainly performs addition operations and there are no function calls, which can reduce the memory resources required during operation and greatly improve the reading efficiency of massive point cloud data.

[0098] Example 2

[0099] This embodiment relates to how to quickly write massive point cloud data in text format, and provides a method for writing point cloud text format, which is as follows:

[0100] When writing point cloud text format, the input form is point cloud set Cloud = {P1, P2, ... P n}, where P i ={x, y, z}, x, y, z are the coordinate values ​​in three directions in the three-dimensional space coordinate system, and n represents the total number of point clouds in the point cloud set. After conversion, the point cloud file in text format is output, each line represents a point, and the coordinates of each point are represented by a string separated by a separator.

[0101] The method of writing point cloud text format includes the following steps:

[0102] S2-1. Build a write comparison table

[0103] Construct a write comparison table to convert all integers with 4 digits or less into strings; in a specific implementation, the write comparison table includes the conversion of 0-9999, represented by a D array with a length of 10000, where D is D is a string representation of an integer with 0 in front of it. if It is a string representation of an integer. The write comparison table is shown in Table 2 below:

[0104] Table 2 Write comparison table

[0105]

[0106] S2-2. Set the initial value of the number of point clouds to be written and open the text file

[0107] In a specific implementation manner, an initial value i=0 for the number of point clouds to be written is set, and a text file in TXT format is opened.

[0108] S2-3. Read a floating point cloud from the point cloud set and convert any one of the three coordinates of the floating point cloud into an integer coordinate.

[0109] In a specific implementation, a point cloud is obtained from the point cloud set Cloud, and the point cloud is assumed to be the i-th point cloud in the point cloud set. The point cloud is recorded as Pi, where Pi is a floating point number including a 12-bit integer part and a 4-bit decimal part.

[0110] Each point cloud contains three coordinates, x, y, and z. The floating point numbers of these three coordinates need to be converted into integers, and the positive and negative signs of these three coordinates need to be obtained. In a specific implementation, because the decimal part is 4 digits, the floating point number Pix of a certain direction coordinate of the point cloud (such as the x coordinate) is multiplied by 10000 and then rounded down. The entire Pix can be converted into an integer and the decimal point removed for easy calculation.

[0111] S2-4. Identify the positive and negative signs of the integer coordinates and take the absolute value of the integer coordinates

[0112] The coordinate value converted to integer coordinates is compared with 0, and a value greater than 0 is positive, and a value less than 0 is negative; at the same time, the absolute value of the converted integer coordinates is taken, that is, d=|x|, where x represents the conversion to integer coordinates, and d represents the number obtained after taking the absolute value of the integer coordinates.

[0113] S2-5, perform piecewise integer division operation on the absolute value of the integer coordinate, and obtain the quotient after multiple piecewise integer division operations

[0114] In a specific implementation, since the current point cloud coordinates are all 12-bit integers and 4 decimal places, each character string in Table 2 corresponds to 4 digits. It is assumed that the first segment d0 corresponds to the 16th to 13th digits of the integer coordinates (i.e., the 12th to 9th digits of the floating-point point cloud), the second segment d1 corresponds to the 12th to 9th digits of the integer coordinates (i.e., the 8th to 5th digits of the floating-point point cloud), the third segment d2 corresponds to the 8th to 5th digits of the integer coordinates (i.e., the 4th to 1st digits of the floating-point point cloud), and the fourth segment d3 corresponds to the 4th to 1st digits of the integer coordinates (i.e., the 4 decimal places of the floating-point point cloud).

[0115] Divide the absolute value of each segment by d and 10 12 Perform integer division to obtain the first quotient and the first remainder of the first segment d0, and add the first remainder to 10 8 Perform integer division to obtain the second quotient and second remainder of the second segment d1, and add the second remainder to 10. 4 Perform integer division to obtain the third quotient and third remainder of the third segment d2, and add the third remainder to 10. 4 An integer division operation is performed to obtain a fourth quotient and a fourth remainder of the third segment d3.

[0116] S2-6. Combine the quotients after multiple segmented integer division operations and write them into a comparison table for table lookup, and write the string into a text file according to the positive and negative identification of the integer point cloud.

[0117] In a specific implementation, first, if the sign of the integer coordinate is negative, a '-' negative sign string is written into the text file;

[0118] Then, if d0≠0, look up the corresponding character string in the write comparison table according to the quotients of d0, d1, d2, and d3 after being divided by integers, and then write the character strings corresponding to the first quotient, the second quotient, and the third quotient into the text file in turn, then write the '.' decimal point character string into the text file, and finally write the character string corresponding to the fourth quotient into the text file; when d0=0, write the '0' character string to the file.

[0119] If d1≠0, write the character strings corresponding to the second and third quotients into the text file in turn, then write the '.' decimal point character string into the text file, and finally write the character string corresponding to the fourth quotient into the text file; when d1=0, write the '0' character string into the file.

[0120] If d2≠0, write the string corresponding to the third quotient into the text file, then write the '.' decimal point string into the text file, and finally write the string corresponding to the fourth quotient into the text file; when d2=0, write the '0' string into the file.

[0121] If d3≠0, write the decimal point string '.' into the text file, and then write the string corresponding to the fourth quotient into the text file; when d3=0, write the string '0' into the file.

[0122] S2-7, convert the other two coordinates of the three coordinates of the floating point cloud into integer coordinates respectively, and repeat steps S2-4, S2-5, and S2-6

[0123] In a specific implementation, since each point cloud contains three coordinates of x, y, and z, the other two coordinates of the three coordinates of the floating point cloud need to be written into a text format file according to methods S2-4, S2-5, and S2-6.

[0124] S2-8, write the line break character to the text file, and repeat steps S2-3 to S2-7

[0125] Write the line break to the text file, repeat steps S2-3 to S2-7, and for the point cloud set Cloud = {P1, P2, ... P n} are read separately and written into the text file as strings until all n point clouds are written.

[0126] Through the technical solution of this embodiment, a floating-point number of a point cloud coordinate can be converted into an integer, and decomposed into four 4-digit numbers according to 4 digits, and the last 4-digit number is the decimal part; then, any 4-digit number can be quickly converted into a string through a table lookup method and written into a text file; the whole process mainly performs division operations and there are no function calls, which can reduce the memory resources required during runtime and greatly improve the writing efficiency of massive point cloud data.

[0127] The present invention adopts a table lookup method, avoiding a large amount of library function research, and can realize rapid conversion between massive point clouds and text formats. Under the same computer hardware environment, it is about 10 times faster than using system functions for conversion.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

Claims

1. A method for reading point cloud text format, characterized in that: The following steps are involved: S1-1, construct a reading comparison table; S1-2, mapping the point cloud text format to the memory to obtain a floating point string, as well as the first address of the point cloud text format in the memory and the number of bytes occupied; S1-3, set the character pointer to point to the first address, determine the tail address of the point cloud text format in the memory according to the first address of the point cloud text format and the number of bytes occupied, and set the initial value of the floating point coordinate number; S1-4, establish an empty set of floating point coordinates; S1-5, scanning the floating point number string, distinguishing the positive and negative signs, the integer part and the decimal part of the floating point number string; S1-6, according to the positive and negative identification, integer part and decimal part of the floating point number string, combined with reading the comparison table, look up and add the results to obtain the floating point number coordinate calculation value; S1-7, put the floating point coordinate calculation value into an empty set, and point the character pointer to the next floating point string; S1-8, repeat steps S1-5, S1-6, and S1-7 until the character pointer points to the tail address, and obtain a floating-point coordinate calculation value set; S1-9. Obtain a point cloud set based on a set of floating-point coordinate calculation values.

2. The point cloud text format reading method according to claim 1, characterized in that: The reading comparison table has 10 rows and 12 columns, and each element in the table is denoted by M r,c , M r,c =(r-1)×10 c-1 , where r represents the row and c represents the column.

3. The point cloud text format reading method according to claim 2, characterized in that: In step S1-6, the integer part is added by looking up a table, as follows: The decimal part is added by looking up the table, as follows: The floating point coordinate calculation values ​​are as follows: T=sign×(T1+T2 / 10 12 ) in, To read an element in the lookup table, n represents the number of digits in the integer part, m represents the number of digits in the decimal part, and sign represents the positive or negative sign.

4. A method for writing point cloud text format, characterized in that: The following steps are involved: S2-1, construct a write comparison table; S2-2, set the initial value of the number of point clouds to be written and open the text file; S2-3, read a floating point cloud from the point cloud set, and convert any one of the three coordinates of the floating point cloud into an integer coordinate; S2-4, identify the positive and negative signs of the integer coordinates, and take the absolute value of the integer coordinates; S2-5, performing a piecewise integer division operation on the absolute value of the integer coordinate to obtain quotients after multiple piecewise integer division operations; S2-6, writing the quotients after the multiple segmented integer division operations into a comparison table for table lookup, and writing the character string into a text file according to the positive and negative marks of the integer point cloud; S2-7, convert the other two coordinates of the three coordinates of the floating point cloud into integer coordinates respectively, and repeat steps S2-4, S2-5, and S2-6; S2-8. Write a line break character to the text file and repeat steps S2-3 to S2-7.

5. The method for writing point cloud text format according to claim 4, characterized in that: The write comparison table includes a character string padded with 0 and a character string not padded with 0.

6. The method for writing point cloud text format according to claim 4, characterized in that: Step S2-5 specifically includes: Suppose the first segment d0 corresponds to the 16th to 13th digits of the integer coordinates, the second segment d1 corresponds to the 12th to 9th digits of the integer coordinates, the third segment d2 corresponds to the 8th to 5th digits of the integer coordinates, and the fourth segment d3 corresponds to the 4th to 1st digits of the integer coordinates; Divide the absolute value of each segment by d and 10 12 Perform integer division to obtain the first quotient and the first remainder of the first segment d0, and add the first remainder to 10 8 Perform integer division to obtain the second quotient and second remainder of the second segment d1, and add the second remainder to 10. 4 Perform integer division to obtain the third quotient and third remainder of the third segment d2, and add the third remainder to 10. 4 An integer division operation is performed to obtain a fourth quotient and a fourth remainder of the third segment d3.

7. The method for writing point cloud text format according to claim 6, characterized in that: Step S2-6 specifically includes: First, if the sign of the integer coordinate is negative, a negative sign string is written to the text file; Then, if d0≠0, according to the digits of the quotients of d0, d1, d2, and d3 after being divided by integers, the corresponding character string is searched in the write comparison table, and then the character strings corresponding to the first quotient, the second quotient, and the third quotient are written into the text file in turn, and then the decimal point character string is written into the text file, and finally the character string corresponding to the fourth quotient is written into the text file; when d0=0, write the character string of 0 into the file; If d1≠0, write the character strings corresponding to the second and third quotients into the text file in turn, then write the decimal point character string into the text file, and finally write the character string corresponding to the fourth quotient into the text file; when d1=0, write the character string of 0 into the file; If d2≠0, write the string corresponding to the third quotient into the text file, then write the decimal point string into the text file, and finally write the string corresponding to the fourth quotient into the text file; when d2=0, write the string of 0 into the file; If d3≠0, write the decimal point string into the text file, and then write the string corresponding to the fourth quotient into the text file; when d3=0, write the 0 string into the file.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the point cloud text format reading method described in any one of claims 1-3.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the point cloud text format writing method described in any one of claims 4-7.