【HALCON工业机器视觉基础教程】第九章 图像模式识别
找到模板–调参数–应用–执行优化–保存模板–代码生成。
·
1. 模板匹配
1. 模板匹配
dev_update_pc ('off')
dev_update_window ('off')
dev_update_var ('off')
read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-20.11-Progress/examples/images/green-dot.png')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_set_color ('red')
dev_display (Image)
threshold (Image, Region, 0, 128)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10000, 99999)
fill_up (SelectedRegions, RegionFillUp)
dilation_circle (RegionFillUp, RegionDilation, 5.5)
reduce_domain (Image, RegionDilation, ImageReduced)
create_scaled_shape_model (ImageReduced, 5, rad(-45), rad(90), 'auto', 0.8, 1, 'auto', 'none', 'ignore_global_polarity', 40, 10, ModelID)
read_image (ImageSearch, 'C:/Users/Public/Documents/MVTec/HALCON-20.11-Progress/examples/images/green-dots.png')
dev_display (ImageSearch)
find_scaled_shape_model (ImageSearch, ModelID, rad(-45), rad(90), 0.8, 1.0, 0.5, 0, 0.5, 'least_squares', 5, 0.8, Row, Column, Angle, Scale, Score)
disp_cross (WindowHandle, Row, Column, 20, 0)
2. 模板匹配助手
找到模板–调参数–应用–执行优化–保存模板–代码生成
2. 模式识别
支持向量机
总结:总结文档
更多推荐
已为社区贡献1条内容
所有评论(0)