Research Article

Research on the Application of Visual SLAM in Embedded GPU

Algorithm 3

Local point selection algorithm.
Input: Feature point information in point cloud maps inInf[0…pointNum]
Output: Selected feature point information outInf[0…pointNum], Number of feature points selected nSelection
1 cudaMemCopyHostToDevice(d_inInf[0…pointNum], inInf[0…pointNum]);
2 for i 0 to pointNum
3  if(gpuIsSelection(d_inInf[i]))
4   d_outInf[i].flag=0;
5   d_outInf[i] gpuSaveSelectedPointsInformation();
6  end
7 end
8 cudaMemCopyDeviceToHost(outInf[0…pointNum], d_outInf[0…pointNum]);
9 nSelection=0;
10 for i 0 to pointNum
11  if(outInf[i].flag==0)
12   nSelection++;
13  end
14 end
Note: The beginning of d refers to the data allocated in the video memory, pointNum is the number of feature points in the point cloud map