cv.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 {0}_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // {0}_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #ifdef CV_EXPORTS
  8. #define CV_API __declspec(dllexport)
  9. #else
  10. #define CV_API __declspec(dllimport)
  11. #endif
  12. // 此类是从 dll 导出的
  13. class CV_API Ccv {
  14. public:
  15. Ccv(void);
  16. // TODO: 在此处添加方法。
  17. };
  18. extern CV_API int ncv;
  19. CV_API int fncv(void);
  20. // 1、读取图片;
  21. CV_API bool ReadImage(std::string strImgPath, cv::Mat& img);
  22. // 2、获取图片全局二值化轮廓图像结果
  23. CV_API bool GetBinaryImage(std::string strImgPath, long nThresholdVal, long nMaxThresholdVal, cv::Mat & thresholdImg);
  24. // 3、获取图片OTSU二值化轮廓图像结果
  25. CV_API bool GetOTSUBinaryImage(std::string strImgPath, long nThresholdVal, long nMaxThresholdVal, cv::Mat& thresholdImg);
  26. // 4、获取图片自适应二值化轮廓图像结果
  27. CV_API bool GetAdaptiveBinaryImage(std::string strImgPath, long nMaxThresholdVal, cv::Mat& thresholdImg);
  28. // 5、图片高斯模糊处理,cv::Size一般为(3,3)或(5,5)
  29. CV_API bool GaussianBlur(cv::Mat& img, cv::Size cvSize, cv::Mat& gaussImg);
  30. CV_API bool GaussianBlur(std::string strImgPath, cv::Size cvSize, cv::Mat& gaussImg);
  31. // 6、图片转灰阶处理(BGR三通道转单通道)
  32. CV_API bool Color2Gray(cv::Mat& img, cv::Mat& grayImg);
  33. CV_API bool Color2Gray(std::string strImgPath, cv::Mat& grayImg);
  34. // 7、灰阶图转BGR处理(单通道转BGR三通道)
  35. CV_API bool Gray2Color(cv::Mat& img, cv::Mat& colorImg);
  36. // 8、对图片腐蚀处理
  37. CV_API bool ErodeImg(cv::Mat& img, cv::MorphShapes kernelShape, cv::Size kernelSize, cv::Mat& erodeImg);
  38. // 9、对图片膨胀处理
  39. CV_API bool DilateImg(cv::Mat& img, cv::MorphShapes kernelShape, cv::Size kernelSize, cv::Mat& dilateImg);
  40. //8、获取图片指定RGB颜色域的轮廓图像结果
  41. //9、裁剪图片指定区域
  42. //10、单个模板图片匹配
  43. //11、多个模板图片匹配
  44. //12、获取图片的LUV平均值
  45. //13、输出图片二值化轮廓填充图像结果
  46. //14、两图片相似度比较