You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Pipeline.h 1.9 kB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // Created by Jack Yu on 22/10/2017.
  3. //
  4. #ifndef HYPERPR_PIPLINE_H
  5. #define HYPERPR_PIPLINE_H
  6. #include "CNNRecognizer.h"
  7. #include "FastDeskew.h"
  8. #include "FineMapping.h"
  9. #include "PlateDetection.h"
  10. #include "PlateInfo.h"
  11. #include "PlateSegmentation.h"
  12. #include "Recognizer.h"
  13. #include "SegmentationFreeRecognizer.h"
  14. namespace pr {
  15. const std::vector<std::string> CH_PLATE_CODE{
  16. "京", "沪", "津", "渝", "冀", "晋", "蒙", "辽", "吉", "黑", "苏", "浙",
  17. "皖", "闽", "赣", "鲁", "豫", "鄂", "湘", "粤", "桂", "琼", "川", "贵",
  18. "云", "藏", "陕", "甘", "青", "宁", "新", "0", "1", "2", "3", "4",
  19. "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G",
  20. "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U",
  21. "V", "W", "X", "Y", "Z", "港", "学", "使", "警", "澳", "挂", "军",
  22. "北", "南", "广", "沈", "兰", "成", "济", "海", "民", "航", "空"};
  23. const int SEGMENTATION_FREE_METHOD = 0;
  24. const int SEGMENTATION_BASED_METHOD = 1;
  25. class PipelinePR {
  26. public:
  27. GeneralRecognizer *generalRecognizer;
  28. PlateDetection *plateDetection;
  29. PlateSegmentation *plateSegmentation;
  30. FineMapping *fineMapping;
  31. SegmentationFreeRecognizer *segmentationFreeRecognizer;
  32. PipelinePR(std::string detector_filename, std::string finemapping_prototxt,
  33. std::string finemapping_caffemodel,
  34. std::string segmentation_prototxt,
  35. std::string segmentation_caffemodel,
  36. std::string charRecognization_proto,
  37. std::string charRecognization_caffemodel,
  38. std::string segmentationfree_proto,
  39. std::string segmentationfree_caffemodel);
  40. ~PipelinePR();
  41. std::vector<std::string> plateRes;
  42. std::vector<PlateInfo> RunPiplineAsImage(cv::Mat plateImage, int method);
  43. };
  44. } // namespace pr
  45. #endif // HYPERPR_PIPLINE_H