如何编译opencv

1. 从opencv的官网下载source,然后编译,安装;

2. 编写你的opencv code

3. 使用以下命令来编译:

g++ -I/YouIncludePath/usr/include -L/YouLibPath/usr/lib64 -lopencv_calib3d
-lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu
-lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree
-lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres
-lopencv_ts -lopencv_video -lopencv_videostab YouTest.cpp