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 2023-05-26 16:34  闻缺陷则喜何志丹  阅读(9)  评论(0编辑  收藏  举报  来源