上結果:
原圖爲RGB:
上代碼:
*RGB轉換Gray
read_image(Image,'D:/HalconWorkplace/img/CarLicensePlate.jpg')
*獲取圖像大小
get_image_size(Image,width,height)
*RGB圖像轉換灰度圖像
rgb1_to_gray(Image,Image_gray)
*打開窗口
dev_open_window(0,0,width,height,'black',WindowHandle)
*顯示灰度圖
dev_display(Image_gray)
參考
https://blog.csdn.net/wujuxKkoolerter/article/details/89550074