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 2.1 kB

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