halcon例程学习笔记(6)----车道线快速检测autobahn
来源:互联网 发布:中国软件外包公司排行 编辑:程序博客网 时间:2024/09/21 09:06
本例程来自halcon例程中的Blob分析中的autobahn例程
通过此例程可以很好的掌握sobel_amp算子的使用。详细使用请查看halcon算子说明文档
例程耿总目标的基本思路:
先获得主要感兴趣区域,去除车的干扰
然后通过sobel_amp算子检测边缘明显变化的图像,得到原始图像边缘位置的图像数据
然后通过阈值获取目标边缘。
通过膨胀目标边缘获得感兴趣区域,再次通过阈值分割获得目标
原始例程如下:
* 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(StreetGrid)
dev_clear_window ()
dev_display(Mask)
sobel_amp (Mask, Gradient, 'sum_abs', 3)
threshold (Gradient, Points, 20, 255)
dilation_rectangle1 (Points, RegionDilation, MinSize, MinSize)
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)
经过分析,修改后的分析方法程序如下:
* autobahn.hdev: Fast detection of lane markers* dev_update_window ('off')dev_close_window ()dev_open_window (0, 0, 768, 575, 'black', WindowID)MinSize := 30get_system ('init_new_image', Information)set_system ('init_new_image', 'false')dev_set_line_width (3)dev_set_color ('green')stop ()for i := 0 to 28 by 1 read_image (ActualImage, 'autobahn/scene_'+(i$'02')) gen_rectangle1 (Rectangle, 130, 0, 512, 512) reduce_domain (ActualImage, Rectangle, ReduceImage) sobel_amp (ReduceImage, Amp, 'sum_abs', 3) threshold (Amp, Points, 20, 255) dilation_rectangle1 (Points, RegionDilation, MinSize, MinSize) reduce_domain (ActualImage, RegionDilation, StripGray) threshold (StripGray, Strip, 190, 255) fill_up (Strip, RegionFillUp) dev_display (ActualImage) dev_display (RegionFillUp) stop()endfordev_set_line_width (1)dev_update_window ('on')set_system ('init_new_image', Information)
- halcon例程学习笔记(6)----车道线快速检测autobahn
- halcon车道检测实例注释
- halcon例程学习笔记(7)---检测漏焊board.hdev
- halcon例程学习笔记(9)---制药的检测check_blister.hdev
- halcon例程学习笔记(2)----check_smd_tilt.hdev
- Halcon例程学习:print_check.hev(光学字符检测)
- Halcon例程学习:adaption_ocv.hev(光学字符检测)
- opencv车道线检测
- opencv车道线检测
- opencv车道线检测
- ADAS-车道线检测
- 车道线检测+车道线跟踪+车道线识别
- Halcon学习笔记之缺陷检测(一)
- Halcon学习笔记之缺陷检测1
- Halcon学习笔记之缺陷检测2
- Halcon学习笔记之缺陷检测
- 【Udacity自动驾驶课程笔记】---- 车道线检测1
- halcon例程学习笔记(11) 一维码、二维码识别
- android 常用方法集合
- Html之设置不换行的标记nobr_实例
- 创表语句
- hadoop配置 - secondarynamenode配置与恢复
- haha
- halcon例程学习笔记(6)----车道线快速检测autobahn
- 芯灵思 嵌入式论坛开站了。。。。。小伙伴们快来啊。。。。。。
- RMQ (Range Minimum/Maximum Query)问题
- javascript学习笔记
- window下VS2008编译libtorrent的过程
- Android测试驱动开发实践3
- [历年IT笔试题]2014微软校园招聘笔试试题
- SQL删除字段及判断字段是否存在的方法
- Oracle 重建控制文件对只读表空间和临时表空间影响的测试