Res50_pos30_test_onTest.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:Market1501-CVLab 作者: Lizw14 项目源码 文件源码
def draw_gt_market(test_image, joints, save_image):
    image = cv2.imread(test_image)
    # draw joints in green spots
    for j in xrange(len(joints) / 2):
        cv2.circle(image, (joints[j * 2], joints[j * 2 + 1]), 2, (0, 255, 0), 1)
    # draw torso in yellow lines
    p1 = [0, 0, 5]
    p2 = [1, 14, 10]
    for j in xrange(len(p1)):
        cv2.line(image, (joints[p1[j] * 2], joints[p1[j] * 2 + 1]), (joints[p2[j] * 2], joints[p2[j] * 2 + 1]),
                 (0, 255, 255), 1)
    # draw left part in pink lines
    p1 = [14, 13, 12, 13, 10, 9]
    p2 = [13, 12, 11, 10, 9, 8]
    for j in xrange(len(p1)):
        cv2.line(image, (joints[p1[j] * 2], joints[p1[j] * 2 + 1]), (joints[p2[j] * 2], joints[p2[j] * 2 + 1]),
                 (255, 0, 255), 1)
    # draw right part in blue lines
    p1 = [1, 2, 3, 2, 5, 6]
    p2 = [2, 3, 4, 5, 6, 7]
    for j in xrange(len(p1)):
        cv2.line(image, (joints[p1[j] * 2], joints[p1[j] * 2 + 1]), (joints[p2[j] * 2], joints[p2[j] * 2 + 1]),
                 (255, 0, 0), 1)
    cv2.imwrite(save_image, image)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号