2
import numpy as np
import cv2
from matplotlib import pyplot as plt

img = cv2.imread('12.jpg',0)
orb = cv2.ORB()
kp = orb.detect(img,None)
kp, des = orb.compute(img, kp)
img2 = cv2.drawKeypoints(img,kp,color=(0,255,0), flags=0)
plt.imshow(img2),plt.show()

I have added the numpy and cv2 modules to my python directory and set their environment variables.

I also installed msvcp71.dll and msvcr71.dll, but this error has not solved.

So how can i fix this kind of dll problem?

Version information:

  1. Python 3.2

  2. numpy-1.6.1-win32-superpack-python3.2

  3. opencv-3.0.0

Mark Lalor
  • 7,820
  • 18
  • 67
  • 106
Jahid Rahman
  • 31
  • 1
  • 1
  • 2
  • 2
    How did you install numpy and OpenCV? What directory did you add them to, and what exactly did you add? What environment variables did you set? Please [edit] your question and add **all** of the relevant details. We can't read your mind, and have no idea what you actually did. Additionally, please add the **full text** of the traceback to your question. – MattDMo Sep 19 '15 at 18:50
  • possible duplicate of [How to use OpenCV in Python?](http://stackoverflow.com/questions/5030362/how-to-use-opencv-in-python) – J Richard Snape Sep 21 '15 at 17:39

1 Answers1

4

I suspect you've mixed a x64 python with x86 cv2.pyd file, or vice versa. Simple way is to install a right version of opencv here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

See discussions here:

  1. ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL's are there
  2. How to use OpenCV in Python?

To check your python arch:

In [2]: import platform

In [3]: platform.architecture()
Out[3]: ('64bit', 'WindowsPE')

and cv2.pyd: I suggest using PESnoop:

D:\Anaconda\Lib\site-packages> PESnoop cv2.pyd /pe_dh
-------------------------------------------------------------------------------
 PESnoop 2.0 - Advanced PE32/PE32+/COFF OBJ,LIB command line dumper by yoda
-------------------------------------------------------------------------------

Dump of file: cv2.pyd...
Modus:        64bit Portable Executable Image...

discussions:

https://serverfault.com/questions/29958/how-to-tell-if-a-windows-application-requires-64-bit

How can I determine for which platform an executable is compiled?

Community
  • 1
  • 1
zhangxaochen
  • 32,744
  • 15
  • 77
  • 108