Anda di halaman 1dari 10

[Solved] Install OpenCV 2.4.

5 using Visual Studio 2010 / 2012 in Windows 7 / 8


Requirements1. OpenCV 2. Cmake 3. Visual Studio 2010 / 2012 4. Windows 7 / 8

Thanks to Hongbo Miao for this tutorial to install OpenCV 2.4.4 for Visual Studio 2012.

Using OpenCV 2.4.5 in Visual Studio 2010 / 2012 Step-1


(For Windows 8 user) -Do this step in a windows 7 machine of your friend as windows 8 does not support Cmake till now.
Install CMake. Open CMake and use settings below. Then click Configure.

Choose Visual Studio 11 Win64. Click Finish.

After a while, click Configure again. Wait a moment and then click Generate. (For Windows 8 user) - Now copy that folder to your windows 8 machine. Now do the following steps. Close CMake and go to C:\MyOpenCV, open OpenCV.sln. Choose Debug.

Right click INSTALL. And choose Build.

After a long period of time, go back and choose Release. Similarly, right click INSTALL. And choose Build. Close Visual Studio 2012. Copy C:\MyOpenCV\install folder to C:\OpenCV. (This install folder contains your whole OpenCV, so there is no need of keeping folders other than install folder.) So now you have a C:\OpenCV\install folder. You can delete C:\MyOpenCV whole folder if you want.

Step-2
Open Windows Explorer. Click on Computer and then System properties.

Choose Advanced system settings.

Click Environment Variables...

Add only this to Environment Variables -> System variables -> Path C:\OpenCV\install\bin

Step-3
(IF YOU HAVE 64BIT OS THEN ONLY FOLLOW THIS, OTHERWISE MOVE TO STEP-4)
After creating your own project in Visual Studio 2012... Build menu -> Configuration Manager Change the Active solution platform. Click on Win32, Select New.... Use the settings below and click OK.

Step-4
FOR RELEASE:
View -> Property Manager Double click Release | x64
1. C/C++ -> General -> Additional Include Directories

C:\OpenCV\install\include\opencv C:\OpenCV\install\include
1. Linker -> General -> Additional Library Directories

C:\OpenCV\install\lib
1. Linker -> Input -> Additional Dependencies

opencv_calib3d245.lib opencv_contrib245.lib opencv_core2453.lib opencv_features2d245.lib opencv_flann245.lib opencv_gpu245.lib opencv_highgui245.lib opencv_imgproc245.lib opencv_legacy245.lib opencv_ml245.lib opencv_nonfree245.lib opencv_objdetect245.lib

opencv_photo245.lib opencv_stitching245.lib opencv_ts245.lib opencv_video245.lib opencv_videostab245.lib

FOR DEBUG:
View -> Property Manager Double click Debug | x64
1. C/C++ -> General -> Additional Include Directories

C:\OpenCV\install\include\opencv C:\OpenCV\install\include
1. Linker -> General -> Additional Library Directories

C:\OpenCV\install\lib
1. Linker -> Input -> Additional Dependencies

opencv_calib3d245d.lib opencv_contrib245d.lib opencv_core245d.lib opencv_features2d245d.lib opencv_flann245d.lib opencv_gpu245d.lib opencv_highgui245d.lib opencv_imgproc245d.lib opencv_legacy245d.lib opencv_ml245d.lib opencv_nonfree245d.lib opencv_objdetect245d.lib opencv_photo245d.lib opencv_stitching245d.lib opencv_ts245d.lib opencv_video245d.lib opencv_videostab245d.lib Note the file names has extra "d" which means debug

Check my blog for any help- http://4someonehelp.blogspot.in/

Anda mungkin juga menyukai