资源简介
在开源的车牌识别系统EasyPR中,用SVM(支持向量机)模型甄选出候选车牌中真正的车牌。目前EasyPR1.4的SVM模型输入的是LBP特征,本代码将EasyPR的svm_train.cpp独立出来,包含SIFT和SURF结合BOW作为SVM输入,以及LBP和HOG特征作为SVM的输入。
代码片段和文件信息
#include “opencv2/opencv_modules.hpp“
#include “opencv2/imgcodecs.hpp“
#include “opencv2/highgui.hpp“
#include “opencv2/imgproc.hpp“
#include “opencv2/features2d.hpp“
#include “opencv2/xfeatures2d.hpp“
#include “opencv2/ml.hpp“
#include “util.h“
#include “BagOfWords.h“
#include
#include
#include
#include
#if defined WIN32 || defined _WIN32
#define WIN32_LEAN_AND_MEAN
#include
#undef min
#undef max
#include “sys/types.h“
#endif
#include
#define DEBUG_DESC_PROGRESS
using namespace cv;
using namespace cv::xfeatures2d;
using namespace cv::ml;
using namespace std;
extern string resPath;
const string paramsFile = “params.xml“;
const string vocabularyFile = “vocabulary.xml.gz“;
const string bowImageDescriptorsDir = “/bowImageDescriptors“;
const string svmsDir = “/svms“;
//const string plotsDir = “/plots“;
class ObdImage
{
public:
ObdImage(string p_id string p_path) : id(p_id) path(p_path) {}
string id;
string path;
};
//
// This part of the code was a little refactor
//
struct DDMParams
{
DDMParams() : detectorType(“SURF“) descriptorType(“SURF“) matcherType(“BruteForce“) {}
DDMParams(const string _detectorType const string _descriptorType const string& _matcherType) :
detectorType(_detectorType) descriptorType(_descriptorType) matcherType(_matcherType){}
void read(const FileNode& fn)
{
fn[“detectorType“] >> detectorType;
fn[“descriptorType“] >> descriptorType;
fn[“matcherType“] >> matcherType;
}
void write(FileStorage& fs) const
{
fs << “detectorType“ << detectorType;
fs << “descriptorType“ << descriptorType;
fs << “matcherType“ << matcherType;
}
void print() const
{
cout << “detectorType: “ << detectorType << endl;
cout << “descriptorType: “ << descriptorType << endl;
cout << “matcherType: “ << matcherType << endl;
}
string detectorType;
string descriptorType;
string matcherType;
};
struct VocabTrainParams
{
VocabTrainParams() : vocabSize(1000) memoryUse(200) descProportion(0.3f) {}
VocabTrainParams(const string _trainObjClass size_t _vocabSize size_t _memoryUse float _descProportion) :
vocabSize((int)_vocabSize) memoryUse((int)_memoryUse) descProportion(_descProportion) {}
void read(const FileNode& fn)
{
fn[“vocabSize“] >> vocabSize;
fn[“memoryUse“] >> memoryUse;
fn[“descProportion“] >> descProportion;
}
void write(FileStorage& fs) const
{
fs << “vocabSize“ << vocabSize;
fs << “memoryUse“ << memoryUse;
fs << “descProportion“ << descProportion;
}
void print() const
{
cout << “vocabSize: “ << vocabSize << endl;
cout << “memoryUse: “ << memoryUse << endl;
cout << “descProportion: “ << descProportion << endl;
}
// It shouldn‘t matter which object class is specified here - visual vocab will still be the same.
int vocabSize; //number of visual words in vocabulary to train
int memoryUse; //
相关资源
- HOG+Adaboost级联分类器训练代码
- 基于SIFT算法的特征提取(VS2015+OpenC
- VS2013+OPENCV2.4.10 提取HOG特征使用SVM多分
- hog+svm行人检测分类器训练
- SIFT+RANSAC识别物体,并标注边界
- Hog特征提取 源码(免费)
- NavneetDalal关于HOG行人识别的博士论文
- siftgpu调试之后的版本,经测试可以直
- 基于SIFT的目标跟踪源码
- HOG+SVM的行人图片和视频检测码源及所
- 特征描述子surf,hog,光流
- sift_vs 源代码
- HOG测试程序
- hog+svm负样本处理
- lbp特征提取代码
- 基于PCA-HOG的人体检测代码-包括训练,
- SIFT特征点匹配代码
- SVM+LBP 人脸检测
- 基于SIFT特征的全景图像拼接(Qt)
- OPENCV实现ORB/SURF/SIFT + RANSAC 图像自动拼
- 68人脸特征点Hog+SVM人脸表情识别
- SIFT特征提取3篇最经典文献
- 行人数据库正样本
- Linux后台开发工具箱-葵花宝典.pdf
- 毕业设计-基于pca和lbp的人脸识别算法
- sift算法fpga实现
- SIFT算法实现及代码详解
- 基于HOG和LBP的行人检测代码
- 论文研究-Demagnification super-lens with g
- lbp2900 win7 驱动
评论
共有 条评论