halcon-watersheds_threshold分水岭阈值_灰度图像

在HDevelop中

dev_update_off()

read_image (Image, 'D:/bb/tu/1.jpg')
rgb1_to_gray(Image,Image1)
*将RGB图像转换为灰度图像

get_image_size (Image1, Width, Height)
dev_open_window(10,10,Width, Height,'black',WindowHandle)

watersheds_threshold (Image1, Basins, 20)
*分水岭阈值
*要分割的图像
*输出图像



dev_display(Basins)


在QtCreator中