2

cv2.ORB and cv2.SIFT don't seem to be in the cv2 module.

 AttributeError: 'module' object has no attribute 'ORB'

Im using cv2 version 2.4.2. I installed the superpackage of SimpleCV. Does anyone know how I can get these functions to work properly?

High schooler
  • 1,682
  • 3
  • 30
  • 46

3 Answers3

3

(OpenCV Python can't use SURF, SIFT) Here is the solution,I am facing the same problem.But this is too hard for me to do all those things.Hope it helps you.If you find much easier solution,please let me know. Best Regards,

Community
  • 1
  • 1
Maham
  • 432
  • 1
  • 8
  • 22
2

OpenCV 3.0.0 (June 2015) built from source on Ubuntu 14.04:

import cv2

# Initiate STAR detector
orb = cv2.ORB_create()

# find the keypoints with ORB
keypoints = orb.detect(image_bgr, None)

# compute the descriptors with ORB
keypoints, descriptors = orb.compute(image_bgr, keypoints)

I've read that the patented algorithms like SURF, etc. are now in the xfeatures module that must be built separately from opencv_contrib. But they also use the new DETECTORNAME_create() syntax, like cv2.xfeatures.SURF_create().

1

Please install version 2.4.6. It works for me.

jiapeng
  • 11
  • 1