有人会Qt调用yolo检测视频的吗?error: C2664: “std::vector<bbox_t,std::allocator<_Ty>> Detector::detect(image_t,float,bool)”: 无法将参数 1 从“cv::Mat”转换为“std::string” with [ _Ty=bbox_t ]

使用Yolov3中的Detector类老是报错:
error: C2664: “std::vector> Detector::detect(image_t,float,bool)”: 无法将参数 1 从“cv::Mat”转换为“std::string” with [ _Ty=bbox_t ]

void MainWindow::on_pushbutton_video()
{
    std::string names_file = "E:/YoloTest/coco.names";
    std::string cfg_file = "E:/YoloTest/yolov3.cfg";
    std::string weights_file = "E:/YoloTest/yolov3.weights";
    Detector detector(cfg_file,weights_file,0);
    //std::vector<std::string> obj_names = objects_names_from_file(names_file); //调用获得分类对象名称
    //或者使用以下四行代码也可实现读入分类对象文件
    std::vector<std::string> obj_names;
    std::ifstream ifs(names_file.c_str());
    std::string line;
    while (getline(ifs, line)) obj_names.push_back(line);

    capture.open("E:/YoloTest/test1.mp4");
    if (!capture.isOpened())
    {
        printf("文件打开失败");
    }
    cv::Mat frame;

    while (true)
    {
        capture >> frame;
        std::vector<bbox_t> result_vec = detector.detect(frame);
        draw_boxes(frame, result_vec, obj_names);

        cv::namedWindow("test", CV_WINDOW_NORMAL);
        cv::imshow("test", frame);
        cv::waitKey(3);
    }
}

求助orz

c++
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问