首页 > 其他分享 >convert

convert

时间:2023-03-22 14:47:01浏览次数:35  
标签:box convert dh dw 2.0 size

 

def convert(size, box):
    dw = 1. / (size[0])
    dh = 1. / (size[1])
    x = (box[0] + box[1]) / 2.0 - 1
    y = (box[2] + box[3]) / 2.0 - 1
    w = box[1] - box[0]
    h = box[3] - box[2]
    x = x * dw
    w = w * dw
    y = y * dh
    h = h * dh
    return x, y, w, h

 

 

 

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

标签:box,convert,dh,dw,2.0,size
From: https://www.cnblogs.com/herd/p/17243676.html

相关文章