| | Input: cross-sectional pier column with two-side point clouds list Datan×3; |
| | Output: The improved RANSAC algorithm’s Distance threshold , the axis of the pier column . |
| | Dataz = Datan × 3 (:, 3); |
| | dz = 1000; //Cut the interval of Data along the Z-axis in a plane parallel. |
| | kz;//Quotient of total length of Dataz and dz. |
| | dx = 1; //millimeter. |
| | kx;//Number of millimeters along the X-axis of each cross section. |
| | for i = 1to kz do |
| | Datai; //Obtain the Point clouds of each segment of point clouds after cutting. |
| | , ;// is the total number of points on the X-axis a of the cross section. a is the width of the cross section. |
| | ; //The average density is calculated ρ Along the X axis. |
| | ; //Definition the density threshold. |
| | for j = 1to kx do |
| | ; //Calculated the number of point clouds per millimeter along X-axis. |
| | end for |
| | Tx; //Find the number greater than in , and then the product of dx. |
| | Ty; //It is the same as the solution process Tx. |
| | l1 = RANSAC (Data, Tx); //Using RANSAC algorithm to fit straight line. |
| | Data0; //Delete the point cloud in Data used in l1 |
| | l2 = RANSAC (Data0, Ty); //Using RANSAC algorithm to fit remaining straight line. |
| | l3 = l1 + (0, 0, a); //the translation strategy is used to supplement the unknown line segment. |
| | l4 = l2 + (0, 0, b); //like l3. |
| | [Pt1, Pt2, Pt3, Pt4]; //calculate the intersection of l1, l2, l3, l4. |
| | Pc; //calculate the centroid of the intersection. |
| | end for |
| | ; //calculate the axis of the pier column. |