Skip to main content

求大佬指点:Windows 上 c++部署最新 Paddleocr,无法通过内存识字都是官方的代码,只能路径识图,改成内存加载图片后:cv::Mat img = cv::imread(png_path);if (img.empty()) {std::cerr << "错误:无法在当前目录找到 123.png" << std::endl;return 1;}// 核心接口:直接将 cv::Mat 对象传入 Predict 函数auto outputs = ocr.Predict(img);这最后一句死活就卡这两句报错“type”: 未声明的标识符"type": 不是 "cv::DataType<T>" 的成员1>D:\Program Files (x86)\opencv\build\include\opencv2\core\traits.hpp(386,31): error C2065: “type”: 未声明的标识符问 AI,头文件顺序,各种花样都试了,就是无法解决,只要是通过内存的形式 ocr.Predict(img);就报错,我也是个菜鸟,没一点办法via V2EX - 技术 (author: DearFox)

  1. 求大佬指点:Windows 上 c++部署最新 Paddleocr,无法通过内存识字

    都是官方的代码,只能路径识图,改成内存加载图片后:
    cv::Mat img = cv::imread(png_path);
    if (img.empty()) {
    std::cerr << "错误:无法在当前目录找到 123.png" << std::endl;
    return 1;
    }

    // 核心接口:直接将 cv::Mat 对象传入 Predict 函数

    auto outputs = ocr.Predict(img);
    这最后一句死活就卡这两句报错
    “type”: 未声明的标识符
    "type": 不是 "cv::DataType<T>" 的成员
    1>D:\Program Files (x86)\opencv\build\include\opencv2\core\traits.hpp(386,31): error C2065: “type”: 未声明的标识符
    问 AI,头文件顺序,各种花样都试了,就是无法解决,只要是通过内存的形式 ocr.Predict(img);就报错,我也是个菜鸟,没一点办法

    via V2EX - 技术 (author: DearFox)
👀 open eyes to see the world. 丨 site views: -