Page 16 - 中国仿真学会通讯2020第1期
P. 16

Figure 5: The Three New Main Directions.

             Figure 4: Modeling process

                                                             Figure 6: The Direction and the Angle of Rotation.

                  n→t = →nfb × →nx                           3.2  Facade Modeling Based on the
                                                                    Hierarchical Reconstruction
                 θ = arccos(→nfb ·→nx )           (1)
                                                             We reconstruct the building facade based on the
  Where →nt is the direction of rotation axis, is the        hierarchicalreconstruction method, which is
                                                             shown as the Algorithm 2.
rotation angle, n→x = (1,0,0)

6. Using Pfb⁃lr for linear fitting iteratively based on the

RANSAC algorithm until the remaining point cloud

do not satisfy the condition of straight line fitting,       Algorithm 2: Facade Modeling Based on the
                                                             HierarchicalReconstruction
leading to obtain a set of fitted lines L

7. Calculating the distance between any two lines and        Input: The facade point cloud of the building

the corresponding number of point, then we can

cluster and merge the lines to get the new set of            1. Traversing each of the front and back layer, rotating

fitted lines L′                                              Pfbi according to equation (2) to obtain a new point

8. Calculating the fitted plane equations of the front and   cloud P′fbi ,as shown in Figure 6

   back layers PLj ( j = 1,...... n) according to n→FB and   n→t = n→FB × n→z

L′, where n represents the number of the front and           θ = arccos( n→FB ·n→z )                          (2)

back layers. The result is shown in Figure 4( e)

9. Clustering planar patches                                 Where →nt is the direction of rotation axis, θ is the

for i = 1 to m                                               rotationangle, →nz = (0,0,1)

  Finding the front and back layer PLj closest to PPi        2. Creating a new black image. For each pixel point p

Letting c(i) = j                                             ( ui , vj ) if there are points in the circular

for i = 1 to m

Finding the planar patch PPj closest to PPi                  neighborhood with radius r centered on pi
                                                               Setting the pixel value of p ( ui ,vj ) = ( 255,255,
   if c(i) ! = c(j) and the centroid of planar patch PPj is
   higher than PPi , letting c(j) = c(i)                     255) ,which iswhite
10. for i = 1 to m
                                                             r                    =  1.5np                    (3)
if c(i) = 1                                                                          nx ny

Projecting PPi onto the corresponding front and              Where np represents the number of point clouds in

back layer, and the optimized layered point cloud            this layer, and nx ,ny represent the image size

Pfbi( j = 1,......n) ( Figure 4( g) ) can be obtained

                                                                                                              13
   11   12   13   14   15   16   17   18   19   20   21