halcon-fill_up填充区域的孔和缝(漏洞)
作者:互联网
在HDevelop中
2.png
dev_open_window(10,10,389,205,'black',WindowHandle) read_image (Image, 'D:/bb/tu/2.png') rgb1_to_gray(Image,Image1) threshold (Image1, Region, 80,100) fill_up (Region, RegionFillUp) *填充区域的孔和缝(漏洞) *参数1:输入含孔的区域 *参数2:输出区域 *区域的数量保持不变,邻域的类型通过算子set_system('neighborhood',<4/8>)设置 dev_display (RegionFillUp)
在QtCreator中
SetWindowAttr("background_color","black"); OpenWindow(10,10,193,143,0,"visible","",&hv_WindowHandle); ReadImage(&ho_Image, "D:/bb/tu/2.png"); Rgb1ToGray(ho_Image, &ho_Image1); Threshold(ho_Image1, &ho_Region, 80, 100); //区域变成白色 FillUp(ho_Region, &ho_RegionFillUp); //填充区域的孔和缝(漏洞) //参数1:输入含孔的区域 //参数2:输出区域 //区域的数量保持不变,邻域的类型通过算子set_system('neighborhood',<4/8>)设置 DispObj(ho_RegionFillUp, hv_WindowHandle);
标签:10,Region,up,halcon,区域,RegionFillUp,ho,Image1,fill 来源: https://www.cnblogs.com/liming19680104/p/15914639.html