opencv vs环境配置

Posted mlj318

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了opencv vs环境配置相关的知识,希望对你有一定的参考价值。

1.新建环境变量 OPENCV = D:\Programss\opencv\build

2.%OPENCV%\x86\vc12\bin;加入Path环境变量

3.导入 VS属性表文件 cv2413.props 到工程,避免重复配置lib

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
        <IncludePath>$(OPENCV)\include;$(IncludePath)</IncludePath>
        <LibraryPath Condition="‘$(Platform)‘==‘Win32‘">$(OPENCV)\x86\vc12\lib;$(LibraryPath)</LibraryPath>
        <LibraryPath Condition="‘$(Platform)‘==‘X64‘">$(OPENCV)\x64\vc12\lib;$(LibraryPath)</LibraryPath>
  </PropertyGroup>
  <ItemDefinitionGroup>
        <Link Condition="‘$(Configuration)‘==‘Debug‘">
          <AdditionalDependencies>opencv_calib3d2413d.lib;opencv_contrib2413d.lib;opencv_core2413d.lib;opencv_features2d2413d.lib;opencv_flann2413d.lib;opencv_gpu2413d.lib;opencv_highgui2413d.lib;opencv_imgproc2413d.lib;opencv_legacy2413d.lib;opencv_ml2413d.lib;opencv_nonfree2413d.lib;opencv_objdetect2413d.lib;opencv_ocl2413d.lib;opencv_photo2413d.lib;opencv_stitching2413d.lib;opencv_superres2413d.lib;opencv_ts2413d.lib;opencv_video2413d.lib;opencv_videostab2413d.lib;%(AdditionalDependencies)</AdditionalDependencies>
        </Link>
        <Link Condition="‘$(Configuration)‘==‘Release‘">
          <AdditionalDependencies>opencv_calib3d2413.lib;opencv_contrib2413.lib;opencv_core2413.lib;opencv_features2d2413.lib;opencv_flann2413.lib;opencv_gpu2413.lib;opencv_highgui2413.lib;opencv_imgproc2413.lib;opencv_legacy2413.lib;opencv_ml2413.lib;opencv_nonfree2413.lib;opencv_objdetect2413.lib;opencv_ocl2413.lib;opencv_photo2413.lib;opencv_stitching2413.lib;opencv_superres2413.lib;opencv_ts2413.lib;opencv_video2413.lib;opencv_videostab2413.lib;%(AdditionalDependencies)</AdditionalDependencies>
        </Link>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>

vs2015中导入属性文件:在菜单栏中选择 “视图”、 “属性管理器”、“添加现有属性表”  

 https://msdn.microsoft.com/zh-cn/library/669zx6zc.aspx

 

4.vs2015运行opencv会出现 找不到msvcp120d.dll msvcr120d.dll丢失,

下载这两个文件放到exe目录下或者%OPENCV%\x86\vc12\bin下

以上是关于opencv vs环境配置的主要内容,如果未能解决你的问题,请参考以下文章

OpenCV入门教程之一 OpenCV 2.4.8 +VS2010的开发环境配置

vs2012怎么配置opencv

opencv vs环境配置

opencv 环境配置-windowsx64 +VS2017

OpenCV3.2 + VS2015环境配置

请问如何在vs2010下配置opencv2.2,求详细步骤,万分感谢!