上结果:
原图为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