After spending many hour doing trial and error in order to compile OpenCV with Eigen, TBB I made a simple text installation guide.
If you want to add to this or make corrections feel free.
A) Get OpenCV source code Open Folder called opencv Fork from github: https://github.com/Itseez/opencv , into subfolder sources Open folder next to sources called build
Now you have:
opencv--build
|-sources
Note: You can download the source directly as a zip file or clone it using git, tortoiseGit, svn or tortoise SVN. I cloned the file using TortoiseGit and renamed the file opencv to sources
How to clone using git at command line?
Open a command line window
cd to d:
mkdir opencv
type: git clone https://github.com/Itseez/opencv.git
You should get the following message:
Cloning into 'opencv'...
Soon you will have OpenCV source code in subfolder named "d:\opencv\opencv"
Move the contents of 'd:\opencv\opencv' to 'd:\opencv\sources'
B) Download TBB Under build open subfolder common and put Itels tbb into it
C) Download Eigen and also put it under build/common
Make sure you put the entire "EIGEN" directory under common. It should include at least "eigen" and "unsupported"
D) Download CMake
E) Define as system variables CVROOT = d:\opencv\build\ TBBROOT = %CVROOT%\common\tbb\bin\intel64\ (or instead of intel64 use ia32 if you only have x86 processor)
How to check if you entered the path correctly? AFTER entering path and ONLY AFTER entering and applying all your changes open a DOS cmd window.
Type %CVROOT% at the command line
If you get the following message:
'd:\OpenCV\opencv_v1\' is not recognized as an internal or external command,
operable program or batch file.
You have entered the path correctly and now it is a system variable
F) Add to Path, the following:
1) C:\Program Files (x86)\CMake 2.8\bin
2) %CVROOT%\build\x64\vc12\
3) %CVROOT%\build\common\tbb\bin\intel64\vc12\
Note: use V12 for Visual studio 2013. If you are using an earlier version for example Visual Studio 2010 instead of vc12 use vc10.
How to know which number is the right one for you? Take a look at project configuration properties->General->Platform Toolset
How to check if you entered the Paths correctly?
Type Path at the command line. You should see the Paths you just added in the list
G) Open Cmake gui
Enter the following at:
Where is the Source code: $(CVROOT)/sources
Where to build the binaries: $(CVROOT)/Build
H) Configure Cmake Click on configure and you will be asked to specify the compiler. For Visual Studio 2013 specify Visual Studio 12 win64 Make sure to choose "Use native compilers"
-Click finish
-Check the “BUILD_EXAMPLES” option (in the "BUILD" group).
-Check the “WITH_TBB” option (in the "BUILD" group).
-Set EIGEN_INCLUDE_PATH as "d:/opencv/build/common"
-Mark in WITH -WITH_EIGEN and -WITH_TBB
-In TBB group set
-TBB_INCLUDE_DIRS : D:/opencv/build/common/tbb/include/
-TBB_LIB_DIR : D:/opencv/build/common/tbb/lib/intel64/vc12
Click on generate after a successful configure. Pay attention to errors and warnings you get from configure