打开Halcon自带的threshold例程
main程序如下
read_image (Audi2, 'audi2')
fill_interlace (Audi2, ImageFilled,'odd')
threshold (ImageFilled, Region,0, 90)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions,'width', 'and', 30, 70)
select_shape (SelectedRegions, Letters,'height', 'and', 60, 110)
dev_clear_window ()
dev_set_colored (12)
dev_display (ImageFilled)
dev_display (Letters)
read_image (Audi2, 'audi2')//读入一副图像
fill_interlace (Audi2, ImageFilled, 'odd')//处理一下显得清晰
threshold (ImageFilled, Region, 0, 90)
这个算子是把灰度值在0-90作为一个区域Region(下图的红色部分),其他灰度值的作为一个区域,即灰度图像的二值化
connection (Re