These days, I am busy carrying out my last experiments named “video anomaly detection” for my thesis. For extracting features of video, I would use some functions of opencv, so I configured opencv in VS2013, here are some steps.
Environment
- C++ IDE: VS2013 Ultimate
- opencv version: 2.4.8
- operating system: win8
Step 1: install opencv and configure
download opencv and extract to your file folders. Here I extracted it to F:/program files.
Then we need to configure environment variables for opencv.
1 | #add system variable -- Path |
pay attention:
please choose X86, whether your system is 32bit or 64bit, otherwise some errors will occur when you compiles.
Step2: Configure opencv in VS2013
Firstly, we create a new visual C++ project.
Then follow the pic below. We need to change three places.
VC++目录
1
2
3
4#add:
F:\program files\opencv\build\include
F:\program files\opencv\build\include\opencv
F:\program files\opencv\build\include\opencv2库目录
1
2#add:
F:\program files\opencv\build\x86\vc12\lib连接器->输入->附加依赖项
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#add:
opencv_calib3d248d.lib
opencv_contrib248d.lib
opencv_core248d.lib
opencv_features2d248d.lib
opencv_flann248d.lib
opencv_gpu248d.lib
opencv_highgui248d.lib
opencv_imgproc248d.lib
opencv_legacy248d.lib
opencv_ml248d.lib
opencv_nonfree248d.lib
opencv_objdetect248d.lib
opencv_ocl248d.lib
opencv_photo248d.lib
opencv_stitching248d.lib
opencv_superres248d.lib
opencv_ts248d.lib
opencv_video248d.lib
opencv_videostab248d.lib
These files are in F:\program files\opencv\build\x86\vc12\lib.
Test: Convert Video to Image
1 | /*实现视频的读取以及每一帧图像的保存*/ |