halcon-prewitt_amp计算边缘
在HDevelop中
dev_close_window () read_image (Image, 'D:/bb/tu/1.jpg') rgb1_to_gray (Image, GrayImage) prewitt_amp (GrayImage, ImageEdgeAmp) *计算边缘 *参数2:输出图像 get_image_size (GrayImage, Width, Height) dev_open_window(10,10,Width, Height,'black',WindowHandle) dev_display(ImageEdgeAmp)
在QtCreator中
HObject ho_Image, ho_GrayImage, ho_ImageEdgeAmp;
HTuple hv_Width, hv_Height, hv_WindowHandle;
ReadImage(&ho_Image, "D:/bb/tu/1.jpg"); Rgb1ToGray(ho_Image, &ho_GrayImage); PrewittAmp(ho_GrayImage, &ho_ImageEdgeAmp); //计算边缘 //参数2:输出图像 GetImageSize(ho_GrayImage, &hv_Width, &hv_Height); SetWindowAttr("background_color","black"); OpenWindow(10,10,hv_Width,hv_Height,0,"visible","",&hv_WindowHandle); HDevWindowStack::Push(hv_WindowHandle); if (HDevWindowStack::IsOpen()) DispObj(ho_ImageEdgeAmp, HDevWindowStack::GetActive());