各位大神,大家好
我使用opencv的imshow显示图片,但是窗口能正常显示,但是图片一直为灰色,而且鼠标显示忙碌,然后会自动退出。在网上查询许久不得要领,小白一枚,劳烦各位帮忙看看是什么原因,谢谢orz
#include<opencv2\opencv.hpp>
#include "../include/Pipeline.h"
using namespace pr;
using namespace cv;
void TEST_PIPELINE(){
/* 定义模型 */
pr::PipelinePR prc("../lpr/model/cascade.xml",
"../lpr/model/HorizonalFinemapping.prototxt","../lpr/model/HorizonalFinemapping.caffemodel",
"../lpr/model/Segmentation.prototxt","../lpr/model/Segmentation.caffemodel",
"../lpr/model/CharacterRecognization.prototxt","../lpr/model/CharacterRecognization.caffemodel" //"../Ipr/model/SegmentationFree.prototxt", "../Ipr/model/SegmentationFree.caffemodel"
);
Mat image = imread("C:\\Users\\wysdy\\Desktop\\HyperLPR-master\\Prj-Win\\1.jpg");
imshow("image",image);
waitKey(25);
/* 申明一个存储该图片车牌信息检测结果的列表,读取结果 */
std::vector<pr::PlateInfo> res = prc.RunPiplineAsImage(image);
float conf = 0 ;
/* 开始对每一个结果进行遍历 */
for(auto st:res) {
if(st.confidence>0.75) {
std::cout << st.getPlateName() << " " << st.confidence << std::endl;
conf += st.confidence;
//waitKey(0);
}
}
std::cout<<conf<<std::endl;
system("pause");
}
int main()
{
TEST_PIPELINE();
return 0 ;
}