最近在做對應點估計homography,需要用到opencv,c++的接口不如python的接口來的方便
但是在安裝python接口的opencv的時候,遇到了各種問題,主要是函數找不到的問題
比如在使用sift函數的時候,
cv2.xfeatures2d.SIFT_create()
會遇到函數找不到的問題
AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
或者:
error: (-213:The function/feature is not implemented) This algorithm is patented
這個時候經過摸索,得到的解決方案大致是:
python2的環境,而非python3的環境,然后不要安裝opencv
安裝的是
pip install opencv-contrib-python==3.4.1.15
大致是這樣