查看: 13|回复: 0

halcon 轮廓XLD,区域region,图片

[复制链接]

256

主题

1

回帖

1305

积分

管理员

积分
1305
QQ
发表于 2025-7-3 10:24:35 | 显示全部楼层 |阅读模式
  1. read_image (Image, '黑白图.png')

  2. read_image (Image1, '彩色图.png')

  3. *Region    ROI  Region Of Interest
  4. *根据图像灰度值来提取区域
  5. threshold (Image1, Region, 128, 255)

  6. get_image_size (Image1, Width, Height)

  7. count:=Width*Height

  8. get_region_runs(Region, Row, ColumnBegin, ColumnEnd)

  9. *Xld  轮廓提取

  10. *提取采购图片的亚像素

  11. edges_color_sub_pix (Image, Edges, 'canny', 1, 20, 40)

  12. *Contours  Polygons

  13. *生成圆形Xld轮廓

  14. gen_circle_contour_xld (ROI_0, 287.122, 577.451, 287.294, 0, 6.28318, 'positive', 1)

  15. *获取轮廓的坐标点信息

  16. get_contour_xld (ROI_0, Row1, Col)

  17. gen_polygons_xld (ROI_0, Polygons, 'ramer', 2)

  18. *获取轮廓生产之后的基本信息

  19. get_polygon_xld (Polygons, Row2, Col1, Length, Phi)

  20. *Region和Xld互转

  21. *区域转化成轮廓
  22. gen_contour_region_xld (Region, Contours, 'border')
  23. *轮廓转化成区域
  24. gen_region_contour_xld (Contours, Region1, 'filled')
复制代码

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

关于我们

企业文化

人才招聘

常见问题

建议反馈

合作伙伴

商务合作

新闻媒体

产品服务

客户案例

联系我们

联系电话:14776878570(同VX号)

邮箱:14776878570@163.com(同VX号)

工作时间:周一至周六(早上8点至下午10点)

关注微信公众号

QQ|Archiver|手机版|小黑屋|鸿翔机器人

GMT+8, 2025-8-6 15:56 , Processed in 0.060001 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.