halcon代码:
dev_close_window () read_image (Image, 'E:/图片/123.jpg') get_image_size (Image, Width, Height) dev_open_window (0, 0, Width, Height, 'black', WindowHandle) rgb1_to_gray(Image,GrayImage) dev_display (GrayImage)
输出效果: