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.

43 lines
1.3 KiB
C++

//
// Created by 庾金科 on 16/10/2017.
//
#include "../include/PlateSegmentation.h"
#include "../include/CNNRecognizer.h"
#include "../include/Recognizer.h"
std::vector<std::string> chars{"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"};
void TEST_SLIDINGWINDOWS_EVAL(){
cv::Mat demo = cv::imread("res/cache/finemappingres.png");
cv::resize(demo,demo,cv::Size(136,36));
cv::Mat respones;
pr::PlateSegmentation plateSegmentation("model/Segmentation.prototxt","model/Segmentation.caffemodel");
pr::PlateInfo plate;
plate.setPlateImage(demo);
std::vector<cv::Rect> rects;
plateSegmentation.segmentPlatePipline(plate,1,rects);
plateSegmentation.ExtractRegions(plate,rects);
pr::GeneralRecognizer *recognizer = new pr::CNNRecognizer("model/CharacterRecognization.prototxt","model/CharacterRecognization.caffemodel");
recognizer->SegmentBasedSequenceRecognition(plate);
std::cout<<plate.decodePlateNormal(chars)<<std::endl;
delete(recognizer);
}
int main(){
TEST_SLIDINGWINDOWS_EVAL();
return 0;
}