autobahn.hdev:快速检测车道标志
* autobahn.hdev: 快速检测车道标志
* 1、用扣出部分区域的方式大幅减小干扰,然后用阈值分割进行粗定位
* 2、用粗定位后的区域进行膨胀,选取大致ROI位置,再进行细定位
*
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')
*长宽为512-1的矩形内,用直线分割,生成30*30的方格
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'))
* 1、粗定位
* 扣除线条方格区域的图像
reduce_domain (ActualImage, StreetGrid, Mask)
* 检测Mask区域中的边缘
sobel_amp (Mask, Gradient, 'sum_abs', 3)
* 区域分割
threshold (Gradient, Points, 20, 255)
dilation_rectangle1 (Points, RegionDilation, MinSize, MinSize)
* 2、细定位
reduce_domain (ActualImage, RegionDilation, 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)