移除不必要的build文件
This commit is contained in:
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+18
-18
@@ -17,9 +17,9 @@
|
||||
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","港","学","使","警","澳","挂","军","北","南","广","沈","兰","成","济","海","民","航","空"};
|
||||
"琼", "川", "贵", "云", "藏", "陕", "甘", "青", "宁", "新", "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","港","学","使","警","澳","挂","军","北","南","广","沈","兰","成","济","海","民","航","空"};
|
||||
|
||||
|
||||
|
||||
@@ -27,25 +27,25 @@ namespace pr{
|
||||
const int SEGMENTATION_BASED_METHOD = 1;
|
||||
|
||||
class PipelinePR{
|
||||
public:
|
||||
GeneralRecognizer *generalRecognizer;
|
||||
PlateDetection *plateDetection;
|
||||
PlateSegmentation *plateSegmentation;
|
||||
FineMapping *fineMapping;
|
||||
SegmentationFreeRecognizer *segmentationFreeRecognizer;
|
||||
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();
|
||||
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);
|
||||
std::vector<std::string> plateRes;
|
||||
std::vector<PlateInfo> RunPiplineAsImage(cv::Mat plateImage,int method);
|
||||
|
||||
|
||||
|
||||
|
||||
Regular → Executable
+3
-2
@@ -6,8 +6,9 @@
|
||||
#define SWIFTPR_PLATEDETECTION_H
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <PlateInfo.h>
|
||||
#include <vector>
|
||||
#include "PlateInfo.h"
|
||||
|
||||
namespace pr{
|
||||
class PlateDetection{
|
||||
public:
|
||||
@@ -22,7 +23,7 @@ namespace pr{
|
||||
|
||||
|
||||
|
||||
private:
|
||||
public:
|
||||
cv::CascadeClassifier cascade;
|
||||
|
||||
|
||||
|
||||
Regular → Executable
Regular → Executable
+1
-1
@@ -6,7 +6,7 @@
|
||||
#define SWIFTPR_PLATESEGMENTATION_H
|
||||
|
||||
#include "opencv2/opencv.hpp"
|
||||
#include <opencv2/dnn.hpp>
|
||||
#include "opencv2/dnn.hpp"
|
||||
#include "PlateInfo.h"
|
||||
|
||||
namespace pr{
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
@@ -49,10 +49,8 @@ Java_pr_platerecognization_PlateRecognition_InitPlateRecognizer(
|
||||
|
||||
pr::PipelinePR *PR = new pr::PipelinePR(detector_path,
|
||||
finemapping_prototxt_path, finemapping_caffemodel_path,
|
||||
segmentation_prototxt_path,
|
||||
segmentation_caffemodel_path,
|
||||
charRecognization_proto_path,
|
||||
charRecognization_caffemodel_path);
|
||||
segmentation_prototxt_path, segmentation_caffemodel_path,
|
||||
charRecognization_proto_path, charRecognization_caffemodel_path);
|
||||
|
||||
return (jlong) PR;
|
||||
}
|
||||
@@ -65,10 +63,14 @@ Java_pr_platerecognization_PlateRecognition_SimpleRecognization(
|
||||
pr::PipelinePR *PR = (pr::PipelinePR *) object_pr;
|
||||
cv::Mat &mRgb = *(cv::Mat *) matPtr;
|
||||
cv::Mat rgb;
|
||||
// cv::cvtColor(mRgb,rgb,cv::COLOR_RGBA2GRAY);
|
||||
cv::cvtColor(mRgb,rgb,cv::COLOR_RGBA2BGR);
|
||||
cv::imwrite("/sdcard/demo.jpg",rgb);
|
||||
|
||||
std::vector<pr::PlateInfo> list_res= PR->RunPiplineAsImage(rgb);
|
||||
// cv::imwrite("/sdcard/demo.jpg",rgb);
|
||||
|
||||
//1表示SEGMENTATION_BASED_METHOD在方法里有说明
|
||||
std::vector<pr::PlateInfo> list_res= PR->RunPiplineAsImage(rgb,1);
|
||||
// std::vector<pr::PlateInfo> list_res= PR->RunPiplineAsImage(rgb,1);
|
||||
std::string concat_results;
|
||||
for(auto one:list_res)
|
||||
{
|
||||
@@ -80,13 +82,14 @@ Java_pr_platerecognization_PlateRecognition_SimpleRecognization(
|
||||
return env->NewStringUTF(concat_results.c_str());
|
||||
|
||||
}
|
||||
JNIEXPORT jstring JNICALL
|
||||
JNIEXPORT void JNICALL
|
||||
Java_pr_platerecognization_PlateRecognition_ReleasePlateRecognizer(
|
||||
JNIEnv *env, jobject obj,
|
||||
jlong object_re) {
|
||||
// std::string hello = "Hello from C++";
|
||||
pr::PipelinePR *PR = (pr::PipelinePR *) object_re;
|
||||
delete PR;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,13 @@
|
||||
|
||||
|
||||
|
||||
#include <../include/FastDeskew.h>
|
||||
#include "../include/FastDeskew.h"
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <opencv2/core/types.hpp>
|
||||
#include <opencv2/core/mat.hpp>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <opencv2/opencv.hpp>
|
||||
|
||||
namespace pr{
|
||||
|
||||
@@ -67,7 +73,7 @@ namespace pr{
|
||||
|
||||
cv::Size size(skewPlate.cols + extend_padding ,skewPlate.rows);
|
||||
|
||||
float interval = abs(sin((angle /180) * 3.14)* skewPlate.rows);
|
||||
float interval = std::abs(sin((angle /180) * 3.14)* skewPlate.rows);
|
||||
// std::cout<<interval<<std::endl;
|
||||
|
||||
cv::Point2f pts1[4] = {cv::Point2f(0,0),cv::Point2f(0,size_o.height),cv::Point2f(size_o.width,0),cv::Point2f(size_o.width,size_o.height)};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Created by 庾金科 on 22/09/2017.
|
||||
//
|
||||
|
||||
#include "FineMapping.h"
|
||||
#include "../include/FineMapping.h"
|
||||
namespace pr{
|
||||
|
||||
const int FINEMAPPING_H = 60 ;
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace pr {
|
||||
PipelinePR::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) {
|
||||
std::string charRecognization_proto, std::string charRecognization_caffemodel){
|
||||
// std::string segmentationfree_proto,std::string segmentationfree_caffemodel) {
|
||||
plateDetection = new PlateDetection(detector_filename);
|
||||
fineMapping = new FineMapping(finemapping_prototxt, finemapping_caffemodel);
|
||||
plateSegmentation = new PlateSegmentation(segmentation_prototxt, segmentation_caffemodel);
|
||||
generalRecognizer = new CNNRecognizer(charRecognization_proto, charRecognization_caffemodel);
|
||||
segmentationFreeRecognizer = new SegmentationFreeRecognizer(segmentationfree_proto,segmentationfree_caffemodel);
|
||||
// segmentationFreeRecognizer = new SegmentationFreeRecognizer(segmentationfree_proto,segmentationfree_caffemodel);
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace pr {
|
||||
delete fineMapping;
|
||||
delete plateSegmentation;
|
||||
delete generalRecognizer;
|
||||
delete segmentationFreeRecognizer;
|
||||
// delete segmentationFreeRecognizer;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,9 +16,10 @@ namespace pr{
|
||||
|
||||
void PlateDetection::plateDetectionRough(cv::Mat InputImage,std::vector<pr::PlateInfo> &plateInfos,int min_w,int max_w){
|
||||
|
||||
cv::Mat processImage;
|
||||
cv::Mat processImage(InputImage);
|
||||
// cv::Mat processImage;
|
||||
|
||||
cv::cvtColor(InputImage,processImage,cv::COLOR_BGR2GRAY);
|
||||
// cv::cvtColor(InputImage,processImage,cv::COLOR_BGR2GRAY);
|
||||
|
||||
|
||||
std::vector<cv::Rect> platesRegions;
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace pr{
|
||||
int w = candidatePts[5] - candidatePts[4];
|
||||
int cols = plateImage.cols;
|
||||
int rows = plateImage.rows;
|
||||
for(int i = 0 ; i < candidatePts.size() ; i++)
|
||||
for(int i = 0; i < candidatePts.size() ; i++)
|
||||
{
|
||||
int left = 0;
|
||||
int right = 0 ;
|
||||
@@ -84,8 +84,9 @@ namespace pr{
|
||||
|
||||
computeSafeMargin(right,cols);
|
||||
computeSafeMargin(left,cols);
|
||||
cv::Rect roi(left,0,right - left,rows-1);
|
||||
cv::Mat roiImage;
|
||||
// plateImage.copyTo(roiImage);
|
||||
cv::Rect roi(left,0,right-left,rows-1);
|
||||
plateImage(roi).copyTo(roiImage);
|
||||
|
||||
if (i>=1)
|
||||
@@ -191,7 +192,8 @@ namespace pr{
|
||||
|
||||
}
|
||||
|
||||
delete filterd;
|
||||
delete[] filterd;
|
||||
// delete filterd;
|
||||
}
|
||||
|
||||
void PlateSegmentation::templateMatchFinding(const cv::Mat &respones,int windowsWidth,std::pair<float,std::vector<int>> &candidatePts){
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace pr {
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::string decodeResults(cv::Mat code_table,std::vector<std::string> mapping_table)
|
||||
{
|
||||
cv::MatSize mtsize = code_table.size;
|
||||
|
||||
Regular → Executable
Reference in New Issue
Block a user