Installing OpenCV in Windows 7 / 8 32 Bit OS using Visual Studio 2010 / 2012
Know how to earn through Cloud computing without investing anything, without doing any work.
- This tutorial is only for 32 bit machines. If you have 64 bit OS then follow this link.Know how to earn through Cloud computing without investing anything, without doing any work.
Shopping FREE of Cost :) (Without doing any work)
Notes-
- Simplest way of OpenCV Tutorial follow this link. (For 32 bit OS)
Requirements-
1. OpenCV-2.4.7
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.
Important Note- After downloading and extracting OpenCV, delete the folder named "x64" inside "build" folder. Then go ahead.
Step-1
Extract OpenCV-2.4.7.exe to a folder let "C:/OpenCV". This OpenCV folder should contain many folders like build, include etc.
Choose Visual Studio 11 otherwise choose Visual Studio 10. Click Finish.
After getting red output, click Configure again. Wait a moment and then click Generate.
Close CMake and go to C:\MyOpenCV, open OpenCV.sln.
Choose Debug. (or By default it will be Debug)
Right click on INSTALL. And choose Build.
After build successful , go back and choose Release. Similarly, right click on INSTALL. And choose Build.
After build finish, 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
For Release:
Create a new empty C++ project.
View -> Property Manager or right click on project name inside solution Explorer and choose property.
Double click Release
- C/C++ -> General -> Additional Include Directories for 2012 or VC++ Directories -> include directories for 2010, add
C:\OpenCV\install\include\opencv
C:\OpenCV\install\include
- Linker -> General -> Additional Library Directories
C:\OpenCV\install\lib
- Linker -> Input -> Additional Dependencies
opencv_calib3d247.libopencv_contrib247.libopencv_core247.libopencv_features2d247.libopencv_flann247.libopencv_gpu247.libopencv_highgui247.libopencv_imgproc247.libopencv_legacy247.libopencv_ml247.libopencv_nonfree247.libopencv_objdetect247.libopencv_photo247.libopencv_stitching247.libopencv_ts247.libopencv_video247.libopencv_videostab247.lib
For Debug:
View -> Property Manager
Double click Debug
- C/C++ -> General -> Additional Include Directories
C:\OpenCV\install\include\opencvC:\OpenCV\install\include
- Linker -> General -> Additional Library Directories
C:\OpenCV\install\lib
- Linker -> Input -> Additional Dependencies
opencv_calib3d247d.libopencv_contrib247d.libopencv_core247d.libopencv_features2d247d.libopencv_flann247d.libopencv_gpu247d.libopencv_highgui247d.libopencv_imgproc247d.libopencv_legacy247d.libopencv_ml247d.libopencv_nonfree247d.libopencv_objdetect247d.libopencv_photo247d.libopencv_stitching247d.libopencv_ts247d.libopencv_video247d.libopencv_videostab247d.lib
Note the file names has extra "d" which means debug
and its over...
Note- Now restart the system and run the below program for testing.
Please share some experience on why to use OPEN CV/ MATLAB /C / C++!!!
Sample code:
//Reading an image
#include "opencv2\core\core.hpp"
#include "opencv2\highgui\highgui.hpp"
#include "cv.h"
#include "highgui.h"
#include "opencv2\highgui\highgui.hpp"
#include "cv.h"
#include "highgui.h"
using namespace std;
using namespace cv;
void main()
{
Mat image = imread("00.jpg"); //Give the full path to the image file
namedWindow("mywin");
imshow("mywin", image);
waitKey(0);
}
Sample code:
//Playing Video
#include "cv.h"
#include "opencv2\core\core.hpp"
#include "opencv2\highgui\highgui.hpp"
#include "opencv2\highgui\highgui.hpp"
#include "highgui.h"
using namespace cv;
int main()
{
// Open the video file
VideoCapture capture("asmall.avi"); //Give the full path for the video file
// check if video successfully opened
if (!capture.isOpened())
return 1;
// Get the frame rate
bool stop(false);
Mat frame; // current video frame
namedWindow("Extracted Frame");
// Delay between each frame in ms
// corresponds to video frame rate
// for all frames in video
while (!stop) {
// read next frame if any
if (!capture.read(frame))
break;
imshow("Extracted Frame",frame);
// introduce a delay in mili-second
waitKey(50);
}
// Close the video file.
// Not required since called by destructor
capture.release();
return 0;
}
After Successfully installed comment below. So that I can keep on updating my blog.
Important apps for Android
STOP AUTORUN of APPS in ANDROID
Important apps for Android
STOP AUTORUN of APPS in ANDROID