modified PTAM and SfM implementation