def test_BriefDescriptorExtractor_create_called_for_opencv3_if_detector_on_LIST_WITHOUT_EXTRACTORS(self, cv2_mock): OpencvDetectorInterface.OPENCV_MAJOR = "3" extractor = Mock() interface = OpencvDetectorInterface() interface.create_extractor(extractor, 'FAST') cv2_mock.BriefDescriptorExtractor_create.assert_called_once_with() self.assertIsNotNone(cv2_mock.BriefDescriptorExtractor_create)
def test_for_opencv3_create_extractor_returns_none_if_detector_not_on_LIST_WITHOUT_EXTRACTORS(self): OpencvDetectorInterface.OPENCV_MAJOR = "3" interface = OpencvDetectorInterface() extractor = interface.create_extractor(Mock(), 'ORB') self.assertIsNone(extractor)
def test_DescriptorExtractor_create_called_for_opencv2(self, cv2_mock): OpencvDetectorInterface.OPENCV_MAJOR = "2" extractor = Mock() interface = OpencvDetectorInterface() interface.create_extractor(extractor, 'ORB') cv2_mock.assert_called_once_with(extractor)