fork download
  1. #include <iostream>
  2. #include <windows.h>
  3. #include "opencv2\opencv.hpp"
  4.  
  5. using namespace std;
  6.  
  7. typedef double (*ptr_DLL_Add)(double,double);
  8. typedef cv::Mat (*ptr_DLL_threshold)(cv::Mat);
  9. typedef void (*ptr_DLL_showPic)(cv::Mat src);
  10.  
  11. typedef void (*test)(uchar* p, int x, int y);
  12.  
  13. HINSTANCE hinstDLL;
  14.  
  15. int main()
  16. {
  17. ptr_DLL_Add add_(0);
  18. ptr_DLL_threshold thre(0);
  19. ptr_DLL_showPic show(0);
  20.  
  21. hinstDLL = LoadLibrary("dll_pack.dll");
  22.  
  23. // if(hinstDLL != 0)
  24. // {
  25. // add_ = (ptr_DLL_Add)GetProcAddress(hinstDLL, "DLL_Add");
  26. // thre = (ptr_DLL_threshold)GetProcAddress(hinstDLL, "DLL_threshold");
  27. // show = (ptr_DLL_showPic)GetProcAddress(hinstDLL, "DLL_showPic");
  28. //
  29. // cout<<add_(3.4,0.2)<<endl;
  30. //
  31. // show(cv::imread("20100812133.jpg", 0 ));
  32. //
  33. // cv::imshow("aaa",thre(cv::imread("20100812133.jpg", 0 )));
  34. // cv::waitKey();
  35. //
  36. // FreeLibrary(hinstDLL);
  37. // }
  38.  
  39.  
  40. test tt(0);
  41. tt = (test)GetProcAddress(hinstDLL, "test");
  42.  
  43. cv::Mat asd=cv::imread("20100812133.jpg", 0 );
  44.  
  45. tt(asd.data,asd.cols,asd.rows);
  46.  
  47. return 0;
  48. }
  49.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty