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

55 lines
1.8 KiB
C++

//
// Created by Jack Yu on 22/10/2017.
//
#ifndef HYPERPR_PIPLINE_H
#define HYPERPR_PIPLINE_H
#include "CNNRecognizer.h"
#include "FastDeskew.h"
#include "FineMapping.h"
#include "PlateDetection.h"
#include "PlateInfo.h"
#include "PlateSegmentation.h"
#include "Recognizer.h"
#include "SegmentationFreeRecognizer.h"
namespace pr {
const std::vector<std::string> CH_PLATE_CODE{
"", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "0", "1", "2", "3", "4",
"5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G",
"H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U",
"V", "W", "X", "Y", "Z", "", "", "使", "", "", "", "",
"", "", "广", "", "", "", "", "", "", "", ""};
const int SEGMENTATION_FREE_METHOD = 0;
const int SEGMENTATION_BASED_METHOD = 1;
class PipelinePR {
public:
GeneralRecognizer *generalRecognizer;
PlateDetection *plateDetection;
PlateSegmentation *plateSegmentation;
FineMapping *fineMapping;
SegmentationFreeRecognizer *segmentationFreeRecognizer;
PipelinePR(std::string detector_filename, std::string finemapping_prototxt,
std::string finemapping_caffemodel,
std::string segmentation_prototxt,
std::string segmentation_caffemodel,
std::string charRecognization_proto,
std::string charRecognization_caffemodel,
std::string segmentationfree_proto,
std::string segmentationfree_caffemodel);
~PipelinePR();
std::vector<std::string> plateRes;
std::vector<PlateInfo> RunPiplineAsImage(cv::Mat plateImage, int method);
};
} // namespace pr
#endif // HYPERPR_PIPLINE_H