设置首页收藏本站
123
返回列表 发新帖
开启左侧

划痕检测,求帮我

  [复制链接]
wx_kHC5fbb1 发表于 2019-2-13 16:15:36 | 显示全部楼层
來學習的
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
大凡光学,专注标定板提供
SingleZhou 发表于 2021-11-22 08:51:55 | 显示全部楼层
参考一下这一段,图像处理那段修改一下,先阈值把中间圆环区域提取出来再往下走,应该就可以实现你这个功能了
Screenshot 2021-11-22 085051.jpg
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
weicc 发表于 2022-9-2 18:04:16 | 显示全部楼层
  1. list_files ('C:/Users/njtl003/Desktop/51halcon划痕图像', ['files','follow_links'], ImageFiles)
  2. tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)
  3. for Index := 0 to |ImageFiles| - 1 by 1
  4.     read_image (Image, ImageFiles[Index])
  5.     binary_threshold (Image, Region, 'smooth_histo', 'light', UsedThreshold)
  6.     opening_circle (Region, RegionOpening, 5.5)
  7.     connection (RegionOpening, ConnectedRegions)
  8.     select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 70)
  9.     fill_up (SelectedRegions, RegionFillUp)
  10.     shape_trans (RegionFillUp, RegionOuter, 'outer_circle')
  11.     difference (RegionFillUp, SelectedRegions, RegionDifference)
  12.     opening_circle (RegionDifference, RegionOpening1, 5.5)
  13.     connection (RegionOpening1, ConnectedRegions1)
  14.     select_shape_std (ConnectedRegions1, SelectedRegions1, 'max_area', 70)
  15.     shape_trans (SelectedRegions1, RegionInner, 'outer_circle')
  16.     difference (RegionOuter, RegionInner, RegionDifference1)
  17.     erosion_circle (RegionDifference1, RegionErosion, 2.5)
  18.     reduce_domain (Image, RegionErosion, ImageReduced)

  19.     *检测线
  20.     calculate_lines_gauss_parameters (3, 75, Sigma, Low, High)
  21.     lines_gauss (ImageReduced, Lines, Sigma, Low, High, 'dark', 'true', 'bar-shaped', 'true')
  22.     union_adjacent_contours_xld (Lines, UnionContours, 20, 1, 'attr_keep')
  23.     union_collinear_contours_ext_xld (UnionContours, UnionContours1, 10, 1, 2, 0.1, 0, -1, 1, 1, 1, 1, 1, 0, 'attr_keep')
  24.     select_contours_xld (UnionContours1, SelectedContours, 'contour_length', 50, 2000, -0.5, 0.5)
  25.     dev_get_window (WindowHandle)
  26.     dev_clear_window ()
  27.     dev_display (Image)
  28.     dev_display (SelectedContours)
  29.     stop()
  30. endfor
复制代码
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
秃头强 发表于 2022-12-12 10:06:45 | 显示全部楼层
动态阈值学到了
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
回复 支持 1 反对 0

使用道具 举报

liuchaonuaa 发表于 2023-3-7 13:45:52 | 显示全部楼层
谢谢,借鉴下
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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