Structure From Motion for RGB-D videos using Generalized Bundle Adjustment