1.region_to_bin ( Region : BinImage : ForegroundGray, BackgroundGray,Width, Height : )
将区域
Region
转换为一幅二进制图像
BinImage
。
ForegroundGray, BackgroundGray
分别为前景色灰度值和背景色灰度值。
Width, Height
为
Region
的宽度和高度。
**************
阈值化
*********************
thread:=60
//
阈值
threshold(Image, ImgRegion, thread, 255)
region_to_bin(ImgRegion, BinImage, 255, 0, Width, Height)
*threshold(BinImage, Region, thread, 255)
* shape_trans (RegionEF, Die, 'rectangle2')
**************
提取参考点
******************
connection(ImgRegion, RefRegionConnect)
dev_set_color('red')
dev_display (RefRegionConnect)
select_shape(RefRegionConnect,
SelectedRegions,
['rectangularity','width','heigh