test_sift_compatibility.py 508 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. # Python 2/3 compatibility
  3. from __future__ import print_function
  4. import os
  5. import numpy as np
  6. import cv2 as cv
  7. from tests_common import NewOpenCVTests
  8. class sift_compatibility_test(NewOpenCVTests):
  9. def test_create(self):
  10. sift = cv.xfeatures2d.SIFT_create()
  11. self.assertFalse(sift is None)
  12. img1 = np.zeros((100, 100, 3), dtype=np.uint8)
  13. kp1_, des1_ = sift.detectAndCompute(img1, None)
  14. if __name__ == '__main__':
  15. NewOpenCVTests.bootstrap()