threshold_sub_pix(Segmentation/Threshold)

来源:互联网 发布:netbeans 如何配置php 编辑:程序博客网 时间:2024/06/17 09:08

一、效果一览

这里写图片描述

二、功能

用输入图像的阈值,提取平交路口(交通术语)——亚像素精度

三、算子实例

read_image (Image, 'double_circle')dev_close_window ()get_image_size (Image, Width, Height)dev_open_window (0, 0, Width, Height, 'black', WindowHandle)threshold_sub_pix (Image, Edges, 128)segment_contours_xld (Edges, ContoursSplit, 'lines_circles', 5, 4, 3)count_obj (ContoursSplit, Number)dev_display (Image)dev_set_draw ('margin')dev_set_color ('red')dev_update_window ('off')for i := 1 to Number by 1    select_obj (ContoursSplit, ObjectSelected, i)    get_contour_global_attrib_xld (ObjectSelected, 'cont_approx', Attrib)    if (Attrib > 0)        fit_circle_contour_xld (ObjectSelected, 'ahuber', -1, 2, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)        gen_ellipse_contour_xld (ContEllipse, Row, Column, 0, Radius, Radius, 0, 4 * acos(0), 'positive', 1.0)        dev_display (ContEllipse)    endifendfor
0 0
原创粉丝点击