setting up opencv in windows 7 to run tutorials [closed]

asked 2016-07-20 16:13:38 -0500

RexSr gravatar image

I am a embedded developer (most of my work is done with 'C' using various IDE's in the Windows environment but don't have a lot of background with Visual Studio (have done a couple of apps but no guru for sure). I have a Windows 7/sp1 on on 64 bit intel based computer.

I have been trying to get up on a version of opencv (don't really care which one at this point) so I can run the tutorials and become acquainted with it for some future development projects. I have had a lot of trouble just getting to the point where I could start using the visual studio environment to start compiling the test projects. I finally elected to down load the anaconda build and was able to get to the point where I could import numpy and cv2 (from whatever version of opencv that I had downloaded) without errors. Now I am trying to run the simple test program (opencv equivalent of hello world) and cant get it to compile for various reasons. I just downloaded the version 2.3.1 (mainly because it has all the libraries compiled which are referenced in the tutorial). This required me to download an old version of visual studio (10) as an iso image and burn it to a cd which hopefully will allow me to install visual studio 10 (since all the libraries were compiled in that environment...).

My question: Is there a simpler way to get up on OpenCV? If necessary I can create a virtual box running Linux and approach it from that direction. It just seems that all the tutorials are out of date and everything I try doesn't work for some reason or another. What is the best way to become familiar with OpenCV?

Thanks for whatever help you can give.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-11-17 04:37:53.460266



can we encourage you somehow, to try to build latest opencv from src, instead of wasting your time with something as outdated as 2.3.1 ?

(it's for sure possible, even with vs2010 !)

berak gravatar imageberak ( 2016-07-21 00:21:52 -0500 )edit

Even if you don't want to build from source (although recommended), you can find pre-built 64bit binaries of latest releases (3.x version) for VS 2011/2012+. Also, read the installation tutorial and VS setup tutorial (they might be outdated in certain steps - if you come into trouble, let us know)

LorenaGdL gravatar imageLorenaGdL ( 2016-07-21 01:41:58 -0500 )edit

All, thanks for taking the time to answer my question and especially for your offer to help. I will do whatever is necessary to get up where I can start working with opencv. I originally started out to build the source rather than using prebuild binaries, but found problems with just about everything I tried to do there as well. I originally tried the c++ route then went to the opencv-python, requiring me to study the python language as well. Since you are offering to help I will start over with the tutorial building the source files and come back here for help for the problems I run into along the way. It is quite important to me to learn opencv. Thanks very much for your help.

RexSr gravatar imageRexSr ( 2016-07-21 12:04:20 -0500 )edit

"and come back here for help for the problems I run into along the way."

sure, that's the original purpose of this site.

berak gravatar imageberak ( 2016-07-21 12:06:58 -0500 )edit

I am working from the tutorial at "Install OpenCV-Python in Windows" I could not seem to get a valid version of VS2012 so I am planning to use vs2013. I installed version 2.8 of CMAKE (pointed to by the tutorial) although I have a later version already installed from a previous attempt. I downloaded Python 2.7.5, Numpy 1.7.x and the version of Matplotlib pointed to by the tutorial. Phython that shows up in the program files menu tries to do an install (gui and command line version) so I am working from the command line version in the python27 directory. when I import numpy and enter "numpy.__version__" at the prompt I get: '1.7.1' I need to know if this is reasonable before I continue to the next step where I will be downloading OpenCV and trying to get it compiled. Thanks.

RexSr gravatar imageRexSr ( 2016-07-21 20:04:56 -0500 )edit

I have continued on with the installation: "Install OpenCV-Python in Windows" "Building OpenCV from source" and everything seemed successful down to step 17. When I entered "import cv2" at the python command line prompt I got the following message: "RuntimeError: module compiled against API version 9 but this version of numpy is 7" I had this error in a previous attempt and solved it by downloading "anaconda" however, I am not sure if that download is going to be compatible with the current install path I am following. How should I proceed from here? Thanks for your help.

RexSr gravatar imageRexSr ( 2016-07-26 10:27:58 -0500 )edit

NOTE: I am using Python2.7.5 as called for in the tutorial. I had to use a later version of CMAKE because the one called for in the tutorial seemed to expect Python 2.6 or earlier.

RexSr gravatar imageRexSr ( 2016-07-26 12:30:30 -0500 )edit