示例#1
0
    def setUp(self):
        super().setUp()

        np.random.seed(RANDOM_SEED)
        random.seed(RANDOM_SEED)
        self.verifier = Ransac(use_intrinsics_in_verification=True,
                               estimation_threshold_px=0.5)

        self.euler_angle_err_tol = 1.0
        self.translation_err_tol = 0.01
示例#2
0
class TestRansacVerifierArgoverse(unittest.TestCase):
    def setUp(self):
        super().setUp()

        np.random.seed(RANDOM_SEED)
        random.seed(RANDOM_SEED)
        self.verifier = Ransac(use_intrinsics_in_verification=True,
                               estimation_threshold_px=0.5)

        self.euler_angle_err_tol = 1.0
        self.translation_err_tol = 0.01

    def testRecoveredPoseError(self):
        check_verifier_output_error(self.verifier, self.euler_angle_err_tol,
                                    self.translation_err_tol)

    def test_5pt_algo_5correspondences(self) -> None:
        """ """
        fx, px, py, k1, k2 = load_log_front_center_intrinsics()
        keypoints_i1, keypoints_i2 = load_argoverse_log_annotated_correspondences(
        )

        # match keypoints row by row
        match_indices = np.vstack(
            [np.arange(len(keypoints_i1)),
             np.arange(len(keypoints_i1))]).T

        intrinsics_i1 = Cal3Bundler(fx, k1, k2, px, py)
        intrinsics_i2 = Cal3Bundler(fx, k1, k2, px, py)

        match_indices = match_indices[:5]

        i2Ri1, i2ti1, _, _ = self.verifier.verify(keypoints_i1, keypoints_i2,
                                                  match_indices, intrinsics_i1,
                                                  intrinsics_i2)
示例#3
0
    def setUp(self):
        super().setUp()

        np.random.seed(RANDOM_SEED)
        random.seed(RANDOM_SEED)

        self.verifier: VerifierBase = Ransac(
            use_intrinsics_in_verification=True)
示例#4
0
    def setUp(self) -> None:
        super().setUp()

        np.random.seed(RANDOM_SEED)
        random.seed(RANDOM_SEED)

        self.verifier: VerifierBase = Ransac(
            use_intrinsics_in_verification=True, estimation_threshold_px=0.5)
示例#5
0
    def setUp(self):
        super().setUp()

        np.random.seed(RANDOM_SEED)
        random.seed(RANDOM_SEED)
        self.verifier = Ransac()
        self.use_intrinsics_for_verification = True

        self.euler_angle_err_tol = 1.0
        self.translation_err_tol = 0.01
示例#6
0
 def test_sift_twoway_ransac(self):
     """Check DoG + SIFT + 2-way Matcher + RANSAC-5pt frontend."""
     det_desc = SIFTDetectorDescriptor()
     feature_extractor = FeatureExtractor(det_desc)
     two_view_estimator = TwoViewEstimator(matcher=TwoWayMatcher(),
                                           verifier=Ransac(),
                                           corr_metric_dist_threshold=0.1)
     self.__compare_frontend_result_error(
         feature_extractor,
         two_view_estimator,
         euler_angle_err_tol=1.4,
         translation_err_tol=0.026,
     )
示例#7
0
 def test_superpoint_superglue_twoway_ransac(self):
     """Check SuperPoint + SuperGlue + OpenCV RANSAC-5pt frontend (Essential matrix estimation)."""
     det_desc = SuperPointDetectorDescriptor()
     feature_extractor = FeatureExtractor(det_desc)
     two_view_estimator = TwoViewEstimator(
         matcher=SuperGlueMatcher(use_outdoor_model=True),
         verifier=Ransac(use_intrinsics_in_verification=True, estimation_threshold_px=4),
         eval_threshold_px=4,
         bundle_adjust_2view=False,
         inlier_support_processor=InlierSupportProcessor(
             min_num_inliers_est_model=15, min_inlier_ratio_est_model=0.1
         ),
     )
     self.__compare_frontend_result_error(
         feature_extractor, two_view_estimator, euler_angle_err_tol=1.4, translation_err_tol=0.026
     )
 def setUp(
     self, verifier: VerifierBase = Ransac(use_intrinsics_in_verification=False, estimation_threshold_px=3)
 ) -> None:
     super().setUp()
     self._verifier: VerifierBase = verifier
     detector_descriptor = SIFTDetectorDescriptor()
     matcher = TwoWayMatcher()
     self._image_i1 = io_utils.load_image(str(IMG1_PATH))
     self._image_i2 = io_utils.load_image(str(IMG2_PATH))
     self._keypoints_i1, descriptors_i1 = detector_descriptor.detect_and_describe(self._image_i1)
     self._keypoints_i2, descriptors_i2 = detector_descriptor.detect_and_describe(self._image_i2)
     self._match_indices = matcher.match(
         self._keypoints_i1,
         self._keypoints_i2,
         descriptors_i1,
         descriptors_i2,
         (self._image_i1.height, self._image_i1.width),
         (self._image_i2.height, self._image_i2.width),
     )
示例#9
0
 def setUp(self):
     super().setUp()
     self.verifier = Ransac(use_intrinsics_in_verification=False, estimation_threshold_px=0.5)
示例#10
0
 def setUp(self):
     super().setUp()
     self.verifier = Ransac(use_intrinsics_in_verification=False)