Browse Source

变更到opencv4.7版本

Jeff 1 year ago
parent
commit
2ca5a68869
3 changed files with 14 additions and 12 deletions
  1. 11 7
      IDE_Single/IDE/IDE.vcxproj
  2. 1 1
      IDE_Single/IDE/IDEView.cpp
  3. 2 4
      IDE_Single/IDE/stdafx.h

+ 11 - 7
IDE_Single/IDE/IDE.vcxproj

@@ -23,20 +23,20 @@
     <ProjectGuid>{77608216-0D0C-45C2-94DC-DD2E4F6E5DF0}</ProjectGuid>
     <Keyword>MFCProj</Keyword>
     <RootNamespace>IDE</RootNamespace>
-    <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v143</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
     <UseOfMfc>Dynamic</UseOfMfc>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v143</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
     <UseOfMfc>Dynamic</UseOfMfc>
@@ -44,16 +44,16 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v141</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v143</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
     <UseOfMfc>Dynamic</UseOfMfc>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v143</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
+    <CharacterSet>MultiByte</CharacterSet>
     <UseOfMfc>Dynamic</UseOfMfc>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -82,6 +82,8 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
+    <IncludePath>D:\Program Files\Opencv\include;D:\Program Files\Opencv\include\opencv2;$(IncludePath)</IncludePath>
+    <LibraryPath>D:\Program Files\Opencv\lib\Debug;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
@@ -126,6 +128,7 @@
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
+      <AdditionalDependencies>opencv_calib3d470d.lib;opencv_core470d.lib;opencv_dnn470d.lib;opencv_features2d470d.lib;opencv_flann470d.lib;opencv_gapi470d.lib;opencv_highgui470d.lib;opencv_imgcodecs470d.lib;opencv_imgproc470d.lib;opencv_ml470d.lib;opencv_objdetect470d.lib;opencv_photo470d.lib;opencv_stitching470d.lib;opencv_ts470d.lib;opencv_video470d.lib;opencv_videoio470d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <Midl>
       <MkTypLibCompatible>false</MkTypLibCompatible>
@@ -181,6 +184,7 @@
       <SubSystem>Windows</SubSystem>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>opencv_calib3d470.lib;opencv_core470.lib;opencv_dnn470.lib;opencv_features2d470.lib;opencv_flann470.lib;opencv_gapi470.lib;opencv_highgui470.lib;opencv_imgcodecs470.lib;opencv_imgproc470.lib;opencv_ml470.lib;opencv_objdetect470.lib;opencv_photo470.lib;opencv_stitching470.lib;opencv_ts470.lib;opencv_video470.lib;opencv_videoio470.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <Midl>
       <MkTypLibCompatible>false</MkTypLibCompatible>

+ 1 - 1
IDE_Single/IDE/IDEView.cpp

@@ -261,7 +261,7 @@ void CIDEView::OnInitialUpdate()
 {
 	CScrollView::OnInitialUpdate();
 
-	m_img = imread(_T("IDE.png"), CV_LOAD_IMAGE_COLOR);
+	m_img = imread(_T("IDE.png"), IMREAD_COLOR);
 
 	// 设置滚动条出现时的范围;
 	CSize sizeTotal = CSize(m_img.cols, m_img.rows);

+ 2 - 4
IDE_Single/IDE/stdafx.h

@@ -57,10 +57,8 @@
 using namespace Gdiplus;
 #pragma comment(lib, "gdiplus.lib")
 
-// OpenCV 库头文件及命名空间;
-#include <opencv2/imgproc/imgproc.hpp>  // Gaussian Blur
-#include <opencv2/core/core.hpp>        // Basic OpenCV structures (cv::Mat, Scalar)
-#include <opencv2/highgui/highgui.hpp>  // OpenCV window I/O
+// 只需要包含一个头文件即可;
+#include "opencv2/opencv.hpp"
 using namespace std;
 using namespace cv;