ZV_ContOrientation -- 轮廓角度

类型

特征

描述

计算轮廓的角度

别名:ZV_ContOrient

语法

ZV_ContOrientation(cont,tabId)

 

参数:

cont:轮廓

tabId:TABLE索引,输出参数,主轴角度,顺时针为正,[-180°,180°)

适用控制器

支持ZV功能或者5系列以上的控制器

例子

ZVOBJECT img,img_bw,cont_list

ZV_ImgRead(img,"count1.jpg",0) '读取图片

ZV_ImpThresh(img,img_bw,200,255) '图像二值化

ZV_ContGen(img_bw,cont_list,1,0) '查找轮廓

 

ZVOBJECT cont

ZV_ObjSelect(cont_list,cont,0) '获取第一个轮廓

ZV_ContOrientation(cont,0) '计算轮廓角度

?"轮廓角度:",TABLE(0)