简体   繁体   English

使用C++ opencv-openvino dnn调用openvino提供的license-plate-recognition-barrier识别车牌

[英]Use C++ opencv-openvino dnn to call the license-plate-recognition-barrier provided by openvino to recognize the license plate

Use C++ opencv dnn to call the license-plate-recognition-barrier provided by openvino to recognize the license plate.使用C++ opencv dnn调用openvino提供的license-plate-recognition-barrier识别车牌。 The width and height of the Mat returned by net.forward() are both -1. net.forward() 返回的 Mat 的宽度和高度都是 -1。 What is the reason for this?这是什么原因?

cv::dnn::Net net = cv::dnn::readNetFromModelOptimizer(lprModelXml, lprModelBin);
net.setPreferableBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE);
net.setPreferableTarget(cv::dnn::DNN_TARGET_CPU);
cv::Mat img = cv::imread(imagePath);
cv::Mat inputBlob = cv::dnn::blobFromImage(img, 0, cv::Size(94, 24), CV_8U);
net.setInput(inputBlob, "data");
Mat img2(88, 1, CV_8U, Scalar(1));
img2.at<uchar>(0, 0) = 0;
net.setInput(img2, "seq_ind");
auto output = net.forward();

It would be great if you could provide your output to get a clearer insight into your -1 findings.如果您能提供您的 output 以更清楚地了解您的 -1 发现,那就太好了。

If you are talking about shape, the -1 usually flattens the shape into 1D.如果您在谈论形状,-1 通常会将形状展平为一维。 You may refer here .你可以参考这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM