某些时候,如获取图像像素值采用halcon函数GetGrayval时 速度较慢,可以通过把HObject图像格式转换为byte格式提高访问速度。具体方法如下:
HTuple hv_Pointer, hv_byte;
GetImagePointer1(ho_ImgBinT, &hv_Pointer, &hv_byte, &m_MapWidthT, &m_MapHeightT);
BYTE ptr = (BYTE)hv_Pointer[0].L();
通过ptr[行数宽度+列数]访问像素值。
来源:CSDN
作者:笑看风云^_^
链接:https://blog.csdn.net/weixin_43913330/article/details/104270311