Skip to main content
. 2023 Feb 7;23(4):1876. doi: 10.3390/s23041876
Algorithm1. Local Map Extraction.
  • Input: 

    j is the index of the current frame. TwFj is the pose of the current frame. poseDatabase is the pose database that stores the poses of each frame and their surfels. far_dist is the maximum mapping distance.

  • Output: 

    localIndexes is a vector of the local frame indexes. localSurfels is a vector of the local surfels.

  • 1:

    localIndexes.CLEAR()

  • 2:

    localSurfels.CLEAR()

  • 3:

    for each FiposeDatabasedo

  • 4:

        flagfalse

  • 5:

        TFjFi← transform(TwFiTwFj)

  • 6:

        u,v← project(TFjFi)

  • 7:

        if isValidRange(u,v) && TFjFizk·far_dist then

  • 8:

            flagtrue

  • 9:

        end if

  • 10:

        TFiFj← transform(TwFjTwFi)

  • 11:

        u,v← project(TFiFj)

  • 12:

        if isValidRange(u,v) && TFiFjzk·far_dist then

  • 13:

            flagtrue

  • 14:

        end if

  • 15:

        if distance(TwFiTwFj) ≤k·far_dist && angle(TwFiTwFj) ≤θth then

  • 16:

            flagtrue

  • 17:

        end if

  • 18:

        if flag then

  • 19:

            for tn,n+1...n1,n do

  • 20:

               localIndexes.PUSH(i+t)

  • 21:

            end for

  • 22:

        end if

  • 23:

    end for

  • 24:

    for each ilocalIndexesdo

  • 25:

        localSurfel.INSERT(poseDatabase[i].surfels)

  • 26:

    end for