#ifndef HYPERPR_PLATESEGMENTATION_H #define HYPERPR_PLATESEGMENTATION_H #include "PlateInfo.h" #include "opencv2/opencv.hpp" #include namespace pr { class PlateSegmentation { public: const int PLATE_NORMAL = 6; const int PLATE_NORMAL_GREEN = 7; const int DEFAULT_WIDTH = 20; PlateSegmentation(std::string phototxt, std::string caffemodel); PlateSegmentation() {} void segmentPlatePipline(PlateInfo &plateInfo, int stride, std::vector &Char_rects); void segmentPlateBySlidingWindows(cv::Mat &plateImage, int windowsWidth, int stride, cv::Mat &respones); void templateMatchFinding(const cv::Mat &respones, int windowsWidth, std::pair> &candidatePts); void refineRegion(cv::Mat &plateImage, const std::vector &candidatePts, const int padding, std::vector &rects); void ExtractRegions(PlateInfo &plateInfo, std::vector &rects); cv::Mat classifyResponse(const cv::Mat &cropped); private: cv::dnn::Net net; }; } // namespace pr #endif // HYPERPR_PLATESEGMENTATION_H