halcon-disp_xld.hdev
* Display an XLD object. * read_image (Image, 'mreut') dev_close_window () dev_open_window (0, 0, 512, 512, 'black', WindowID) * Extract edges subpixel precisely using Deriche filter edges_sub_pix (Image, Edges, 'mderiche2', 0.7, 10, 20) edges_image (Image, ImaAmp, ImaDir, 'mderiche2', 0.7, 'nms', 10, 20) threshold (ImaAmp, Region, 1, 255) gen_contours_skeleton_xld (Region, Contours, 1, 'filter') dev_clear_window () * Measure the runtime to dispay xlds count_seconds (Seconds1) disp_xld (Edges, WindowID) count_seconds (Seconds2) Time1 := Seconds2-Seconds1 dev_clear_window () count_seconds (Seconds1) disp_xld (Contours, WindowID) count_seconds (Seconds2) Time2 := Seconds2-Seconds1
基本步骤:
1.读取灰度图像
2.edges_sub_pix,取得亚像素精度边缘
或
1.读取灰度图像
2.edges_image,取得边缘
3.threshold,变成二值图像
4.gen_contours_skeleton_xld,产生亚像素精度边缘