我的windows下是使用的一个镜像安装的vs2015,然后在vs上编译工程需要使用opencv时,需要在工程中配置opencv
新建一个C++工程,按照下面的步骤进行配置。
设置opencv的环境变量
“此电脑”右键点击“属性”-->选择“高级系统设置”-->选择“高级”-->选择“环境变量”-->选择“Path”-->点击“编辑”-->添加“bin路径”
第一步:
左键选中“项目”-->右键选择“属性”-->点击“VC++目录”-->点击“包含目录”右侧的“下三角”-->点击编辑-->然后添加关于opencv的include,opencv, opencv2目录
第二步:点击“库目录”右侧的下三角-->点击“编辑”-->点击“...”选择相应的lib路径
第三步:将下面的内容根据图像的指示复制到相应的位置。
opencv_calib3d341d.lib
opencv_core341d.lib
opencv_features2d341d.lib
opencv_flann341d.lib
opencv_highgui341d.lib
opencv_imgcodecs341d.lib
opencv_imgproc341d.lib
opencv_ml341d.lib
opencv_objdetect341d.lib
opencv_photo341d.lib
opencv_shape341d.lib
opencv_stitching341d.lib
opencv_superres341d.lib
opencv_video341d.lib
opencv_videoio341d.lib
opencv_videostab341d.lib
opencv_xfeatures2d341d.lib
opencv_xobjdetect341d.lib
opencv_aruco341d.lib
opencv_bgsegm341d.lib
opencv_bioinspired341d.lib
opencv_ccalib341d.lib
opencv_datasets341d.lib
opencv_dnn_objdetect341d.lib
opencv_dnn341d.lib
opencv_dpm341d.lib
opencv_face341d.lib
opencv_fuzzy341d.lib
opencv_hfs341d.lib
opencv_img_hash341d.lib
opencv_line_descriptor341d.lib
opencv_optflow341d.lib
opencv_phase_unwrapping341d.lib
opencv_plot341d.lib
opencv_reg341d.lib
opencv_rgbd341d.lib
opencv_saliency341d.lib
opencv_stereo341d.lib
opencv_structured_light341d.lib
opencv_surface_matching341d.lib
opencv_text341d.lib
opencv_tracking341d.lib
opencv_ximgproc341d.lib
opencv_xphoto341d.lib