MFC里halcon的图像类型的转换
直接点 上代码
HImage HobjectToHImage(Hobject hobject)//转灰度图的
{HImage image;
HTuple pointer, type, width, height;
get_image_pointer1(hobject,&pointer,&type,&width,&height);
image.GenImage1(type, width, height, pointer);
return image;
}
HImage HobjectToRGBHimage(Hobject hobject)/ //新增的另一个转换彩色图像的方法
{
HImage image;
HTuple pointerRed, pointerGreen, pointerBlue, type, width, height;
get_image_pointer3(hobject,&pointerRed,&pointerGreen, &pointerBlue, &type,&width,&height);
image.GenImage3(type, width, height, pointerRed, pointerGreen, pointerBlue);
return image;
}