halcon-区域分割+区域膨胀
*案例
* Saving an OCV tool to file
*
* 读取图像
read_image (Image, 'a01')
*全局二值化分割
threshold (Image, Region, 0, 100)
*把字符区域转变成最小的外接矩形
shape_trans (Region, RegionTrans, 'rectangle1')
*对最小外接矩形进行膨胀
dilation_rectangle1 (RegionTrans, RegionDilation, 10, 10)
* Reduce the domain of an image.
reduce_domain (Image, RegionDilation, ImageReduced)
* Create a new OCV tool based on gray value projections
create_ocv_proj ('A', OCVHandle)
traind_ocv_proj (ImageReduced, OCVHandle, 'A', 'single')
write_ocv (OCVHandle, 'test_ocv.ocv')
OCVHandle := []
stop ()
read_ocv ('test_ocv.ocv', OCVHandle)
赞 (0)