Your next step is to create the final occupancy grid from the pose graph output from SLAM. You need to combine the warped camera images in a principled way to create an occupancy grid.
1. After completing SLAM, you should have a set of poses and respective images. Transfer the images to the correct location using their corresponding pose. Check the helping code in the repo: https://github.com/fdayoub/RVSS2018WS/blob/master/correct_motion_in_image_space.py
2. Consider what size occupancy grid you would like to create, and the size of each grid cell. Initialise an empty occupancy grid, for example an empty numpy array:
occupancy_grid = np.zeros((50,50), float)3. Discretise each image from each step in the robot trajectory into the same number of cells as the map (maybe 30 by 30 pixels as a cell), and average the number of black, "occupied" pixels in each cell. Use this average to determine whether this particular cell will be considered occupied or not, for example, you may choose to consider a cell occupied if it has more than 50% of it's pixels occupied.
4. With each consecutive image, update the occupancy grid cells based on your local occupancy measurements. For this step, you want to add to or subtract from the global occupancy grid values based on whether the cell in the current view is found to be occupied or empty, respectively. For example, you may choose to add 1 to the grid for each new occupied cell, and subtract 1 for empty cells.
5. Finally, once all the images have been combined in this way, you will need to normalise the grid to produce a final occupancy grid of 1s and 0s, indicating empty and occupied cells.