dev_update_window ('off')
read_image (Bottle, 'C:/Users/Administrator/Desktop/23.png')
edges_sub_pix(Bottle, Edges, 'canny', 1, 10, 20)
write_contour_xld_dxf(Edges,'C:/Users/Administrator/Desktop/Draw.dxf')
read_contour_xld_dxf(Contours,'C:/Users/Administrator/Desktop/Draw.dxf' , [], [], DxfStatus)
dev_display(Bottle)
dev_display(Contours)
stop()
介绍一下edges_sub_pix(Bottle, Edges, ‘canny’, 1, 10, 20)
canny使用累计直方图计算两个阀值。凡是大于高阀值的一定是边缘; 凡是小于低阀值的一定不是边缘;如果检测结果大于低阀值但又小于高阀值,那就要看这个像素的邻接像素中有没有超过高阀值的边缘像素:如果有的话那么它就是边缘了,否则他就不是边缘;
alpha:参数指定值越小,平滑越强大,会减少边缘细节。(canny刚好相反,值越大,边缘细节越少)。
Low:低阀值
High:高阀值