Halcon-图像锐化(边缘处理)

sobel算子

*sobel算子
read_image (Image, 'claudia')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
dev_display (Image)

rgb1_to_gray (Image, GrayImage)
sobel_amp (GrayImage, EdgeAmplitude, 'sum_abs', 3)
dump_window (WindowHandle, 'bmp', 'D:1/sobel_image')

sobel_amp (GrayImage, EdgeAmplitude, 'x', 3)
dump_window (WindowHandle, 'bmp', 'D:1/sobelx_image')

sobel_amp (GrayImage, EdgeAmplitude, 'y', 3)
dump_window (WindowHandle, 'bmp', 'D:1/sobely_image')

函数:sobel_amp (GrayImage, EdgeAmplitude, ‘sum_abs’, 3)

在这里插入图片描述

read_image (Image, 'patras')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
sobel_amp (Image, EdgeAmplitude, 'sum_abs', 3)
threshold (EdgeAmplitude, Region, 30, 255)
skeleton (Region, Skeleton)
dev_set_color ('white')
dev_display (Image)
dev_display (Skeleton)

在这里插入图片描述

Roberts算子

read_image (Image, 'patras')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
roberts (Image, ImageRoberts, 'roberts_max')
threshold (ImageRoberts, Region, 30, 255)
dump_window (WindowHandle, 'jpg', 'D:t')
skeleton (Region, Skeleton)
dev_set_color ('white')
dev_display (Image)
dev_display (Skeleton)

在这里插入图片描述
Prewitt算子

read_image (Image, 'patras')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
prewitt_amp (Image, ImageEdgeAmp)
threshold (ImageEdgeAmp, Region, 30, 255)
skeleton (Region, Skeleton)
dev_set_color ('white')
dev_display (Image)
dev_display (Skeleton)

在这里插入图片描述
Kirsch算子

read_image (Image, 'patras')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
kirsch_amp (Image, ImageEdgeAmp)
threshold (ImageEdgeAmp, Region, 30, 255)
skeleton (Region, Skeleton)
dev_set_color ('white')
dev_display (Image)
dev_display (Skeleton)

在这里插入图片描述
Canny算子

*Canny
read_image (Image, 'patras')
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
edges_image (Image, ImaAmp, ImaDir, 'canny', 0.5, 'nms', 12, 22)
threshold (ImaAmp, Region, 1, 255)
skeleton (Region, Skeleton)
gen_contours_skeleton_xld (Skeleton, Contours, 1, 'filter')
dev_set_color ('white')
dev_display (Image)
dev_display (Skeleton)

在这里插入图片描述

Laplace算子

*laplace算子
read_image (Image, 'can')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window_fit_size (0, 0, Width, Width, -1, -1, WindowHandle)
dev_display (Image)

rgb1_to_gray (Image, GrayImage)
laplace (GrayImage, ImageLaplace, 'absolute', 3, 'n_4')
dump_window (WindowHandle, 'bmp', 'D:1/laplace_image')

函数:laplace (GrayImage, ImageLaplace, ‘absolute’, 3, ‘n_4’)

在这里插入图片描述

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 设计师:@WitnesS 返回首页