opencv3.3 sample是个学习opencv的最佳方法,运行示例查看运行结果方法如下
1.打开D:opencv3.3samplescppexample_cmake
2.将需要运行的示例cpp文件copy至此,如:videocapture_basic.cpp
3.创建目录如:video-build
4.修改CMakeLists.txt最后2行为:
# Declare the executable target built from your sources
add_executable(videocapture_basic videocapture_basic.cpp)
# Link your application with OpenCV libraries
target_link_libraries(videocapture_basic ${OpenCV_LIBS})
5.cd至video-build
6.执行cmake -G "MinGW Makefiles" ..
7.make
8.运行videocapture_basic.exe