向OpenCV3.0中添加opencv_contrib插件中的新功能

OpenCv3改变了框架,采用了主体+插件的方式,插件里是一些新功能,有些还不稳定,官方在不断地更新。

首先,现在这https://github.com/itseez/opencv_contrib,下载。

然后安装cmake,并把安装目录的bin文件夹添加到环境变量里。

在cmd中 使用

cd <你的opencv安装目录下的build文件夹的地址>
cmake -DOPENCV_EXTRA_MODULES_PATH=<下载的那个文件夹的地址>/modules <你的opencv安装目录下的source文件夹的地址>

然后关闭,打开C:\users(你的用户名)这个文件夹,就会看到vs的解决方案。
打开解决方案,选择CMakeTargets下INSTALL,右键“生成,然后切换到Release模式,再次生成。
然后就可以看到还是那个文件夹,打开install

然后和往常一样配置一下就可以用了。
但是要注意,附加依赖项的添加,如果你是debug要把下面这些全部加进去:
opencv_ts300d.lib
opencv_aruco300d.lib
opencv_bgsegm300d.lib
opencv_bioinspired300d.lib
opencv_calib3d300d.lib
opencv_ccalib300d.lib
opencv_core300d.lib
opencv_datasets300d.lib
opencv_dpm300d.lib
opencv_face300d.lib
opencv_features2d300d.lib
opencv_flann300d.lib
opencv_hal300d.lib
opencv_highgui300d.lib
opencv_imgcodecs300d.lib
opencv_imgproc300d.lib
opencv_line_descriptor300d.lib
opencv_ml300d.lib
opencv_objdetect300d.lib
opencv_optflow300d.lib
opencv_photo300d.lib
opencv_reg300d.lib
opencv_rgbd300d.lib
opencv_saliency300d.lib
opencv_shape300d.lib
opencv_stereo300d.lib
opencv_stitching300d.lib
opencv_superres300d.lib
opencv_surface_matching300d.lib
opencv_text300d.lib
opencv_tracking300d.lib
opencv_video300d.lib
opencv_videoio300d.lib
opencv_videostab300d.lib
opencv_xfeatures2d300d.lib
opencv_ximgproc300d.lib
opencv_xobjdetect300d.lib
opencv_xphoto300d.lib

release就把上面的那些后面的d给去掉。

然后就可以运行了

你可能感兴趣的:(opencv,cmake)