* autobahn.hdev: Fast detection of lane markers

dev_update_window ('off')

*指定操作符调用返回的所有图标对象不显示在活动图像窗口中
dev_close_window ()
dev_open_window (0, 0, 768, 575, 'black', WindowID)

*打开一个窗口
MinSize := 30
get_system ('init_new_image', Information)

*返回图片信息参数
set_system ('init_new_image', 'false')

*不允许更改系统参数
gen_grid_region (Grid, MinSize, MinSize, 'lines', 512, 512)

*创建一个512*512的网格
clip_region (Grid, StreetGrid, 130, 10, 450, 502)

*将网格剪辑到制定矩形内

dev_set_line_width (3)
dev_set_color ('green')

*设定线宽为3,颜色为绿色

halcon中Fast detection of lane markers“快速检测车道标志”详解
read_image (ActualImage, 'autobahn/scene_00')
dev_display (ActualImage)
stop ()
dev_display (StreetGrid)
stop ()
for i := 0 to 28 by 1
    read_image (ActualImage, 'autobahn/scene_' + (i$'02'))

   *读取以“autobahn/scene"开头的文件,后面表示数字是两位数
    reduce_domain (ActualImage, StreetGrid, Mask)

    *给定图像缩小到指定区域
    sobel_amp (Mask, Gradient, 'sum_abs', 3)

    *边缘检测sobel算子
    threshold (Gradient, Points, 20, 255)

    *阈值分割
    dilation_rectangle1 (Points, RegionDilation, MinSize, MinSize)

   *通过MinSize*MinSize结构元素对输入区域进行扩展

halcon中Fast detection of lane markers“快速检测车道标志”详解
    reduce_domain (ActualImage, RegionDilation, StripGray)
    threshold (StripGray, Strip, 190, 255)
    fill_up (Strip, RegionFillUp)

   *填补区域漏洞

halcon中Fast detection of lane markers“快速检测车道标志”详解
    dev_display (ActualImage)
    dev_display (RegionFillUp)
endfor
dev_set_line_width (1)
dev_update_window ('on')
set_system ('init_new_image', Information)

相关文章:

  • 2021-08-24
  • 2021-09-02
  • 2021-10-21
  • 2021-06-26
  • 2021-12-18
  • 2021-07-02
  • 2021-04-22
  • 2021-04-30
猜你喜欢
  • 2021-04-06
  • 2021-06-26
  • 2022-01-14
  • 2021-09-24
  • 2021-07-22
  • 2021-11-06
  • 2022-12-23
相关资源
相似解决方案