1.1K Star 3K Fork 1.2K

GVPliuruoze / EasyPR

函数有模型参数,但是好像没用到

Backlog
lidanger  Opened this issue

api.hpp 15行

static bool plate_judge(const char* image, const char* model) {
		cv::Mat src = cv::imread(image);

		assert(!src.empty());

		int result;
		PlateJudge::instance()->plateJudge(src, result);

		return result == 1;
	}

api.hpp 40行

static std::vector<std::string> plate_recognize(const char* image,
		const char* model_svm,
		const char* model_ann,
		const bool life_mode = true) {
		cv::Mat img = cv::imread(image);

		assert(!img.empty());

		CPlateRecognize pr;
		pr.setLifemode(life_mode);
		pr.setDebug(false);

		std::vector<std::string> results;
		pr.plateRecognize(img, results);

		return std::move(results);
	}
423361 lidanger 1578923382 total 1 participants

Comments (1)

423361 lidanger 1578923382
lidanger 2016-01-09 10:59

搞了半天发现根本就没有设置模型的位置,私有成员暂时还没有开放

class PlateJudge {
public:
	static PlateJudge* instance();

	//! 对多幅车牌进行SVM判断
	int plateJudge(const std::vector<CPlate>&, std::vector<CPlate>&);

	//! 车牌判断
	int plateJudge(const std::vector<Mat>&, std::vector<Mat>&);

	//! 车牌判断(一副图像)
	int plateJudge(const Mat& inMat, int& result);

private:
	PlateJudge();

	static PlateJudge* instance_;

	cv::Ptr<ml::SVM> svm_;
};

实现文件:

PlateJudge::PlateJudge() { svm_ = ml::SVM::load<ml::SVM>(kDefaultSvmPath); }

字符识别类似。都是使用了静态实例,防止模型被反复加载,不过感觉还是应该开放模型重新设置的功能。

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
C++
1
https://git.oschina.net/easypr/EasyPR.git
git@git.oschina.net:easypr/EasyPR.git
easypr
EasyPR
EasyPR

Search