renderer/viewer2D.py [405:476]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    for k in np.arange( len(pt2d) ):
        cv2.circle(image, (int(pt2d[k][0]), int(pt2d[k][1]) ), radius, (0,255,0),-1)

    for k in np.arange( len(link2D) ):
        parent = link2D[k][0]
        child = link2D[k][1]
        if color is not None:
            c = color
        else:
            if bLeft[k]:
                c = (0,0,255)#BGR, RED
            else:
                c = (0,0,0)

        cv2.line(image, (int(pt2d[parent][0]), int(pt2d[parent][1])), (int(pt2d[child][0]), int(pt2d[child][1])), c, radius - 2)

    return image




#Panoptic Studio SMC19 ordering

def Vis_Skeleton_2D_SMC19(pt2d, image = None, color=None):
    pt2d = np.reshape(pt2d,[-1,2])          #Just in case. Make sure (32, 2)


    #Draw via opencv
    if not isinstance(image, np.ndarray):#not image: #If no image is given, generate Blank image
        image = np.ones((1000,1000,3),np.uint8) *255

    radius = 4

    assert pt2d.shape[0]==19
    print("Vis_Skeleton_2D_H36m: {} joints".format(16))
    #Without Nose
    link2D = [ [0,1], [0,2],  #neck -> nose, neck-> bodyCenter
                 [0,3], [3,4], [4,5],   #Left Arm

                 [2,6], [6,7], [7,8],   #left leg
                [2,12],[12,13], [13,14], #Right leg
                [0,9], [9, 10], [10, 11], #Right Arm
                [1, 15], [15, 16], #left eye
                [1, 17], [17, 18]] #right eye

    bLeft = [ 1,1,
        1, 1, 1,
        1,1,1,
        0,0,0,
        0,0,0,
        1,1,
        0,0]


    # for i in np.arange( len(link) ):
    for k in np.arange( len(pt2d) ):
        cv2.circle(image, (int(pt2d[k][0]), int(pt2d[k][1]) ), radius, (0,255,0),-1)

    for k in np.arange( len(link2D) ):
        parent = link2D[k][0]
        child = link2D[k][1]
        if color is not None:
            c = color
        else:
            if bLeft[k]:
                c = (0,0,255)#BGR, RED
            else:
                c = (0,0,0)

        cv2.line(image, (int(pt2d[parent][0]), int(pt2d[parent][1])), (int(pt2d[child][0]), int(pt2d[child][1])), c, radius - 2)

    return image
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



renderer/viewer2D.py [460:531]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    for k in np.arange( len(pt2d) ):
        cv2.circle(image, (int(pt2d[k][0]), int(pt2d[k][1]) ), radius, (0,255,0),-1)

    for k in np.arange( len(link2D) ):
        parent = link2D[k][0]
        child = link2D[k][1]
        if color is not None:
            c = color
        else:
            if bLeft[k]:
                c = (0,0,255)#BGR, RED
            else:
                c = (0,0,0)

        cv2.line(image, (int(pt2d[parent][0]), int(pt2d[parent][1])), (int(pt2d[child][0]), int(pt2d[child][1])), c, radius - 2)

    return image




#Panoptic Studio SMC19 ordering
 
def Vis_Skeleton_2D_SMC19(pt2d, image = None, color=None):
    pt2d = np.reshape(pt2d,[-1,2])          #Just in case. Make sure (32, 2)


    #Draw via opencv
    if not isinstance(image, np.ndarray):#not image: #If no image is given, generate Blank image
        image = np.ones((1000,1000,3),np.uint8) *255        

    radius = 4

    assert pt2d.shape[0]==19
    print("Vis_Skeleton_2D_H36m: {} joints".format(16))
    #Without Nose
    link2D = [ [0,1], [0,2],  #neck -> nose, neck-> bodyCenter
                 [0,3], [3,4], [4,5],   #Left Arm
                
                 [2,6], [6,7], [7,8],   #left leg
                [2,12],[12,13], [13,14], #Right leg
                [0,9], [9, 10], [10, 11], #Right Arm
                [1, 15], [15, 16], #left eye
                [1, 17], [17, 18]] #right eye
    
    bLeft = [ 1,1,
        1, 1, 1,
        1,1,1,
        0,0,0,
        0,0,0,
        1,1,
        0,0]

            
    # for i in np.arange( len(link) ):
    for k in np.arange( len(pt2d) ):
        cv2.circle(image, (int(pt2d[k][0]), int(pt2d[k][1]) ), radius, (0,255,0),-1)

    for k in np.arange( len(link2D) ):
        parent = link2D[k][0]
        child = link2D[k][1]
        if color is not None:
            c = color
        else:
            if bLeft[k]:
                c = (0,0,255)#BGR, RED
            else:
                c = (0,0,0)

        cv2.line(image, (int(pt2d[parent][0]), int(pt2d[parent][1])), (int(pt2d[child][0]), int(pt2d[child][1])), c, radius - 2)

    return image
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



