Photometric Bundle Adjustment