Imported from https://github.com/ZJUCVG/ENFT-SfM