* 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)
clip_region (Grid, StreetGrid, 130, 10, 450, 502)
dev_set_line_width (3)
dev_set_color ('green')
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'))
reduce_domain (ActualImage, StreetGrid, Mask)
*根据区域网格裁剪原图,缩小目标区域提高检测效率
dev_clear_window()
dev_display(Mask)
sobel_amp (Mask, Gradient, 'sum_abs', 3)
* sobel算子分割图片
threshold (Gradient, Points, 20, 255)
*二值化
dilation_rectangle1 (Points, RegionDilation, MinSize, MinSize)
*膨胀区域
reduce_domain (ActualImage, RegionDilation, StripGray)
*将图片剪切成膨胀区域.
dev_clear_window()
dev_display(StripGray)
threshold (StripGray, Strip, 190, 255)
* 二值化
fill_up (Strip, RegionFillUp)
* 填充图片
dev_display (ActualImage)
dev_display (RegionFillUp)
endfor
dev_set_line_width (1)
dev_update_window ('on')
set_system ('init_new_image', Information)