Ask Your Question

overview needed for opencv setup on windows using eclipse

asked 2015-01-12 05:42:33 -0500

reggie gravatar image

updated 2015-01-13 10:54:19 -0500

I've really been struggling to get open CV to work with python and eclipse over the last few days. I've tried alsorts, and feel thurley beaten.

Because i've installed so much, i'm wondering if I need to start afresh, with a "dummy's guide" to getting this library working with eclipse and Python.

1) I have:

windows 7 (64 bit)

Eclipse Luna Service Release 1 (4.4.1) with pydev (

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32

Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32

numpty version 1.6.1 (not sure if its 32 or 64 bit)

Cmake-gui 3.1

I also have an un built (compiled version of numpty 1.91 sitting on my desktop un built (compiled) because i dont know how to do it.)

opencv version, not sure, because I have a folder on my c drive with many folders in it but the top 2 are build and sources. I haven't built (compiled) open cv, just downloaded and extracted it to my C drive.

2) Could someone explain the nuts and bolts of a python file using open CV and numpty, within eclipse? in particular how the file structure works? Should the open cv library be an exe or dll, why are there no windows installation files? should numpty be an exe or dll? What tests could I go through to verify that my installation is working? that kind of thing.

3) I don't think i fully understand the many setup tutorials I have read, I think i'm missing something fundamental. Because i'm not using visual studio, do I have to build open CV and Numpty from the source files?

Please can someone point me in the correct direction, because I feel as though i'm swimming in circles! Ideally, a step by step guide in how to build this library and solve build issues using cmake-gui. I have tried many, but seem to get stuck at the make stage.

edit retag flag offensive close merge delete


  • make your life a bit easier, and avoid eclipse while building opencv, rather stay on the cmdline, cmake, make, make install. (no problem using eclipse later for your python projects)
  • python3 only works with opencv3, python2.7 works for both opencv2.4.x and opencv3.0
berak gravatar imageberak ( 2015-01-13 08:58:42 -0500 )edit

I understand about leaving eclipse till later. Is it ok to use GUI of cmake, as opposed to the cmdline? could you point me in the direction of an Idiot's tutorial to building opencv using cmake? I'm following but i get stuck at the make stage.

reggie gravatar imagereggie ( 2015-01-13 10:59:18 -0500 )edit

yes cmake-gui is ok as well. just set your CMAKE_MAKE_PROGRAM to path/to/mingw32-make.exe

(that's where it fails for most folks)

berak gravatar imageberak ( 2015-01-13 11:19:16 -0500 )edit

I know you advised to leave eclipse till later, but I didn't fully understand your answer. I'm a novice library builder! However, I managed to get to the very last step in the above link, by pointing the CMAKE_ECLIPSE_EXECUTABLE to the location of my eclipse.exe; but don't know how to "Add %OPENCV_DIR%\bin to the system PATH". Do I add things to the system path in eclipse or using windows cmd? Could you please spell it out how to do this, thanks.

reggie gravatar imagereggie ( 2015-01-14 13:35:59 -0500 )edit

sorry found out how to do this using windows!

reggie gravatar imagereggie ( 2015-01-14 13:52:40 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-01-13 11:15:59 -0500

berak gravatar image

in general, building for mingw is much similar to the way it's done on linux

  1. make a build folder, cd there.
  2. run cmake [lots of params] [path to opencv_folder]

    • for mingw, you will have to give the location of your compiler, and make tool, like:

      cmake -G "MinGW Makefiles" -D CMAKE_CXX_COMPILER="D:\Programme\MinGW\bin\mingw32-g++.exe" -D CMAKE_MAKE_PROGRAM="D:\Programme\MinGW\bin\mingw32-make.exe"

    • -D BUILD_opencv_python3=OFF (or ON, depending, if you're building opencv3, and if you want py3 support)

      if all went fine, and it liked one of your your numpy installs, proceed to the next stage:

  3. run make [check for build errors]

  4. run make install . this will copy your new cv2.pyd to python/libs/site-packages.
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-01-12 05:42:33 -0500

Seen: 832 times

Last updated: Jan 13 '15