Home >Backend Development >C++ >How to Set Up OpenCV 2.4.3 in Visual C 2010 Express?
How to Install OpenCV 2.4.3 in Visual C 2010 Express
To install OpenCV 2.4.3 in Visual C 2010 Express, follow these steps:
1. Installation
2. Project Configuration
In the project properties → Linker → Input, add the following dependencies (with the "_d" suffix indicating the "Debug" configuration):
opencv_calib3d243d.lib opencv_contrib243d.lib opencv_core243d.lib opencv_features2d243d.lib opencv_flann243d.lib opencv_gpu243d.lib opencv_haartraining_engined.lib opencv_highgui243d.lib opencv_imgproc243d.lib opencv_legacy243d.lib opencv_ml243d.lib opencv_nonfree243d.lib opencv_objdetect243d.lib opencv_photo243d.lib opencv_stitching243d.lib opencv_ts243d.lib opencv_video243d.lib opencv_videostab243d.lib
3. Code Example
Create a new C file in your project and enter the following code:
#include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main() { // Load and display an image Mat im = imread("c:/full/path/to/lena.jpg"); if (im.empty()) { cout << "Cannot load image!" << endl; return -1; } imshow("Image", im); waitKey(0); return 0; }
Going Further
After setting up your OpenCV environment, explore the samples in c:opencvsamplescpp to enhance your skills and develop your own OpenCV applications.
The above is the detailed content of How to Set Up OpenCV 2.4.3 in Visual C 2010 Express?. For more information, please follow other related articles on the PHP Chinese website!