简体   繁体   中英

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. The width and height of the Mat returned by net.forward() are both -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.

If you are talking about shape, the -1 usually flattens the shape into 1D. You may refer here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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