read_image(Image,'data/flower')
rgb1_to_gray (Image, GrayImage)
sobel_amp(GrayImage,Amp,'sum_abs',3)
threshold(Amp,Edg,100,255)
skeleton (Edg, Skeleton)
dev_clear_window ()
dev_display (Skeleton)
sobel_amp(Imaqe : EdqeAmplitude : Fi1terType, Size : )
edges_image(Image : ImaAmp, ImaDir : Filter, Alpha, NMs, LoW, High :)
dev_close_window ()
read_image(Image,'data/flower')
rgb1_to_gray (Image, GrayImage)
gen_image_proto (Image, ImageCleared, 1)
dev_open_window (0, 0, 256, 256, 'black', WindowHandle1)
dev_open_window (0, 256, 256, 256, 'black', WindowHandle2)
dev_open_window (0, 512, 256, 256, 'black', WindowHandle3)
edges_image (GrayImage, ImaAmpGray, ImaDirGray, 'canny', 1, 'none', -1, -1)
edges_image (GrayImage, ImaAmpGrayNMS, ImaDirGrayHyst, 'canny', 1, 'nms',20, 40)
*对非极大值抑制后的边缘梯度图像进行了阈值处理
threshold (ImaAmpGrayNMS, RegionGray, 1, 255)
*提取边缘轮廓
skeleton (RegionGray, EdgesGray)
*用于结果显示和对比
dev_set_window (WindowHandle1)
dev_display (ImageCleared)
dev_display (ImaAmpGray)
dev_set_window (WindowHandle2)
dev_display (ImageCleared)
dev_display (ImaAmpGrayNMS)
dev_set_window (WindowHandle3)
dev_display (ImageCleared)
dev_display (EdgesGray)
edges_color(Image : ImaAmp , ImaDir : Filter , Alpha , NMs , Low , High :)
derivate_gauss (Image : DerivGauss : Sigma , component :)
laplace ( Image : ImageLaplace : ResultType , MaskSize , FilterMask :)
read_image (Image, 'data/flower')
laplace (Image, ImageLaplace, 'signed', 11, 'n_8_isotropic')
zero_crossing (ImageLaplace, RegionCrossing)
laplace_of_gauss ( Image : Imageaplace : Sigma :)
read_image (Image, 'data/flower')
laplace_of_gauss(Image,Laplace,2.0)
zero_crossing(Laplace,ZeroCrossings)
edges_sub_pix ( Image : Edges , Filter , Alpha , Low , High :)
read_image (Image, 'data/flower')
*转换为单通道灰色图像
rgb1_to_gray (Image, GrayImage)
*进行亚像素边缘提取。分别使用了不同的滞后阈值以便进行对比
edges_sub_pix (GrayImage, Edges1, 'lanser2', 0.5, 5, 50)
edges_sub_pix (GrayImage, Edges2, 'lanser2', 0.5, 25, 50)
edges_sub_pix (GrayImage, Edges3, 'lanser2', 0.5, 5, 25)
*将提取结果显示在窗口中
dev_display (Edges1)
stop()
dev_display (Edges2)
stop()
dev_display (Edges3)
read_image (Image, 'data/flower')
*使用canny算子进行亚像素边缘提取
edges_color_sub_pix (Image, Edges1, 'canny', 0.5, 5, 50)
*使用canny算子进行亚像素边缘提取
edges_color_sub_pix (Image, Edges2, 'sobel_fast', 0.5, 40, 70)
dev_clear_window ()
dev_display (Edges1)
dev_display (Edges2)
lines_ gauss ( Image : Lines : Sigma , Low , High , LightDark , ExtractWidth, LineModel, CompleteJunetions : )
read_image (Image, 'data/flower')
rgb1_to_gray (Image, GrayImage)
dev_open_window (0, 512, 512, 512, 'black', WindowHandle1)
*进行边缘检测
lines_gauss(GrayImage,Lines,1.5,1,8,'light','true','bar-shaped','true')
*在窗口将轮廓线条绘制出来
dev_set_color ('red')
dev_clear_window()
dev_display (Lines)
dev_close_window ()
read_image (Image, 'data/shapes')
rgb1_to_gray (Image, GrayImage)
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width , Height, 'black', WindowHandle)
*提取出的亚像素边缘edge的图像,得到了一个初始的轮廓
edges_sub_pix (GrayImage, Edges, 'canny', 2.5, 15, 40)
*对上一步的轮廓进行分割
segment_contours_xld (Edges, ContoursSplit, 'lines_circles', 5, 4, 2)
*提取出轮廓中较长的部分线段
select_contours_xld (ContoursSplit, SelectedContours, 'contour_length', 20, Width / 2, -0.5, 0.5)
*对相邻的轮廓段进行连接
union_adjacent_contours_xld (SelectedContours, UnionContours, 20, 1, 'attr_keep')
dev_close_window ()
*读取了图像并创建显示窗口
read_image (Image, 'data/flower')
rgb1_to_gray (Image, GrayImage)
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width , Height, 'black', WindowHandle)
dev_set_color ('white')
*对图像进行阈值处理
threshold (GrayImage, Region, 130, 255)
*使用闭运算进行填充
closing_circle (Region, Region, 20.5)
*获取前景目标的初始轮廓
gen_contour_region_xld (Region, Contour, 'border')
*拟合圆形轮廓
fit_circle_contour_xld (Contour, 'atukey', -1, 2, 0, 10, 1, Row, Column, Radius, StartPhi, EndPhi, PointOrder)
*生成该拟合的圆形轮廓
gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 4 * acos(0), 'positive', 1)