浏览代码

#IQBX #comment libimageproc 编译通过

80374374 1 年之前
父节点
当前提交
b6e10dd097

+ 1 - 0
Other/CMakeLists.txt

@@ -7,6 +7,7 @@ add_subdirectory(acmstrdec)
 add_subdirectory(acmstrenc)
 add_subdirectory(libCMBPrint)
 add_subdirectory(libRestfulFunc)
+add_subdirectory(libimageproc)
 
 if(MSVC)
    add_subdirectory(win)

+ 28 - 0
Other/unix/libimageproc/CMakeLists.txt → Other/libimageproc/CMakeLists.txt

@@ -25,6 +25,7 @@ target_include_directories(${MODULE_NAME} PRIVATE
 target_compile_definitions(${MODULE_NAME} PUBLIC "LIBIMAGEPROC_EXPORTS")
 
 if(RVC_DEBUG_MODE)
+	#todo
     set(OPENCV_DYNAMIC_LIBS 
 	opencv_calib3d 
 	opencv_core 
@@ -41,6 +42,25 @@ if(RVC_DEBUG_MODE)
 	opencv_videostab
 	)
 else()
+
+if(MSVC)
+
+    set(OPENCV_DYNAMIC_LIBS
+	opencv_calib3d310 
+	opencv_core310 
+	opencv_features2d310 
+	opencv_flann310 
+	opencv_highgui310 
+	opencv_imgcodecs310 
+	opencv_imgproc310 
+	opencv_ml310 
+	opencv_objdetect310 
+	opencv_photo310 
+	opencv_video310 
+	opencv_videoio310 
+	opencv_videostab310
+	)
+else()
     set(OPENCV_DYNAMIC_LIBS
 	opencv_calib3d 
 	opencv_core 
@@ -56,9 +76,17 @@ else()
 	opencv_videoio 
 	opencv_videostab
 	)
+endif(MSVC)
+
 endif(RVC_DEBUG_MODE)
+
+
 # 添加需要依赖的其他共享库(包括系统库)
+if(MSVC)
+target_link_directories(${MODULE_NAME} PRIVATE ${CONAN_LIB_DIRS_OPENCV})
+else()
 target_link_directories(${MODULE_NAME} PRIVATE ${CONAN_BIN_DIRS_OPENCV})
+endif(MSVC)
 target_link_libraries(${MODULE_NAME} ${OPENCV_DYNAMIC_LIBS})
 
 if(MSVC)

+ 0 - 0
Other/unix/libimageproc/ReadMe.txt → Other/libimageproc/ReadMe.txt


+ 0 - 0
Other/unix/libimageproc/bk.bmp → Other/libimageproc/bk.bmp


+ 3 - 0
Other/libimageproc/dllmain.cpp

@@ -0,0 +1,3 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+

+ 36 - 1
Other/unix/libimageproc/libimageproc.cpp → Other/libimageproc/libimageproc.cpp

@@ -6,11 +6,29 @@
 #include "highgui.h"
 #include "cv.h"
 #include "resource.h"
-
+#if defined(_MSC_VER)
+#include "atlcore.h"
+static HINSTANCE g_module = NULL;
+#endif //_MSC_VER
 
 LIBIMAGEPROC_API bool imageprocess(char* BackImgPath, char* FrontImgPath, char* ResultImgPath)
 {
+#if defined(_MSC_VER)
+	IplImage* pBK = cvCreateImage(cvSize(324, 202), IPL_DEPTH_8U, 3);
+	HBITMAP hBitmap = (HBITMAP)LoadImageA(g_module,
+		MAKEINTRESOURCEA(IDB_BK),
+		IMAGE_BITMAP,
+		0,
+		0,
+		LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
+	if (hBitmap) {
+		LONG cb = 324 * 202 * 3;
+		GetBitmapBits(hBitmap, cb, pBK->imageData);
+		DeleteObject(hBitmap);
+	}
+#else
 	IplImage* pBK = cvLoadImage(BackImgPath, 1);
+#endif //_MSC_VER
 	
 	IplImage* pfront = cvLoadImage(FrontImgPath, 1);
 	if (pBK == NULL || pfront == NULL)
@@ -44,3 +62,20 @@ LIBIMAGEPROC_API bool imageprocess(char* BackImgPath, char* FrontImgPath, char*
 	return true;
 }
 
+#if defined(_MSC_VER)
+BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
+{
+	switch (ul_reason_for_call) {
+	case DLL_PROCESS_ATTACH:
+		g_module = hModule;
+		DisableThreadLibraryCalls(hModule);
+		break;
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+
+	return TRUE;
+}
+#endif //_MSC_VER

+ 0 - 0
Other/unix/libimageproc/libimageproc.h → Other/libimageproc/libimageproc.h


+ 0 - 0
Other/unix/libimageproc/resource.h → Other/libimageproc/resource.h


+ 0 - 0
Other/unix/libimageproc/stdafx.cpp → Other/libimageproc/stdafx.cpp


+ 5 - 5
Other/unix/libimageproc/stdafx.h → Other/libimageproc/stdafx.h

@@ -6,11 +6,11 @@
 #pragma once
 
 #include "targetver.h"
-
+#if defined(_MSC_VER)
+#ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
-// Windows 头文件:
-//#include <windows.h>
-
-
+#endif //WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif //_MSC_VER
 
 // TODO: 在此处引用程序需要的其他头文件

+ 3 - 1
Other/unix/libimageproc/targetver.h → Other/libimageproc/targetver.h

@@ -5,4 +5,6 @@
 // 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
 // WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
 
-//#include <SDKDDKVer.h>
+#if defined(_MSC_VER)
+#include <SDKDDKVer.h>
+#endif //_MSC_VER

+ 0 - 1
Other/unix/CMakeLists.txt

@@ -2,7 +2,6 @@ if(SIMULATE_ON)
 	rvc_set_library_output_dir("${RVC_INSTALL_PREFIX}${RVC_RUNTIME_PATH}")
 endif(SIMULATE_ON)
 
-add_subdirectory(libimageproc)
 add_subdirectory(libscreencodec)
 add_subdirectory(libbizchan)
 

+ 0 - 24
Other/unix/libimageproc/dllmain.cpp

@@ -1,24 +0,0 @@
-// dllmain.cpp : 定义 DLL 应用程序的入口点。
-#include "stdafx.h"
-
-#if defined (_WIN32)
-#include "atlcore.h"
-static HINSTANCE g_module = NULL;
-
-BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
-{
-	switch (ul_reason_for_call)
-	{
-	case DLL_PROCESS_ATTACH:
-		g_module = hModule;
-		DisableThreadLibraryCalls(hModule);
-		break;
-	case DLL_THREAD_ATTACH:
-	case DLL_THREAD_DETACH:
-	case DLL_PROCESS_DETACH:
-		break;
-	}
-
-	return TRUE;
-}
-#endif