8 net = cv::dnn::readNetFromTensorflow(modelPath);
29 cv::Mat roi = scene.
frame(cv::Range(y, y+height), cv::Range(x, x+width));
33 cv::dnn::blobFromImage(small, blob, (1.0 / 255.0));
43 if(scene.
frame.empty())
return scene;
46 cv::Mat prob =
net.forward();
47 cv::Point classIdPoint;
49 minMaxLoc(prob.reshape(1, 1), 0, &confidence, 0, &classIdPoint);
50 int classId = classIdPoint.x;
51 scene.
result = SignapseUtils::getLetterFromDigit(classId);
CNNProcessor(CNNProcessorSettings s)
void LoadModel(std::string modelPath)
Scene ProcessScene(Scene s)
CNNProcessorSettings settings
cv::Mat MakeBlob(Scene scene)
std::string result
Member variable.
cv::Mat frame
Member variable.
BoundingBox regionOfInterest
Member variable.