recdetect.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // recdetect.h
  3. // recdetect
  4. //
  5. // Created by fujikoli(李鑫) on 2017/9/15.
  6. // Copyright © 2017年 fujikoli(李鑫). All rights reserved.
  7. //
  8. // 远程身份认证iOS端SDK
  9. // v1.4.0
  10. //
  11. #ifndef recdetect_h
  12. #define recdetect_h
  13. #include <opencv2/imgproc.hpp>
  14. #include <opencv2/core.hpp>
  15. /**
  16. * 清晰度检测
  17. * @param imgSrc 输入图像
  18. * @return 返回清晰度程度,值越大图像越清晰
  19. */
  20. double blurDetect(cv::Mat& imgSrc);
  21. /**
  22. * 身份证边缘检测
  23. * @param imgSrc 输入图像
  24. * @param corners 检测出的身份证的四个顶点,顺时针排序,未检出size为0
  25. * @param roiRect ROI区域
  26. * @param threshold1 身份证长宽比低阈值
  27. * @param threshold2 身份证长宽比高阈值
  28. */
  29. void IDCardDetect(cv::Mat& imgSrc, std::vector<cv::Point>& corners, cv::Rect& roiRect, double threshold1, double threshold2);
  30. /**
  31. * 银行卡边缘检测
  32. * @param imgSrc 输入图像
  33. * @param corners 检测出的银行卡的四个顶点,顺时针排序,未检出size为0
  34. * @param roiRect ROI区域
  35. * @param threshold1 长边与短边的比的低阈值,低于该阈值的矩形在内部逻辑中被过滤
  36. * @param threshold2 长边与短边的比的高阈值,高于该阈值的矩形在内部逻辑中被过滤
  37. */
  38. void BankCardDetect(cv::Mat& imgSrc, std::vector<cv::Point>& corners, cv::Rect& roiRect, double threshold1, double threshold2);
  39. /**
  40. * 角度检测
  41. * @param corners 输入检测出的四个顶点
  42. * @return 返回四个点连线形成的不规则四边形面积与包围四个点的最小外接矩形的比值
  43. */
  44. double distortionDetect(std::vector<cv::Point> corners);
  45. /**
  46. * 版本
  47. * @return 版本号
  48. */
  49. std::string Version();
  50. #endif /* recdetect_h */