資源簡介
HyperLPR帶UI界面的工程(cpp文件)
代碼片段和文件信息
//
//?Created?by?庾金科?on?21/10/2017.
//
#include?“stdafx.h“
#include?“CNNRecognizer.h“
namespace?pr{
????CNNRecognizer::CNNRecognizer(std::string?prototxtstd::string?caffemodel){
????????net?=?cv::dnn::readNetFromCaffe(prototxt?caffemodel);
????}
????label?CNNRecognizer::recognizeCharacter(cv::Mat?charImage){
????????if(charImage.channels()==?3)
????????????cv::cvtColor(charImagecharImagecv::COLOR_BGR2GRAY);
????????cv::Mat?inputBlob?=?cv::dnn::blobFromImage(charImage?1/255.0?cv::Size(CHAR_INPUT_WCHAR_INPUT_H)?cv::Scalar(000)false);
????????net.setInput(inputBlob“data“);
????????return?net.forward();
????}
}
- 上一篇:新編MCS-51單片機應用設計
- 下一篇:Linux C編程一站式學習
評論
共有 條評論