(self)
| 6 | |
| 7 | class RootSIFT: |
| 8 | def __init__(self): |
| 9 | # initialize the SIFT feature extractor for OpenCV 2.4 |
| 10 | if is_cv2(): |
| 11 | self.extractor = cv2.DescriptorExtractor_create("SIFT") |
| 12 | |
| 13 | # otherwise initialize the SIFT feature extractor for OpenCV 3+ |
| 14 | else: |
| 15 | self.extractor = cv2.xfeatures2d.SIFT_create() |
| 16 | |
| 17 | def compute(self, image, kps, eps=1e-7): |
| 18 | # compute SIFT descriptors |