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.

PlateSegmentation.h 1.2 kB

7 years ago
123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // Created by 庾金科 on 16/10/2017.
  3. //
  4. #ifndef SWIFTPR_PLATESEGMENTATION_H
  5. #define SWIFTPR_PLATESEGMENTATION_H
  6. #include "opencv2/opencv.hpp"
  7. #include <opencv2/dnn.hpp>
  8. #include "PlateInfo.h"
  9. namespace pr{
  10. class PlateSegmentation{
  11. public:
  12. const int PLATE_NORMAL = 6;
  13. const int PLATE_NORMAL_GREEN = 7;
  14. const int DEFAULT_WIDTH = 20;
  15. PlateSegmentation(std::string phototxt,std::string caffemodel);
  16. PlateSegmentation(){}
  17. void segmentPlatePipline(PlateInfo &plateInfo,int stride,std::vector<cv::Rect> &Char_rects);
  18. void segmentPlateBySlidingWindows(cv::Mat &plateImage,int windowsWidth,int stride,cv::Mat &respones);
  19. void templateMatchFinding(const cv::Mat &respones,int windowsWidth,std::pair<float,std::vector<int>> &candidatePts);
  20. void refineRegion(cv::Mat &plateImage,const std::vector<int> &candidatePts,const int padding,std::vector<cv::Rect> &rects);
  21. void ExtractRegions(PlateInfo &plateInfo,std::vector<cv::Rect> &rects);
  22. cv::Mat classifyResponse(const cv::Mat &cropped);
  23. private:
  24. cv::dnn::Net net;
  25. // RefineRegion()
  26. };
  27. }//namespace pr
  28. #endif //SWIFTPR_PLATESEGMENTATION_H