设置首页收藏本站
开启左侧

Halcon获得图像指针

[复制链接]
zy1985 发表于 2023-5-31 17:14:40 | 显示全部楼层 |阅读模式
  1. Hlong width,height;
  2. HObject ho_image;
  3. ReadImage(&ho_image, path.c_str());
  4. ConvertImageType(ho_image, &ho_image, "real");    //转化为float的数据
  5. HImage hImg(ho_image);
  6. HString ho_type;
  7. void *ptr_img = hImg.GetImagePointer1(&ho_type, &width, &height);        //获取float的指针

  8. HTuple hv_pointer;
  9. unsigned char *ptr;
  10. GetImagePointer1(himage,&hv_pointer,&htype,&width,&height);
  11. ptr=(unsigned char *)hv_pointer[0].L();

  12. HTuple hv_ptrRed,hv_ptrGreen,hv_ptrBlue;
  13. GetImagePointer3(himage,&hv_ptrRed,&hv_ptrGreen,&hv_ptrBlue,&htype,&width,&height);
  14. uchar *ptrRed=(uchar*)hv_ptrRed[0].L();
  15. uchar *ptrGreen=(uchar*)hv_ptrGreen[0].L();
  16. uchar *ptrBlue=(uchar*)hv_ptrBlue[0].L();
复制代码


奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表