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

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