当我运行我的python代码
import numpy as np
import cv2
import matplotlib.pyplot as plt
img1 = cv2.imread('/home/shar/home.jpg',0) # queryImage
img2 = cv2.imread('/home/shar/home2.jpg',0) # trainImage
# Initiate SIFT detector
orb = cv2.ORB()
# find the keypoints and descriptors with SIFT
kp1, des1 = orb.detectAndCompute(img1,None)
kp2, des2 = orb.detectAndCompute(img2,None)
# create BFMatcher object
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
# Match descriptors.
matches = bf.match(des1,des2)
# Sort them in the order of their distance.
matches = sorted(matches, key = lambda x:x.distance)
# Draw first 10 matches.
img3 …Run Code Online (Sandbox Code Playgroud) 最近,我安装了当前版本的Python(x,y)包(2.7.6.0),现在当我运行我的python代码时,它显示一个错误:
Traceback (most recent call last):
File "D:\Projects\comparison\Lagebestimmung\main.py", line 11, in <module>
import cv2
ImportError: DLL load failed: The specified procedure could not be found.
Run Code Online (Sandbox Code Playgroud)
我在安装过程中正确选择了opencv模块.
另外,我之前在我的计算机中使用旧版本的Python(x,y),我在安装新版本之前卸载了该版本.在那个版本中,没有这样的问题.