halcon读取一张照片,并转化为灰度图像
1 dev_close_window () 2 read_image (Image, 'E:/图片/123.jpg') 3 get_image_size (Image, Width, Height) 4 dev_open_window (0, 0, Width, Height, 'black', WindowHandle) 5 rgb1_to_gray(Image,GrayImage) 6 dev_display (GrayImage)
输出效果:
1 dev_close_window () 2 read_image (Image, 'E:/图片/123.jpg') 3 get_image_size (Image, Width, Height) 4 dev_open_window (0, 0, Width, Height, 'black', WindowHandle) 5 rgb1_to_gray(Image,GrayImage) 6 dev_display (GrayImage)
输出效果: