HALCON error #
1201: Wrong type of control parameter 1
源码:
HObject rgbImage;
        const int iRow = 1;
        const int iCol = 1;
        const char sz[3 * iRow*iCol] = { 1,2,3 };
        try
        {
                HalconCpp::GenImageInterleaved(&rgbImage, (const char*)sz, "rgb",
                        iCol, iRow, 0,
                        "byte", iCol, iRow,
                        0, 0, -1, 0);
        }

将 HObject rgbImage;改成HImage rgbImage; 错误提示不变。

改成成员函数,就好了。

    HImage rgbImage;
    const int iRow = 1;
    const int iCol = 1;
    const char sz[3 * iRow*iCol] = { 1,2,3 };
    try
    {
        rgbImage.GenImageInterleaved( (void*)sz, "rgb",
            iCol, iRow, 0,
            "byte", iCol, iRow,
            0, 0, -1, 0);
    }
    CATCH_AND_LOG;

开发环境:Win10 + VS2017+ halcon20

第一个参数是ImageRGB,第一个控制参数是PixelPointer, 错误提示误导人。 

posted on   闻缺陷则喜何志丹  阅读(38)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
历史上的今天:
2022-05-26 以下代码为什么无法导出函数
2021-05-26 如何模拟按下“计算器”的“7”键?



点击右上角即可分享
微信分享提示