halcon-fast_threshold快速阈值
作者:互联网
在HDevelop中
ma.jpg
dev_update_off() read_image (Image, 'D:/bb/tu/ma.jpg') rgb1_to_gray(Image,Image1) *将RGB图像转换为灰度图像 get_image_size (Image1, Width, Height) dev_open_window(10,10,Width, Height,'black',WindowHandle) fast_threshold (Image1, Region, 10, 80, 100) *快速阈值 *参数1:输入图像 *参数2:输出区域 *参数3:最小阈值 *参数4:最大阈值 *参数5:提取像素的最小大小。默认值:20;忽略小于这个值的区域 dev_display(Region)
在Qt Creator中
HObject ho_Image, ho_Image1, ho_Region; HTuple hv_Width, hv_Height, hv_WindowHandle;
ReadImage(&ho_Image, "D:/bb/tu/ma.jpg"); Rgb1ToGray(ho_Image, &ho_Image1); //将RGB图像转换为灰度图像 GetImageSize(ho_Image1, &hv_Width, &hv_Height); SetWindowAttr("background_color","black"); OpenWindow(10,10,hv_Width,hv_Height,0,"visible","",&hv_WindowHandle); HDevWindowStack::Push(hv_WindowHandle); FastThreshold(ho_Image1, &ho_Region, 10, 80, 100); //快速阈值 //参数1:输入图像 //参数2:输出区域 //参数3:最小阈值 //参数4:最大阈值 //参数5:提取像素的最小大小。默认值:20;忽略小于这个值的区域 if (HDevWindowStack::IsOpen()) DispObj(ho_Region, HDevWindowStack::GetActive());
标签:10,阈值,hv,fast,halcon,参数,ho,threshold,Image1 来源: https://www.cnblogs.com/liming19680104/p/15958060.html