python alphashape

python alphashape

alphashape_opt = alphashape.optimizealpha(bottom_points)
alphashape_obj = alphashape.alphashape(bottom_points, alphashape_opt)
hull_result = hull.exterior.coords.xy

 

遍历结果:

for k in range(len(hull_result[0])):
  x1 = int(hull_result[0][k])
  y1 = int(hull_result[1][k])

 

 

原始数据:

[(412, 319), (179, 127), (274, 206), (129, 277), (265, 397), (35, 188)]

 

输出数据:

(array('d', [122.0, 237.0, 363.0, 260.0, 158.0, 41.0, 122.0]), array('d', [245.0, 206.0, 173.0, 100.0, 122.0, 154.0, 245.0]))

 

 

 

 

#######################

posted @ 2022-05-04 20:43  西北逍遥  阅读(660)  评论(0编辑  收藏  举报