Vuser_216485
2021-11-30 14:18
二次开发

调用MVID_CR_Process进行条码解析 失败,返回0x80002200 一维码相关错误?

问题:

我在MVID_CR_CAM_RegisterImageBufferCallBack注册图像回调函数中,得到相机的原始图像后 调用MVID_CR_Process进行条码解析 失败,返回:返回0x80002200 一维码相关错误


代码如下:

// MVID_CR_CAM_RegisterImageBufferCallBack的回调函数

void __stdcall RegisterImgBuffCall(MVID_IMAGE_INFO* pstPreOutput,void* pUser)

{

    MainWindow* pThis = (MainWindow *)pUser;

    if(pThis){

      

        QDateTime current_date_time =QDateTime::currentDateTime();

        codedata.time =current_date_time.toString("yyyy-MM-dd hh:mm:ss.zzz ");

        if( pstPreOutput->pImageBuf = nullptr ){

            qDebug()<<codedata.time;

            return;

        }

        Img.pImageBuf = pstPreOutput->pImageBuf;

        Img.nImageLen = pstPreOutput->nImageLen;

        Img.enImageType = pstPreOutput->enImageType;

        qDebug()<<"Input Image type =  "<<pstPreOutput->enImageType;

        Img.nWidth = pstPreOutput->nWidth;

        Img.nHeight = pstPreOutput->nHeight;

        pThis->ImgCallBack(Img);

    }

}


void MainWindow::ImgCallBack(MVID_PROC_PARAM data)

{

    uint ret = MVID_CR_Process(m_hDevHandle,&data,MVID_BCR) ;

   if(  ret != MVID_CR_OK ){

       qDebug()<< " MVID_CR_Process error : "<<ret;

       return;

   }

    for( int i = 0 ; i < data.stCodeList.nCodeNum ; ++i){

        QString str = QString::fromLocal8Bit((char *)data.stCodeList.stCodeInfo[i].strCode) + "," + codedata.time;

        qDebug()<< str;

    }

    return ;

}

运行后的输出 :

Input Image type = 1

MVID_CR_Process error : 2147492352


从输出结果得出:

MVID_IMAGE_MONO8      = 1,    // ch:Mono8 | en:MONO8 format

输入的图像类型是: MONO8

2147492352  对应的16进制是 0x80002200

#define MVID_CR_E_BCR   0x80002200  ///< ch:一维码相关错误 | en:1D barcode error


疑问:

请问MVID_CR_Process 的参数如何正确设置 ,才返回条码信息


相关函数结构体参考如下:







  • 502
  • 0
  • 分享

全部回答1

🤔

您好

这里提供的相关代码暂时无法确定问题的根本原因,建议出现问题的时候连接我司对应技术支持同事远程查看现象及问题进行解决;针对本次问题给出以下建议:

☝️上述操作的逻辑为先使用不解码的回调接口获取一张图片,在将这张图片放到process本地图片解码的接口去解码。其实这样的操作一个接口就可以满足:

MVID_CR_CAM_RegisterImageCallBack接口本身支持获取图像时,同时获取图像中的解码数据。


可以参考最新的SDK开发包中回调接口的使用


2023-03-16 15:07 未知地区
    |
  • 评论
  • |
  • 1

请升级浏览器版本

您正在使用的浏览器版本过低,请升级最新版本以获得更好的体验。

推荐使用以下浏览器