def __runWithSingleOutlier(self, obj: Point3dInitializer) -> bool: """Run the initialization for a track with all inlier measurements except one, and checks for correctness of the estimated point.""" sfm_track = obj.triangulate(SfmTrack2d(get_track_with_one_outlier())) point3d = sfm_track.point3() return np.array_equal(point3d, LANDMARK_POINT)
def __runWithTwoMeasurements(self, obj: Point3dInitializer) -> bool: """Run the initialization with a track with all correct measurements, and checks for correctness of the recovered 3D point.""" sfm_track = obj.triangulate(SfmTrack2d(MEASUREMENTS[:2])) point3d = sfm_track.point3() return np.allclose(point3d, LANDMARK_POINT)
def __runWithDuplicateMeasurements(self, obj: Point3dInitializer) -> bool: """Run the initialization for a track with all inlier measurements except one, and checks for correctness of the estimated point.""" sfm_track = obj.triangulate( SfmTrack2d(get_track_with_duplicate_measurements())) point3d = sfm_track.point3() return np.allclose(point3d, LANDMARK_POINT, atol=1, rtol=1e-1)
def __runWithOneMeasurement(self, obj: Point3dInitializer) -> bool: """Run the initialization with a track with all correct measurements, and checks for a None track as a result.""" sfm_track = obj.triangulate(SfmTrack2d(MEASUREMENTS[:1])) return sfm_track is None