def setUp( self, detector_descriptor: DetectorDescriptorBase = SIFTDetectorDescriptor() ) -> None: super().setUp() self._input: Image = io_utils.load_image(str(IMG_PATH)) self._detector_descriptor: DetectorDescriptorBase = detector_descriptor
def setUp(self): """Setup the attributes for the tests.""" super().setUp() self.detector_descriptor = SIFTDetectorDescriptor() # explicitly set the detector self.detector = DetectorFromDetectorDescriptor( self.detector_descriptor)
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), )
def test_sift_twoway_degensac(self): """Check DoG + SIFT + 2-way Matcher + DEGENSAC-8pt frontend.""" det_desc = SIFTDetectorDescriptor() feature_extractor = FeatureExtractor(det_desc) two_view_estimator = TwoViewEstimator(matcher=TwoWayMatcher(), verifier=Degensac(), corr_metric_dist_threshold=0.1) self.__compare_frontend_result_error( feature_extractor, two_view_estimator, euler_angle_err_tol=0.95, translation_err_tol=0.03, )
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(use_intrinsics_in_verification=True), 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, )
def setUp(self) -> None: super().setUp(detector_descriptor=SIFTDetectorDescriptor())